Bläddra i källkod

修改刘子麟添加的bug

夏文涛 1 år sedan
förälder
incheckning
c6cbd57acc

+ 1 - 1
src/main/java/com/template/api/WelcomeBedControllerAPI.java

@@ -52,7 +52,7 @@ public interface WelcomeBedControllerAPI {
 
     @PostMapping(value = "/submit")
     @ApiOperation(value = "提交床位信息", notes = "提交床位信息", httpMethod = "POST")
-    CommonResult submit(@RequestBody WelcomeBed welcomeBed);
+    CommonResult submit(@RequestAttribute String studentCard, @RequestBody WelcomeBed welcomeBed);
 
     @GetMapping(value = "/bedDetails")
     @ApiOperation(value = "宿舍详情", notes = "宿舍详情", httpMethod = "GET")

+ 2 - 3
src/main/java/com/template/controller/WelcomeBedController.java

@@ -763,14 +763,13 @@ public class WelcomeBedController implements WelcomeBedControllerAPI {
     }
 
     @Override
-    public CommonResult submit(WelcomeBed welcomeBed) {
-        String studentCard = welcomeBed.getStudentCard();
+    public CommonResult submit(String studentCard,WelcomeBed welcomeBed) {
 //        先判断是否已经提交
         LambdaQueryWrapper<WelcomeBed> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(WelcomeBed::getStudentCard, studentCard);
         WelcomeBed one = welcomeBedService.getOne(wrapper);
         if (ObjectUtils.isNotEmpty(one)) {
-            return CommonResult.fail("已提交,请勿重复提交");
+            return CommonResult.fail("当前用户已选择宿舍,请勿重复提交");
         }
 
         WelcomeBed wb = welcomeBedService.getBedById(welcomeBed.getId());