@@ -0,0 +1,2191 @@
+package asia.gkc.vneedu.controller.api.v1_0;%0A%0Aimport asia.gkc.vneedu.authorization.annotation.ActiveUser;%0Aimport asia.gkc.vneedu.authorization.annotation.RequireLogin;%0Aimport asia.gkc.vneedu.common.ResultModel;%0Aimport asia.gkc.vneedu.common.ResultStatus;%0Aimport asia.gkc.vneedu.controller.core.BaseController;%0Aimport asia.gkc.vneedu.model.Requirement;%0Aimport asia.gkc.vneedu.model.User;%0Aimport com.alibaba.fastjson.JSON;%0Aimport com.alibaba.fastjson.JSONArray;%0Aimport org.springframework.validation.BindingResult;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RequestParam;%0Aimport org.springframework.web.bind.annotation.RestController;%0A%0Aimport javax.validation.Valid;%0A%0A/**%0A * File Name: RequirementController.java%0A * Function:%0A *%0A * @author jakes.%0A * @version 1.0%0A * @since 4/12/16 11:27 AM%0A */%0A%0A@RestController%0A@RequestMapping(value = %22/api/v1.0%22)%0Apublic class RequirementController extends BaseController %7B%0A%0A    @RequestMapping(value = %22/requirement%22, method = RequestMethod.POST)%0A    @RequireLogin%0A    public ResultModel newRequirement(@Valid Requirement requirement,%0A                                      @RequestParam(value = %22images%22, required = false) String images,%0A                                      @ActiveUser User currentUser,%0A                                      BindingResult errors) %7B%0A%0A        if (errors.hasFieldErrors(%22price%22))%0A            return ResultModel.ERROR(ResultStatus.INCORRECT_PRICE);%0A        else if (errors.hasFieldErrors(%22payMethod%22))%0A            return ResultModel.ERROR(ResultStatus.INCORRECT_PAY_METHOD);%0A%0A        // %E8%AE%BE%E7%BD%AE%E5%8F%91%E5%B8%83%E7%94%A8%E6%88%B7%E4%B8%BA%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%0A        requirement.setPublisherId(currentUser.getId());%0A%0A        logger.debug(images);%0A%0A        String%5B%5D files = null;%0A        if (images != null) %7B%0A            JSONArray jsonArray = JSON.parseArray(images);%0A            files = jsonArray.toArray(new String%5B0%5D) ;%0A        %7D%0A%0A        requirementService.addRequirementWithFiles(requirement, files);%0A%0A        if (requirement.getId() == null)%0A            return ResultModel.ERROR(ResultStatus.ERROR_IN_SAVING);%0A        return ResultModel.OK();%0A    %7D%0A%7D%0A

add creation API for requirement