Skip to content

Commit b82ae05

Browse files
author
liujun
committed
update
1 parent 15326b3 commit b82ae05

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

llmall-commodity/src/main/java/biz/llmall/commodity/CommodityApplication.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
package biz.llmall.commodity;
2-
32
import com.spring4all.swagger.EnableSwagger2Doc;
43
import org.mybatis.spring.annotation.MapperScan;
54
import org.springframework.boot.SpringApplication;

llmall-commodity/src/main/java/biz/llmall/commodity/controller/CommodityController.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import biz.llmall.common.dto.response.EnumStatus;
55
import biz.llmall.common.entity.commodity.Commodity;
66
import org.springframework.beans.factory.annotation.Autowired;
7-
import org.springframework.validation.Errors;
87
import org.springframework.web.bind.annotation.PathVariable;
98
import org.springframework.web.bind.annotation.RequestMapping;
109
import 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
}

llmall-common/src/main/java/biz/llmall/common/dto/response/EnumStatus.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)