todo log开关
This commit is contained in:
parent
55cb65bdc9
commit
0d6c79f088
@ -173,6 +173,9 @@ public class PendingMessageBizConfig {
|
||||
@Getter
|
||||
private int todoTitleSearchMaxSize = 5000;
|
||||
|
||||
@Getter
|
||||
private boolean enableTodoLog = true;
|
||||
|
||||
public boolean determineOldMsgStatCacheOn() {
|
||||
return isOldMsgStatCacheOn();
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import cn.axzo.msg.center.dal.TodoLogDao;
|
||||
import cn.axzo.msg.center.domain.entity.Todo;
|
||||
import cn.axzo.msg.center.domain.entity.TodoBusiness;
|
||||
import cn.axzo.msg.center.domain.entity.TodoLog;
|
||||
import cn.axzo.msg.center.inside.notices.config.PendingMessageBizConfig;
|
||||
import cn.axzo.msg.center.service.enums.BizCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.PendingMessageStateEnum;
|
||||
import cn.axzo.msg.center.service.enums.TodoLogType;
|
||||
@ -27,8 +28,10 @@ public class TodoLogger {
|
||||
|
||||
private final TodoLogDao todoLogDao;
|
||||
private final TodoBusinessDao todoBusinessDao;
|
||||
private final PendingMessageBizConfig cfg;
|
||||
|
||||
void logBusinessUpdated(TodoRequestContext ctx, TodoBusiness business) {
|
||||
if (!cfg.isEnableTodoLog()) return;
|
||||
TodoLog log = createBusinessLog(ctx, business);
|
||||
log.setContext(ctx.getName());
|
||||
log.addLogContents(ctx.getLogContents());
|
||||
@ -60,8 +63,8 @@ public class TodoLogger {
|
||||
}
|
||||
|
||||
public void logTodosUpdated(TodoRequestContext ctx, List<Todo> todos) {
|
||||
if (CollectionUtils.isEmpty(todos))
|
||||
return;
|
||||
if (!cfg.isEnableTodoLog()) return;
|
||||
if (CollectionUtils.isEmpty(todos)) return;
|
||||
TodoBusinesses businesses = todoBusinessDao.getBusinesses(todos);
|
||||
ArrayList<TodoLog> logs = new ArrayList<>();
|
||||
for (Todo todo : todos) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user