mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 10:56:50 +08:00
通过token获取userid
This commit is contained in:
@@ -7,6 +7,8 @@ import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.data.dto.UserData;
|
||||
import com.xboe.data.outside.IOutSideDataService;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import com.xboe.school.study.service.IStudyCourseService;
|
||||
import com.xboe.system.organization.service.IOrganizationService;
|
||||
@@ -63,6 +65,10 @@ public class CourseFullTextApi extends ApiBaseController{
|
||||
@Autowired
|
||||
ThirdApi thirdApi;
|
||||
|
||||
@Autowired
|
||||
IOutSideDataService outsideDataService;
|
||||
|
||||
|
||||
/**
|
||||
* 课程的初始化
|
||||
* @return
|
||||
@@ -212,6 +218,7 @@ public class CourseFullTextApi extends ApiBaseController{
|
||||
*/
|
||||
@PostMapping("/search")
|
||||
public JsonResponse<PageList<CourseFullText>> search(Pagination pager, CourseQueryDto dto, Integer minDuration, Integer maxDuration, HttpServletRequest request){
|
||||
|
||||
//获取例外人员id
|
||||
List<String> userId = thirdApi.getUserId();
|
||||
String userIds = String.join(",", userId);
|
||||
@@ -221,6 +228,13 @@ public class CourseFullTextApi extends ApiBaseController{
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
|
||||
if (dto.getUserId() == null ){
|
||||
log.info("通过token获取userid dto.getUserId() = " + dto.getUserId() + ",token = " + token);
|
||||
UserData userData = outsideDataService.getUserInfoByToken(token);
|
||||
dto.setUserId(userData.getId());
|
||||
}
|
||||
|
||||
log.info("根据userId查询面授课id dto.getUserId() = " + dto.getUserId() + ",token = " + token);
|
||||
List<String> offCourseId = thirdApi.getOffCourseId(dto.getUserId(),token);
|
||||
log.info("根据userId查询面授课id offCourseId.size() = " + offCourseId );
|
||||
|
||||
Reference in New Issue
Block a user