xiangpei
2025-05-22 e868be6c913a6a99e1491c088d052a5f58e252f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package cn.lili.controller.lmk;
 
import cn.lili.base.AbsQuery;
import cn.lili.group.Update;
import cn.lili.group.Add;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import lombok.RequiredArgsConstructor;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotEmpty;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import cn.lili.modules.lmk.service.VideoService;
import cn.lili.base.Result;
import cn.lili.modules.lmk.domain.form.VideoForm;
import cn.lili.modules.lmk.domain.query.VideoQuery;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
/**
 * 视频内容 前端控制器
 *
 * @author xp
 * @since 2025-05-16
 */
@Validated
@RequiredArgsConstructor
@Api(value = "视频内容", tags = "视频内容管理")
@RestController
@RequestMapping("/buyer/lmk/video")
public class VideoController {
 
    private final VideoService videoService;
 
    @PostMapping("/publish")
    @ApiOperation(value = "发布视频", notes = "发布视频")
    public Result publish(@RequestBody @Validated({Add.class}) VideoForm form) {
        return videoService.publish(form);
    }
 
    @PutMapping
    @ApiOperation(value = "修改", notes = "修改")
    public Result update(@RequestBody @Validated(Update.class) VideoForm form) {
        return videoService.update(form);
    }
 
    @DeleteMapping("/{id}")
    @ApiOperation(value = "ID删除", notes = "ID删除")
    public Result removeById(@PathVariable("id") String id) {
        return videoService.removeById(id);
    }
 
    @DeleteMapping("/batch")
    @ApiOperation(value = "批量删除", notes = "批量删除")
    public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) {
        return videoService.remove(ids);
    }
 
    @GetMapping("/{id}")
    @ApiOperation(value = "详情", notes = "详情")
    public Result detail(@PathVariable("id") String id) {
        return videoService.detail(id);
    }
 
    @GetMapping("/recommend")
    @ApiOperation(value = "视频推荐", notes = "视频推荐")
    public Result recommendVideo(AbsQuery query) {
        return videoService.recommendVideo(query);
    }
 
}