基础结构修改,以及基础接口添加完善逻辑
This commit is contained in:
@@ -45,19 +45,6 @@ public class ChatWebSocketHandler {
|
||||
// @Value("${whisper.language}")
|
||||
private String language = "en";
|
||||
|
||||
/**
|
||||
* 16kHz
|
||||
*/
|
||||
private static final int SAMPLE_RATE = 16000;
|
||||
/**
|
||||
* 4 KB 每次读取
|
||||
*/
|
||||
private static final int BUFFER_SIZE = 4096;
|
||||
/**
|
||||
* 每样本 16 位
|
||||
*/
|
||||
private static final int BITS_PER_SAMPLE = 16;
|
||||
|
||||
/**
|
||||
* 缓存客户端流式解析的语音文本数据
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.vetti.web.controller.system;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import com.vetti.common.utils.MessageUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -29,6 +31,7 @@ import com.vetti.system.service.ISysMenuService;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Api(tags ="登录模块")
|
||||
@RestController
|
||||
public class SysLoginController
|
||||
{
|
||||
@@ -53,6 +56,7 @@ public class SysLoginController
|
||||
* @param loginBody 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation("登录方法")
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||
{
|
||||
@@ -69,6 +73,7 @@ public class SysLoginController
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@ApiOperation("获取用户信息")
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo()
|
||||
{
|
||||
@@ -84,11 +89,13 @@ public class SysLoginController
|
||||
tokenService.refreshToken(loginUser);
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
ajax.put("permissions", permissions);
|
||||
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||
Map mapInfo = new HashMap();
|
||||
mapInfo.put("user", user);
|
||||
mapInfo.put("roles", roles);
|
||||
mapInfo.put("permissions", permissions);
|
||||
mapInfo.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||
mapInfo.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||
ajax.put("data", mapInfo);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@@ -97,6 +104,7 @@ public class SysLoginController
|
||||
*
|
||||
* @return 路由信息
|
||||
*/
|
||||
@ApiOperation("获取路由信息")
|
||||
@GetMapping("getRouters")
|
||||
public AjaxResult getRouters()
|
||||
{
|
||||
@@ -128,4 +136,19 @@ public class SysLoginController
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 忘记密码
|
||||
*
|
||||
* @param loginBody 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation("忘记密码")
|
||||
@PostMapping("/forgotPassword")
|
||||
public AjaxResult handlePassword(@RequestBody LoginBody loginBody)
|
||||
{
|
||||
loginService.resetPassword(loginBody.getUsername(),loginBody.getPassword(),loginBody.getRepeatPassword(),loginBody.getCode(),loginBody.getUuid());
|
||||
return AjaxResult.success(MessageUtils.messageCustomize("systemCommonTip10001"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.vetti.web.controller.system;
|
||||
|
||||
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;
|
||||
@@ -16,23 +18,19 @@ import com.vetti.system.service.ISysConfigService;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Api(tags ="注册验证模块")
|
||||
@RestController
|
||||
public class SysRegisterController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private SysRegisterService registerService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@ApiOperation("注册方法")
|
||||
@PostMapping("/register")
|
||||
public AjaxResult register(@RequestBody RegisterBody user)
|
||||
{
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
||||
{
|
||||
return error("当前系统没有开启注册功能!");
|
||||
}
|
||||
String msg = registerService.register(user);
|
||||
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.vetti.web.controller.system;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.vetti.common.core.controller.BaseController;
|
||||
import com.vetti.common.core.domain.R;
|
||||
import com.vetti.common.exception.ServiceException;
|
||||
import com.vetti.common.service.verification.VerificationEmailService;
|
||||
import com.vetti.common.utils.MessageUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ID
|
||||
* @date 2025/8/28 16:16
|
||||
*/
|
||||
@Api(tags ="邮箱验证码")
|
||||
@RestController
|
||||
@RequestMapping("/verificationEmail")
|
||||
@RequiredArgsConstructor
|
||||
public class VerificationEmailController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private final VerificationEmailService verificationEmailService;
|
||||
|
||||
|
||||
@ApiOperation("发送验证码(标题、内容走的配置文件)")
|
||||
@PostMapping("/send")
|
||||
public R sendVerificationCode(@RequestParam String email) {
|
||||
boolean isSent = verificationEmailService.sendVerificationEm7941VerificationCode(email);
|
||||
if (isSent) {
|
||||
return R.ok(MessageUtils.messageCustomize("systemVerificationEmailController10001"));
|
||||
} else {
|
||||
return R.fail(MessageUtils.messageCustomize("systemVerificationEmailController10002"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证邮箱验证码
|
||||
*/
|
||||
@PostMapping("/verify")
|
||||
public R verifyCode(@RequestParam String email, @RequestParam String code) {
|
||||
boolean isValid = verificationEmailService.verifyCode(email, code);
|
||||
if (isValid) {
|
||||
return R.ok(MessageUtils.messageCustomize("systemVerificationEmailController10003"));
|
||||
} else {
|
||||
return R.fail(MessageUtils.messageCustomize("systemVerificationEmailController10004"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user