Commit 6ee27f1d authored by 王亮's avatar 王亮

add some constrains.

parent f4aa78ac
......@@ -39,6 +39,7 @@ import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.http.HttpStatus;
import org.hibernate.validator.constraints.Length;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.domain.PageRequest;
......@@ -1395,7 +1396,7 @@ public class InnerController implements IBaseController {
* @return
*/
@RequestMapping(path = "/user/disable", method = RequestMethod.POST)
public JsonResult forbiddenUser(Long userId,String reason,@RequestHeader(value = "Access-Token",required = false)String accessToken) {
public JsonResult forbiddenUser(Long userId,@Length(max = 10,message = "原因不能大于10个字符") String reason,@RequestHeader(value = "Access-Token",required = false)String accessToken) {
boolean flushed = flushUserStatus(userId, false);
UserDisableRecord userDisableRecord = new UserDisableRecord();
userDisableRecord.setUserId(userId);
......@@ -1417,7 +1418,7 @@ public class InnerController implements IBaseController {
* @return List<UserDisableRecord>
*/
@RequestMapping(path = "/user/records/{userId}", method = RequestMethod.POST)
public JsonResult disableRecordList(@PathVariable("userId") Long userId,@RequestParam("page")int page,@RequestParam("size") int size){
public JsonResult disableRecordList(@PathVariable("userId") Long userId,@RequestParam(value = "page",defaultValue = "0")Integer page,@RequestParam(value = "size",defaultValue = "20") Integer size){
Pageable pageable = new PageRequest(page,size);
return JsonResult.buildSuccessResultGeneric(iUserDisableRecordRepository.findByUserIdOrderByCreatedAtDesc(userId,pageable));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment