|
@@ -2,6 +2,7 @@ package com.mooctest.crowd.site.controller;
|
|
|
|
|
|
import com.mooctest.crowd.domain.exception.BaseException;
|
|
|
import com.mooctest.crowd.site.command.ApplyAgencyAuthCommand;
|
|
|
+import com.mooctest.crowd.site.command.GenerateAgencyCommand;
|
|
|
import com.mooctest.crowd.site.data.dto.UserDTO;
|
|
|
import com.mooctest.crowd.site.service.AgencyService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -29,7 +30,7 @@ public class AgencyController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/greenChannel/agency", method = RequestMethod.POST)
|
|
|
- public UserDTO generateAgency(@RequestBody @Validated ApplyAgencyAuthCommand command, BindingResult result){
|
|
|
+ public UserDTO generateAgency(@RequestBody @Validated GenerateAgencyCommand command, BindingResult result){
|
|
|
if (result.hasErrors())
|
|
|
throw new BaseException(result.getFieldError().getDefaultMessage());
|
|
|
return agencyService.generateAgency(command);
|