package org.springblade.modules.sms.controller;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.modules.sms.service.ISmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created By lidexi in 2021/7/7
 **/
@RestController
@Slf4j
@RequestMapping("/huawei/sms")
@Api(tags = "华为短信接口")
@AllArgsConstructor
public class HwySmsController {


	private final ISmsService huaweiSmsServiceImpl;



	//发送短信
	@PostMapping("/sendSms")
	public R sendSms(String phone){
		return this.huaweiSmsServiceImpl.sendSmsCode(phone);
	}

	//短信校验
	@PostMapping("/validCode")
	public R validCode(@RequestParam("phone") String phone, @RequestParam("code") String code){
		return this.huaweiSmsServiceImpl.codeValite(phone,code);
	}




}
