package com.diagbot.web;

import com.diagbot.dto.RespDTO;
import com.diagbot.service.SmsVerService;
import com.diagbot.util.DateUtil;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @Description: 测试控制层
 * @author: gaodm
 * @time: 2018/9/5 14:23
 */
@RestController
@Slf4j
@ApiIgnore
@RequestMapping("/test")
public class TestController {
    @Autowired
    private SmsVerService smsVerService;

    @ApiOperation(value = "测试发送短信[by:gaodm]",
            notes = "测试发送短信")
    @PostMapping("/sms_send")
    RespDTO testSmsSend() {
        System.out.println("The time is now " + DateUtil.nowString());
        log.info("短信验证发送开始！");
//        String code="1234";
        //SMS_143861902
        String code = smsVerService.smsSend("188575800**","SMS_143861***");
        log.info("短信验证发送结束！验证码:{}",code);
        return RespDTO.onSuc(code);
    }
}
