package com.ruoyi.frequency.votelike.entity;

import com.ruoyi.controller.req.VoteLikeReq;
import com.ruoyi.controller.req.WorksLikeReq;
import com.ruoyi.utils.SnowIdUtils;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.vo.UserInfo;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 投票点赞对象 t_vote_like
 *
 * @author liwenlong
 * @date 2024-04-10
 */
@Data
@Accessors(chain = true)
@TableName("t_vote_like")
public class VoteLike extends BaseEntity
{
    private static final long serialVersionUID = 1L;


    @ApiModelProperty("主键id")
    private Long id;

    @ApiModelProperty("删除标志 1正常 删除 3 禁用")
    private Integer delFlag;

    @ApiModelProperty("类型 1投票 2评论")
    @Excel(name = "类型 1投票 2评论")
    private Integer type;

    @ApiModelProperty("用户类型 1 用户 2 商家")
    @Excel(name = "用户类型 1 用户 2 商家")
    private Integer userType;

    @ApiModelProperty("用户id")
    @Excel(name = "用户id")
    private Long userId;

    @ApiModelProperty("投票id")
    @Excel(name = "投票id")
    private Long objectId;

    @ApiModelProperty("用户信息")
    @TableField(exist = false)
    private UserInfo userInfo;


    public VoteLike() {
    }

    public VoteLike(VoteLikeReq req) {
        this.id = SnowIdUtils.uniqueLong();
        this.objectId = req.getObjectId();
        this.type = req.getType();
    }
}
