|
@@ -9,6 +9,8 @@ import com.simuwang.base.pojo.vo.EmailTypeRuleVO;
|
|
import com.simuwang.daq.service.EmailParseApiService;
|
|
import com.simuwang.daq.service.EmailParseApiService;
|
|
import com.simuwang.manage.api.base.BaseController;
|
|
import com.simuwang.manage.api.base.BaseController;
|
|
import com.simuwang.manage.service.ParseEmailService;
|
|
import com.simuwang.manage.service.ParseEmailService;
|
|
|
|
+import com.smppw.common.pojo.ResultVo;
|
|
|
|
+import com.smppw.common.pojo.enums.status.ResultCode;
|
|
import jakarta.servlet.ServletOutputStream;
|
|
import jakarta.servlet.ServletOutputStream;
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
@@ -44,14 +46,16 @@ public class ParseEmailController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/save-email-type")
|
|
@PostMapping("/save-email-type")
|
|
- public AjaxResult saveEmailType(@RequestBody EmailTypeRuleVO emailTypeRuleVO){
|
|
|
|
|
|
+ public ResultVo saveEmailType(@RequestBody EmailTypeRuleVO emailTypeRuleVO){
|
|
|
|
+ ResultVo vo = new ResultVo(ResultCode.SAVE_SUCCESS);
|
|
try{
|
|
try{
|
|
parseEmailService.saveEmailType(emailTypeRuleVO);
|
|
parseEmailService.saveEmailType(emailTypeRuleVO);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
logger.error(e.getMessage(),e);
|
|
logger.error(e.getMessage(),e);
|
|
- return AjaxResult.error("保存失败");
|
|
|
|
|
|
+ vo.setCode(ResultCode.SAVE_SUCCESS.getCode());
|
|
|
|
+ vo.setMsg(e.getMessage());
|
|
}
|
|
}
|
|
- return AjaxResult.success();
|
|
|
|
|
|
+ return vo;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -60,15 +64,9 @@ public class ParseEmailController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/search-email-type")
|
|
@GetMapping("/search-email-type")
|
|
- public AjaxResult searchEmailType(){
|
|
|
|
- EmailTypeRuleVO emailTypeRuleVO = new EmailTypeRuleVO();
|
|
|
|
- try{
|
|
|
|
- emailTypeRuleVO = parseEmailService.searchEmailType();
|
|
|
|
- }catch (Exception e){
|
|
|
|
- logger.error(e.getMessage(),e);
|
|
|
|
- return AjaxResult.error("查询失败");
|
|
|
|
- }
|
|
|
|
- return AjaxResult.success(emailTypeRuleVO);
|
|
|
|
|
|
+ public ResultVo searchEmailType(){
|
|
|
|
+ EmailTypeRuleVO emailTypeRuleVO = parseEmailService.searchEmailType();
|
|
|
|
+ return ResultVo.ok(emailTypeRuleVO);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -92,9 +90,9 @@ public class ParseEmailController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/{id}")
|
|
@GetMapping("/{id}")
|
|
- public AjaxResult searchEmail(@PathVariable("id") Integer id){
|
|
|
|
|
|
+ public ResultVo searchEmail(@PathVariable("id") Integer id){
|
|
EmailParseInfoVO result = parseEmailService.searchEmailById(id);
|
|
EmailParseInfoVO result = parseEmailService.searchEmailById(id);
|
|
- return AjaxResult.success(result);
|
|
|
|
|
|
+ return ResultVo.ok(result);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -103,9 +101,9 @@ public class ParseEmailController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/search-email-count")
|
|
@GetMapping("/search-email-count")
|
|
- public AjaxResult searchEmailCount(@RequestParam("parseDate") String parseDate){
|
|
|
|
|
|
+ public ResultVo searchEmailCount(@RequestParam("parseDate") String parseDate){
|
|
Map<String,Integer> result = parseEmailService.searchEmailCount(parseDate);
|
|
Map<String,Integer> result = parseEmailService.searchEmailCount(parseDate);
|
|
- return AjaxResult.success(result);
|
|
|
|
|
|
+ return ResultVo.ok(result);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -139,8 +137,8 @@ public class ParseEmailController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/reparse/{id}")
|
|
@GetMapping("/reparse/{id}")
|
|
- public AjaxResult reparse(@PathVariable("id")Integer id){
|
|
|
|
|
|
+ public ResultVo reparse(@PathVariable("id")Integer id){
|
|
emailParseApiService.reparseEmail(id);
|
|
emailParseApiService.reparseEmail(id);
|
|
- return AjaxResult.success();
|
|
|
|
|
|
+ return ResultVo.ok(null);
|
|
}
|
|
}
|
|
}
|
|
}
|