package cn.superdesk.uniorder.executor.scheduler.task;

import cn.superdesk.uniorder.common.json.AnJsonUtils;
import cn.superdesk.uniorder.dto.param.system.notify.SysNotifyClearByDatabaseRecordCriteria;
import cn.superdesk.uniorder.dubbo.consumer.sys.notify.SysNotifyDubboConsumerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * @Description: 系统通知清理
 * @Author: linjinyu
 * @CreateDate: 2021/6/1 上午10:39
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/6/1 上午10:39
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class SysNotifyClearTask {

	@Autowired
	private SysNotifyDubboConsumerService sysNotifyDubboConsumerService;


	public void run(String json) {

		SysNotifyClearByDatabaseRecordCriteria sysNotifyClearByDatabaseRecordCriteria = AnJsonUtils.toObject(json, SysNotifyClearByDatabaseRecordCriteria.class);

		sysNotifyDubboConsumerService.clearByDatabaseRecord(sysNotifyClearByDatabaseRecordCriteria);
	}


}
