package com.ruoyi.frequency.worklike.entity;

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

/**
 * 作品点赞对象 t_work_like
 * 
 * @author liwenlong
 * @date 2023-10-12
 */
@Data
@Accessors(chain = true)
@TableName("t_work_like")
public class WorkLike extends BaseEntity
{
    private static final long serialVersionUID = 1L;


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

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

    @ApiModelProperty("类型 1 作品 ")
    @Excel(name = "类型 1 作品 ")
    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 workId;

    public WorkLike() {
    }

    public WorkLike(WorksLikeReq req) {
        this.id = SnowIdUtils.uniqueLong();
        this.workId = req.getObjectId();
        this.type = req.getType();
    }
}
