guo00guo 5 anni fa
parent
commit
582d96e111

+ 8 - 6
site/src/main/java/com/mooctest/crowd/site/command/ApplyEnterpriseAuthCommand.java

@@ -1,6 +1,7 @@
 package com.mooctest.crowd.site.command;
 
 import com.mooctest.crowd.domain.domainobject.EnterpriseAuthentication;
+import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.springframework.beans.BeanUtils;
@@ -14,27 +15,28 @@ import java.sql.Timestamp;
  * @date 2019-08-28 01:20
  */
 @Data
+@AllArgsConstructor
+@NoArgsConstructor
 public class ApplyEnterpriseAuthCommand {
 
     @NotNull(message = "请选择认证研发机构或者评测机构")
-    private  String   isDaOrEa;
+    private String isDaOrEa;
     @NotNull(message = "企业法人姓名不可为空")
     private String legalPersonName;
     @NotNull(message = "请上传营业执照")
     private String businessLicensePhoto;
     @NotNull(message = "身份证号不可为空")
-    private String IDCardNum;
+    private String idCardNum;
     @NotNull(message = "地址不可为空")
     private String address;
     @NotNull(message = "请选择性别")
     private String sex;
     @NotNull(message = "请上传身份证正面照")
-    private String IDCardPositivePhoto;//身份证正面照
+    private String idCardPositivePhoto;//身份证正面照
     @NotNull(message = "请上传身份证反面照")
-    private String IDCardBackPhoto;//身份证反面照
+    private String idCardBackPhoto;//身份证反面照
     @NotNull(message = "请正确填写身份证过期时间")
-    private Timestamp IDCardDeadTime;
-
+    private Timestamp idCardDeadTime;
 
     public EnterpriseAuthentication toEnterpriseAuth() {
         EnterpriseAuthentication enterpriseAuthentication = new EnterpriseAuthentication();

+ 16 - 0
site/src/main/java/com/mooctest/crowd/site/command/TestCommand.java

@@ -0,0 +1,16 @@
+package com.mooctest.crowd.site.command;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @Author: xuexb
+ * @Date: 2019.7.5 14:24
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TestCommand {
+    private String mobileNum;
+}

+ 9 - 8
site/src/main/java/com/mooctest/crowd/site/controller/UserController.java

@@ -237,14 +237,15 @@ public class UserController extends BaseController {
      * @return
      */
     @LoginRequired
-    @RequestMapping(value = "/user/{userId}/enterpriseAuth", method = RequestMethod.POST)
-    public EnterpriseAuthVO applyEnterpriseAuth(@PathVariable("userId") Long userId,
-                                                @Validated @RequestBody ApplyEnterpriseAuthCommand command,
-                                                BindingResult result, HttpSession session) {
-        if (!userId.equals(Long.parseLong((String) session.getAttribute("userId"))))
-            throw new UnauthorizedException("没有权限对他人账号进行操作!");
-        if (result.hasErrors())
-            throw new BaseException(result.getFieldError().getDefaultMessage());
+    @PostMapping(value = "/user/{userId}/enterpriseAuth")
+    public EnterpriseAuthVO test(@PathVariable("userId") Long userId,
+                                 @Validated @RequestBody ApplyEnterpriseAuthCommand command,
+                                 BindingResult result, HttpSession session){
+//        if (!userId.equals(Long.parseLong((String) session.getAttribute("userId"))))
+//            throw new UnauthorizedException("没有权限对他人账号进行操作!");
+//        if (result.hasErrors())
+//            throw new BaseException(result.getFieldError().getDefaultMessage());
+        System.out.println(command);
         return userService.applyEnterpriseAuth(userId, command);
     }