chore: 初始开源发布
iotlcm-onelink-mock:OneLink 挡板服务(本地测试替身)。 - Go module 迁移至 git.5iot.com/iotlcm-public/iotlcm-onelink-mock - 修复同毫秒内多次生成卡导致 ICCID/IMSI 唯一约束冲突 - 补 Apache-2.0 LICENSE,README 重写并新增 docs/deploy.md - 移除内部部署资产(CI 触发器 / 镜像推送脚本 / 指定环境部署文档) - 测试凭据改为 demo_appid / demo_password,真实手机号与内网 IP 脱敏 - 统一 LF 行尾并加 .gitattributes
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
package service
|
||||
|
||||
import "time"
|
||||
|
||||
type Response struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
Result []interface{} `json:"result"`
|
||||
}
|
||||
|
||||
type Store struct {
|
||||
AppIDs []Credential `json:"appids"`
|
||||
Groups []CardGroup `json:"groups"`
|
||||
Cards []SIMCard `json:"cards"`
|
||||
Tokens map[string]Token `json:"tokens"`
|
||||
Orders []Order `json:"orders"`
|
||||
Settings SimulationSettings `json:"settings"`
|
||||
}
|
||||
|
||||
type CardGroup struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CardCount int `json:"cardCount"`
|
||||
}
|
||||
|
||||
type Credential struct {
|
||||
AppID string `json:"appid"`
|
||||
Password string `json:"password"`
|
||||
Name string `json:"name"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
LastToken string `json:"lastToken,omitempty"`
|
||||
TokenExpires string `json:"tokenExpires,omitempty"`
|
||||
}
|
||||
|
||||
type Token struct {
|
||||
AppID string `json:"appid"`
|
||||
Value string `json:"value"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
}
|
||||
|
||||
type APN struct {
|
||||
Name string `json:"name"`
|
||||
Status string `json:"status"`
|
||||
DiagnosisStatus string `json:"diagnosisStatus,omitempty"`
|
||||
UsageBytes float64 `json:"usageBytes"`
|
||||
ModifyTime string `json:"modifyTime,omitempty"`
|
||||
OverUseDetails string `json:"overUseDetails,omitempty"`
|
||||
ServiceUsageState string `json:"serviceUsageState,omitempty"`
|
||||
PCCs []PCC `json:"pccs,omitempty"`
|
||||
}
|
||||
|
||||
type PCC struct {
|
||||
ServiceCode string `json:"serviceCode"`
|
||||
Name string `json:"name"`
|
||||
PolicyStatus string `json:"policyStatus"`
|
||||
ServiceUsageState string `json:"serviceUsageState"`
|
||||
ModifyTime string `json:"modifyTime"`
|
||||
}
|
||||
|
||||
type SIMCard struct {
|
||||
GroupID int64 `json:"groupId,omitempty"`
|
||||
GroupName string `json:"groupName,omitempty"`
|
||||
MSISDN string `json:"msisdn"`
|
||||
ICCID string `json:"iccid"`
|
||||
IMSI string `json:"imsi"`
|
||||
IMEI string `json:"imei"`
|
||||
Remark string `json:"remark"`
|
||||
CardStatus string `json:"cardStatus"`
|
||||
LastChangeDate string `json:"lastChangeDate"`
|
||||
StopReason string `json:"stopReason,omitempty"`
|
||||
FrozenStatus string `json:"frozenStatus,omitempty"`
|
||||
FrozenReason string `json:"frozenReason,omitempty"`
|
||||
FrozenOperTime string `json:"frozenOperTime,omitempty"`
|
||||
OpenDate string `json:"openDate"`
|
||||
ActiveDate string `json:"activeDate"`
|
||||
OnOffStatus string `json:"onOffStatus"`
|
||||
SessionStatus string `json:"sessionStatus"`
|
||||
SessionCreateDate string `json:"sessionCreateDate,omitempty"`
|
||||
IP string `json:"ip"`
|
||||
IPv6Prefix string `json:"ipv6Prefix"`
|
||||
IPv6 string `json:"ipv6"`
|
||||
RAT string `json:"rat"`
|
||||
CardBindStatus string `json:"cardBindStatus"`
|
||||
RegionLimitStatus string `json:"regionLimitStatus"`
|
||||
AreaRestrictType string `json:"areaRestrictType"`
|
||||
RestrictedArea string `json:"restrictedArea"`
|
||||
MonthUsageKB float64 `json:"monthUsageKB"`
|
||||
PoolUsageBytes float64 `json:"poolUsageBytes"`
|
||||
DailyBaseKB float64 `json:"dailyBaseKB"`
|
||||
MonthlyBaseKB float64 `json:"monthlyBaseKB"`
|
||||
GrowthPerMinuteKB float64 `json:"growthPerMinuteKB"`
|
||||
APNs []APN `json:"apns"`
|
||||
LastUsageUpdateTime string `json:"lastUsageUpdateTime"`
|
||||
Exported bool `json:"exported"`
|
||||
ExportCheckedAt string `json:"exportCheckedAt"`
|
||||
}
|
||||
|
||||
type Order struct {
|
||||
OrderNum string `json:"orderNum"`
|
||||
MSISDN string `json:"msisdn,omitempty"`
|
||||
ICCID string `json:"iccid,omitempty"`
|
||||
IMSI string `json:"imsi,omitempty"`
|
||||
Type string `json:"type"`
|
||||
OperType string `json:"operType,omitempty"`
|
||||
APNName string `json:"apnName,omitempty"`
|
||||
Status string `json:"status"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
}
|
||||
|
||||
type SimulationSettings struct {
|
||||
AutoGrowthEnabled bool `json:"autoGrowthEnabled"`
|
||||
DefaultGrowthKB float64 `json:"defaultGrowthKB"`
|
||||
}
|
||||
|
||||
type SyncResult struct {
|
||||
Scanned int `json:"scanned"`
|
||||
Synced int `json:"synced"`
|
||||
}
|
||||
|
||||
type GenerateResult struct {
|
||||
Generated int `json:"generated"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
type CardPage struct {
|
||||
Items []SIMCard `json:"items"`
|
||||
Total int `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
}
|
||||
|
||||
type OrderPage struct {
|
||||
Items []Order `json:"items"`
|
||||
Total int `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
}
|
||||
Reference in New Issue
Block a user