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);
|
}
|
|
}
|