| | |
| | | package com.linghu.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.linghu.config.FinalStatus; |
| | | import com.linghu.listener.KeywordExcelListener; |
| | | import com.linghu.model.common.ResponseResult; |
| | | import com.linghu.model.dto.ExportFeedDTO; |
| | |
| | | import com.linghu.model.dto.ExportStaticsDTO; |
| | | import com.linghu.model.entity.*; |
| | | import com.linghu.model.excel.*; |
| | | import com.linghu.model.validator.UpdateGroup; |
| | | import com.linghu.model.vo.*; |
| | | import com.linghu.model.vo.KeywordStaticsListVO; |
| | | import com.linghu.model.vo.PlatformProportionVO; |
| | |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | |
| | | @PostMapping(value = "/exportStatics") |
| | | @ApiOperation(value = "EChart图导出") |
| | | public ResponseEntity<byte[]> exportStatics(@RequestBody ExportStaticsDTO exportStaticsDTO) { |
| | | public ResponseEntity<byte[]> exportStatics(@Valid @RequestBody ExportStaticsDTO exportStaticsDTO) { |
| | | |
| | | return keywordService.exportEChart(exportStaticsDTO); |
| | | } |
| | |
| | | */ |
| | | @PostMapping(value = "/exportGetResultByTypeId") |
| | | @ApiOperation(value = "导出:根据类别查看") |
| | | public ResponseEntity<byte[]> exportGetResultByTypeId(@RequestBody ExportGetResultDTO dto) { |
| | | public ResponseEntity<byte[]> exportGetResultByTypeId(@Valid @RequestBody ExportGetResultDTO dto) { |
| | | return keywordService.exportResult(dto); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/updateKeyword") |
| | | @ApiOperation(value = "修改关键词") |
| | | public ResponseResult<String> updateKeyword(@RequestBody Keyword keyword) { |
| | | if("submitted".equals(keyword.getStatus())){ |
| | | public ResponseResult<String> updateKeyword(@Validated(UpdateGroup.class) @RequestBody Keyword keyword) { |
| | | if(FinalStatus.SUBMITTED.getValue().equals(keyword.getStatus())){ |
| | | return ResponseResult.error("关键词已开始采集不允许修改!"); |
| | | } |
| | | keywordService.updateById(keyword); |
| | |
| | | @ApiOperation(value = "删除关键词") |
| | | public ResponseResult<String> deleteKeyword(@RequestParam("keywordId") Integer keywordId) { |
| | | Keyword keyword = keywordService.getById(keywordId); |
| | | if("submitted".equals(keyword.getStatus())){ |
| | | if(FinalStatus.SUBMITTED.getValue().equals(keyword.getStatus())){ |
| | | return ResponseResult.error("关键词已开始采集或不允许删除!"); |
| | | } |
| | | keywordService.removeById(keywordId); |