package com.pj.tb_orders_cart;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * Model: tb_orders_cart -- 订单购物车
 *
 * @author linbl
 */
@Data
@Accessors(chain = true)
@TableName(TbOrdersCart.TABLE_NAME)
@EqualsAndHashCode(callSuper = false)
public class TbOrdersCart extends Model<TbOrdersCart> implements Serializable {

    // ---------- 模块常量 ----------
    /**
     * 序列化版本id
     */
    private static final long serialVersionUID = 1L;
    /**
     * 此模块对应的表名
     */
    public static final String TABLE_NAME = "tb_orders_cart";
    /**
     * 此模块对应的权限码
     */
    public static final String PERMISSION_CODE = "tb-orders-cart";
    public static final String PERMISSION_CODE_ADD = "tb-orders-cart-add";
    public static final String PERMISSION_CODE_EDIT = "tb-orders-cart-edit";
    public static final String PERMISSION_CODE_DEL = "tb-orders-cart-del";


    // ---------- 表中字段 ----------
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 订单id
     */
    @NotNull(message = "订单ID为空")
    private Long orderId;

    /**
     * 购买者的ID
     */
    private Long userId;

    /**
     * 创建时间
     */
    private Date createTime;

}
