package model

import "time"

// UEEventAMF UE会话对象AMF ue_event_amf
type UEEventAMF 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"`
	EventType    string    `json:"eventType" gorm:"column:event_type"` // 事件类型 auth-result detach cm-state
	EventJSONStr string    `json:"eventJSON" gorm:"column:event_json"`
	CreatedAt    time.Time `json:"createdAt" gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
}

// TableName 表名称
func (*UEEventAMF) TableName() string {
	return "ue_event_amf"
}

// UEEventAMFQuery UE会话对象AMF查询参数结构体
type UEEventAMFQuery struct {
	NeType    string `json:"neType" form:"neType" binding:"required,oneof=AMF"` // 网元类型, 暂时支持AMF
	NeID      string `json:"neId" form:"neId" binding:"required"`
	RmUID     string `json:"rmUID" form:"rmUID"`
	EventType string `json:"eventType" form:"eventType"` // 事件类型 auth-result detach cm-state
	IMSI      string `json:"imsi" form:"imsi"`           // imsi
	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"`
}
