feat: 修改预约详情接口并调整成功码
This commit is contained in:
@@ -11,7 +11,7 @@ public class Result<T> {
|
||||
|
||||
public static <T> Result<T> success(T data) {
|
||||
Result<T> result = new Result<>();
|
||||
result.setCode(200);
|
||||
result.setCode(0);
|
||||
result.setMessage("success");
|
||||
result.setData(data);
|
||||
return result;
|
||||
|
||||
@@ -29,6 +29,17 @@ public class AppointmentController {
|
||||
return Result.success(appointmentService.getLatest(openid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取预约记录详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public Result<VisitApplication> getDetail(@RequestParam String id) {
|
||||
if (id == null || id.trim().isEmpty()) {
|
||||
return Result.error("id不能为空");
|
||||
}
|
||||
return Result.success(appointmentService.getDetail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户所有预约记录(按创建时间倒序)
|
||||
*/
|
||||
@@ -95,17 +106,17 @@ public class AppointmentController {
|
||||
/**
|
||||
* 根据id获取审批详情
|
||||
*/
|
||||
@PutMapping("/detail")
|
||||
public Result<VisitApplicationVo> detail(@RequestParam String id, @RequestParam String openid) throws Exception {
|
||||
if (id == null || id.trim().isEmpty()) {
|
||||
return Result.error("id不能为空");
|
||||
}
|
||||
if (openid == null || openid.trim().isEmpty()) {
|
||||
return Result.error("openid不能为空");
|
||||
}
|
||||
VisitApplicationVo vo = appointmentService.detail(id, openid);
|
||||
return Result.success(vo);
|
||||
}
|
||||
// @PutMapping("/detail")
|
||||
// public Result<VisitApplicationVo> detail(@RequestParam String id, @RequestParam String openid) throws Exception {
|
||||
// if (id == null || id.trim().isEmpty()) {
|
||||
// return Result.error("id不能为空");
|
||||
// }
|
||||
// if (openid == null || openid.trim().isEmpty()) {
|
||||
// return Result.error("openid不能为空");
|
||||
// }
|
||||
// VisitApplicationVo vo = appointmentService.detail(id, openid);
|
||||
// return Result.success(vo);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 受访人下拉框值
|
||||
|
||||
@@ -60,6 +60,9 @@ public class AppointmentService {
|
||||
log.info("查询到 {} 条预约记录", list.size());
|
||||
return list;
|
||||
}
|
||||
public VisitApplication getDetail(String id) {
|
||||
return visitApplicationMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建预约记录
|
||||
|
||||
Reference in New Issue
Block a user