package model // 物联网卡标识 type SimKey struct { // ChanKey is required for the asynchronous full-sync caller. Supplying it // lets Chan route directly without looking the channel up through Proxy. 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 SimBaseRes[T any] struct { Code int `json:"code" dc:"状态码"` Message string `json:"message" dc:"消息"` Cached bool `json:"cached,omitempty" dc:"是否来自缓存"` UpdatedAt string `json:"updatedAt,omitempty" dc:"缓存更新时间"` // ErrCode carries the raw carrier error code (for example telecom S00004) // so downstream consumers can classify errors without parsing Message. ErrCode string `json:"errCode" dc:"运营商原始错误码"` SimKey *SimKey `json:"simKey" dc:"SIM卡标识"` ResData T `json:"resData" dc:"响应数据"` } // 查询请求参数 空结构 type SimInputReqNullDate struct{} // 物联网卡基本信息查询 type SimBasicInfoInput = SimBaseReq[SimInputReqNullDate] // 物联网卡基本信息查询 响应参数 type SimBasicInfoOutput = []*SimBaseRes[SimBasicInfoItem] // 物联网卡基本信息查询 响应参数 基本信息项 type SimBasicInfoItem struct { ICCID string `json:"iccid" dc:"联网卡集成电路卡识别码"` IMSI string `json:"imsi" dc:"国际移动用户识别码"` MSISDN string `json:"msisdn" dc:"接入号码"` ActiveDate string `json:"activeDate" dc:"激活时间"` OpenDate string `json:"openDate" dc:"开卡时间"` Remark string `json:"remark" dc:"备注"` SimStatus string `json:"simStatus" dc:"SIM卡状态"` StopTypeList []string `json:"stopTypeList" dc:"停机类型列表"` MainOfferName string `json:"mainOfferName" dc:"主套餐名称"` CardBindingType string `json:"cardBindingType" dc:"机卡绑定类型"` IsDirectVisit string `json:"isDirectVisit" dc:"是否定向访问"` IsHumanLimit string `json:"isHumanLimit" dc:"是否有人联网限制"` VpdnGreDoamin string `json:"vpdnGreDoamin" dc:"VPDN(GRE)功能产品域名"` VpdnL2tpDoamin string `json:"vpdnL2tpDoamin" dc:"VPDN(L2TP)功能产品域名"` AreaLimitType string `json:"areaLimitType" dc:"区域限制类型"` AreaLimitInfo string `json:"areaLimitInfo" dc:"区域限制信息"` } // 物联网卡在线信息实时查询 请求参数 type SimSessionInput = SimBaseReq[SimInputReqNullDate] // 物联网卡在线信息实时查询 响应参数 type SimSessionOutput = []*SimBaseRes[SimSessionItem] // 物联网卡在线信息实时查询 响应参数 会话项 type SimSessionItem struct { ApnId string `json:"apnId" dc:"APN ID"` Imei string `json:"imei" dc:"实时IMEI"` 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 SimStopReasonInput = SimBaseReq[SimInputReqNullDate] // 物联网卡停机原因查询 响应参数 type SimStopReasonOutput = []*SimBaseRes[SimStopReasonItem] // 物联网卡停机原因查询 响应参数 停机原因项 type SimStopReasonItem struct { StopReason string `json:"stopReason" dc:"停机原因"` PlatformType string `json:"platformType" dc:"平台类型"` } // 物联网卡冻结状态查询 请求参数 type SimFrozenStateInput = SimBaseReq[SimInputReqNullDate] // 物联网卡冻结状态查询 响应参数 type SimFrozenStateOutput = []*SimBaseRes[SimFrozenStateItem] // 物联网卡冻结状态查询 响应参数 冻结状态项 type SimFrozenStateItem struct { FrozenStatus string `json:"frozenStatus" dc:"冻结状态"` FrozenReason string `json:"frozenReason" dc:"冻结原因"` OperTime string `json:"operTime" dc:"操作时间"` } // 物联网卡卡状态查询 请求参数 type SimCardStatusInput = SimBaseReq[SimInputReqNullDate] // 物联网卡卡状态查询 响应参数 type SimCardStatusOutput = []*SimBaseRes[SimCardStatusItem] // 物联网卡卡状态查询 响应参数 卡状态项 type SimNetBlockType struct { BlockType string `json:"blockType"` BlockTypeName string `json:"blockTypeName"` } type SimCardStatusItem struct { NetBlockStatus *string `json:"netBlockStatus,omitempty" dc:"断网状态:0未断网 1已断网"` NetBlockTypes []SimNetBlockType `json:"netBlockTypes,omitempty" dc:"断网类型列表"` CardStatus int `json:"cardStatus" dc:"卡状态"` LastChangeDate string `json:"lastChangeDate" dc:"最后变更时间"` } // 物联网卡IMEI查询 请求参数 type SimImeiInput = SimBaseReq[SimInputReqNullDate] // 物联网卡IMEI查询 响应参数 type SimImeiOutput = []*SimBaseRes[SimImeiItem] // 物联网卡IMEI查询 响应参数 IMEI项 type SimImeiItem struct { Imei string `json:"imei" dc:"IMEI"` } // 单卡本月流量累计使用量查询 请求参数 type SimDataUsageInPoolInput = SimBaseReq[SimInputReqNullDate] // 单卡本月流量累计使用量查询 响应参数 type SimDataUsageInPoolOutput = []*SimBaseRes[SimDataUsageInPoolItem] // 单卡本月流量累计使用量查询 响应参数 流量累计使用量项 type SimDataUsageInPoolItem struct { DataUsage float64 `json:"dataUsage" dc:"流量累计使用量(单位: KB)"` } // SimDataUsageInput is the real-time current-month usage contract. // // The asynchronous consumer should send one chanKey per request and include // all three card identifiers available in the card table. ReqData is empty: // the upstream endpoint queries the current month at call time, unlike the // historical monthly endpoint which accepts queryDate. type SimDataUsageInput = SimBaseReq[SimInputReqNullDate] // 单卡本月流量累计使用量查询 响应参数 type SimDataUsageOutput = []*SimBaseRes[SimDataUsageItem] // 单卡本月流量累计使用量查询 响应参数 流量累计使用量项 type SimDataUsageItem struct { PackageFlow *SimPackageFlowItem `json:"packageFlow,omitempty" dc:"Package-period flow in MB, separate from current-month usage"` PackageFlowError string `json:"packageFlowError,omitempty" dc:"Package flow query failure; absent package flow is not zero"` // Chan normalizes carrier responses to MB for this real-time contract. DataUsage float64 `json:"dataUsage" dc:"流量累计使用量(单位: MB)"` TotalFlow *float64 `json:"totalFlow,omitempty" dc:"套餐总流量(单位: MB)"` } // 物联卡达量限速档位查询 请求参数 type SimDataDiagnosisInput = SimBaseReq[SimInputReqNullDate] // 物联卡达量限速档位查询 响应参数 type SimDataDiagnosisOutput = []*SimBaseRes[any] // 物联卡达量限速档位查询 响应参数 type SimDataDiagnosisItem struct { RateLimitStatus string `json:"rateLimitStatus" dc:"达量限速状态:0已触发 1未触发 2未知 3运营商暂不支持"` RateLimitReason string `json:"rateLimitReason" dc:"达量限速原因"` RateLimitDetail string `json:"rateLimitDetail" dc:"达量限速明细"` ApnDetails []SimDataDiagnosisApnDetail `json:"apnDetails" dc:"APN达量限速明细"` } type SimDataDiagnosisApnDetail struct { ApnName string `json:"apnName" dc:"APN名称"` ApnStatus string `json:"apnStatus" dc:"APN状态"` ModifyTime string `json:"modifyTime" dc:"APN状态变更时间"` OverUseDetails string `json:"overUseDetails" dc:"超停原因"` ApnServiceUsageState string `json:"apnServiceUsageState" dc:"APN业务配额状态"` PccDetails []SimDataDiagnosisPccDetail `json:"pccDetails" dc:"PCC白名单策略明细"` } type SimDataDiagnosisPccDetail struct { PccServiceCode string `json:"pccServiceCode" dc:"PCC白名单策略编码"` PccName string `json:"pccName" dc:"PCC白名单策略名称"` PccPolicyStatus string `json:"pccPolicyStatus" dc:"PCC白名单策略状态"` PccServiceUsageState string `json:"pccServiceUsageState" dc:"PCC白名单业务配额状态"` ModifyTime string `json:"modifyTime" dc:"PCC状态变更时间"` } // 物联卡单月 GPRS流量使用量批量查询 请求参数 type SimDataUsageMonthlyInput = SimBaseReq[SimDataUsageMonthlyInputItem] type SimDataUsageMonthlyInputItem struct { QueryDate string `json:"queryDate" dc:"查询月份,格式yyyyMM,仅支持已结束月份"` } // 物联卡单月 GPRS流量使用量批量查询 响应参数 type SimDataUsageMonthlyOutput = []*SimBaseRes[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 = []*SimBaseRes[SimDataUsageDailyOutputItem] type SimDataUsageDailyOutputItem struct { QueryDate string `json:"queryDate" dc:"查询日期,格式yyyyMMdd"` DataAmount float64 `json:"dataAmount" dc:"单日流量使用量,单位MB"` } // 单卡已开通APN信息查询 请求参数 type SimApnInfoInput = SimBaseReq[SimInputReqNullDate] // 单卡已开通APN信息查询 响应参数 type SimApnInfoOutput = []*SimBaseRes[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:"APN信息状态(0:暂停 1:恢复/正常)"` } // 物联网卡状态变更 请求参数 type SimCardStatusChangeInput = SimBaseReq[SimCardStatusChangeInputItem] // 物联网卡状态变更 请求参数 操作类型 type SimCardStatusChangeInputItem struct { OperType string `json:"operType" dc:"单卡卡状态变更操作类型: 0=申请停机(已激活转已停机), 1=申请复机(已停机转已激活)"` } // 物联网卡状态变更 响应参数 type SimCardStatusChangeOutput = []*SimBaseRes[SimCardStatusChangeItem] // 物联网卡状态变更 响应参数 数据项 type SimCardStatusChangeItem struct { OrderNum string `json:"orderNum" dc:"订单号"` } // 单卡 APN功能开停 请求参数 type SimCardOperateChangeApnInput = SimBaseReq[SimCardOperateChangeApnInputItem] // 单卡 APN功能开停 请求参数 操作类型 // ApnOperationCheckpointKey 传递受理即落库回调,避免等待同请求内其他单卡办理。 type ApnOperationCheckpointKey struct{} type SimCardOperateChangeApnInputItem struct { OperType string `json:"operType" dc:"APN功能开停操作类型(0:开 1:停)"` ApnName string `json:"apnName" dc:"APN名称"` SubmitOnly bool `json:"submitOnly,omitempty"` QueryJobID string `json:"queryJobId,omitempty"` OperationID string `json:"operationId,omitempty"` RecoverOnly bool `json:"recoverOnly,omitempty"` } // 单卡 APN功能开停 响应参数 type SimCardOperateChangeApnOutput = []*SimBaseRes[SimCardOperateChangeApnItem] // 单卡 APN功能开停 响应参数 数据项 type SimApnCapabilityItem struct { ProtocolVersion int `json:"protocolVersion"` } type SimApnCapabilityOutput = []*SimBaseRes[SimApnCapabilityItem] type SimCardOperateChangeApnItem struct { OrderNum string `json:"orderNum" dc:"订单号"` Pending bool `json:"pending,omitempty"` Uncertain bool `json:"uncertain,omitempty"` } // 物联网卡绑定状态查询 请求参数 type SimCardBindStatusInput = SimBaseReq[SimCardBindStatusInputItem] type SimCardBindStatusInputItem struct { TestType *int `json:"testType" dc:"分离检测方式:0话单侧检测 1网络侧检测"` } type SimCardBindStatusOutput = []*SimBaseRes[SimCardBindStatusItem] // 物联网卡绑定状态查询 响应参数 数据项 type SimCardBindStatusItem struct { BindStatus string `json:"bindStatus" dc:"机卡绑定状态"` CardBindingType string `json:"cardBindingType" dc:"机卡绑定类型"` OrderStatus string `json:"orderStatus,omitempty" dc:"机卡绑定订购状态:0订购 1未订购"` BindImei string `json:"bindImei,omitempty" dc:"绑定IMEI"` LastImei string `json:"lastImei,omitempty" dc:"最近一次上线IMEI"` ErrorCode string `json:"errorCode,omitempty" dc:"错误码"` ErrorDes string `json:"errorDes,omitempty" dc:"错误描述"` } // 物联网卡设备状态查询 请求参数 type SimDeviceStatusInput = SimBaseReq[SimInputReqNullDate] type SimDeviceStatusOutput = []*SimBaseRes[SimDeviceStatusItem] // 物联网卡设备状态查询 响应参数 数据项 type SimDeviceStatusItem struct { DeviceStatus string `json:"deviceStatus" dc:"兼容设备状态:0异常/不可用 1正常"` OperatingStatus string `json:"operatingStatus,omitempty" dc:"终端开关机状态:0关机 1开机"` } // 物联网卡区域限制状态查询 请求参数 type SimRegionLimitStatusInput = SimBaseReq[SimInputReqNullDate] type SimRegionLimitStatusOutput = []*SimBaseRes[SimRegionLimitStatusItem] // 物联网卡区域限制状态查询 响应参数 数据项 type SimRegionLimitStatusItem struct { RegionLimitStatus string `json:"regionLimitStatus" dc:"地域限制状态"` OrderStatus string `json:"orderStatus" dc:"区域限制订购状态"` LimitStatus string `json:"limitStatus" dc:"区域限制触发状态"` LimitType string `json:"limitType" dc:"区域限制类型"` LimitArea string `json:"limitArea" dc:"限制区域"` }