package com.nokia.tsl_data.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import com.nokia.common.message.pushmessage.PushMessageUtil;

@Configuration
public class PushMessageUtilConfig {

    // api-url，不增加转发时应该时能力商店的url
    private String url = "http://10.244.18.105:8000/api/chinaUnicom/microservice/notice/pushMessage/v1";
    // 能力商店的appid
    private String appId = "ENWaB7YdUD";
    // 能力商店正式环境密钥
    private String appSecret = "oz4OgKBaMNwi4LWfLPbhrPbbuCS8T0Rb";
    // 系统编号
    private String systemId = "10000078";
    // 模块编号
    private String moduleId = "20000156";
    // 业务编码
    private String busiCode = "30000111";

    // 关键字： `CUC:` 我自己的群
    // https://oapi.dingtalk.com/robot/send?access_token=b2f1424d6119affaacab614b184f043fcd2c73db2651bb86eff29992d66820bf
    private String accessToken = "b2f1424d6119affaacab614b184f043fcd2c73db2651bb86eff29992d66820bf";
    private String prefix = "CUC:";

    @Bean
    public PushMessageUtil pushMessageUtil(RestTemplate restTemplate) {
        return PushMessageUtil.builder()
                .url(url)
                .appId(appId)
                .appSecret(appSecret)
                .systemId(systemId)
                .moduleId(moduleId)
                .busiCode(busiCode)
                .accessToken(accessToken)
                .prefix(prefix)
                .restTemplate(restTemplate)
                .build();
    }

}
