Files
iotlcm/server/internal/model/app_card.go
T
MiFaZhan 2ed5dfa6a1 chore: 初始开源发布
iotlcm-app:小程序端 + 用户端服务。

- app/:uni-app 小程序前端(基于 unibest,MIT)
  - 微信 AppID → YOUR_WX_APPID,uni-app AppID → __UNI__YOURAPPID
  - 内网后端地址 → admin.iotlcm.example.com
  - 应用标题与 unibest 模板 README 重写(保留上游致谢与 MIT 声明)
- server/:GoFrame 用户端服务(基于 XiuAdmin,Apache-2.0)
  - module xiuadmin → git.5iot.com/iotlcm-public/iotlcm-app(360 文件)
  - 支付回调地址 → app.iotlcm.example.com,商户名与应用名泛化
  - 真实手机号 → 合法 11 位编造号(保留号段前 3 位 + 后 4 位)
  - 依赖号码尾部的断言同步更新
  - 补 server/LICENSE(Apache-2.0)
- 移除内部资产:CI 触发器
- 补根 README,LF 行尾 + .gitattributes

已知:TestSysDept_RefreshDeptAncestors 在源仓同一提交上同样失败,属既有缺陷。
2026-10-26 14:01:25 +08:00

389 lines
23 KiB
Go

package model
import (
"git.5iot.com/iotlcm-public/iotlcm-app/internal/model/request"
"github.com/gogf/gf/v2/os/gtime"
)
type AppCardQueryParam struct {
TenantId string `json:"tenantId" dc:"租户ID"`
CardValue string `json:"cardValue" v:"required#请输入ICCID、MSISDN、IMSI或IMEI" dc:"卡号标识"`
}
type AppCardRecognitionModel struct {
Code string `json:"code" dc:"识别业务码"`
Message string `json:"message" dc:"识别结果提示"`
CardType string `json:"cardType" dc:"卡号类型"`
CardValue string `json:"cardValue" dc:"识别到的ICCID"`
Confidence float64 `json:"confidence" dc:"模型置信度"`
Candidates []string `json:"candidates" dc:"候选卡号"`
Card *AppCardModel `json:"card,omitempty" dc:"卡片查询结果"`
}
type AppCardListParam struct {
request.PageInfo
CardValue string `json:"cardValue" dc:"卡号标识"`
Status string `json:"status" dc:"状态分类:all/normal/low-flow/expiring/error"`
CategoryCode string `json:"categoryCode" dc:"套餐分类编码"`
IncludeTotal *bool `json:"includeTotal" dc:"是否返回精确总数"`
}
type AppCardDetailParam struct {
CardValue string `json:"cardValue" v:"required#请输入ICCID、MSISDN、IMSI或IMEI" dc:"卡号标识"`
}
type AppCardBindParam struct {
TenantId string `json:"tenantId" dc:"租户ID"`
CardValue string `json:"cardValue" v:"required#请输入ICCID、MSISDN、IMSI或IMEI" dc:"卡号标识"`
Remark string `json:"remark" dc:"备注"`
}
type AppCardRestartParam struct {
CardValue string `json:"cardValue" v:"required#请输入ICCID、MSISDN、IMSI或IMEI" dc:"卡号标识"`
Remark string `json:"remark" dc:"备注"`
}
type AppCardLifecycleParam struct {
CardValue string `json:"cardValue" dc:"单张卡号标识"`
CardValues []string `json:"cardValues" dc:"批量卡号标识列表"`
Operation string `json:"operation" v:"required#请选择卡片操作" dc:"操作类型:stop/start/restart"`
Remark string `json:"remark" dc:"备注"`
}
type AppCardLifecycleStatusParam struct {
BatchNo string `json:"batchNo" v:"required#批次号不能为空" dc:"批次编号"`
}
type AppCardRenewPrepareParam struct {
CardValue string `json:"cardValue" v:"required#请输入ICCID、MSISDN、IMSI或IMEI" dc:"卡号标识"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
SubscriptionNo string `json:"subscriptionNo" dc:"订购记录编号"`
}
type AppCardRenewBatchPrepareParam struct {
CardValues []string `json:"cardValues" v:"required#请输入需要续费的卡" dc:"卡号标识列表"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
}
type AppCardRenewBatchItemParam struct {
CardValue string `json:"cardValue" dc:"卡号标识"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
SubscriptionNo string `json:"subscriptionNo" dc:"订购记录编号"`
DurationMonths int `json:"durationMonths" dc:"续费时长(月)"`
DurationYears int `json:"durationYears" dc:"续费时长(年)"`
}
type AppCardRenewSubmitParam struct {
CardValue string `json:"cardValue" v:"required#请输入ICCID、MSISDN、IMSI或IMEI" dc:"卡号标识"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
SubscriptionNo string `json:"subscriptionNo" dc:"订购记录编号"`
DurationMonths int `json:"durationMonths" dc:"续费时长(月,兼容字段)"`
DurationYears int `json:"durationYears" dc:"续费时长(年)"`
BuyerNote string `json:"buyerNote" dc:"买家备注"`
}
type AppCardRenewBatchSubmitParam struct {
CardValues []string `json:"cardValues" dc:"卡号标识列表"`
BatchNo string `json:"batchNo" dc:"预处理批次号"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
DurationMonths int `json:"durationMonths" dc:"续费时长(月,兼容字段)"`
DurationYears int `json:"durationYears" dc:"续费时长(年)"`
Items []*AppCardRenewBatchItemParam `json:"items" dc:"逐卡续费明细"`
BuyerNote string `json:"buyerNote" dc:"买家备注"`
}
type AppCardAllocateTargetListParam struct {
request.PageInfo
Keyword string `json:"keyword" dc:"目标客户名称或编码"`
}
type AppCardAllocateBatchPrepareParam struct {
CardValues []string `json:"cardValues" v:"required#请选择需要划拨的卡" dc:"卡号标识列表"`
TargetDeptId int64 `json:"targetDeptId" v:"required|min:1#请选择划拨目标客户|请选择划拨目标客户" dc:"目标客户部门ID"`
}
type AppCardAllocateBatchSubmitParam struct {
CardValues []string `json:"cardValues" dc:"卡号标识列表"`
BatchNo string `json:"batchNo" v:"required#预处理批次号不能为空" dc:"预处理批次号"`
TargetDeptId int64 `json:"targetDeptId" dc:"目标客户部门ID"`
Remark string `json:"remark" dc:"划拨备注"`
}
type AppCardChangePrepareParam struct {
CardValues []string `json:"cardValues" v:"required#请选择需要变更套餐的卡" dc:"卡号标识列表"`
NewPackageCode string `json:"newPackageCode" dc:"目标套餐编码"`
TargetPackageCode string `json:"targetPackageCode" dc:"目标套餐编码兼容字段"`
}
type AppCardChangeSubmitParam struct {
CardValues []string `json:"cardValues" dc:"卡号标识列表"`
BatchNo string `json:"batchNo" v:"required#预处理批次号不能为空" dc:"预处理批次号"`
NewPackageCode string `json:"newPackageCode" v:"required#请选择目标套餐" dc:"目标套餐编码"`
DurationMonths int `json:"durationMonths" v:"required|min:1#请选择套餐时长|套餐时长必须大于0" dc:"套餐时长(月)"`
BuyerNote string `json:"buyerNote" dc:"买家备注"`
Remark string `json:"remark" dc:"备注"`
}
type AppPackageListParam struct {
request.PageInfo
Keyword string `json:"keyword" dc:"套餐名称、分类、卡号或备注"`
CardValue string `json:"cardValue" dc:"卡号标识"`
SubscriptionNo string `json:"subscriptionNo" dc:"订购记录编号"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
Status string `json:"status" dc:"状态分类:all/active/expiring/expired/pending/addon"`
CategoryCode string `json:"categoryCode" dc:"套餐分类编码"`
}
type AppPackagePublicDetailParam struct {
TenantId string `json:"tenantId" dc:"租户ID"`
CardValue string `json:"cardValue" v:"required#请输入ICCID、MSISDN、IMSI或IMEI" dc:"卡号标识"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
SubscriptionNo string `json:"subscriptionNo" dc:"订购记录编号"`
}
type AppCardModel struct {
Id int64 `json:"-" dc:"主键ID"`
Iccid string `json:"iccid" dc:"ICCID"`
Msisdn string `json:"msisdn" dc:"MSISDN/卡号"`
Imsi string `json:"imsi" dc:"IMSI"`
Imei string `json:"imei" dc:"IMEI"`
RegionCode string `json:"regionCode" dc:"归属地"`
DeptId int64 `json:"-" dc:"渠道客户ID"`
DeptName string `json:"deptName" dc:"当前归属客户名称"`
DeptKey string `json:"-" dc:"当前归属客户编码"`
CurrentPackageCode string `json:"currentPackageCode" dc:"当前套餐编号"`
PackageName string `json:"packageName" dc:"当前套餐名称"`
PackageType int `json:"packageType" dc:"套餐类型"`
CategoryCode string `json:"categoryCode" dc:"套餐分类编码"`
CategoryName string `json:"categoryName" dc:"套餐分类名称"`
PackageStatus int `json:"packageStatus" dc:"套餐状态"`
AccessType int `json:"-" dc:"接入方式"`
BossCardStatus int `json:"bossCardStatus" dc:"运营商卡状态"`
AbnormalReason string `json:"abnormalReason,omitempty" dc:"异常原因摘要"`
AbnormalReasons []string `json:"abnormalReasons,omitempty" dc:"异常原因列表"`
CardType int `json:"cardType" dc:"卡类型"`
NetModel int `json:"netModel" dc:"网络类型"`
OnlineStatus string `json:"onlineStatus,omitempty" dc:"会话在线状态"`
ApnName string `json:"apnName,omitempty" dc:"APN名称"`
ApnId string `json:"apnId,omitempty" dc:"APN ID"`
Rat string `json:"rat,omitempty" dc:"接入方式"`
Ipv4 string `json:"ipv4,omitempty" dc:"IPv4"`
Ipv6 string `json:"ipv6,omitempty" dc:"IPv6"`
Ipv6Prefix string `json:"ipv6Prefix,omitempty" dc:"IPv6前缀"`
SessionCreateTime string `json:"sessionCreateTime,omitempty" dc:"会话创建时间"`
PackageTotalFlowMb float64 `json:"packageTotalFlowMb" dc:"套餐总流量MB"`
UsedFlowMb float64 `json:"usedFlowMb" dc:"已用流量MB"`
RemainFlowMb float64 `json:"remainFlowMb" dc:"剩余流量MB"`
UsedFlowPercent float64 `json:"usedFlowPercent" dc:"流量使用百分比"`
YesterdayFlowStatDate string `json:"yesterdayFlowStatDate,omitempty" dc:"昨日流量统计日期"`
YesterdayDeptUsedFlowMb float64 `json:"yesterdayDeptUsedFlowMb,omitempty" dc:"所属客户昨日总用量MB"`
YesterdayDeptSms int `json:"yesterdayDeptSms,omitempty" dc:"所属客户昨日短信条数"`
YesterdayDeptVoiceMin int `json:"yesterdayDeptVoiceMin,omitempty" dc:"所属客户昨日语音分钟数"`
FlowPkgBeginAt *gtime.Time `json:"flowPkgBeginAt" dc:"套餐生效时间"`
FlowPkgEndAt *gtime.Time `json:"flowPkgEndAt" dc:"套餐到期时间"`
DataServiceStatus int `json:"dataServiceStatus" dc:"数据服务状态"`
PackageTotalSms int `json:"packageTotalSms" dc:"套餐短信总条数"`
UsedSms int `json:"usedSms" dc:"已用短信条数"`
SmsServiceStatus int `json:"smsServiceStatus" dc:"短信服务状态"`
PackageTotalVoice int `json:"packageTotalVoice" dc:"套餐语音总分钟数"`
UsedVoice int `json:"usedVoice" dc:"已用语音分钟数"`
VoiceServiceStatus int `json:"voiceServiceStatus" dc:"语音服务状态"`
RoamServiceStatus int `json:"roamServiceStatus" dc:"国漫服务状态"`
StatusSyncTime *gtime.Time `json:"statusSyncTime" dc:"状态同步时间"`
FlowSyncTime *gtime.Time `json:"flowSyncTime" dc:"流量同步时间"`
ChanKey string `json:"-" dc:"通道编号"`
ChanName string `json:"-" dc:"通道名称"`
ChanAlias string `json:"-" dc:"通道别名"`
Remark string `json:"remark" dc:"备注"`
TenantId string `json:"-" dc:"租户ID"`
TerminalName string `json:"terminalName,omitempty" dc:"终端客户名称"`
IsBound bool `json:"isBound" dc:"是否已绑定当前用户"`
CanBusiness bool `json:"canBusiness" dc:"是否允许办理业务"`
CanAllocate bool `json:"canAllocate" dc:"是否允许划拨"`
OwnerType string `json:"ownerType" dc:"查询归属类型"`
DataSource string `json:"dataSource,omitempty" dc:"数据来源:local/onelink_mock"`
UpstreamProvider string `json:"upstreamProvider,omitempty" dc:"上游服务来源"`
}
type AppPackageModel struct {
Id int64 `json:"id" dc:"订购记录ID"`
SubscriptionNo string `json:"subscriptionNo" dc:"订购记录编号"`
PackageCode string `json:"packageCode" dc:"套餐编码"`
PackageName string `json:"packageName" dc:"套餐名称"`
PackageType int `json:"packageType" dc:"套餐类型"`
PackageTypeName string `json:"packageTypeName" dc:"套餐类型名称"`
CategoryCode string `json:"categoryCode" dc:"套餐分类编码"`
CategoryName string `json:"categoryName" dc:"套餐分类名称"`
Iccid string `json:"iccid" dc:"ICCID"`
Msisdn string `json:"msisdn" dc:"MSISDN/卡号"`
CardId int64 `json:"cardId" dc:"卡片ID"`
CardValue string `json:"cardValue" dc:"卡号标识"`
CardRemark string `json:"cardRemark" dc:"卡片备注"`
TerminalName string `json:"terminalName,omitempty" dc:"终端客户名称"`
BusinessType int `json:"businessType" dc:"业务类型"`
BusinessTypeName string `json:"businessTypeName" dc:"业务类型名称"`
EffectiveStatus int `json:"effectiveStatus" dc:"订购状态"`
Status string `json:"status" dc:"状态名称"`
StatusType string `json:"statusType" dc:"状态样式"`
FilterValue string `json:"filterValue" dc:"筛选值"`
EffectiveTime *gtime.Time `json:"effectiveTime" dc:"生效时间"`
ExpireTime *gtime.Time `json:"expireTime" dc:"到期时间"`
ValidText string `json:"validText" dc:"有效期文本"`
EffectText string `json:"effectText" dc:"生效说明"`
FlowMb float64 `json:"flowMb" dc:"套餐流量MB"`
FlowText string `json:"flowText" dc:"套餐流量文本"`
OwnerType string `json:"ownerType" dc:"查询归属类型"`
CanBusiness bool `json:"canBusiness" dc:"是否允许办理业务"`
}
type AppCardRestartModel struct {
BatchNo string `json:"batchNo" dc:"批次编号"`
BatchType int `json:"batchType" dc:"批次类型"`
Status string `json:"status" dc:"提交状态"`
Card *AppCardModel `json:"card" dc:"卡信息"`
}
type AppCardLifecycleModel struct {
BatchNo string `json:"batchNo" dc:"批次编号"`
BatchType int `json:"batchType" dc:"批次类型"`
Operation string `json:"operation" dc:"操作类型"`
Status string `json:"status" dc:"处理状态"`
Quantity int `json:"quantity" dc:"卡数量"`
SuccessCount int `json:"successCount" dc:"成功数量"`
FailCount int `json:"failCount" dc:"失败数量"`
FailReason string `json:"failReason,omitempty" dc:"失败原因"`
Cards []*AppCardModel `json:"cards" dc:"卡信息"`
}
type AppRenewOptionModel struct {
DurationMonths int `json:"durationMonths" dc:"实际续费时长(月,兼容字段)"`
ActualDurationMonths int `json:"actualDurationMonths" dc:"实际续费时长(月)"`
DurationYears int `json:"durationYears" dc:"续费时长(年)"`
DurationValue int `json:"durationValue" dc:"续费时长显示值"`
DurationUnit string `json:"durationUnit" dc:"续费时长单位"`
DurationUnitText string `json:"durationUnitText" dc:"续费时长单位文本"`
Label string `json:"label" dc:"展示标签"`
UnitPrice float64 `json:"unitPrice" dc:"单年价格"`
TotalAmount float64 `json:"totalAmount" dc:"总金额"`
PriceText string `json:"priceText" dc:"总金额文本"`
ExpireAfter *gtime.Time `json:"expireAfter" dc:"续费后到期时间"`
Recommended bool `json:"recommended" dc:"是否推荐"`
}
type AppRenewPackageOptionModel struct {
Package *AppPackageModel `json:"package" dc:"续费目标套餐"`
PackageCode string `json:"packageCode" dc:"续费目标套餐编码"`
PackageName string `json:"packageName" dc:"续费目标套餐名称"`
RenewUnitPrice float64 `json:"renewUnitPrice" dc:"续费单年价格"`
UnitPrice float64 `json:"unitPrice" dc:"续费单年价格兼容字段"`
PriceSource string `json:"priceSource" dc:"价格来源"`
PriceText string `json:"priceText" dc:"续费单年价格文本"`
RenewableDurationOptions []int `json:"renewableDurationOptions" dc:"可续费年限"`
Options []*AppRenewOptionModel `json:"options" dc:"续费档位"`
}
type AppCardRenewPrepareModel struct {
BatchNo string `json:"batchNo" dc:"预处理批次号"`
BatchType int `json:"batchType" dc:"批次类型"`
Card *AppCardModel `json:"card" dc:"卡信息"`
Cards []*AppCardModel `json:"cards" dc:"批量续费卡列表"`
Quantity int `json:"quantity" dc:"续费卡数量"`
CurrentPackage *AppPackageModel `json:"currentPackage" dc:"当前套餐"`
Package *AppPackageModel `json:"package" dc:"选中的续费目标套餐"`
RenewablePackageCodes []string `json:"renewablePackageCodes" dc:"可续费套餐编码列表"`
RenewablePackages []*AppRenewPackageOptionModel `json:"renewablePackages" dc:"可续费套餐列表"`
Options []*AppRenewOptionModel `json:"options" dc:"续费档位"`
PriceSource string `json:"priceSource" dc:"价格来源"`
UnitPrice float64 `json:"unitPrice" dc:"单年价格"`
EffectiveRule string `json:"effectiveRule" dc:"生效规则"`
RecommendIndex int `json:"recommendIndex" dc:"推荐档位下标"`
}
type AppCardRenewSubmitModel struct {
BatchNo string `json:"batchNo" dc:"续费批次号"`
BatchType int `json:"batchType" dc:"批次类型"`
OrderId int64 `json:"orderId" dc:"订单ID"`
OrderSn string `json:"orderSn" dc:"订单编号"`
TotalAmount float64 `json:"totalAmount" dc:"订单总金额"`
PriceText string `json:"priceText" dc:"订单金额文本"`
Quantity int `json:"quantity" dc:"续费卡数量"`
OrderStatus int `json:"orderStatus" dc:"订单状态"`
PayStatus int `json:"payStatus" dc:"支付状态"`
Status string `json:"status" dc:"提交状态"`
EffectiveRule string `json:"effectiveRule" dc:"生效规则"`
Card *AppCardModel `json:"card" dc:"卡信息"`
Cards []*AppCardModel `json:"cards" dc:"批量续费卡列表"`
CurrentPackage *AppPackageModel `json:"currentPackage" dc:"当前套餐"`
Package *AppPackageModel `json:"package" dc:"续费目标套餐"`
Option *AppRenewOptionModel `json:"option" dc:"续费档位"`
}
type AppCardAllocateTargetModel struct {
DeptId int64 `json:"deptId" dc:"目标客户ID"`
ParentId int64 `json:"parentId" dc:"上级客户ID"`
DeptKey string `json:"deptKey" dc:"客户编码"`
DeptName string `json:"deptName" dc:"客户名称"`
DeptCategory string `json:"deptCategory" dc:"客户类别"`
TargetScope string `json:"targetScope" dc:"目标范围:self/direct_child"`
TargetScopeName string `json:"targetScopeName" dc:"目标范围名称"`
Label string `json:"label" dc:"展示名称"`
}
type AppCardAllocateBatchDetailModel struct {
RowNo int `json:"rowNo" dc:"源文件行号"`
ItemId string `json:"itemId" dc:"卡号"`
Status string `json:"status" dc:"处理状态"`
ErrorReason string `json:"errorReason,omitempty" dc:"异常原因"`
}
type AppCardAllocateBatchModel struct {
BatchNo string `json:"batchNo" dc:"划拨批次号"`
SourceBatchNo string `json:"sourceBatchNo" dc:"来源批次号"`
BatchType int `json:"batchType" dc:"批次类型"`
Quantity int `json:"quantity" dc:"划拨卡数量"`
TotalCount int `json:"totalCount" dc:"总数量"`
ValidCount int `json:"validCount" dc:"有效数量"`
FailCount int `json:"failCount" dc:"失败数量"`
FailReason string `json:"failReason,omitempty" dc:"失败原因"`
Target *AppCardAllocateTargetModel `json:"target" dc:"目标客户"`
Cards []*AppCardModel `json:"cards" dc:"划拨卡列表"`
Details []*AppCardAllocateBatchDetailModel `json:"details" dc:"逐卡校验结果"`
Status string `json:"status" dc:"处理状态"`
}
type AppCardChangePackageOptionModel struct {
Package *AppPackageModel `json:"package" dc:"目标套餐"`
Options []*AppRenewOptionModel `json:"options" dc:"可选时长和金额"`
UnitPrice float64 `json:"unitPrice" dc:"单月价格"`
PriceText string `json:"priceText" dc:"单月价格文本"`
}
type AppCardChangePrepareModel struct {
BatchNo string `json:"batchNo" dc:"预处理批次号"`
BatchType int `json:"batchType" dc:"批次类型"`
Quantity int `json:"quantity" dc:"变更卡数量"`
Cards []*AppCardModel `json:"cards" dc:"卡列表"`
CurrentPackage *AppPackageModel `json:"currentPackage" dc:"当前套餐"`
TargetPackages []*AppCardChangePackageOptionModel `json:"targetPackages" dc:"可变更套餐列表"`
EffectiveRule string `json:"effectiveRule" dc:"生效规则"`
}
type AppCardChangeSubmitModel struct {
BatchNo string `json:"batchNo" dc:"变更批次号"`
BatchType int `json:"batchType" dc:"批次类型"`
OrderId int64 `json:"orderId" dc:"订单ID"`
OrderSn string `json:"orderSn" dc:"订单编号"`
TotalAmount float64 `json:"totalAmount" dc:"订单总金额"`
PriceText string `json:"priceText" dc:"订单金额文本"`
Quantity int `json:"quantity" dc:"变更卡数量"`
OrderStatus int `json:"orderStatus" dc:"订单状态"`
PayStatus int `json:"payStatus" dc:"支付状态"`
Status string `json:"status" dc:"处理状态"`
EffectiveRule string `json:"effectiveRule" dc:"生效规则"`
Cards []*AppCardModel `json:"cards" dc:"卡列表"`
CurrentPackage *AppPackageModel `json:"currentPackage" dc:"原套餐"`
NewPackage *AppPackageModel `json:"newPackage" dc:"目标套餐"`
Option *AppRenewOptionModel `json:"option" dc:"变更档位"`
}