无关风月
2024-11-04 64f7ccb9ef8b5a0618e65cddc14b981c1f108ba3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.xinquan.course.api.feign;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinquan.common.core.constant.SecurityConstants;
import com.xinquan.common.core.constant.ServiceNameConstants;
import com.xinquan.common.core.domain.R;
import com.xinquan.common.core.utils.page.PageDTO;
import com.xinquan.course.api.domain.*;
import com.xinquan.course.api.factory.RemoteCourseFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * @author mitao
 * @date 2024/8/21
 */
@FeignClient(contextId = "remoteCourseService", value = ServiceNameConstants.COURSE_SERVICE, fallbackFactory = RemoteCourseFallbackFactory.class)
public interface RemoteCourseService {
    @GetMapping("/client/course/course/getCourseCount")
    public R<String> getCourseCount();
    /**
     * 根据课程id 查询学习人数
     * @param id
     * @return
     */
    @GetMapping("/client/course/course/getCountByCourseId/{id}")
    public R<Integer> getCountByCourseId(
            @PathVariable("id")String id);
    /**
     * 根据课程id 查询章节列表
     * @param id
     * @return
     */
    @GetMapping("/client/course/course/getChapterByCourseId/{id}")
    public R<List<CourseChapter>> getChapterByCourseId(
            @PathVariable("id")String id);
    @GetMapping("/client/course/course/getCourseByIds/{pageCurr}/{pageSize}/{ids}")
    R<Page<Course>> getCourseByIds(@PathVariable("pageCurr") Integer pageCurr,
                                                  @PathVariable("pageSize") Integer pageSize,
                                                  @PathVariable("ids")String ids
    );
    @PostMapping("/client/course/course/getCourseIdsByName/{name}")
    public R<List<Long>> getCourseIdsByName(@PathVariable("name") String name);
    /**
     * 根据id获取课程信息
     *
     * @param targetId 课程id
     * @param source   请求来源
     * @return
     */
    @GetMapping("/inner/course/course/getCourseById/{targetId}")
    R<Course> getCourseById(@PathVariable("targetId") Long targetId
    );
    @PostMapping("/client/course/course/getCourseByIdAny")
    public R<OrderCourseVO> getCourseByIdAny(@RequestBody OrderCourseVO req);
    @GetMapping("/client/course/course/getCategoryById/{id}")
    R<CourseCategory> getCategoryById(@PathVariable("id") String id);
    @GetMapping("/client/course/course/cateList")
    R<List<CourseCategory>> cateList();
    @PostMapping("/client/course/course/courseList")
    R<PageDTO<Course>> courseList(@RequestBody CourseDTO courseDTO);
}