package model

import (
	"gorm.io/gorm"
)

type Carrier struct {
	gorm.Model
	BaseModel            `gorm:"embedded"`
	CarrierCode          string `gorm:"column:carrier_code;type:varchar(50);uniqueIndex:idx_carrier_code,where:deleted_at IS NULL;not null;comment:运营商编码" json:"carrier_code"`
	CarrierName          string `gorm:"column:carrier_name;type:varchar(100);not null;comment:运营商名称" json:"carrier_name"`
	CarrierType          string `gorm:"column:carrier_type;type:varchar(20);not null;default:'CMCC';comment:运营商类型(CMCC/CUCC/CTCC/CBN)" json:"carrier_type"`
	Description          string `gorm:"column:description;type:varchar(500);comment:运营商描述" json:"description"`
	Status               int    `gorm:"column:status;type:int;default:1;comment:状态 1-启用 0-禁用" json:"status"`
	RealnameLinkType     string `gorm:"column:realname_link_type;type:varchar(20);not null;default:'none';comment:实名链接类型 none-不支持 template-模板URL gateway-Gateway接口" json:"realname_link_type"`
	RealnameLinkTemplate string `gorm:"column:realname_link_template;type:varchar(500);default:'';comment:实名链接模板URL" json:"realname_link_template"`
	DataResetDay         int    `gorm:"column:data_reset_day;type:int;not null;default:1;comment:上游流量重置日(1-28) 运营商每月清零网关计数器的日期" json:"data_reset_day"`
}

// TableName 指定表名
func (Carrier) TableName() string {
	return "tb_carrier"
}
