| | |
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.springframework.web.bind.annotation.RequestParam;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | |
|
| | | @Resource
|
| | | private CustomerServiceHistoryService customerServiceHistoryService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserComplaintService userComplaintService;
|
| | | |
| | |
|
| | | /**
|
| | | * 预设标题的关键字列表
|
| | |
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getApiCommonGson().toJson(answer)));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 用户吐槽记录添加
|
| | | * 用户吐槽记录添加
|
| | | * |
| | | * @param fileList
|
| | | * @param uid
|
| | | * @param content
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "complaint")
|
| | | public void complaint(AcceptData acceptData, MultipartFile[] fileList, String content, Long uid, PrintWriter out) {
|
| | | // try {
|
| | | // userComplaintService.addUserComplaint(fileList, uid, content);
|
| | | // out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | // } catch (UserComplaintException e) {
|
| | | // out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | // e.printStackTrace();
|
| | | // } catch (IOException e) {
|
| | | // out.print(JsonUtil.loadFalseResult("图片上传失败失败"));
|
| | | // e.printStackTrace();
|
| | | // } catch (Exception e) {
|
| | | // out.print(JsonUtil.loadFalseResult("保存失败"));
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | System.out.println(content);
|
| | | public void complaint(AcceptData acceptData, MultipartFile[] fileList, String content, Long uid,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | List<MultipartFile> files = new ArrayList<>();
|
| | | if (fileList != null)
|
| | | for (MultipartFile mf : fileList) {
|
| | | files.add(mf);
|
| | | }
|
| | | userComplaintService.addUserComplaint(files, uid, content);
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserComplaintException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | out.print(JsonUtil.loadFalseResult("图片上传失败失败"));
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("保存失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|