fix(01-01): 统一实名状态常量(CRITICAL-01 核心)
- polling_handler.go: parseRealnameStatus 不再返回硬编码 2,改为 constants.RealNameStatusVerified(=1) - polling_handler.go: isFirstRealname 判断改用常量比较,不再使用 == 2 - polling_handler.go: HandleProtectConsistencyCheck 注释更正为 real_name_status=1 - iot_card.go: RealNameStatus gorm comment 统一为 0-未实名 1-已实名(去除行业卡说明) - asset_dto.go: RealNameStatus description 更正为 0未实名 1已实名(去除错误的 1实名中 2已实名) - scheduler.go: getCardCondition 改用常量替代硬编码 0/1/2 判断 - iot_card/service.go: parseGatewayRealnameStatus 注释更正,返回值改为常量
This commit is contained in:
@@ -629,10 +629,10 @@ func (s *Scheduler) matchConfigConditions(cfg *model.PollingConfig, card *model.
|
||||
// getCardCondition 获取卡的状态条件
|
||||
func (s *Scheduler) getCardCondition(card *model.IotCard) string {
|
||||
// 根据卡的实名状态和激活状态确定条件
|
||||
if card.RealNameStatus == 0 || card.RealNameStatus == 1 {
|
||||
if card.RealNameStatus != constants.RealNameStatusVerified {
|
||||
return "not_real_name" // 未实名
|
||||
}
|
||||
if card.RealNameStatus == 2 {
|
||||
if card.RealNameStatus == constants.RealNameStatusVerified {
|
||||
if card.NetworkStatus == 1 {
|
||||
return "activated" // 已激活
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user