51Testing软件测试论坛
标题:
在数据库表中添加三个数据: 运动量、批次、 状态,并显示在postman上
[打印本页]
作者:
测试积点老人
时间:
2021-8-11 10:56
标题:
在数据库表中添加三个数据: 运动量、批次、 状态,并显示在postman上
[attach]133739[/attach]
springboot中要对某个表添加数据元素(添加三列),我对实体类,mapper,service,controller都进行了修改,增加了三种数据元素,但postman上还是看不到增加的status状态,exercise运动量,times批次。不知道为什么postman上仍然显示不出来这三个数据。
内容:
[attach]133740[/attach]
实体类MachineLogEntity:
package com.ywyl.sh.platform.entity;
import...
@Table(name = "sh_machine_log")
public class MachineLogEntity {
@Id
private String id;
private String machineId;
private String spo2;
private Integer ppg;
private String lbslat;
private String lbslng;
private String gpslat;
private String gpslng;
private String altitude;
private Integer battery;
private Integer sos;
private Date insertTime;
private String status;
private String exercise;
private String times;
public MachineLogEntity(String id, String machineId, String spo2, Integer ppg, String lbslat, String lbslng, String gpslat, String gpslng, String altitude, Integer battery, Integer sos, Date insertTime, String status, String exercise,String times) {
this.id = id;
this.machineId = machineId;
this.spo2 = spo2;
this.ppg = ppg;
this.sos = sos;
this.lbslat = lbslat;
this.lbslng = lbslng;
this.gpslat = gpslat;
this.gpslng = gpslng;
this.altitude = altitude;
this.battery = battery;
this.insertTime = insertTime;
this.status = status;
this.times=times;
this.exercise=exercise;
}
public MachineLogEntity() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMachineId() {
return machineId;
}
public void setMachineId(String machineId) {
this.machineId = machineId;
}
public String getSpo2() {
return spo2;
}
public void setSpo2(String spo2) {
this.spo2 = spo2;
}
public Integer getPpg() {
return ppg;
}
public void setPpg(Integer ppg) {
this.ppg = ppg;
}
public String getLbslat() {
return lbslat;
}
public void setLbslat(String lbslat) {
this.lbslat = lbslat;
}
public String getLbslng() {
return lbslng;
}
public void setLbslng(String lbslng) {
this.lbslng = lbslng;
}
public String getGpslat() {
return gpslat;
}
public void setGpslat(String gpslat) {
this.gpslat = gpslat;
}
public String getGpslng() {
return gpslng;
}
public void setGpslng(String gpslng) {
this.gpslng = gpslng;
}
public String getAltitude() {
return altitude;
}
public void setAltitude(String altitude) {
this.altitude = altitude;
}
public Integer getBattery() {
return battery;
}
public void setBattery(Integer battery) {
this.battery = battery;
}
public Integer getSos() {
return sos;
}
public void setSos(Integer sos) {
this.sos = sos;
}
public Date getInsertTime() {
return insertTime;
}
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getExercise() {
return exercise;
}
public void setExercise(String exercise) {
this.exercise = exercise;
}
public String getTimes() {
return times;
}
public void setTimes(String times) {
this.times = times;
}
}
复制代码
对应的service里的功能:
public PageInfo pageSelectMachineLog(String machineId,int currentPage,int pageSize){
PageHelper.startPage(currentPage,pageSize);
List<MachineLogEntity> machineLogEntityList = machineLogMapper.selectMachineLogsByMachineId(machineId);
PageInfo pageInfo = new PageInfo<>(machineLogEntityList);
return pageInfo;
}
复制代码
对应controller里面:
@GetMapping("pageSelectMachineLog")
public @ResponseBody String pageSelectMachineLog(@RequestParam("machineId")String machineId,
@RequestParam("currentPage")int currentPage,
@RequestParam("pageSize")int pageSize,
HttpServletRequest request){
return toJson(machineLogService.pageSelectMachineLog(machineId,currentPage,pageSize),request);
}
复制代码
作者:
海海豚
时间:
2021-8-12 10:48
https://www.csdn.net/tags/NtzaUgwsNjcyMS1ibG9n.html
参考下看看
作者:
bellas
时间:
2021-8-12 11:13
参考下这个链接
https://www.csdn.net/tags/NtzaUgwsNjcyMS1ibG9n.html
作者:
qqq911
时间:
2021-8-12 12:10
用其他工具试试呢,
作者:
jingzizx
时间:
2021-8-12 18:27
调一下
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2