package cn.axzo.msg.center.message.service.impl.oldmsg;

import com.alibaba.fastjson.JSON;
import lombok.Data;

/**
 * @author yanglin
 */
@Data
public class OldMsgCacheReloadJobParam {

    private static final int DEFAULT_SYNC_DAY = 30;

    private int syncDay;
    private int batchSize;

    static OldMsgCacheReloadJobParam defaultParam() {
        OldMsgCacheReloadJobParam defaultParam = new OldMsgCacheReloadJobParam();
        defaultParam.setSyncDay(DEFAULT_SYNC_DAY);
        return defaultParam;
    }

    int determineSyncDay() {
        return syncDay <= 0 ? DEFAULT_SYNC_DAY : syncDay;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

}