Sfoglia il codice sorgente

feat: 修改查询top用户信息接口错误提示

weijianghai 2 anni fa
parent
commit
8527a5a380

+ 3 - 3
src/main/java/com/nokia/controller/web/WebUserController.java

@@ -33,9 +33,9 @@ public class WebUserController {
     @Operation(summary = "查询top用户信息")
     @ApiResponses(value = {
             @ApiResponse(),
-            @ApiResponse(responseCode = "新增用户必须是top已有账号,用户正常使用需要top增加移网投诉权限。", description = "{\"success\":false,\"code\":0,\"message\":\"没有查询到top用户信息\",\"data\":null}", content = @Content),
-            @ApiResponse(responseCode = "非本地市用户", description = "{\"success\":false,\"code\":0,\"message\":\"非本地市用户\",\"data\":null}", content = @Content),
-            @ApiResponse(responseCode = "用户已存在系统中", description = "{\"success\":false,\"code\":0,\"message\":\"用户已存在系统中\",\"data\":null}", content = @Content)
+            @ApiResponse(responseCode = "新增用户必须是TOP已由账号,用户正常使用需要TOP增加移网投诉权限。识别当前用户为外协用户或top用户信息未同步,需要手动输入用户信息", description = "{\"success\":false,\"code\":-1,\"message\":\"新增用户必须是TOP已由账号,用户正常使用需要TOP增加移网投诉权限。识别当前用户为外协用户或top用户信息未同步,需要手动输入用户信息\",\"data\":null}", content = @Content),
+            @ApiResponse(responseCode = "非本地市用户", description = "{\"success\":false,\"code\":-2,\"message\":\"非本地市用户\",\"data\":null}", content = @Content),
+            @ApiResponse(responseCode = "用户已存在系统中", description = "{\"success\":false,\"code\":-3,\"message\":\"用户已存在系统中\",\"data\":null}", content = @Content)
     })
     @PostMapping("getTopUserByLoginName")
     public R<TopUserVo> getTopUserByLoginName(@Valid @RequestBody TopUserDto dto, HttpSession session) {

+ 4 - 3
src/main/java/com/nokia/service/UserService.java

@@ -46,15 +46,16 @@ public class UserService {
 
     public R<TopUserVo> getTopUserByLoginName(TopUserDto dto, HttpSession session) {
         if (hasLoginName(dto.getLoginName())) {
-            return R.error("用户已存在系统中");
+            return R.<TopUserVo>error("用户已存在系统中").code(-3);
         }
         TopUserVo vo = userDao.getTopUserByLoginName(dto.getLoginName());
         if (vo == null) {
-            return R.error("新增用户必须是top已有账号,用户正常使用需要top增加移网投诉权限。");
+            return R.<TopUserVo>error("新增用户必须是TOP已由账号,用户正常使用需要TOP增加移网投诉权限。"
+                    + "识别当前用户为外协用户或top用户信息未同步,需要手动输入用户信息").code(-1);
         }
         UserRoleCity role = getUserRoleCity(session);
         if (role.getCityId() != -1 && !role.getCityId().equals(vo.getCityId())) {
-            return R.error("非本地市用户");
+            return R.<TopUserVo>error("非本地市用户").code(-2);
         }
         if (vo.getCityId() != -1) {
             // 查询归属地市区县列表