| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.system.domain.TVideo; |
| | | import com.ruoyi.system.query.TVideoQuery; |
| | | import com.ruoyi.system.service.TVideoService; |
| | | import com.ruoyi.system.vo.TVideoVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Api(tags = "短视频管理") |
| | | @RestController |
| | | @RequestMapping("/tVideo") |
| | | public class TVideoController { |
| | | |
| | | private final TVideoService videoService; |
| | | |
| | | @Autowired |
| | | public TVideoController(TVideoService videoService) { |
| | | this.videoService = videoService; |
| | | } |
| | | |
| | | /** |
| | | * 获取短视频管理分页列表 |
| | | */ |
| | | @ApiOperation(value = "获取短视频管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TVideoVO>> pageList(@RequestBody TVideoQuery query) { |
| | | return AjaxResult.success(videoService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取短视频管理详情 |
| | | */ |
| | | @ApiOperation(value = "获取短视频管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TVideo> getDetailById(@RequestParam Long id) { |
| | | return AjaxResult.success(videoService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除短视频 |
| | | */ |
| | | @ApiOperation(value = "通过id删除短视频") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<TVideo> deleteById(@RequestParam Long id) { |
| | | return AjaxResult.success(videoService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 短视频上下架 |
| | | */ |
| | | @ApiOperation(value = "短视频上下架") |
| | | @GetMapping(value = "/upAndDown") |
| | | public AjaxResult upAndDown(@RequestParam Long id, |
| | | @RequestParam Integer status) { |
| | | return AjaxResult.success(videoService.upAndDown(id,status)); |
| | | } |
| | | |
| | | } |
| | | |