package com.yuchen.saas.message.api.feign.dingding;


import com.yuchen.saas.message.api.enums.MessageTypeEnum;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(
        value = AppNameConstant.SAAS_MESSAGE,
        fallbackFactory = MonitorDingFeignFallback.class
)
public interface MonitorDingFeignServer {

    String PUSH_MESSAGE = "/monitor/push/message";

    /**
     * 钉钉消息推送
     *
     * @param type      消息类型{@link MessageTypeEnum}
     * @param title     标题， 如 : 业务异常
     * @param platform  所属平台， 如 : 智慧园区
     * @param module    模块， 如 : 停车场功能
     * @param operation 业务操作，如 : 账单支付
     * @param details   异常内容，如 : 发生异常账单、异常放行事件等
     * @param at        艾特目标[all-所有人 手机号-多个以逗号分隔]
     * @return void
     */
    @GetMapping(PUSH_MESSAGE)
    R<Void> pushMessage(@RequestParam("type") String type,
                        @RequestParam("title") String title,
                        @RequestParam("platform") String platform,
                        @RequestParam("module") String module,
                        @RequestParam("operation") String operation,
                        @RequestParam("details") String details,
                        @RequestParam("at") String at);
}
