Skip to content

Commit

Permalink
规范长度限制
Browse files Browse the repository at this point in the history
  • Loading branch information
chopper711 committed May 18, 2022
1 parent e3626a0 commit d25f177
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
@ToString
public class CashierParam {

static Long MAX_DETAIL_LENGTH = 30L;

@ApiModelProperty(value = "价格")
private Double price;

Expand Down Expand Up @@ -48,7 +50,7 @@ public String getDetail() {
return "清单详细";
}
//对参数长度进行限制
if (!StringUtils.isEmpty(detail) && detail.length() > 30) {
if (!StringUtils.isEmpty(detail) && detail.length() > MAX_DETAIL_LENGTH) {
detail = detail.substring(30);
}
return StringUtils.filterSpecialChart(detail);
Expand Down

0 comments on commit d25f177

Please sign in to comment.