|  | @@ -1,6 +1,7 @@
 | 
	
		
			
				|  |  |  package com.mooctest.crowd.site.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.mooctest.crowd.domain.exception.BaseException;
 | 
	
		
			
				|  |  | +import com.mooctest.crowd.site.annotation.LoginRequired;
 | 
	
		
			
				|  |  |  import com.mooctest.crowd.site.command.AgencyUpdateCommand;
 | 
	
		
			
				|  |  |  import com.mooctest.crowd.site.command.ApplyAgencyAuthCommand;
 | 
	
		
			
				|  |  |  import com.mooctest.crowd.site.command.GenerateAgencyCommand;
 | 
	
	
		
			
				|  | @@ -12,6 +13,7 @@ import org.springframework.validation.BindingResult;
 | 
	
		
			
				|  |  |  import org.springframework.validation.annotation.Validated;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import javax.servlet.http.HttpSession;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
	
		
			
				|  | @@ -57,13 +59,27 @@ public class AgencyController {
 | 
	
		
			
				|  |  |       * @param status
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    @RequestMapping(value = "/user/{userId}/agency/status/{status}", method = RequestMethod.PUT)
 | 
	
		
			
				|  |  | +    @RequestMapping(value = "/user/{userId}/agency/status/", method = RequestMethod.PUT)
 | 
	
		
			
				|  |  |      public UserDTO checkAuth(@PathVariable("userId") Long userId, @PathVariable("status") Integer status){
 | 
	
		
			
				|  |  |          if (status > 1 || status < -1)
 | 
	
		
			
				|  |  |              throw new BaseException("错误的状态信息,无法更新认证状态为所选状态");
 | 
	
		
			
				|  |  |          return agencyService.updateAgencyStatus(userId, status);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @LoginRequired
 | 
	
		
			
				|  |  | +    @RequestMapping(value = "/user/{userId}/agency/status/accept", method = RequestMethod.PUT)
 | 
	
		
			
				|  |  | +    public UserDTO passAuth(@PathVariable("userId") Long userId, HttpSession session){
 | 
	
		
			
				|  |  | +        Long operatorId = Long.parseLong((String)session.getAttribute("userId"));
 | 
	
		
			
				|  |  | +        return agencyService.passAuth(userId, operatorId);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @LoginRequired
 | 
	
		
			
				|  |  | +    @RequestMapping(value = "/user/{userId}/agency/status/reject", method = RequestMethod.PUT)
 | 
	
		
			
				|  |  | +    public void rejectAuth(@PathVariable("userId") Long userId, HttpSession session){
 | 
	
		
			
				|  |  | +        Long operatorId = Long.parseLong((String)session.getAttribute("userId"));
 | 
	
		
			
				|  |  | +        agencyService.rejectAuth(userId, operatorId);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 测评机构修改能力和资源信息
 | 
	
		
			
				|  |  |       * @param userId
 |