@@ -0,0 +1,1694 @@
+package selling.sunshine.controller;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0Aimport org.springframework.web.bind.annotation.RestController;%0Aimport org.springframework.web.multipart.MultipartFile;%0Aimport org.springframework.web.multipart.MultipartHttpServletRequest;%0Aimport selling.sunshine.service.UploadService;%0Aimport selling.sunshine.utils.ResponseCode;%0Aimport selling.sunshine.utils.ResultData;%0A%0A%0A/**%0A * Created by sunshine on 6/6/16.%0A */%0A@RestController%0A@RequestMapping(%22/credit%22)%0Apublic class CreditController %7B%0A    private Logger logger = LoggerFactory.getLogger(CreditController.class);%0A%0A    @Autowired%0A    private UploadService uploadService;%0A%0A    @ResponseBody%0A    @RequestMapping(method = RequestMethod.POST, value = %22/upload%22)%0A    public ResultData upload(MultipartHttpServletRequest request) %7B%0A        ResultData result = new ResultData();%0A        String context = request.getSession().getServletContext().getRealPath(%22/%22);%0A        try %7B%0A            MultipartFile file = request.getFile(%22credit%22);%0A            ResultData response = uploadService.upload(file, context);%0A            if (response.getResponseCode() == ResponseCode.RESPONSE_OK) %7B%0A                result.setData(response.getData());%0A            %7D else %7B%0A                result.setResponseCode(ResponseCode.RESPONSE_ERROR);%0A            %7D%0A        %7D catch (Exception e) %7B%0A            logger.error(e.getMessage());%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

add upload credit method