Browse Source

add api binder cms white user

huodongdong 6 years ago
parent
commit
50a2dd42d0

+ 12 - 0
rankin-cms-web/src/main/java/cn/rankin/cmsweb/controller/user/WhiteUserController.java

@@ -11,13 +11,25 @@ import cn.rankin.data.api.user.dto.WhiteUserSearchDTO;
 import cn.rankin.data.api.user.entity.WhiteUser;
 import cn.rankin.data.api.user.vo.WhiteUserVo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.propertyeditors.CustomDateEditor;
+import org.springframework.web.bind.ServletRequestDataBinder;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 
 @RestController
 @RequestMapping(value = "/white/user")
 public class WhiteUserController {
 
+    @InitBinder
+    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
+        binder.registerCustomEditor(Date.class,
+                new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"), true));
+    }
+
     @Autowired
     private WhiteUserService whiteUserService;
 

+ 0 - 1
rankin-data-api/src/main/java/cn/rankin/data/api/user/dto/WhiteUserSearchDTO.java

@@ -1,6 +1,5 @@
 package cn.rankin.data.api.user.dto;
 
-import cn.rankin.common.utils.enums.BaseStatusEnum;
 import lombok.Data;
 import lombok.ToString;