无关风月
2024-11-11 185f5dc7c3c49f565da51cd9c2f7750f30990d4a
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserViewingHistoryController.java
@@ -69,6 +69,26 @@
    private final RemoteAppUserService remoteAppUserService;
    /**
     * 远程调用 根据章节id和用户id查询是否观看完毕
     * @param id
     * @return
     */
    @PostMapping("/getCourseChapterHistoryState/{id}/{chapterId}")
    public R<Integer> getCourseChapterHistoryState(@PathVariable("id") Long id,@PathVariable("chapterId") Long chapterId) {
        List<AppUserViewingHistory> list = appUserViewingHistoryService.lambdaQuery()
                .eq(AppUserViewingHistory::getChapterId, chapterId)
                .eq(AppUserViewingHistory::getAppUserId, id)
                .eq(AppUserViewingHistory::getViewingType, 2)
                .list();
        for (AppUserViewingHistory appUserViewingHistory : list) {
            if (appUserViewingHistory.getIsOver()!=null && appUserViewingHistory.getIsOver()==1){
                return R.ok(1);
            }
        }
        return R.ok(2);
    }
    /**
     * 远程调用查询用户观看了哪些课程
     * @return
     */