package com.pig4cloud.pig.marketing.api.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * @author: lwh
 * @date: 2025-07-23
 * @description: 营销应用IP
 */
@Data
@TableName("mkt_mgmt_apps_ip")
@Schema(description = "营销应用IP")
@EqualsAndHashCode(callSuper = true)
public class MarketingAppsIp extends Model<MarketingAppsIp> {

	@Serial
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId(value = "id")
	@Schema(description = "id")
	private Long id;

	/**
	 * 应用ID
	 */
	@Schema(description = "应用ID")
	private Long appId;

	/**
	 * ip类型
	 */
	@Schema(description = "ip类型,1-白名单,2-黑名单")
	private Integer ipType;

	/**
	 * 所属类型
	 */
	@Schema(description = "所属类型,1-来自分组,2-具体IP")
	private Integer sourceType;

	/**
	 * 分组ID
	 */
	@Schema(description = "分组ID")
	private Long groupId;

	/**
	 * ip模式
	 */
	@Schema(description = "ip模式,1-单IP,2-IP段")
	private Integer ipMode;

	/**
	 * 起始IP
	 */
	@Schema(description = "起始IP")
	private String startIp;

	/**
	 * 结束IP
	 */
	@Schema(description = "结束IP")
	private String endIp;

	/**
	 * 是否属于全局配置
	 */
	@Schema(description = "是否属于全局配置")
	private Boolean config;

	/**
	 * 删除标记
	 */
	@TableLogic
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "删除标记,1:已删除,0:正常")
	private String delFlag;

	/**
	 * 创建人
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建人")
	private String createBy;

	/**
	 * 修改人
	 */
	@TableField(fill = FieldFill.UPDATE)
	@Schema(description = "修改人")
	private String updateBy;

	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 更新时间
	 */
	@TableField(fill = FieldFill.UPDATE)
	@Schema(description = "更新时间")
	private LocalDateTime updateTime;
}
