|
@ -0,0 +1,74 @@
|
|
|
package com.yihu.jw.base.endpoint.video;
|
|
|
|
|
|
import com.yihu.jw.base.service.video.BaseVideoGroupService;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* @author xyq
|
|
|
* @create 2022-07-04 16:18
|
|
|
* @slogan 他化自在,我自逍遥
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/video/manager",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(value = "视频栏目管理接口", description = "视频栏目管理接口", tags = {"wlyy基础服务 - 视频栏目管理接口"})
|
|
|
public class BaseVideoEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
|
private BaseVideoGroupService videoGroupService;
|
|
|
|
|
|
@ApiOperation(value = "分页获取视频栏目")
|
|
|
@GetMapping("/getVideoGroupPage")
|
|
|
public PageEnvelop getVideoGroupPage(@ApiParam(name = "name",value = "栏目名字搜索")@RequestParam(required = false)String name,
|
|
|
@ApiParam(name = "page",value = "页码") @RequestParam(required = false,defaultValue = "1")Integer page,
|
|
|
@ApiParam(name = "pageSize",value = "每页大小") @RequestParam(required = false,defaultValue = "20")Integer pageSize){
|
|
|
try {
|
|
|
return videoGroupService.getVideoGroupPage(name, page, pageSize);
|
|
|
}catch (Exception e){
|
|
|
return failedPageEnvelopException2(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "修改视频栏目")
|
|
|
@PostMapping("/updateVideoGroup")
|
|
|
public Envelop updateVideoGroup(@ApiParam @RequestParam Long id,
|
|
|
@ApiParam(name = "name",value = "栏目名称") @RequestParam String name,
|
|
|
@ApiParam(name = "sortNum",value = "栏目排序")@RequestParam(required = false,defaultValue = "1")Integer sortNum,
|
|
|
@ApiParam(name = "status",value = "1可用,0禁用")@RequestParam(required = false,defaultValue = "1")Integer status){
|
|
|
try {
|
|
|
return videoGroupService.updateVideoGroup(id, name, sortNum, status);
|
|
|
}catch (Exception e){
|
|
|
return failedException2(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "新增视频栏目")
|
|
|
@PostMapping("/addVideoGroup")
|
|
|
public Envelop addVideoGroup(@ApiParam(name = "name",value = "栏目名称") @RequestParam String name,
|
|
|
@ApiParam(name = "sortNum",value = "栏目排序")@RequestParam(required = false,defaultValue = "1")Integer sortNum,
|
|
|
@ApiParam(name = "status",value = "1可用,0禁用")@RequestParam(required = false,defaultValue = "1")Integer status){
|
|
|
try {
|
|
|
return videoGroupService.updateVideoGroup(null, name, sortNum, status);
|
|
|
}catch (Exception e){
|
|
|
return failedException2(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除视频栏目")
|
|
|
@PostMapping("/deleteVideoGroup")
|
|
|
public Envelop deleteVideoGroup(@ApiParam @RequestParam Long id){
|
|
|
try {
|
|
|
return videoGroupService.deleteVideoGroup(id);
|
|
|
}catch (Exception e){
|
|
|
return failedException2(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|