Implementation:A616567126 GPT WEB JAVA SendController
| Knowledge Sources | |
|---|---|
| Domains | Email, User_Registration |
| Last Updated | 2026-10-13 00:00 GMT |
Overview
Concrete REST controller for sending email verification codes during user registration, with duplicate email/phone checking and registration method validation.
Description
The SendController exposes a POST endpoint at `/send/email` that validates the system's registration method is set to email (method 2), checks that the email and mobile number are not already registered, and sends a verification code email via `SendMessageService`.
Usage
Import this controller when implementing the email registration flow to send verification codes to new users.
Code Reference
Source Location
- Repository: A616567126_GPT_WEB_JAVA
- File: src/main/java/com/intelligent/bot/api/sys/SendController.java
- Lines: 1-48
Signature
@RestController
@RequestMapping("/send")
@Transactional(rollbackFor = E.class)
public class SendController {
@RequestMapping(value = "/email", name = "发送邮件验证码")
@AvoidRepeatRequest(msg = "请求频繁请稍后再试")
public B<Void> sendMessage(@Validated @RequestBody SendEmailReq req);
}
Import
import com.intelligent.bot.api.sys.SendController;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| req.email | String | Yes | Email address to send verification code |
| req.mobile | String | Yes | Mobile number (for duplicate check) |
Outputs
| Name | Type | Description |
|---|---|---|
| returns | B<Void> | Success response or error message |
Usage Examples
Send Verification Email
// POST /send/email
{
"email": "user@example.com",
"mobile": "13800138000"
}
// Response:
// { "status": 200, "message": "操作成功" }
// Error: { "status": 500, "message": "发送邮件功能已关闭" }
// Error: { "status": 500, "message": "邮箱或手机号已存在,请更换" }