|
@@ -0,0 +1,109 @@
|
|
|
+package com.miaxis.app.controller.video;
|
|
|
+
|
|
|
+import com.miaxis.common.constant.Constants;
|
|
|
+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.utils.poi.ExcelUtil;
|
|
|
+import com.miaxis.framework.web.service.TokenService;
|
|
|
+import com.miaxis.video.domain.VideoFiveTeaching;
|
|
|
+import com.miaxis.video.dto.VideoFiveTeachingDto;
|
|
|
+import com.miaxis.video.service.IVideoFiveTeachingService;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【精选500题教学视频】Controller
|
|
|
+ *
|
|
|
+ * @author miaxis
|
|
|
+ * @date 2024-11-20
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping(Constants.OPEN_PREFIX + "/video/fiveTeaching")
|
|
|
+@Api(tags = {"【app-精选500题教学视频】"})
|
|
|
+public class VideoFiveTeachingController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private IVideoFiveTeachingService videoFiveTeachingService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TokenService tokenService;
|
|
|
+ /**
|
|
|
+ * 查询精选500题教学视频列表
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("查询精选500题教学视频列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
|
|
|
+ })
|
|
|
+ public ResponsePageInfo<VideoFiveTeaching> list(@ModelAttribute VideoFiveTeachingDto videoFiveTeachingDto) {
|
|
|
+ startPage();
|
|
|
+ List<VideoFiveTeaching> list = videoFiveTeachingService.selectVideoFiveTeachingList(videoFiveTeachingDto);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出精选500题教学视频列表
|
|
|
+ */
|
|
|
+ @GetMapping("/export")
|
|
|
+ @ApiOperation("导出精选500题教学视频列表Excel")
|
|
|
+ public Response<String> export(@ModelAttribute VideoFiveTeachingDto videoFiveTeachingDto) {
|
|
|
+ List<VideoFiveTeaching> list = videoFiveTeachingService.selectVideoFiveTeachingList(videoFiveTeachingDto);
|
|
|
+ ExcelUtil<VideoFiveTeaching> util = new ExcelUtil<VideoFiveTeaching>(VideoFiveTeaching.class);
|
|
|
+ return util.exportExcel(list, "teaching");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取精选500题教学视频详细信息
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ @ApiOperation("获取精选500题教学视频详细信息")
|
|
|
+ public Response<VideoFiveTeaching> getInfo(
|
|
|
+ @ApiParam(name = "id", value = "精选500题教学视频参数", required = true)
|
|
|
+ @PathVariable("id") Long id
|
|
|
+ ) {
|
|
|
+ return Response.success(videoFiveTeachingService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增精选500题教学视频
|
|
|
+ */
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增精选500题教学视频")
|
|
|
+ public Response<Integer> add(@RequestBody VideoFiveTeaching videoFiveTeaching) {
|
|
|
+ return toResponse(videoFiveTeachingService.save(videoFiveTeaching) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改精选500题教学视频
|
|
|
+ */
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改精选500题教学视频")
|
|
|
+ public Response<Integer> edit(@RequestBody VideoFiveTeaching videoFiveTeaching) {
|
|
|
+ return toResponse(videoFiveTeachingService.updateById(videoFiveTeaching) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除精选500题教学视频
|
|
|
+ */
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ @ApiOperation("删除精选500题教学视频")
|
|
|
+ public Response<Integer> remove(
|
|
|
+ @ApiParam(name = "ids", value = "精选500题教学视频ids参数", required = true)
|
|
|
+ @PathVariable Long[] ids
|
|
|
+ ) {
|
|
|
+ return toResponse(videoFiveTeachingService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|