SmsCodeController.java 2.23 KB
package com.zhongzhi.controller;

import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.model.SmsCodeDO;
import com.zhongzhi.service.SmsCodeService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 短信验证码 前端控制器
 * </p>
 *
 * @author DengMin
 * @since 2021-04-28
 */
@RestController
@Api(tags = "短信验证码")
@RequestMapping("/smsCode")
public class SmsCodeController {

    @Autowired
    private SmsCodeService smsCodeService;

    @PostMapping(value = "/sendRegisterCode")
    @ApiOperation("学生端 ---注册验证码:telephone/手机号")
    public ResponseVO sendRegisterCode(@RequestBody SmsCodeDO smsCodeDO) {
        smsCodeService.sendRegisterCode(smsCodeDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "/sendStudentLoginCode")
    @ApiOperation("学生端 ---登陆验证码:telephone/手机号")
    public ResponseVO sendStudentLoginCode(@RequestBody SmsCodeDO smsCodeDO) {
        smsCodeService.sendStudentLoginCode(smsCodeDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "/sendAdministerLoginCode")
    @ApiOperation("中心端 --- 中心端登陆验证码:telephone/手机号")
    public ResponseVO sendAdministerLoginCode(@RequestBody AdministerDO administerDO) {
        smsCodeService.sendAdministerLoginCode(administerDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping(value = "/sendJudgeLoginCode")
    @ApiOperation("评审端 ---登陆验证码:telephone/手机号")
    public ResponseVO sendJudgeLoginCode(@RequestBody SmsCodeDO smsCodeDO) {
        smsCodeService.sendJudgeLoginCode(smsCodeDO);
        return ResponseData.generateCreatedResponse(0);
    }

}