Przeglądaj źródła

删除考场会员信息

zhangbin 1 rok temu
rodzic
commit
f184472f66

+ 12 - 2
jsjp-admin/src/main/java/com/miaxis/app/controller/exam/VipUserExamController.java

@@ -11,6 +11,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.parameters.P;
 import org.springframework.web.bind.annotation.*;
 
 import java.security.KeyFactory;
@@ -40,7 +41,7 @@ public class VipUserExamController extends BaseController {
      */
     @GetMapping("/list")
     @ApiOperation("查询当前用户考试会员列表")
-    public ResponsePageInfo<VipUserExam> list(Long userId,Long examId) throws Exception {
+    public ResponsePageInfo<VipUserExam> list(Long userId, Long examId) throws Exception {
         VipUserExam vipUserExam = new VipUserExam();
         vipUserExam.setUserId(userId);
         vipUserExam.setExamId(examId);
@@ -61,7 +62,16 @@ public class VipUserExamController extends BaseController {
     ) {
         Map<String, Object> map = new HashMap<>();
         map.put("user_id", userId);
-        return toResponse(vipUserExamService.removeByMap(map) ? 1 : 0);
+
+        boolean isDel = vipUserExamService.removeByMap(map);
+        if(isDel) {
+            Response response = new Response(200,"删除成功");
+            return response;
+        } else {
+            Response response = new Response(200,"该记录不存在");
+            return response;
+        }
+
     }
 
 

+ 1 - 1
jsjp-common/src/main/java/com/miaxis/common/core/domain/Response.java

@@ -44,7 +44,7 @@ public class Response<T> implements Serializable {
         this.msg = responseEnum.getMessage();
     }
 
-    private Response(Integer code,String msg){
+    public Response(Integer code,String msg){
         this.code = code;
         this.msg = msg;
     }