jiangping
2024-05-31 bf8d85d5f83c2036fb4239d764d33e99c1b62bd3
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformInterfaceLogServiceImpl.java
@@ -1,9 +1,12 @@
package com.doumee.service.business.impl;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.PlatformInterfaceLogMapper;
import com.doumee.dao.business.model.InterfaceLog;
import com.doumee.dao.business.model.PlatformInterfaceLog;
import com.doumee.service.business.PlatformInterfaceLogService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -23,6 +26,9 @@
 */
@Service
public class PlatformInterfaceLogServiceImpl implements PlatformInterfaceLogService {
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
    private PlatformInterfaceLogMapper platformInterfaceLogMapper;
@@ -125,4 +131,13 @@
        QueryWrapper<PlatformInterfaceLog> wrapper = new QueryWrapper<>(platformInterfaceLog);
        return platformInterfaceLogMapper.selectCount(wrapper);
    }
    @Override
    public void clearThreeMonthLog() {
        int days =15;
        try {
            days = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.LOG_DEL_DAYS_LIMIT).getCode());
        }catch (Exception e){}
        platformInterfaceLogMapper.delete(new UpdateWrapper<PlatformInterfaceLog>().lambda()
                .apply("to_days(create_date)+"+days+" < to_days(now())"));
    }
}