no message
Showing
5 changed files
with
12 additions
and
8 deletions
| ... | @@ -47,7 +47,7 @@ public class AdvertController extends BaseController { | ... | @@ -47,7 +47,7 @@ public class AdvertController extends BaseController { |
| 47 | */ | 47 | */ |
| 48 | @RepeatSubmit() | 48 | @RepeatSubmit() |
| 49 | @PostMapping() | 49 | @PostMapping() |
| 50 | public R<Void> addAdvert(@RequestBody @Valid AdvertBo advertBo) throws ServerException { | 50 | public R<Void> addAdvert(@RequestBody @Valid AdvertBo advertBo) throws ServerException { |
| 51 | return toAjax(service.addAdvert(advertBo)); | 51 | return toAjax(service.addAdvert(advertBo)); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| ... | @@ -59,7 +59,7 @@ public class AdvertController extends BaseController { | ... | @@ -59,7 +59,7 @@ public class AdvertController extends BaseController { |
| 59 | */ | 59 | */ |
| 60 | @RepeatSubmit() | 60 | @RepeatSubmit() |
| 61 | @PutMapping | 61 | @PutMapping |
| 62 | public R<Void> updateAdvert(@RequestBody @Valid AdvertBo advertBo) throws ServerException { | 62 | public R<Void> updateAdvert(@RequestBody @Valid AdvertBo advertBo) throws ServerException { |
| 63 | return toAjax(service.updateAdvert(advertBo)); | 63 | return toAjax(service.updateAdvert(advertBo)); |
| 64 | } | 64 | } |
| 65 | 65 | ... | ... |
| ... | @@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor; | ... | @@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor; |
| 16 | import org.springframework.web.bind.annotation.*; | 16 | import org.springframework.web.bind.annotation.*; |
| 17 | 17 | ||
| 18 | import javax.servlet.http.HttpServletRequest; | 18 | import javax.servlet.http.HttpServletRequest; |
| 19 | import javax.validation.Valid; | ||
| 19 | import java.rmi.ServerException; | 20 | import java.rmi.ServerException; |
| 20 | import java.util.List; | 21 | import java.util.List; |
| 21 | 22 | ||
| ... | @@ -73,7 +74,7 @@ public class CourseController extends BaseController { | ... | @@ -73,7 +74,7 @@ public class CourseController extends BaseController { |
| 73 | */ | 74 | */ |
| 74 | @RepeatSubmit() | 75 | @RepeatSubmit() |
| 75 | @PostMapping() | 76 | @PostMapping() |
| 76 | public R<Void> addCourse(@RequestBody CourseBo CourseBo) { | 77 | public R<Void> addCourse(@RequestBody @Valid CourseBo CourseBo) { |
| 77 | return toAjax(service.addCourse(CourseBo)); | 78 | return toAjax(service.addCourse(CourseBo)); |
| 78 | } | 79 | } |
| 79 | 80 | ||
| ... | @@ -85,7 +86,7 @@ public class CourseController extends BaseController { | ... | @@ -85,7 +86,7 @@ public class CourseController extends BaseController { |
| 85 | */ | 86 | */ |
| 86 | @RepeatSubmit() | 87 | @RepeatSubmit() |
| 87 | @PutMapping | 88 | @PutMapping |
| 88 | public R<Void> update(@RequestBody CourseBo CourseBo) throws ServerException { | 89 | public R<Void> update(@RequestBody @Valid CourseBo CourseBo) throws ServerException { |
| 89 | return toAjax(service.updateCourse(CourseBo)); | 90 | return toAjax(service.updateCourse(CourseBo)); |
| 90 | } | 91 | } |
| 91 | 92 | ... | ... |
| ... | @@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor; | ... | @@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor; |
| 16 | import org.springframework.web.bind.annotation.*; | 16 | import org.springframework.web.bind.annotation.*; |
| 17 | 17 | ||
| 18 | import javax.servlet.http.HttpServletRequest; | 18 | import javax.servlet.http.HttpServletRequest; |
| 19 | import javax.validation.Valid; | ||
| 19 | import java.rmi.ServerException; | 20 | import java.rmi.ServerException; |
| 20 | import java.util.List; | 21 | import java.util.List; |
| 21 | 22 | ||
| ... | @@ -62,7 +63,7 @@ public class EntiretyController extends BaseController { | ... | @@ -62,7 +63,7 @@ public class EntiretyController extends BaseController { |
| 62 | */ | 63 | */ |
| 63 | @RepeatSubmit() | 64 | @RepeatSubmit() |
| 64 | @PostMapping() | 65 | @PostMapping() |
| 65 | public R<Void> addEntirety(@RequestBody EntiretyBo entiretyBo) { | 66 | public R<Void> addEntirety(@RequestBody @Valid EntiretyBo entiretyBo) { |
| 66 | return toAjax(service.addEntirety(entiretyBo)); | 67 | return toAjax(service.addEntirety(entiretyBo)); |
| 67 | } | 68 | } |
| 68 | 69 | ||
| ... | @@ -74,7 +75,7 @@ public class EntiretyController extends BaseController { | ... | @@ -74,7 +75,7 @@ public class EntiretyController extends BaseController { |
| 74 | */ | 75 | */ |
| 75 | @RepeatSubmit() | 76 | @RepeatSubmit() |
| 76 | @PutMapping | 77 | @PutMapping |
| 77 | public R<Void> update(@RequestBody EntiretyBo entiretyBo) throws ServerException { | 78 | public R<Void> update(@RequestBody @Valid EntiretyBo entiretyBo) throws ServerException { |
| 78 | return toAjax(service.updateEntirety(entiretyBo)); | 79 | return toAjax(service.updateEntirety(entiretyBo)); |
| 79 | } | 80 | } |
| 80 | 81 | ... | ... |
| ... | @@ -2,6 +2,7 @@ package com.lego.core.domin.bo; | ... | @@ -2,6 +2,7 @@ package com.lego.core.domin.bo; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import javax.validation.constraints.Max; | ||
| 5 | import javax.validation.constraints.NotBlank; | 6 | import javax.validation.constraints.NotBlank; |
| 6 | import javax.validation.constraints.Size; | 7 | import javax.validation.constraints.Size; |
| 7 | 8 | ||
| ... | @@ -30,7 +31,7 @@ public class AdvertBo extends BaseBO { | ... | @@ -30,7 +31,7 @@ public class AdvertBo extends BaseBO { |
| 30 | /** | 31 | /** |
| 31 | * 排序 | 32 | * 排序 |
| 32 | */ | 33 | */ |
| 33 | @Size(min = 0, max = 10, message = "排序不能超过{max}位数字") | 34 | @Max(value = 1000000000, message = "必须小于等于1000000000") |
| 34 | private Long sort; | 35 | private Long sort; |
| 35 | 36 | ||
| 36 | /** | 37 | /** | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.lego.core.domin.bo; | ... | @@ -3,6 +3,7 @@ package com.lego.core.domin.bo; |
| 3 | import com.baomidou.mybatisplus.annotation.TableId; | 3 | import com.baomidou.mybatisplus.annotation.TableId; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | 5 | ||
| 6 | import javax.validation.constraints.Max; | ||
| 6 | import javax.validation.constraints.NotBlank; | 7 | import javax.validation.constraints.NotBlank; |
| 7 | import javax.validation.constraints.Size; | 8 | import javax.validation.constraints.Size; |
| 8 | 9 | ||
| ... | @@ -31,7 +32,7 @@ public class EntiretyBo extends BaseBO { | ... | @@ -31,7 +32,7 @@ public class EntiretyBo extends BaseBO { |
| 31 | /** | 32 | /** |
| 32 | * 排序 | 33 | * 排序 |
| 33 | */ | 34 | */ |
| 34 | @Size(min = 0, max = 10, message = "排序不能超过{max}位数字") | 35 | @Max(value = 1000000000, message = "必须小于等于1000000000") |
| 35 | private Long sort; | 36 | private Long sort; |
| 36 | 37 | ||
| 37 | /** | 38 | /** | ... | ... |
-
Please register or sign in to post a comment