src/main/java/com/whyc/controller/BOMFeedbakController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/pojo/BOMFeedback.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/BOMFeedbakService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/BOMFeedbakController.java
@@ -3,10 +3,12 @@ import com.whyc.dto.Response; import com.whyc.pojo.BOMFeedback; import com.whyc.service.BOMFeedbakService; import com.whyc.util.ActionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.mail.MessagingException; import java.io.IOException; @@ -38,7 +40,8 @@ @ApiOperation("提交反馈") @PostMapping("submitFeedback") public Response submitFeedback(@RequestBody BOMFeedback feedback) throws IOException, MessagingException { return service.submitFeedback(feedback); public Response submitFeedback(@RequestPart(required = false) MultipartFile multipartFile,@RequestParam String feedbackJson) throws IOException, MessagingException { BOMFeedback feedback = ActionUtil.getGson().fromJson(feedbackJson, BOMFeedback.class); return service.submitFeedback(feedback,multipartFile); } } src/main/java/com/whyc/pojo/BOMFeedback.java
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import org.springframework.web.multipart.MultipartFile; import java.util.Date; @@ -42,8 +41,6 @@ private Date createTime; private Integer confirmStatus; private String confirmUserName; @TableField(exist = false) private MultipartFile multipartFile; public Integer getId() { @@ -182,11 +179,4 @@ this.versionTime = versionTime; } public MultipartFile getMultipartFile() { return multipartFile; } public void setMultipartFile(MultipartFile multipartFile) { this.multipartFile = multipartFile; } } src/main/java/com/whyc/service/BOMFeedbakService.java
@@ -110,10 +110,10 @@ * 2.附件存储 * 3.邮件发送 * @param feedback bom问题反馈 * @param multipartFile * @return response */ public Response submitFeedback(BOMFeedback feedback) throws IOException, MessagingException { MultipartFile multipartFile = feedback.getMultipartFile(); public Response submitFeedback(BOMFeedback feedback, MultipartFile multipartFile) throws IOException, MessagingException { Date date = new Date(); if(multipartFile!=null){ //存储文件