package com.mcwl.web.controller.communityCenter;

import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.R;
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
import com.mcwl.communityCenter.domain.dto.PublishLikeRes;
import com.mcwl.communityCenter.service.PublishCommentLikeService;
import com.mcwl.communityCenter.service.PublishLikeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 社群发布点赞
 */
@Api(tags = "社群发布点赞")
@RestController
@RequiredArgsConstructor
@RequestMapping("PublishLike")
public class PublishLikeController extends BaseController {


    private final PublishLikeService publishLikeService;

    /**
     * 点赞/取消点赞
     */
    @PostMapping("/like")
    @ApiOperation(value = "点赞/取消点赞")
    public R<Object> like(@RequestBody @Valid PublishLikeRes publishLikeRes) {
        publishLikeService.like(publishLikeRes);
        return R.ok();
    }


}
