package com.ruoyi.common.jpush;

import cn.jiguang.sdk.api.PushApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**极光推送配置
 */
@Configuration
public class JiGuangConfig {
    /**
     * 极光官网-个人管理中心-appkey
     * https://www.jiguang.cn/
     */
    @Value("${jpush.appKey}")
    private String appKey;

    /**
     * 极光官网-个人管理中心-点击查看-secret
     */
    @Value("${jpush.masterSecret}")
    private String masterSecret;

    @Bean
    public PushApi pushApi() {
        return new PushApi.Builder()
                .setAppKey(appKey)
                .setMasterSecret(masterSecret)
                .build();
    }
}
