package com.casic.missiles.job.handler;


import com.casic.missiles.service.meter.MeterCertificateService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

import static com.xxl.job.core.biz.model.ReturnT.SUCCESS;

/**
 * 证书到期提醒
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RegularExpirationReminder {

    @Resource
    private MeterCertificateService meterCertificateService;

    @XxlJob(value = "regularExpirationReminder")
    public ReturnT<String> execute() throws Exception {
        meterCertificateService.regularExpirationReminder();
        return SUCCESS;
    }
}
