增加消息处理异常记录--system模块

This commit is contained in:
2023-08-18 09:48:19 +08:00
parent d3847c4b1f
commit 4e55237f4c
11 changed files with 235 additions and 66 deletions

View File

@@ -0,0 +1,64 @@
package com.njcn.system.controller;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil;
import com.njcn.system.pojo.param.DictDataParam;
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
import com.njcn.system.service.IRocketmqMsgErrorLogService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.web.controller.BaseController;
/**
* <p>
* rocketmq消息处理记录表 前端控制器
* </p>
*
* @author hongawen
* @since 2023-08-17
*/
@Slf4j
@RestController
@RequestMapping("/rocketmqMsgErrorLog")
@RequiredArgsConstructor
public class RocketmqMsgErrorLogController extends BaseController {
private final IRocketmqMsgErrorLogService rocketmqMsgErrorLogService;
/**
* 新增消息异常记录
*
* @param rocketmqMsgErrorLog 消息异常数据
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
@PostMapping("/add")
@ApiOperation("新增消息异常记录")
@ApiImplicitParam(name = "rocketmqMsgErrorLog", value = "消息异常数据", required = true)
public HttpResult<Object> add(@RequestBody RocketmqMsgErrorLog rocketmqMsgErrorLog) {
String methodDescribe = getMethodDescribe("add");
LogUtil.njcnDebug(log, "{},消息异常数据:{}", methodDescribe, rocketmqMsgErrorLog);
boolean result = rocketmqMsgErrorLogService.save(rocketmqMsgErrorLog);
if (result) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
}
}

View File

@@ -0,0 +1,16 @@
package com.njcn.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
/**
* <p>
* rocketmq消息处理记录表 Mapper 接口
* </p>
*
* @author hongawen
* @since 2023-08-17
*/
public interface RocketmqMsgErrorLogMapper extends BaseMapper<RocketmqMsgErrorLog> {
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.system.mapper.RocketmqMsgErrorLogMapper">
</mapper>

View File

@@ -0,0 +1,16 @@
package com.njcn.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
/**
* <p>
* rocketmq消息处理记录表 服务类
* </p>
*
* @author hongawen
* @since 2023-08-17
*/
public interface IRocketmqMsgErrorLogService extends IService<RocketmqMsgErrorLog> {
}

View File

@@ -0,0 +1,20 @@
package com.njcn.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.system.mapper.RocketmqMsgErrorLogMapper;
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
import com.njcn.system.service.IRocketmqMsgErrorLogService;
import org.springframework.stereotype.Service;
/**
* <p>
* rocketmq消息处理记录表 服务实现类
* </p>
*
* @author hongawen
* @since 2023-08-17
*/
@Service
public class RocketmqMsgErrorLogServiceImpl extends ServiceImpl<RocketmqMsgErrorLogMapper, RocketmqMsgErrorLog> implements IRocketmqMsgErrorLogService {
}