|  | @@ -1,5 +1,6 @@
 | 
											
												
													
														|  |  package com.mooctest.crowd.site.controller;
 |  |  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.domain.exception.BaseException;
 | 
											
												
													
														|  |  import com.mooctest.crowd.site.annotation.LoginRequired;
 |  |  import com.mooctest.crowd.site.annotation.LoginRequired;
 | 
											
												
													
														|  |  import com.mooctest.crowd.site.command.AgencyResourceAbilityUpdateCommand;
 |  |  import com.mooctest.crowd.site.command.AgencyResourceAbilityUpdateCommand;
 | 
											
										
											
												
													
														|  | @@ -44,20 +45,36 @@ public class AgencyController {
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      /**
 |  |      /**
 | 
											
												
													
														|  | -     * 申请认证为机构
 |  | 
 | 
											
												
													
														|  | 
 |  | +     * 申请机构认证
 | 
											
												
													
														|  |       * @param userId
 |  |       * @param userId
 | 
											
												
													
														|  |       * @param command
 |  |       * @param command
 | 
											
												
													
														|  | 
 |  | +     * @param result
 | 
											
												
													
														|  |       * @return
 |  |       * @return
 | 
											
												
													
														|  |       */
 |  |       */
 | 
											
												
													
														|  |      @LoginRequired
 |  |      @LoginRequired
 | 
											
												
													
														|  |      @RequestMapping(value = "/user/{userId}/agency", method = RequestMethod.POST)
 |  |      @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())
 |  |          if (result.hasErrors())
 | 
											
												
													
														|  |              throw new BaseException(result.getFieldError().getDefaultMessage());
 |  |              throw new BaseException(result.getFieldError().getDefaultMessage());
 | 
											
												
													
														|  |          return agencyService.applyAgency(userId, command);
 |  |          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 userId
 | 
											
												
													
														|  |       * @param status
 |  |       * @param status
 | 
											
										
											
												
													
														|  | @@ -99,6 +116,11 @@ public class AgencyController {
 | 
											
												
													
														|  |          return agencyService.upadteResourceAndAbility(userId, command);
 |  |          return agencyService.upadteResourceAndAbility(userId, command);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    /**
 | 
											
												
													
														|  | 
 |  | +     * 获取机构认证信息
 | 
											
												
													
														|  | 
 |  | +     * @param userId
 | 
											
												
													
														|  | 
 |  | +     * @return
 | 
											
												
													
														|  | 
 |  | +     */
 | 
											
												
													
														|  |      @LoginRequired
 |  |      @LoginRequired
 | 
											
												
													
														|  |      @RequestMapping(value = "/user/{userId}/agency", method = RequestMethod.GET)
 |  |      @RequestMapping(value = "/user/{userId}/agency", method = RequestMethod.GET)
 | 
											
												
													
														|  |      public AgencyVO getAgencyInfo(@PathVariable("userId") Long userId){
 |  |      public AgencyVO getAgencyInfo(@PathVariable("userId") Long userId){
 |