package com.ssyf.feign.application.message;

import com.ssyf.common.domain.message.query.SmsSendMessageQuery;
import com.ssyf.common.web.result.Result;
import com.ssyf.feign.config.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


/**
 * 短信微服务
 * @author huwei
 * @date 2023/9/27 11:25
 */
@FeignClient(name = "message" ,path = "/message" ,contextId = "sms",configuration = FeignConfiguration.class)
public interface SmsFeignService {

    /**
     * 发送消息
     * @param query
     * @return
     */
    @RequestMapping(value = "/api/sms/sendMessage" ,method = RequestMethod.POST ,consumes = MediaType.APPLICATION_JSON_VALUE)
    Result sendMessage(@RequestBody SmsSendMessageQuery query);

    /**
     * 发送短信消息异步
     * @param query
     * @return
     */
    @RequestMapping(value = "/api/sms/sendMessageAsync" ,method = RequestMethod.POST ,consumes = MediaType.APPLICATION_JSON_VALUE)
    Result sendMessageAsync(@RequestBody SmsSendMessageQuery query);
    /**
     * 发送消息批量
     * @param query
     * @return
     */
    @RequestMapping(value = "/api/sms/sendMessageBatch" ,method = RequestMethod.POST ,consumes = MediaType.APPLICATION_JSON_VALUE)
    Result sendMessageBatch(@RequestBody SmsSendMessageQuery query);

    /**
     * 发送消息批量、异步
     * @param query
     * @return
     */
    @RequestMapping(value = "/api/sms/sendMessageBatchAsync" ,method = RequestMethod.POST ,consumes = MediaType.APPLICATION_JSON_VALUE)
    Result sendMessageBatchAsync(@RequestBody SmsSendMessageQuery query);
}
