cloudroam
2025-05-30 83b3bf33bfd212723507fb70c3137c63cf8a6823
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
package com.mzl.flower.web.film;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.dto.request.film.CommentLikesDTO;
import com.mzl.flower.dto.request.film.CommentLikesQueryDTO;
import com.mzl.flower.dto.response.film.CommentLikesVO;
import com.mzl.flower.service.film.CommentLikesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
 
import javax.validation.constraints.NotNull;
 
 
@Api(value = "影视作品评论点赞", tags = "影视作品评论点赞")
@RestController
@RequestMapping("/v2/comment-likes")
@RequiredArgsConstructor
public class CommentLikesController extends BaseController {
 
    private final CommentLikesService commentLikesService;
 
    @GetMapping("/commentLikes/list")
    @ApiOperation(value = "影视作品评论点赞列表", httpMethod = "GET")
    public ResponseEntity<ReturnDataDTO<Page<CommentLikesVO>>> getCommentLikesList(Page page, CommentLikesQueryDTO dto) {
        return returnData(R.SUCCESS.getCode(), commentLikesService.queryPage(dto, page));
    }
 
    @GetMapping(value = "/commentLikes/delete")
    @ApiOperation(value = "删除影视作品评论点赞 ", httpMethod = "GET", notes = "ID")
    public ResponseEntity delete(@NotNull(message = "id不能为空") Long id) {
        commentLikesService.deleteCommentLikes(String.valueOf(id));
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @PostMapping(value = "/commentLikes/new")
    @ApiOperation(value = "保存影视作品评论点赞", httpMethod = "POST")
    public ResponseEntity insert(@RequestBody CommentLikesDTO commentLikesDTO) {
        commentLikesService.saveCommentLikes(commentLikesDTO);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @PostMapping(value = "/commentLikes/edit")
    @ApiOperation(value = "更新影视作品评论点赞", httpMethod = "POST")
    public ResponseEntity update(@RequestBody CommentLikesDTO commentLikesDTO) {
        commentLikesService.updateCommentLikes(commentLikesDTO);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
}