229 lines
8.0 KiB
Go
229 lines
8.0 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// 上游通道代理配置
|
|
type UpstreamChanConfig struct {
|
|
Address string `json:"address" dc:"服务地址或服务发现名称"`
|
|
Timeout time.Duration `json:"timeout" dc:"超时时间"`
|
|
}
|
|
|
|
// 物联网卡标识
|
|
type SimKey struct {
|
|
ChanKey string `json:"chanKey" dc:"通道标识"`
|
|
ICCID string `json:"iccid" dc:"联网卡集成电路卡识别码20位"`
|
|
IMSI string `json:"imsi" dc:"国际移动用户识别码"`
|
|
MSISDN string `json:"msisdn" dc:"移动用户识别码"`
|
|
}
|
|
|
|
// 物联网卡基础请求参数
|
|
type SimBaseReq[T any] struct {
|
|
SimKeys []*SimKey `json:"simKeys" dc:"SIM卡标识列表"`
|
|
ReqData T `json:"reqData" dc:"请求数据"`
|
|
}
|
|
|
|
// 代理响应参数
|
|
type SimResponseData[T any] struct {
|
|
Code int `json:"code" dc:"状态码"`
|
|
Message string `json:"message" dc:"消息"`
|
|
Data []SimBaseRes[T] `json:"data" dc:"数据"`
|
|
}
|
|
|
|
// 物联网卡基础响应参数
|
|
type SimBaseRes[T any] struct {
|
|
Code int `json:"code" dc:"状态码"`
|
|
Message string `json:"message" dc:"消息"`
|
|
SimKey *SimKey `json:"simKey" dc:"SIM卡标识"`
|
|
ResData T `json:"resData" dc:"响应数据"`
|
|
}
|
|
|
|
// 查询请求参数 空结构
|
|
type SimInputReqNullDate struct{}
|
|
|
|
// 物联网卡基本信息查询
|
|
type SimBasicInfoInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 物联网卡基本信息查询 响应参数
|
|
type SimBasicInfoOutput = SimResponseData[SimBasicInfoItem]
|
|
|
|
// 物联网卡基本信息查询 响应参数 基本信息项
|
|
type SimBasicInfoItem struct {
|
|
ActiveDate string `json:"activeDate" dc:"激活时间"`
|
|
OpenDate string `json:"openDate" dc:"开卡时间"`
|
|
Remark string `json:"remark" dc:"备注"`
|
|
}
|
|
|
|
// 物联网卡在线信息实时查询 请求参数
|
|
type SimSessionInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 物联网卡在线信息实时查询 响应参数
|
|
type SimSessionOutput = SimResponseData[SimSessionItem]
|
|
|
|
// 物联网卡在线信息实时查询 响应参数 会话项
|
|
type SimSessionItem struct {
|
|
ApnId string `json:"apnId" dc:"APN ID"`
|
|
Rat string `json:"rat" dc:"接入方式"`
|
|
Ipv4 string `json:"ipv4" dc:"IPV4"`
|
|
Ipv6 string `json:"ipv6" dc:"IPV6"`
|
|
Ipv6Prefix string `json:"ipv6Prefix" dc:"IPV6前缀"`
|
|
Status string `json:"status" dc:"状态(0:用户在线 -1:用户不在线 -2:未查询到会话信息)"`
|
|
CreateTime string `json:"createTime" dc:"创建时间"`
|
|
}
|
|
|
|
// 物联网卡卡状态查询 请求参数
|
|
type SimCardStatusInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 物联网卡卡状态查询 响应参数
|
|
type SimCardStatusOutput = SimResponseData[SimCardStatusItem]
|
|
|
|
// 物联网卡卡状态查询 响应参数 卡状态项
|
|
type SimCardStatusItem struct {
|
|
CardStatus int `json:"cardStatus" dc:"卡状态"`
|
|
LastChangeDate string `json:"lastChangeDate" dc:"最后变更时间"`
|
|
}
|
|
|
|
// 物联网卡IMEI查询 请求参数
|
|
type SimImeiInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 物联网卡IMEI查询 响应参数
|
|
type SimImeiOutput = SimResponseData[SimImeiItem]
|
|
|
|
// 物联网卡IMEI查询 响应参数 IMEI项
|
|
type SimImeiItem struct {
|
|
Imei string `json:"imei" dc:"IMEI"`
|
|
}
|
|
|
|
// 单卡本月流量累计使用量查询 请求参数
|
|
type SimDataUsageInPoolInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 单卡本月流量累计使用量查询 响应参数
|
|
type SimDataUsageInPoolOutput = SimResponseData[SimDataUsageInPoolItem]
|
|
|
|
// 单卡本月流量累计使用量查询 响应参数 流量累计使用量项
|
|
type SimDataUsageInPoolItem struct {
|
|
DataUsage float64 `json:"dataUsage" dc:"流量累计使用量(单位: KB)"`
|
|
}
|
|
|
|
// 单卡本月流量累计使用量查询 请求参数
|
|
type SimDataUsageInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 单卡本月流量累计使用量查询 响应参数
|
|
type SimDataUsageOutput = SimResponseData[SimDataUsageItem]
|
|
|
|
// 单卡本月流量累计使用量查询 响应参数 流量累计使用量项
|
|
type SimDataUsageItem struct {
|
|
DataUsage float64 `json:"dataUsage" dc:"流量累计使用量(单位: MB)"`
|
|
}
|
|
|
|
// 物联卡单月 GPRS流量使用量批量查询 请求参数
|
|
type SimDataUsageMonthlyInput = SimBaseReq[SimDataUsageMonthlyInputItem]
|
|
type SimDataUsageMonthlyInputItem struct {
|
|
QueryDate string `json:"queryDate" dc:"查询日期"`
|
|
}
|
|
|
|
// 物联卡单月 GPRS流量使用量批量查询 响应参数
|
|
type SimDataUsageMonthlyOutput = SimResponseData[SimDataUsageMonthlyOutputItem]
|
|
type SimDataUsageMonthlyOutputItem struct {
|
|
DeadLine string `json:"deadLine" dc:"截止时间"`
|
|
DataAmount float64 `json:"dataAmount" dc:"流量累计使用量"`
|
|
}
|
|
|
|
// 物联卡单日 GPRS流量使用量查询 请求参数
|
|
type SimDataUsageDailyInput = SimBaseReq[SimDataUsageDailyInputItem]
|
|
type SimDataUsageDailyInputItem struct {
|
|
QueryDate string `json:"queryDate" dc:"查询日期,格式yyyyMMdd"`
|
|
}
|
|
|
|
// 物联卡单日 GPRS流量使用量查询 响应参数
|
|
type SimDataUsageDailyOutput = SimResponseData[SimDataUsageDailyOutputItem]
|
|
type SimDataUsageDailyOutputItem struct {
|
|
QueryDate string `json:"queryDate" dc:"查询日期,格式yyyyMMdd"`
|
|
DataAmount float64 `json:"dataAmount" dc:"单日流量使用量,单位MB"`
|
|
}
|
|
|
|
// 单卡已开通APN信息查询 请求参数
|
|
type SimApnInfoInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 单卡已开通APN信息查询 响应参数
|
|
type SimApnInfoOutput = SimResponseData[SimApnInfoItemList]
|
|
|
|
// 单卡已开通APN信息查询 响应参数 APN信息项
|
|
type SimApnInfoItemList struct {
|
|
ApnList []SimApnInfoItem `json:"apnList" dc:"APN列表"`
|
|
}
|
|
type SimApnInfoItem struct {
|
|
ApnName string `json:"apnName" dc:"APN名称"`
|
|
Status string `json:"status" dc:"状态"`
|
|
}
|
|
|
|
// 物联网卡状态变更 请求参数
|
|
type SimCardStatusChangeInput = SimBaseReq[SimCardStatusChangeInputItem]
|
|
|
|
// 物联网卡状态变更 请求参数 操作类型
|
|
type SimCardStatusChangeInputItem struct {
|
|
OperType string `json:"operType" dc:"操作类型"`
|
|
}
|
|
|
|
// 物联网卡状态变更 响应参数
|
|
type SimCardStatusChangeOutput = SimResponseData[SimCardStatusChangeItem]
|
|
|
|
// 物联网卡状态变更 响应参数 数据项
|
|
type SimCardStatusChangeItem struct {
|
|
OrderNum string `json:"orderNum" dc:"订单号"`
|
|
}
|
|
|
|
// 单卡 APN功能开停 请求参数
|
|
type SimCardOperateChangeApnInput = SimBaseReq[SimCardOperateChangeApnInputItem]
|
|
|
|
// 单卡 APN功能开停 请求参数 操作类型
|
|
type SimCardOperateChangeApnInputItem struct {
|
|
OperType string `json:"operType" dc:"操作类型"`
|
|
ApnName string `json:"apnName" dc:"APN名称"`
|
|
}
|
|
|
|
// 单卡 APN功能开停 响应参数
|
|
type SimCardOperateChangeApnOutput = SimResponseData[SimCardOperateChangeApnItem]
|
|
|
|
// 单卡 APN功能开停 响应参数 数据项
|
|
type SimCardOperateChangeApnItem struct {
|
|
OrderNum string `json:"orderNum" dc:"订单号"`
|
|
}
|
|
|
|
// 物联网卡机卡绑定状态查询 请求参数
|
|
type SimCardBindStatusInput = SimBaseReq[SimCardBindStatusInputItem]
|
|
|
|
// 物联网卡机卡绑定状态查询 请求参数 请求项
|
|
type SimCardBindStatusInputItem struct {
|
|
TestType int `json:"testType" dc:"分离检测方式:0话单侧检测 1网络侧检测"`
|
|
}
|
|
|
|
// 物联网卡机卡绑定状态查询 响应参数
|
|
type SimCardBindStatusOutput = SimResponseData[SimCardBindStatusItem]
|
|
|
|
// 物联网卡机卡绑定状态查询 响应参数 机卡绑定状态项
|
|
type SimCardBindStatusItem struct {
|
|
BindStatus string `json:"bindStatus" dc:"机卡绑定状态"`
|
|
}
|
|
|
|
// 物联网卡设备状态查询 请求参数
|
|
type SimDeviceStatusInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 物联网卡设备状态查询 响应参数
|
|
type SimDeviceStatusOutput = SimResponseData[SimDeviceStatusItem]
|
|
|
|
// 物联网卡设备状态查询 响应参数 设备状态项
|
|
type SimDeviceStatusItem struct {
|
|
DeviceStatus string `json:"deviceStatus" dc:"设备状态"`
|
|
}
|
|
|
|
// 物联网卡地域限制状态查询 请求参数
|
|
type SimRegionLimitStatusInput = SimBaseReq[SimInputReqNullDate]
|
|
|
|
// 物联网卡地域限制状态查询 响应参数
|
|
type SimRegionLimitStatusOutput = SimResponseData[SimRegionLimitStatusItem]
|
|
|
|
// 物联网卡地域限制状态查询 响应参数 地域限制状态项
|
|
type SimRegionLimitStatusItem struct {
|
|
RegionLimitStatus string `json:"regionLimitStatus" dc:"地域限制状态"`
|
|
}
|