package com.mcwl.resource.service.impl;

import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.QueueConstants;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.resource.domain.WorkFlowCommentLike;
import com.mcwl.resource.mapper.WorkFlowCommentLikeMapper;
import com.mcwl.resource.service.WorkFlowCommentLikeService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author：ChenYan
 * @Project：McWl
 * @Package：com.mcwl.resource.service.impl
 * @Filename：ModelCommentLikeServiceImpl
 * @Description TODO
 * @Date：2025/1/12 12:01
 */
@Service
public class WorkFlowCommentLikeServiceImpl extends ServiceImpl<WorkFlowCommentLikeMapper, WorkFlowCommentLike> implements WorkFlowCommentLikeService {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Override
    public void like(Long commentId) {
        Map<String, Long> map = new HashMap<>();
        map.put("userId", SecurityUtils.getUserId());
        map.put("commentId", commentId);
        rabbitTemplate.convertAndSend(QueueConstants.WORK_FLOW_COMMENT_LIKE_QUEUE, map);
    }


}
