no message
Showing
1 changed file
with
3 additions
and
4 deletions
| ... | @@ -9,10 +9,10 @@ import com.lego.core.domin.bo.AdvertBo; | ... | @@ -9,10 +9,10 @@ import com.lego.core.domin.bo.AdvertBo; |
| 9 | import com.lego.core.domin.vo.AdvertVo; | 9 | import com.lego.core.domin.vo.AdvertVo; |
| 10 | import com.lego.core.service.IAdvertService; | 10 | import com.lego.core.service.IAdvertService; |
| 11 | import lombok.RequiredArgsConstructor; | 11 | import lombok.RequiredArgsConstructor; |
| 12 | import org.springframework.validation.annotation.Validated; | ||
| 13 | import org.springframework.web.bind.annotation.*; | 12 | import org.springframework.web.bind.annotation.*; |
| 14 | 13 | ||
| 15 | import javax.servlet.http.HttpServletRequest; | 14 | import javax.servlet.http.HttpServletRequest; |
| 15 | import javax.validation.Valid; | ||
| 16 | import java.rmi.ServerException; | 16 | import java.rmi.ServerException; |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| ... | @@ -24,7 +24,6 @@ import java.rmi.ServerException; | ... | @@ -24,7 +24,6 @@ import java.rmi.ServerException; |
| 24 | @RequiredArgsConstructor | 24 | @RequiredArgsConstructor |
| 25 | @RestController | 25 | @RestController |
| 26 | @RequestMapping("/core/advert") | 26 | @RequestMapping("/core/advert") |
| 27 | @Validated | ||
| 28 | public class AdvertController extends BaseController { | 27 | public class AdvertController extends BaseController { |
| 29 | private final IAdvertService service; | 28 | private final IAdvertService service; |
| 30 | 29 | ||
| ... | @@ -48,7 +47,7 @@ public class AdvertController extends BaseController { | ... | @@ -48,7 +47,7 @@ public class AdvertController extends BaseController { |
| 48 | */ | 47 | */ |
| 49 | @RepeatSubmit() | 48 | @RepeatSubmit() |
| 50 | @PostMapping() | 49 | @PostMapping() |
| 51 | public R<Void> addAdvert(@RequestBody AdvertBo advertBo) throws ServerException { | 50 | public R<Void> addAdvert(@RequestBody @Valid AdvertBo advertBo) throws ServerException { |
| 52 | return toAjax(service.addAdvert(advertBo)); | 51 | return toAjax(service.addAdvert(advertBo)); |
| 53 | } | 52 | } |
| 54 | 53 | ||
| ... | @@ -60,7 +59,7 @@ public class AdvertController extends BaseController { | ... | @@ -60,7 +59,7 @@ public class AdvertController extends BaseController { |
| 60 | */ | 59 | */ |
| 61 | @RepeatSubmit() | 60 | @RepeatSubmit() |
| 62 | @PutMapping | 61 | @PutMapping |
| 63 | public R<Void> updateAdvert(@RequestBody AdvertBo advertBo) throws ServerException { | 62 | public R<Void> updateAdvert(@RequestBody @Valid AdvertBo advertBo) throws ServerException { |
| 64 | return toAjax(service.updateAdvert(advertBo)); | 63 | return toAjax(service.updateAdvert(advertBo)); |
| 65 | } | 64 | } |
| 66 | 65 | ... | ... |
-
Please register or sign in to post a comment