chore: 初始开源发布
iotlcm-admin-svr:管理后台服务。 - Go module:iotlcm → git.5iot.com/iotlcm-public/iotlcm-admin-svr(729 文件) - 凭据与地址脱敏:JWT signingKey(含代码里的 MustGet 默认值)、 MySQL DSN、Redis 口令、告警邮件发件人邮箱全部改为占位; 私网 IP → 文档地址段;库名 xiujie_admin → iotlcm - 真实手机号/邮箱 → 合法 11 位编造号 / example.com - 移除内部资产:CI 触发器、过时 DDL(sql/db_iotlcm.sql)、 私有依赖 go get 行、明文 registry 登录口令 - 启动 banner 统一 IOTLCM 方块字 + 社区惯例署名 - Dockerfile 改用公共基础镜像 - 拼错的 RADEME.md → README.md,README 重写 - 需要真实数据库的用例改为可用 IOTLCM_TEST_WITH_DB=1 显式启用 - 补 Apache-2.0 LICENSE,LF 行尾 + .gitattributes 数据库 schema 不随本仓发布(生产 DDL 已过时),README 已说明。
This commit is contained in:
@@ -0,0 +1,307 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// 上游通道代理配置
|
||||
type UpstreamChanConfig struct {
|
||||
Address string `json:"address" dc:"服务地址或服务发现名称"`
|
||||
Timeout time.Duration `json:"timeout" dc:"超时时间"`
|
||||
}
|
||||
|
||||
// UpstreamChannelTestRequest is sent only by the authenticated admin service;
|
||||
// TenantID is copied from the server-side auth context, never from the UI.
|
||||
type UpstreamChannelTestRequest struct {
|
||||
ChannelID int64 `json:"channelId"`
|
||||
TenantID string `json:"tenantId"`
|
||||
InputMode string `json:"inputMode"`
|
||||
CardValueType string `json:"cardValueType"`
|
||||
CardValue string `json:"cardValue"`
|
||||
ICCID string `json:"iccid"`
|
||||
IMSI string `json:"imsi"`
|
||||
MSISDN string `json:"msisdn"`
|
||||
Items []string `json:"items"`
|
||||
}
|
||||
|
||||
// 物联网卡标识
|
||||
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:"消息"`
|
||||
Cached bool `json:"cached,omitempty" dc:"是否来自缓存"`
|
||||
UpdatedAt string `json:"updatedAt,omitempty" 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 {
|
||||
ICCID string `json:"iccid" dc:"ICCID"`
|
||||
IMSI string `json:"imsi" dc:"IMSI"`
|
||||
MSISDN string `json:"msisdn" dc:"MSISDN"`
|
||||
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 = SimResponseData[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 SimCardStatusInput = SimBaseReq[SimInputReqNullDate]
|
||||
|
||||
// 物联网卡卡状态查询 响应参数
|
||||
type SimCardStatusOutput = SimResponseData[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 = 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)"`
|
||||
}
|
||||
|
||||
// 物联卡达量限速档位查询 请求参数
|
||||
type SimDataDiagnosisInput = SimBaseReq[SimInputReqNullDate]
|
||||
|
||||
// 物联卡达量限速档位查询 响应参数
|
||||
type SimDataDiagnosisOutput = SimResponseData[SimDataDiagnosisItem]
|
||||
|
||||
// 物联卡达量限速档位查询 响应参数
|
||||
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:"查询日期"`
|
||||
}
|
||||
|
||||
// 物联卡单月 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:"机卡绑定状态"`
|
||||
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 = SimResponseData[SimDeviceStatusItem]
|
||||
|
||||
// 物联网卡设备状态查询 响应参数 设备状态项
|
||||
type SimDeviceStatusItem struct {
|
||||
DeviceStatus string `json:"deviceStatus" dc:"设备状态"`
|
||||
OperatingStatus string `json:"operatingStatus,omitempty" dc:"终端开关机状态:0关机 1开机"`
|
||||
}
|
||||
|
||||
// 物联网卡地域限制状态查询 请求参数
|
||||
type SimRegionLimitStatusInput = SimBaseReq[SimInputReqNullDate]
|
||||
|
||||
// 物联网卡地域限制状态查询 响应参数
|
||||
type SimRegionLimitStatusOutput = SimResponseData[SimRegionLimitStatusItem]
|
||||
|
||||
// 物联网卡地域限制状态查询 响应参数 地域限制状态项
|
||||
type SimRegionLimitStatusItem struct {
|
||||
RegionLimitStatus string `json:"regionLimitStatus" dc:"区域限制状态:0终端未超出业务限制的位置区 1终端已超出业务限制的位置区"`
|
||||
OrderStatus string `json:"orderStatus" dc:"区域限制订购状态"`
|
||||
LimitStatus string `json:"limitStatus" dc:"区域限制触发状态"`
|
||||
LimitType string `json:"limitType" dc:"区域限制类型"`
|
||||
LimitArea string `json:"limitArea" dc:"限制区域"`
|
||||
}
|
||||
Reference in New Issue
Block a user