package com.gxwebsoft.websopy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

/**
 * app_config（db_websopy）跨表映射实体
 * 实际查询通过 XML 使用全限定表名 db_websopy.app_config
 *
 * 实际表结构：
 *   config_id, app_id, config_key, config_value, config_type,
 *   is_encrypted, is_secret, updated_time, created_time,
 *   description, sort_number, tenant_id, deleted
 *
 * @author WebSoft
 * @since 2026-06-17
 */
@Data
public class AppConfig {
    private static final long serialVersionUID = 1L;

    @TableId(value = "config_id", type = IdType.AUTO)
    private Integer configId;

    @TableField("app_id")
    private Integer appId;

    @TableField("tenant_id")
    private Integer tenantId;

    /** 应用绑定的租户ID（用于精确匹配当前请求租户的配置） */
    @TableField("bound_tenant_id")
    private Integer boundTenantId;

    @TableField("config_key")
    private String configKey;

    @TableField("config_value")
    private String configValue;

    /** 分类字段，如 wechat / payment / sms */
    @TableField("config_type")
    private String configType;

    @TableField("is_encrypted")
    private Integer isEncrypted;

    @TableField("is_secret")
    private Integer isSecret;

    @TableField("description")
    private String description;
}
