| | |
| | | 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.course.api.domain.Course; |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | */ |
| | | @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获取课程信息 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/inner/course/course/getCourseById/{targetId}") |
| | | R<Course> getCourseById(@PathVariable("targetId") Long targetId, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | 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); |
| | | } |