feat: 修改预约详情接口并调整成功码

This commit is contained in:
ws
2026-04-27 19:11:24 +08:00
parent 21c8bf821c
commit 0cf6cf11aa
4 changed files with 26 additions and 13 deletions
-1
View File
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager"> <component name="MavenProjectsManager">
@@ -11,7 +11,7 @@ public class Result<T> {
public static <T> Result<T> success(T data) { public static <T> Result<T> success(T data) {
Result<T> result = new Result<>(); Result<T> result = new Result<>();
result.setCode(200); result.setCode(0);
result.setMessage("success"); result.setMessage("success");
result.setData(data); result.setData(data);
return result; return result;
@@ -29,6 +29,17 @@ public class AppointmentController {
return Result.success(appointmentService.getLatest(openid)); 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获取审批详情 * 根据id获取审批详情
*/ */
@PutMapping("/detail") // @PutMapping("/detail")
public Result<VisitApplicationVo> detail(@RequestParam String id, @RequestParam String openid) throws Exception { // public Result<VisitApplicationVo> detail(@RequestParam String id, @RequestParam String openid) throws Exception {
if (id == null || id.trim().isEmpty()) { // if (id == null || id.trim().isEmpty()) {
return Result.error("id不能为空"); // return Result.error("id不能为空");
} // }
if (openid == null || openid.trim().isEmpty()) { // if (openid == null || openid.trim().isEmpty()) {
return Result.error("openid不能为空"); // return Result.error("openid不能为空");
} // }
VisitApplicationVo vo = appointmentService.detail(id, openid); // VisitApplicationVo vo = appointmentService.detail(id, openid);
return Result.success(vo); // return Result.success(vo);
} // }
/** /**
* 受访人下拉框值 * 受访人下拉框值
@@ -60,6 +60,9 @@ public class AppointmentService {
log.info("查询到 {} 条预约记录", list.size()); log.info("查询到 {} 条预约记录", list.size());
return list; return list;
} }
public VisitApplication getDetail(String id) {
return visitApplicationMapper.selectById(id);
}
/** /**
* 创建预约记录 * 创建预约记录