|
|
@@ -1,5 +1,6 @@
|
|
|
package com.mooctest.crowd.site.controller;
|
|
|
|
|
|
+import com.alibaba.druid.sql.visitor.functions.Bin;
|
|
|
import com.mooctest.crowd.domain.exception.BaseException;
|
|
|
import com.mooctest.crowd.site.annotation.LoginRequired;
|
|
|
import com.mooctest.crowd.site.command.AgencyResourceAbilityUpdateCommand;
|
|
|
@@ -44,20 +45,36 @@ public class AgencyController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 申请认证为机构
|
|
|
+ * 申请机构认证
|
|
|
* @param userId
|
|
|
* @param command
|
|
|
+ * @param result
|
|
|
* @return
|
|
|
*/
|
|
|
@LoginRequired
|
|
|
@RequestMapping(value = "/user/{userId}/agency", method = RequestMethod.POST)
|
|
|
- public UserDTO authAgency(@PathVariable("userId") Long userId, @RequestBody @Validated ApplyAgencyAuthCommand command, BindingResult result){
|
|
|
+ public UserDTO applyAgencyAuth(@PathVariable("userId") Long userId, @RequestBody @Validated ApplyAgencyAuthCommand command, BindingResult result){
|
|
|
if (result.hasErrors())
|
|
|
throw new BaseException(result.getFieldError().getDefaultMessage());
|
|
|
return agencyService.applyAgency(userId, command);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 更新机构认证信息
|
|
|
+ * @param userId
|
|
|
+ * @param command
|
|
|
+ * @param result
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @LoginRequired
|
|
|
+ @RequestMapping(value = "/user/{userId}/agency", method = RequestMethod.PUT)
|
|
|
+ public AgencyVO updateAgencyInfo(@PathVariable("userId") Long userId, @RequestBody @Validated ApplyAgencyAuthCommand command, BindingResult result){
|
|
|
+ if (result.hasErrors())
|
|
|
+ throw new BaseException(result.getFieldError().getDefaultMessage());
|
|
|
+ return agencyService.updateAgencyInfo(userId, command);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 审核认证请求(修改认证申请的状态)
|
|
|
* @param userId
|
|
|
* @param status
|
|
|
@@ -99,6 +116,11 @@ public class AgencyController {
|
|
|
return agencyService.upadteResourceAndAbility(userId, command);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取机构认证信息
|
|
|
+ * @param userId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@LoginRequired
|
|
|
@RequestMapping(value = "/user/{userId}/agency", method = RequestMethod.GET)
|
|
|
public AgencyVO getAgencyInfo(@PathVariable("userId") Long userId){
|