File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed
llmall-commodity/src/main/java/biz/llmall/commodity
llmall-common/src/main/java/biz/llmall/common/dto/response Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 11package biz .llmall .commodity ;
2-
32import com .spring4all .swagger .EnableSwagger2Doc ;
43import org .mybatis .spring .annotation .MapperScan ;
54import org .springframework .boot .SpringApplication ;
Original file line number Diff line number Diff line change 44import biz .llmall .common .dto .response .EnumStatus ;
55import biz .llmall .common .entity .commodity .Commodity ;
66import org .springframework .beans .factory .annotation .Autowired ;
7- import org .springframework .validation .Errors ;
87import org .springframework .web .bind .annotation .PathVariable ;
98import org .springframework .web .bind .annotation .RequestMapping ;
109import org .springframework .web .bind .annotation .RestController ;
@@ -43,13 +42,4 @@ public APIResponse<Commodity> findCommodityByPrimaryId(@PathVariable("id") Strin
4342 return APIResponse .error (EnumStatus .SERVICE_ERROR , ex .getMessage ());
4443 }
4544 }
46-
47- private Errors validCommodityId (String id , Errors errors ) {
48- Pattern pattern = Pattern .compile ("\\ d+" );
49- Matcher matcher = pattern .matcher (id );
50- if (!matcher .matches ()) {
51- errors .reject (EnumStatus .INVALID_PARAMETER .getMessage ());
52- }
53- return errors ;
54- }
5545}
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ public enum EnumStatus implements IStatus {
77 UNAUTHORIZED (401 , "用户认证失败" ),
88 FORBIDDEN (403 , "权限不足" ),
99 SERVICE_ERROR (500 , "服务器错误" ),
10- CAPTCHA_INVALID (405 , "验证码校验失败" );
10+ CAPTCHA_INVALID (405 , "验证码校验失败" ),
11+ INVALID_PARAMETER (406 , "无效的参数" ),
12+ ;
1113 private Integer code ;
1214 private String message ;
1315
You can’t perform that action at this time.
0 commit comments