package com.tofly.xrtygis.custom.controller;

import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.service.SendSmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Bubble
 */
@RestController
@RequestMapping("/sendSms")
@AllArgsConstructor
@Api(tags = "发送短信相关接口")
public class SendSmsController {

    private final SendSmsService sendSmsService;

    @PostMapping("/sendSms")
    @ApiOperation("发送短信")
    public ResultRespone sendSms(String phone, String content){
        return ResultRespone.success(sendSmsService.sendSms(phone, content));
    }

    @GetMapping("/getSmsSignature")
    @ApiOperation("获取短信签名")
    public ResultRespone getSmsSignature(){
        return ResultRespone.success(sendSmsService.getSmsSignature());
    }

}
