package com.crunii.micro.feign.client;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.feign.client.fallbackfactory.ObsServiceFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author qiaolin
 * @version 1.0
 * @date 2023/6/29 12:40
 */
@FeignClient(value = "service-sms", fallbackFactory = ObsServiceFallbackFactory.class)
public interface SmsService {

    @ApiOperation(value = "短信验证码")
    @RequestMapping(path = "/auth/SmsController/smsCode", method = RequestMethod.GET)
    Result<String> smsCode(@RequestParam("phone") String phone);

    @ApiOperation("测试")
    @RequestMapping(path = "/auth/SmsController/updateTestFile", method = RequestMethod.GET)
    Result<String> updateTestFile();

    @ApiOperation("通手机号发送短信")
    @RequestMapping(value = "/sendMessage", method = RequestMethod.GET)
    public Result<String> sendMessage(@RequestParam("phone") String phone, @RequestParam("content") String content);

    @ApiOperation("通手机号+短信模板+填充数据发送短信")
    @RequestMapping(value = "/auth/SmsController/sendSms", method = RequestMethod.GET)
    public Result<String> sendSms(@RequestParam("phone") String phone,@RequestParam("templateCode") String templateCode,@RequestParam("fillData") String fillData);

}
