feat: 实现运营商模块重构,添加冗余字段优化查询性能
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m16s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m16s
主要变更: - 新增 Carrier CRUD API(创建、列表、详情、更新、删除、状态更新) - IotCard/IotCardImportTask 添加 carrier_type/carrier_name 冗余字段 - 移除 Carrier 表的 channel_name/channel_code 字段 - 查询时直接使用冗余字段,避免 JOIN Carrier 表 - 添加数据库迁移脚本(000021-000023) - 添加单元测试和集成测试 - 同步更新 OpenAPI 文档和 specs
This commit is contained in:
@@ -88,6 +88,14 @@ const (
|
||||
StatusEnabled = 1 // 启用
|
||||
)
|
||||
|
||||
// 运营商类型常量
|
||||
const (
|
||||
CarrierTypeCMCC = "CMCC" // 中国移动
|
||||
CarrierTypeCUCC = "CUCC" // 中国联通
|
||||
CarrierTypeCTCC = "CTCC" // 中国电信
|
||||
CarrierTypeCBN = "CBN" // 中国广电
|
||||
)
|
||||
|
||||
// 订单状态常量
|
||||
const (
|
||||
OrderStatusPending = "pending" // 待支付
|
||||
|
||||
@@ -82,6 +82,10 @@ const (
|
||||
CodeStorageInvalidPurpose = 1094 // 不支持的文件用途
|
||||
CodeStorageInvalidFileType = 1095 // 不支持的文件类型
|
||||
|
||||
// 运营商相关错误 (1100-1109)
|
||||
CodeCarrierNotFound = 1100 // 运营商不存在
|
||||
CodeCarrierCodeExists = 1101 // 运营商编码已存在
|
||||
|
||||
// 服务端错误 (2000-2999) -> 5xx HTTP 状态码
|
||||
CodeInternalError = 2001 // 内部服务器错误
|
||||
CodeDatabaseError = 2002 // 数据库错误
|
||||
@@ -156,6 +160,8 @@ var allErrorCodes = []int{
|
||||
CodeStorageFileNotFound,
|
||||
CodeStorageInvalidPurpose,
|
||||
CodeStorageInvalidFileType,
|
||||
CodeCarrierNotFound,
|
||||
CodeCarrierCodeExists,
|
||||
CodeInternalError,
|
||||
CodeDatabaseError,
|
||||
CodeRedisError,
|
||||
@@ -232,6 +238,8 @@ var errorMessages = map[int]string{
|
||||
CodeStorageFileNotFound: "文件不存在",
|
||||
CodeStorageInvalidPurpose: "不支持的文件用途",
|
||||
CodeStorageInvalidFileType: "不支持的文件类型",
|
||||
CodeCarrierNotFound: "运营商不存在",
|
||||
CodeCarrierCodeExists: "运营商编码已存在",
|
||||
CodeInvalidCredentials: "用户名或密码错误",
|
||||
CodeAccountLocked: "账号已锁定",
|
||||
CodePasswordExpired: "密码已过期",
|
||||
|
||||
Reference in New Issue
Block a user