123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- package com.zhongzheng.controller.course;
- import java.util.List;
- import java.util.Arrays;
- import com.zhongzheng.modules.course.bo.CourseChapterSectionAddBo;
- import com.zhongzheng.modules.course.bo.CourseChapterSectionEditBo;
- import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
- import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
- import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
- import lombok.RequiredArgsConstructor;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.zhongzheng.common.annotation.Log;
- import com.zhongzheng.common.core.controller.BaseController;
- import com.zhongzheng.common.core.domain.AjaxResult;
- import com.zhongzheng.common.enums.BusinessType;
- import com.zhongzheng.common.utils.poi.ExcelUtil;
- import com.zhongzheng.common.core.page.TableDataInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- /**
- * 章与节关系Controller
- *
- * @author hjl
- * @date 2021-10-12
- */
- @Api(value = "章与节关系控制器", tags = {"章与节关系管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/course/chapter/section")
- public class CourseChapterSectionController extends BaseController {
- private final ICourseChapterSectionService iCourseChapterSectionService;
- /**
- * 查询章与节关系列表
- */
- @ApiOperation("查询章与节关系列表")
- @PreAuthorize("@ss.hasPermi('system:section:list')")
- @GetMapping("/list/{id}")
- public TableDataInfo<CourseChapterSectionVo> list(@PathVariable("id" ) Long id) {
- startPage();
- List<CourseChapterSectionVo> list = iCourseChapterSectionService.getListById(id);
- return getDataTable(list);
- }
- /**
- * 导出章与节关系列表
- */
- /* @ApiOperation("导出章与节关系列表")
- @PreAuthorize("@ss.hasPermi('system:section:export')")
- @Log(title = "章与节关系", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult<CourseChapterSectionVo> export(CourseChapterSectionQueryBo bo) {
- List<CourseChapterSectionVo> list = iCourseChapterSectionService.queryList(bo);
- ExcelUtil<CourseChapterSectionVo> util = new ExcelUtil<CourseChapterSectionVo>(CourseChapterSectionVo.class);
- return util.exportExcel(list, "章与节关系");
- }*/
- /**
- * 获取章与节关系详细信息
- */
- /* @ApiOperation("获取章与节关系详细信息")
- @PreAuthorize("@ss.hasPermi('system:section:query')")
- @GetMapping("/{id}")
- public AjaxResult<CourseChapterSectionVo> getInfo(@PathVariable("id" ) Long id) {
- return AjaxResult.success(iCourseChapterSectionService.queryById(id));
- }*/
- /**
- * 新增章与节关系
- */
- @ApiOperation("新增章与节关系")
- @PreAuthorize("@ss.hasPermi('system:section:add')")
- @Log(title = "章与节关系", businessType = BusinessType.INSERT)
- @PostMapping()
- public AjaxResult<Void> add(@RequestBody CourseChapterSectionAddBo bo) {
- return toAjax(iCourseChapterSectionService.insertByAddBo(bo) ? 1 : 0);
- }
- /**
- * 修改章与节关系
- */
- /* @ApiOperation("修改章与节关系")
- @PreAuthorize("@ss.hasPermi('system:section:edit')")
- @Log(title = "章与节关系", businessType = BusinessType.UPDATE)
- @PostMapping()
- public AjaxResult<Void> edit(@RequestBody CourseChapterSectionEditBo bo) {
- return toAjax(iCourseChapterSectionService.updateByEditBo(bo) ? 1 : 0);
- }*/
- /**
- * 删除章与节关系
- */
- @ApiOperation("删除章与节关系")
- @PreAuthorize("@ss.hasPermi('system:section:remove')")
- @Log(title = "章与节关系" , businessType = BusinessType.DELETE)
- @PostMapping("/del/{ids}")
- public AjaxResult<Void> remove(@PathVariable Long[] ids) {
- return toAjax(iCourseChapterSectionService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
- }
- }
|