153 lines
5.7 KiB
Go
153 lines
5.7 KiB
Go
package model
|
|
|
|
import "github.com/gogf/gf/v2/os/gtime"
|
|
|
|
// 统一模板
|
|
type ReqTemplate[T any] struct {
|
|
Param T `json:"Param"`
|
|
Verify VerifyItem `json:"verify"`
|
|
}
|
|
|
|
type VerifyItem struct {
|
|
TimeStamp string `json:"timeStamp"`
|
|
Password string `json:"password"`
|
|
AppId string `json:"appId"`
|
|
Sign string `json:"sign"`
|
|
}
|
|
|
|
type RespTemplate[T any] struct {
|
|
Status int `json:"status"`
|
|
Message string `json:"message"`
|
|
Result T `json:"result"`
|
|
}
|
|
|
|
// 2.1.1 SIM卡信息详情 请求参数
|
|
type SimCardInfoInput = ReqTemplate[SimCardInfoInputItem]
|
|
type SimCardInfoInputItem struct {
|
|
Type string `json:"type"`
|
|
Cardno string `json:"cardno"`
|
|
}
|
|
|
|
// 2.1.1 SIM卡信息详情 响应参数
|
|
type SimCardInfoOutput struct {
|
|
Vid string `json:"vid"` // 物联网卡虚拟编号
|
|
Msisdn string `json:"msisdn"` // 物联卡号码,最长13位数字
|
|
Iccid string `json:"iccid"` // 20位ICCID卡号
|
|
Imsi string `json:"imsi"` // ≤15位IMSI数字
|
|
Imei string `json:"imei"` // 15~17位IMEI
|
|
DeptName string `json:"deptName"` // 所属集团名称
|
|
StatusId int `json:"statusId"` // 卡状态编码
|
|
PackageId string `json:"packageId"` // 套餐编号
|
|
PackageName string `json:"packageName"` // 套餐名称
|
|
Used float64 `json:"used"` // 周期用量
|
|
Remaining float64 `json:"remaining"` // 周期剩余流量
|
|
Type string `json:"type"` // 卡类型
|
|
PacketArr []map[string]interface{} `json:"packetArr"` // 资费计划,仅最后生效1条
|
|
Remark string `json:"remark"` // 备注
|
|
Grouping string `json:"grouping"` // 分组
|
|
DeliverDate string `json:"deliverDate"` // 发货日期 yyyy-MM-dd
|
|
ActivateDate string `json:"activateDate"` // 激活日期 yyyy-MM-dd
|
|
ExpireTime *gtime.Time `json:"expireTime"` // 到期时间 yyyy-MM-dd HH:mm:ss
|
|
}
|
|
|
|
var SimCardNameMap = map[int]string{
|
|
1: "插拔",
|
|
2: "贴卡5X6",
|
|
3: "贴卡2X2",
|
|
4: "插拔卡(MP1)",
|
|
5: "插拔卡(MP2)",
|
|
6: "贴片卡(MS0)",
|
|
7: "贴片卡(MS1)",
|
|
}
|
|
|
|
// 2.1.3 SIM卡账期用量查询 请求参数
|
|
type SimDataUsageOldInput = ReqTemplate[SimDataUsageInputItem]
|
|
type SimDataUsageInputItem struct {
|
|
Iccid string `json:"iccid"`
|
|
}
|
|
|
|
// 2.1.3 SIM卡账期用量查询 响应参数
|
|
type SimDataUsageOldOutput struct {
|
|
UseUnit string `json:"useUnit"` // 单位:MB
|
|
UseAmount float64 `json:"useAmount"` // 周期用量
|
|
}
|
|
|
|
// 2.1.4 SIM卡历史用量查询 请求参数
|
|
type SimDataUsageMonthlyOldInput = ReqTemplate[SimDataUsageMonthlyOldInputItem]
|
|
type SimDataUsageMonthlyOldInputItem struct {
|
|
Iccid string `json:"iccid"` // 20位ICCID卡号
|
|
DateTime string `json:"dateTime"` // 日期时间 yyyyMM
|
|
}
|
|
|
|
// 2.1.4 SIM卡历史用量查询 响应参数
|
|
type SimDataUsageMonthlyOldOutput struct {
|
|
UseUnit string `json:"useUnit"` // 单位:MB
|
|
UseAmount float64 `json:"useAmount"` // 周期用量
|
|
}
|
|
|
|
// 2.1.5 SIM卡生命周期查询 请求参数
|
|
type SimStatusOldInput = ReqTemplate[SimStatusOldInputItem]
|
|
type SimStatusOldInputItem struct {
|
|
Iccid string `json:"iccid"` // 20位ICCID卡号
|
|
}
|
|
|
|
// 2.1.5 SIM卡生命周期查询 响应参数
|
|
type SimStatusOldOutput struct {
|
|
StatusMessage string `json:"statusMessage"` // 状态描述
|
|
StatusCode int `json:"statusCode"` // 状态码
|
|
}
|
|
|
|
var SimCardStatusMap = map[int]string{
|
|
1: "库存",
|
|
2: "可测试",
|
|
3: "待激活",
|
|
4: "已激活",
|
|
5: "已停机",
|
|
6: "预销户",
|
|
7: "已销户",
|
|
8: "未知",
|
|
}
|
|
|
|
// 2.1.6 SIM卡在网状态查询 请求参数
|
|
type SimStatusOnlineOldInput = ReqTemplate[SimStatusOnlineOldInputItem]
|
|
type SimStatusOnlineOldInputItem struct {
|
|
Iccid string `json:"iccid"` // 20位ICCID卡号
|
|
}
|
|
|
|
// 2.1.6 SIM卡在网状态查询 响应参数
|
|
type SimStatusOnlineOldOutput struct {
|
|
TypeName string `json:"typeName"` // 运营商系统类型
|
|
Imei string `json:"imei"` // 15~17位IMEI
|
|
StatusMessage string `json:"statusMessage"` // 状态描述
|
|
StatusCode int `json:"statusCode"` // 状态码
|
|
Data SimStatusOnlineOldData `json:"data"` // 数据
|
|
}
|
|
type SimStatusOnlineOldData struct {
|
|
ApnId string `json:"apnId"` // APN ID
|
|
Rat string `json:"rat"` // Radio Access Technology
|
|
Ipv6 string `json:"ipv6"` // IPv6 地址
|
|
Ip string `json:"ip"` // IP 地址
|
|
Ipv6Prefix string `json:"ipv6Prefix"` // IPv6 前缀
|
|
Status string `json:"status"` // 状态
|
|
CreateDate string `json:"createDate"` // 创建时间 yyyy-MM-dd HH:mm:ss
|
|
}
|
|
|
|
// 2.1.1 批量查询卡基础信息 请求参数
|
|
type QueryCardInfoListInput = ReqTemplate[QueryCardInfoListInputItem]
|
|
type QueryCardInfoListInputItem struct {
|
|
Iccid []string `json:"iccid"` // 20位ICCID卡号
|
|
}
|
|
|
|
// 2.1.1 批量查询卡基础信息 响应参数
|
|
type QueryCardInfoListOutput struct {
|
|
Iccid string `json:"iccid"` // 20位ICCID卡号
|
|
ActivateDate string `json:"activateDate"` // 激活日期 yyyy-MM-dd
|
|
DueExpireTime string `json:"dueExpireTime"` // 到期时间 yyyy-MM-dd
|
|
Imei string `json:"imei"` // 15~17位IMEI
|
|
Imsi string `json:"imsi"` // 15~17位IMSI
|
|
Msisdn string `json:"msisdn"` // 11位手机号
|
|
Type string `json:"type"` // 卡类型
|
|
Remarks string `json:"remarks"` // 备注
|
|
Status int `json:"status"` // 状态
|
|
}
|