| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.modules.lmk.domain.form.VideoFootPrintForm; |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | | 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 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; |
| | | |
| | | /** |
| | | * 视频内容 前端控制器 |
| | |
| | | |
| | | @PostMapping("/publish") |
| | | @ApiOperation(value = "发布视频", notes = "发布视频") |
| | | public Result publish(@RequestBody @Validated({Add.class}) VideoForm form) { |
| | | public Result publish(@RequestBody @Validated({Add.class}) WxVideoForm form) { |
| | | return videoService.publish(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) VideoForm form) { |
| | | return videoService.update(form); |
| | | public Result update(@RequestBody @Validated(Update.class) WxVideoForm form) { |
| | | return videoService.updatePublish(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return videoService.removeById(id); |
| | | } |
| | | |
| | | @PostMapping("/down/{id}") |
| | | @ApiOperation(value = "用户下架视频", notes = "用户下架视频") |
| | | public Result downVideo(@PathVariable("id") String id) { |
| | | return videoService.buyerDownVideo(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | |
| | | |
| | | @GetMapping("/recommend") |
| | | @ApiOperation(value = "视频推荐", notes = "视频推荐") |
| | | public Result recommendVideo(AbsQuery query) { |
| | | 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") |
| | |
| | | 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); |
| | | } |
| | | } |