package com.app.service;

import com.app.feign.WeChatWorkFeign;
import com.app.feign.WeChatWorkResponse;
import com.app.feign.dto.BotMsg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * 功能描述：
 *
 * @Author 梁展鹏
 * @Date 2020/11/8 12:23
 */
@Slf4j
@Service
public class WeChatWorkService {

    @Value("${spring.profiles.active}")
    private String active;

    @Autowired
    private WeChatWorkFeign weChatWorkFeign;

    public void sendGlobalExceptionRobot(BotMsg botMsg) {
        if ("prod".equals(active)) {
            WeChatWorkResponse response = weChatWorkFeign.send(botMsg, "d36a1eb9-d20b-4a28-a22f-b4d995c4db3a");
        }
    }

}
