| | |
| | | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.log.annotation.Log; |
| | | import com.xinquan.common.log.enums.BusinessType; |
| | | import com.xinquan.course.api.domain.Course; |
| | | import com.xinquan.course.api.domain.CourseCategory; |
| | | import com.xinquan.course.api.domain.CourseDTO; |
| | |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | List<CourseCategory> data = remoteCourseService.cateList().getData(); |
| | | return R.ok(data); |
| | | } |
| | | @PostMapping("/courseList") |
| | | @GetMapping("/courseList") |
| | | @ApiOperation(value = "选择课程-分页",tags = "管理后台banner") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = false, dataType = "Integer"), |
| | |
| | | @ApiImplicitParam(value = "课程标题", name = "courseTitle", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "导师名称", name = "tutor", required = false, dataType = "String"), |
| | | }) |
| | | public R<PageDTO<Banner>> courseList( |
| | | @RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(value = "courseType") Integer courseType, |
| | | @RequestParam(value = "cateId") Long cateId, |
| | | @RequestParam(value = "courseTitle")String courseTitle, |
| | | @RequestParam(value = "tutor") String tutor |
| | | public R<PageDTO<Course>> courseList( |
| | | Integer pageCurr, |
| | | Integer pageSize, |
| | | Integer courseType, |
| | | Long cateId, |
| | | String courseTitle, |
| | | |
| | | String tutor |
| | | ) { |
| | | CourseDTO courseDTO = new CourseDTO(); |
| | | courseDTO.setPageCurr(pageCurr); |
| | |
| | | courseDTO.setCateId(cateId); |
| | | courseDTO.setCourseTitle(courseTitle); |
| | | courseDTO.setTutor(tutor); |
| | | remoteCourseService.courseList(courseDTO); |
| | | return R.ok(); |
| | | PageDTO<Course> data = remoteCourseService.courseList(courseDTO).getData(); |
| | | return R.ok(data); |
| | | } |
| | | @PostMapping("/deleteBatch") |
| | | @ApiOperation(value = "批量删除banner",tags = "管理后台banner") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "ids", name = "ids", required = true, dataType = "String"), |
| | | }) |
| | | @Log(title = "【banner】批量删除", businessType = BusinessType.DELETE) |
| | | |
| | | public R deleteBatch( |
| | | @RequestParam(value = "ids") String ids) |
| | | { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | List<Long> list = Arrays.asList(ids.split(",")).stream().map(Long::valueOf).collect(Collectors.toList()); |
| | | bannerService.removeBatchByIds(list); |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/addBanner") |
| | | @ApiOperation(value = "添加banner",tags = "管理后台banner") |
| | | @Log(title = "【banner】添加", businessType = BusinessType.INSERT) |
| | | |
| | | public R addBanner(@RequestBody Banner banner) |
| | | { |
| | |
| | | } |
| | | @PostMapping("/updateBanner") |
| | | @ApiOperation(value = "修改banner",tags = "管理后台banner") |
| | | |
| | | @Log(title = "【banner】修改", businessType = BusinessType.UPDATE) |
| | | public R updateBanner(@RequestBody Banner banner) |
| | | { |
| | | bannerService.updateById(banner); |
| | |
| | | { |
| | | Banner byId = bannerService.getById(uid); |
| | | if (byId.getCourseId()!=null){ |
| | | Course data = remoteCourseService.getCourseById(byId.getCourseId(), "").getData(); |
| | | Course data = remoteCourseService.getCourseById(byId.getCourseId()).getData(); |
| | | if (data!=null){ |
| | | byId.setCourseTitle(data.getCourseTitle()); |
| | | byId.setCoverUrl(data.getCoverUrl()); |