package model

import "time"

// UEEvent UE会话对象 ue_event
type UEEvent 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"`
	EventJSONStr string    `json:"eventJSON" gorm:"column:event_json"`
	CreatedAt    time.Time `json:"createdAt" gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
}

// UEEventQuery UE会话对象查询参数结构体
type UEEventQuery struct {
	NeType    string `json:"neType" form:"neType" binding:"required"` // 网元类型, 暂时支持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
	StartTime string `json:"startTime" form:"startTime"`
	EndTime   string `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"`
}
