|
@@ -0,0 +1,109 @@
|
|
|
+package com.miaxis.app.controller.video;
|
|
|
+
|
|
|
+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.common.utils.poi.ExcelUtil;
|
|
|
+import com.miaxis.video.domain.VideoTeaching;
|
|
|
+import com.miaxis.video.service.IVideoTeachingService;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【教练视频】Controller
|
|
|
+ *
|
|
|
+ * @author miaxis
|
|
|
+ * @date 2023-02-20
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/video/teaching")
|
|
|
+@Api(tags={"【app-教练视频】"})
|
|
|
+public class VideoTeachingController extends BaseController{
|
|
|
+ @Autowired
|
|
|
+ private IVideoTeachingService videoTeachingService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询教练视频列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('video:teaching: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<VideoTeaching> list(@ModelAttribute VideoTeaching videoTeaching){
|
|
|
+ startPage();
|
|
|
+ List<VideoTeaching> list = videoTeachingService.selectVideoTeachingList(videoTeaching);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出教练视频列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('video:teaching:export')")
|
|
|
+ @Log(title = "教练视频", businessType = BusinessTypeEnum.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ @ApiOperation("导出教练视频列表Excel")
|
|
|
+ public Response<String> export(@ModelAttribute VideoTeaching videoTeaching){
|
|
|
+ List<VideoTeaching> list = videoTeachingService.selectVideoTeachingList(videoTeaching);
|
|
|
+ ExcelUtil<VideoTeaching> util = new ExcelUtil<VideoTeaching>(VideoTeaching.class);
|
|
|
+ return util.exportExcel(list, "teaching");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取教练视频详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('video:teaching:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ @ApiOperation("获取教练视频详细信息")
|
|
|
+ public Response<VideoTeaching> getInfo(
|
|
|
+ @ApiParam(name = "id", value = "教练视频参数", required = true)
|
|
|
+ @PathVariable("id") Long id
|
|
|
+ ){
|
|
|
+ return Response.success(videoTeachingService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增教练视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('video:teaching:add')")
|
|
|
+ @Log(title = "教练视频", businessType = BusinessTypeEnum.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增教练视频")
|
|
|
+ public Response<Integer> add(@RequestBody VideoTeaching videoTeaching){
|
|
|
+ return toResponse(videoTeachingService.save(videoTeaching) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改教练视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('video:teaching:edit')")
|
|
|
+ @Log(title = "教练视频", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改教练视频")
|
|
|
+ public Response<Integer> edit(@RequestBody VideoTeaching videoTeaching){
|
|
|
+ return toResponse(videoTeachingService.updateById(videoTeaching) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除教练视频
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('video:teaching:remove')")
|
|
|
+ @Log(title = "教练视频", businessType = BusinessTypeEnum.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ @ApiOperation("删除教练视频")
|
|
|
+ public Response<Integer> remove(
|
|
|
+ @ApiParam(name = "ids", value = "教练视频ids参数", required = true)
|
|
|
+ @PathVariable Long[] ids
|
|
|
+ ){
|
|
|
+ return toResponse(videoTeachingService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|