package model

// CDREventSMF CDR会话对象SMF cdr_event_smf
type CDREventSMF struct {
	ID         string `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
	NeType     string `json:"neType" gorm:"column:ne_type"`
	NeName     string `json:"neName" gorm:"column:ne_name"`
	RmUID      string `json:"rmUID" gorm:"column:rm_uid"`
	Timestamp  int64  `json:"timestamp" gorm:"column:timestamp"`
	CDRJSONStr string `json:"cdrJSON" gorm:"column:cdr_json"`
	CreatedAt  string `json:"createdAt" gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
	TenantID   string `json:"tenantID" gorm:"-"`
	TenantName string `json:"tenantName" gorm:"-"`
	// ====== 非数据库字段属性 ======
}

// TableName 表名称
func (*CDREventSMF) TableName() string {
	return "cdr_event_smf"
}

// CDREventSMFQuery CDR会话对象SMF查询参数结构体
type CDREventSMFQuery struct {
	NeType       string `json:"neType" form:"neType" binding:"required,oneof=SMF"` // 网元类型, 暂时支持SMF
	NeID         string `json:"neId" form:"neId" binding:"required"`
	RmUID        string `json:"rmUID" form:"rmUID"`
	RecordType   string `json:"recordType" form:"recordType"` // 暂时没用到
	SubscriberID string `json:"subscriberID" form:"subscriberID"`
	DNN          string `json:"dnn" form:"dnn"`
	TenantName   string `json:"tenantName" form:"tenantName"`
	UserName     string `json:"userName" form:"userName"`
	StartTime    int64  `json:"startTime" form:"startTime"`
	EndTime      int64  `json:"endTime" form:"endTime"`
	SortField    string `json:"sortField" form:"sortField" binding:"omitempty,oneof=timestamp"` // 排序字段，填写结果字段
	SortOrder    string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"`  // 排序升降序，asc desc
	PageNum      int64  `json:"pageNum" form:"pageNum" binding:"required"`
	PageSize     int64  `json:"pageSize" form:"pageSize" binding:"required"`
}
