package cn.pluss.platform.config;

import lombok.Data;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import javax.annotation.PostConstruct;

@Data
@Configuration
@PropertySource("classpath:config/application-common.yml")
public class GetuiConfig {

    public String domain = "https://restapi.getui.com/v2/jzSkfM0Wsk8uSDL2zwGu07";

    public static String token = null;

    public static Long expireTime = null;

    /**
     * 获取鉴权token
     */
    public String auth = "/auth";

    /**
     * 按照别名单推
     */
    public static String singleAlias = "/push/single/alias";

    public static String singleCid = "/push/single/cid";

    public static String createMsg = "/push/list/message";

    /**
     * 按照别名批量推
     */
    public static String listAlias = "/push/list/alias";

    /**
     * 执行cid批量推
     */
    public static String listCid = "/push/list/cid";

    /**
     * 全量推送
     */
    public static String all = "/push/all";

    public static String tag = "/push/tag";

    @PostConstruct
    public void init() {
        auth = domain + auth;
        singleAlias = domain + singleAlias;
        singleCid = domain + singleCid;

        all = domain + all;
        tag = domain + tag;
        listAlias = domain + listAlias;
        listCid = domain + listCid;
        createMsg = domain + createMsg;
    }
}
