package com.citygis.web.controller;

import com.citygis.common.core.domain.AjaxResult;
import com.citygis.web.domain.Mail;
import com.citygis.web.service.MailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author: zyl
 * @CreateTime: 2024-12-25
 * @Description: 邮箱 前端控制器
 * @Version: 1.0
 */
@Api(tags = "邮箱")
@CrossOrigin
@RestController
@RequestMapping("/web/mail")
public class MailController {

    @Resource
    MailService mailService;

    @ApiOperation("发送邮件验证码")
    @PostMapping("/sendMail")
    public AjaxResult sendMail(@RequestBody Mail mail){
        return mailService.sendMail(mail);
    }

    @ApiOperation("验证邮件验证码")
    @PostMapping("/verifyMail")
    public AjaxResult verifyMail(@RequestBody Mail mail){
        return mailService.verifyMail(mail);
    }

}
