|
@@ -0,0 +1,126 @@
|
|
|
+package com.miaxis.pc.controller.teachingVideo;
|
|
|
+
|
|
|
+import com.miaxis.common.annotation.Log;
|
|
|
+import com.miaxis.common.core.controller.BaseController;
|
|
|
+import com.miaxis.common.core.domain.Response;
|
|
|
+import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
+import com.miaxis.common.enums.BusinessTypeEnum;
|
|
|
+import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
|
|
|
+import com.miaxis.teachingVideo.service.ITeachingVideoInfoService;
|
|
|
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【教学视频】Controller
|
|
|
+ * @author wwl
|
|
|
+ * @version 1.0
|
|
|
+ * @date 2021/7/1 14:49
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/pc/teachingVideo/info")
|
|
|
+@Api(tags={"【pc-教学视频】"})
|
|
|
+public class TeachingVideoInfoController extends BaseController {
|
|
|
+
|
|
|
+ private final ITeachingVideoInfoService teachingVideoInfoService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询教学视频列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('teachingVideo:info:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("查询教学视频列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
+ })
|
|
|
+ public ResponsePageInfo<TeachingVideoInfoVo> list(@ModelAttribute TeachingVideoInfo teachingVideoInfo){
|
|
|
+ startPage();
|
|
|
+ List<TeachingVideoInfoVo> list = teachingVideoInfoService.selectTeachingVideoInfoList(teachingVideoInfo);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取教学视频详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('teachingVideo:info:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ @ApiOperation("获取教学视频详细信息")
|
|
|
+ public Response<TeachingVideoInfoVo> getInfo(
|
|
|
+ @ApiParam(name = "id", value = "教学视频参数", required = true)
|
|
|
+ @PathVariable("id") Long id
|
|
|
+ ){
|
|
|
+ return teachingVideoInfoService.getTeachingVideoDetailsById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增教学视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('teachingVideo:info:add')")
|
|
|
+ @Log(title = "教学视频", businessType = BusinessTypeEnum.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增教学视频")
|
|
|
+ public Response<Integer> add(@RequestBody TeachingVideoInfo teachingVideoInfo){
|
|
|
+ return toResponse(teachingVideoInfoService.save(teachingVideoInfo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改教学视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('teachingVideo:info:edit')")
|
|
|
+ @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改教学视频")
|
|
|
+ public Response<Integer> edit(@RequestBody TeachingVideoInfo teachingVideoInfo){
|
|
|
+ return toResponse(teachingVideoInfoService.updateById(teachingVideoInfo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除教学视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('teachingVideo:info:remove')")
|
|
|
+ @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping("/{ids}")
|
|
|
+ @ApiOperation("删除教学视频")
|
|
|
+ public Response remove(
|
|
|
+ @ApiParam(name = "ids", value = "教学视频ids参数", required = true)
|
|
|
+ @PathVariable Long[] ids
|
|
|
+ ){
|
|
|
+ return teachingVideoInfoService.removeTeachingVideoByIds(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上架教学视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('teachingVideo:info:putShelf')")
|
|
|
+ @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping("/putShelf/{ids}")
|
|
|
+ @ApiOperation("上架教学视频")
|
|
|
+ public Response putShelf(
|
|
|
+ @ApiParam(name = "ids", value = "教学视频ids参数", required = true) @PathVariable Long[] ids
|
|
|
+ ){
|
|
|
+ return teachingVideoInfoService.removePutShelfByIds(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下架教学视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('teachingVideo:info:offShelf')")
|
|
|
+ @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping("/offShelf/{ids}")
|
|
|
+ @ApiOperation("下架教学视频")
|
|
|
+ public Response offShelf(
|
|
|
+ @ApiParam(name = "ids", value = "教学视频ids参数", required = true) @PathVariable Long[] ids
|
|
|
+ ){
|
|
|
+ return teachingVideoInfoService.removeOffShelfByIds(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|