ECR
lxw
2023-02-23 d0e4a1a2192982a93d51a0372191ae14455341ba
src/main/java/com/whyc/controller/BOMFeedbakController.java
@@ -3,12 +3,16 @@
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@RestController
@@ -37,8 +41,15 @@
    }
    @ApiOperation("提交反馈")
    @GetMapping("submitFeedback")
    public Response submitFeedback(@RequestBody BOMFeedback feedback) throws IOException, MessagingException {
        return service.submitFeedback(feedback);
    @PostMapping("submitFeedback")
    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);
    }
    @ApiOperation(value = "根据文件路径下载")
    @GetMapping("downLoadFileByFilePath")
    public void downLoadFileByFilePath(HttpServletRequest req, HttpServletResponse resp, @RequestParam String filePath){
        service.downLoadFileByFilePath(req,resp,filePath);
    }
}