xiangpei
6 天以前 288ce585418550bbf2fd898fc01bc2ff9245f960
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package cn.lili.controller.lmk;
 
import cn.lili.group.Update;
import cn.lili.group.Add;
import cn.lili.modules.lmk.domain.form.VideoFootPrintForm;
import cn.lili.modules.lmk.domain.form.VideoHomePageInfoForm;
import cn.lili.modules.lmk.domain.form.WxVideoForm;
import cn.lili.modules.lmk.domain.query.AuthorVideoQuery;
import cn.lili.modules.lmk.domain.query.HealthVideoQuery;
import cn.lili.modules.lmk.domain.query.WxHealthVideoQuery;
import org.springframework.validation.annotation.Validated;
import lombok.RequiredArgsConstructor;
import java.util.List;
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.query.VideoQuery;
import org.springframework.web.bind.annotation.*;
 
/**
 * 视频内容 前端控制器
 *
 * @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}) WxVideoForm form) {
        return videoService.publish(form);
    }
 
    @PutMapping
    @ApiOperation(value = "修改", notes = "修改")
    public Result update(@RequestBody @Validated(Update.class) WxVideoForm 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(VideoQuery query) {
        return videoService.recommendVideo(query);
    }
    @GetMapping("/health/recommend")
    @ApiOperation(value = "大健康视频推荐", notes = "大健康视频推荐")
    public Result healthRecommendVideo(WxHealthVideoQuery query) {
        return videoService.healthRecommendVideo(query);
    }
 
    @GetMapping("/goods/detail/{videoId}")
    @ApiOperation(value = "视频商品查看", notes = "视频商品查看")
    public Result getGoodsDetail(@PathVariable("videoId") String videoId) {
        return videoService.getGoodsDetail(videoId);
    }
 
    @PostMapping("/view/record")
    @ApiOperation(value = "保存观看记录", notes = "保存观看记录")
    public Result saveViewRecord(@RequestBody VideoFootPrintForm form) {
        return videoService.saveViewRecord(form);
    }
 
    @GetMapping("/author-info/{authorId}")
    @ApiOperation(value = "获取视频主页作者信息", notes = "获取视频主页作者信息")
    public Result getAuthorInfo(@PathVariable("authorId") String authorId) {
        return videoService.getAuthorInfo(authorId);
    }
 
    @GetMapping("/author-video-page")
    @ApiOperation(value = "获取视频主页作者视频分页", notes = "获取视频主页作者视频分页")
    public Result getAuthorVideoPage(AuthorVideoQuery query) {
        return videoService.getAuthorVideoPage(query);
    }
 
    @GetMapping("/author-collect-video-page")
    @ApiOperation(value = "获取视频主页作者收藏的视频分页", notes = "获取视频主页作者收藏的视频分页")
    public Result getAuthorCollectVideoPage(AuthorVideoQuery query) {
        return videoService.getAuthorCollectVideoPage(query);
    }
 
    @PostMapping("/home-page-info-edit")
    @ApiOperation(value = "保存视频主页的个人信息修改", notes = "保存视频主页的个人信息修改")
    public Result homePageInfoEdit(@RequestBody @Validated VideoHomePageInfoForm form) {
        return videoService.homePageInfoEdit(form);
    }
 
    @GetMapping("/wx/detail/{id}")
    @ApiOperation(value = "小程序-获取视频详情", notes = "小程序-获取视频详情")
    public Result wxDetail(@PathVariable("id") String id) {
        return videoService.wxDetail(id);
    }
}