Compare commits
2 Commits
52798ce478
...
c48769872d
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c48769872d | ||
![]() |
9830e0d3b3 |
@ -18,6 +18,7 @@ import org.jeecg.modules.gen.userinfo.entity.UserInfo;
|
|||||||
import org.jeecg.modules.gen.userinfo.mapper.UserInfoMapper;
|
import org.jeecg.modules.gen.userinfo.mapper.UserInfoMapper;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
import org.jeecg.modules.system.service.*;
|
import org.jeecg.modules.system.service.*;
|
||||||
|
import org.jeecg.common.system.vo.DictModel;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -33,6 +34,7 @@ import org.jeecg.common.util.PasswordUtil;
|
|||||||
import org.jeecg.common.util.RedisUtil;
|
import org.jeecg.common.util.RedisUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -52,6 +54,8 @@ public class UserBizController {
|
|||||||
private UserBizService userBizService;
|
private UserBizService userBizService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserInfoMapper userInfoMapper;
|
private UserInfoMapper userInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseApi;
|
||||||
|
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
@Operation(summary = "用户登录")
|
@Operation(summary = "用户登录")
|
||||||
@ -118,6 +122,7 @@ public class UserBizController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录登录失败次数
|
* 记录登录失败次数
|
||||||
|
*
|
||||||
* @param username
|
* @param username
|
||||||
*/
|
*/
|
||||||
private void addLoginFailOvertimes(String username) {
|
private void addLoginFailOvertimes(String username) {
|
||||||
@ -161,8 +166,7 @@ public class UserBizController {
|
|||||||
|
|
||||||
// 4. 根据用户ID查询user_info表信息
|
// 4. 根据用户ID查询user_info表信息
|
||||||
UserInfo userInfo = userInfoMapper.selectOne(
|
UserInfo userInfo = userInfoMapper.selectOne(
|
||||||
new QueryWrapper<UserInfo>().eq("user_id", sysUser.getId())
|
new QueryWrapper<UserInfo>().eq("user_id", sysUser.getId()));
|
||||||
);
|
|
||||||
|
|
||||||
// 5. 构建返回结果
|
// 5. 构建返回结果
|
||||||
UserInfoResponse response = new UserInfoResponse();
|
UserInfoResponse response = new UserInfoResponse();
|
||||||
@ -186,4 +190,15 @@ public class UserBizController {
|
|||||||
return Result.error(500, "查询用户信息失败:" + e.getMessage());
|
return Result.error(500, "查询用户信息失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/schools")
|
||||||
|
@Operation(summary = "查询学校列表")
|
||||||
|
@IgnoreAuth
|
||||||
|
public Result<List<String>> querySchools() {
|
||||||
|
List<DictModel> list = sysBaseApi.getDictItems("school_list");
|
||||||
|
List<String> schools = list.stream()
|
||||||
|
.map(d -> d.getLabel())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return Result.OK(schools);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user