package com.tourism.webadmin.back.model;

import com.baomidou.mybatisplus.annotation.*;
import com.tourism.common.core.annotation.RelationOneToOne;
import com.tourism.common.core.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户游记点赞表实体对象。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tour_user_like_travel_notes")
public class TourUserLikeTravelNotes extends BaseModel {

    /**
     * 主键id。
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 用户id。
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 游记id。
     */
    @TableField(value = "travel_notes_id")
    private Long travelNotesId;

    /**
     * 逻辑删除标记字段(1: 正常 -1: 已删除)。
     */
    @TableLogic
    @TableField(value = "data_state")
    private Integer dataState;

    @RelationOneToOne(
            masterIdField = "travelNotesId",
            slaveModelClass = TourismProjectTravelNotesWrite.class,
            slaveIdField = "id")
    @TableField(exist = false)
    private TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite;
}
