You've already forked FrameTour-BE
feat(scenic-account): 添加景区账号激活/停用功能并优化登录验证
- 新增激活/停用景区账号的接口和相关逻辑 - 在登录时增加账号激活状态的验证 - 更新数据库表结构,添加 isActive 字段 - 优化 MyBatis 映射文件,支持新功能
This commit is contained in:
@@ -90,6 +90,9 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
if (scenicAccount.getStatus() == 0) {
|
||||
return ApiResponse.fail("账号已被禁用");
|
||||
}
|
||||
if (scenicAccount.getIsActive() == null || scenicAccount.getIsActive() != 1) {
|
||||
return ApiResponse.fail("账号未激活");
|
||||
}
|
||||
if (!scenicAccount.getPassword().equals(scenicLoginReq.getPassword())) {
|
||||
return ApiResponse.fail("密码错误");
|
||||
}
|
||||
|
@@ -17,5 +17,7 @@ public interface ScenicAccountService {
|
||||
|
||||
int updateStatus(Long id);
|
||||
|
||||
int updateActiveStatus(Long id);
|
||||
|
||||
ScenicAccountEntity getScenicAccountByAccount(String account);
|
||||
}
|
@@ -72,6 +72,11 @@ public class ScenicAccountServiceImpl implements ScenicAccountService {
|
||||
return mapper.updateStatus(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateActiveStatus(Long id) {
|
||||
return mapper.updateActiveStatus(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScenicAccountEntity getScenicAccountByAccount(String account) {
|
||||
ScenicAccountEntity accountEntity = mapper.getByAccount(account);
|
||||
|
Reference in New Issue
Block a user