package com.ruoyi.post.controller;

import com.ruoyi.annotations.UserLoginToken;
import com.ruoyi.post.controller.req.PostLikeReq;
import com.ruoyi.post.frequency.postlike.service.PostLikeService;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.RyController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 帖子点赞相关
 * @author liwenlong
 *
 */
@CrossOrigin
@RestController
@RequestMapping("/api/postLike")
@Api(tags = "帖子点赞相关")
public class ApiPostLikeController extends RyController {

    @Autowired
    private PostLikeService postLikeService;


    /**
     * 帖子点赞
     *
     * @return
     */
    @PostMapping("/postLike")
    @UserLoginToken
    @ApiOperation(value = "帖子点赞", notes = "帖子点赞")
    public ResponseData postLike(@RequestBody PostLikeReq req) {
        return postLikeService.postLike(req,getUserVo());
    }


}
