fix: 修复订阅列表查询逻辑并更新Dockerfile配置
修复订阅列表查询中服务器组为空时的处理逻辑,避免潜在错误 在getSubscribeListLogic.go中添加服务器数量统计功能 更新Dockerfile添加logs目录拷贝 清理ppanel.yaml配置文件中的合并冲突和冗余配置
This commit is contained in:
parent
e898e6afbe
commit
41423ca666
@ -38,6 +38,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY --from=builder /app/ppanel /app/ppanel
|
COPY --from=builder /app/ppanel /app/ppanel
|
||||||
COPY --from=builder /build/etc /app/etc
|
COPY --from=builder /build/etc /app/etc
|
||||||
|
COPY --from=builder /build/logs /app/logs
|
||||||
|
|
||||||
# Expose the port (optional)
|
# Expose the port (optional)
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|||||||
@ -1,44 +1,5 @@
|
|||||||
Host: 0.0.0.0
|
Host: 0.0.0.0
|
||||||
Port: 8080
|
Port: 8080
|
||||||
<<<<<<< HEAD
|
|
||||||
TLS:
|
|
||||||
Enable: false
|
|
||||||
CertFile: ""
|
|
||||||
KeyFile: ""
|
|
||||||
Debug: true
|
|
||||||
JwtAuth:
|
|
||||||
AccessSecret: 89270267-f1dc-4136-9c9c-dc38c4685d63
|
|
||||||
AccessExpire: 604800
|
|
||||||
Logger:
|
|
||||||
ServiceName: PPanel
|
|
||||||
Mode: file
|
|
||||||
Encoding: json
|
|
||||||
TimeFormat: "2006-01-02 15:04:05.000"
|
|
||||||
Path: logs
|
|
||||||
Level: info
|
|
||||||
MaxContentLength: 0
|
|
||||||
Compress: false
|
|
||||||
Stat: true
|
|
||||||
KeepDays: 0
|
|
||||||
StackCooldownMillis: 100
|
|
||||||
MaxBackups: 0
|
|
||||||
MaxSize: 0
|
|
||||||
Rotation: daily
|
|
||||||
FileTimeFormat: 2006-01-02T15:04:05.000Z07:00
|
|
||||||
MySQL:
|
|
||||||
Addr: ppanel-db:3306
|
|
||||||
Username: ppanel
|
|
||||||
Password: ppanelpassword
|
|
||||||
Dbname: ppanel
|
|
||||||
Config: charset=utf8mb4&parseTime=true&loc=Asia%2FShanghai
|
|
||||||
MaxIdleConns: 10
|
|
||||||
MaxOpenConns: 10
|
|
||||||
SlowThreshold: 1000
|
|
||||||
Redis:
|
|
||||||
Host: redis:6379
|
|
||||||
Pass:
|
|
||||||
DB: 0
|
|
||||||
=======
|
|
||||||
Debug: false
|
Debug: false
|
||||||
JwtAuth:
|
JwtAuth:
|
||||||
AccessSecret: 1234567890
|
AccessSecret: 1234567890
|
||||||
@ -60,7 +21,7 @@ Logger:
|
|||||||
Rotation: daily
|
Rotation: daily
|
||||||
FileTimeFormat: 2025-01-01T00:00:00.000Z00:00
|
FileTimeFormat: 2025-01-01T00:00:00.000Z00:00
|
||||||
MySQL:
|
MySQL:
|
||||||
Addr: 172.245.180.199:3306
|
Addr: ppanel-db:3306
|
||||||
Dbname: ppanel
|
Dbname: ppanel
|
||||||
Username: ppanel
|
Username: ppanel
|
||||||
Password: ppanelpassword
|
Password: ppanelpassword
|
||||||
@ -75,4 +36,3 @@ Redis:
|
|||||||
Administrator:
|
Administrator:
|
||||||
Password: password
|
Password: password
|
||||||
Email: admin@ppanel.dev
|
Email: admin@ppanel.dev
|
||||||
>>>>>>> old
|
|
||||||
|
|||||||
@ -47,6 +47,13 @@ func (l *GetSubscribeListLogic) GetSubscribeList(req *types.GetSubscribeListRequ
|
|||||||
l.Logger.Error("[GetSubscribeListLogic] JSON unmarshal failed: ", logger.Field("error", err.Error()), logger.Field("discount", item.Discount))
|
l.Logger.Error("[GetSubscribeListLogic] JSON unmarshal failed: ", logger.Field("error", err.Error()), logger.Field("discount", item.Discount))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
servers, err := l.svcCtx.ServerModel.FindServerListByGroupIds(l.ctx, sub.ServerGroup)
|
||||||
|
if err != nil {
|
||||||
|
l.Errorw("[QuerySubscribeListLogic] FindServerListByGroupIds error", logger.Field("error", err.Error()))
|
||||||
|
sub.ServerCount = 0
|
||||||
|
} else {
|
||||||
|
sub.ServerCount = int64(len(servers))
|
||||||
|
}
|
||||||
sub.Server = tool.StringToInt64Slice(item.Server)
|
sub.Server = tool.StringToInt64Slice(item.Server)
|
||||||
sub.ServerGroup = tool.StringToInt64Slice(item.ServerGroup)
|
sub.ServerGroup = tool.StringToInt64Slice(item.ServerGroup)
|
||||||
resultList = append(resultList, sub)
|
resultList = append(resultList, sub)
|
||||||
|
|||||||
@ -50,12 +50,17 @@ func (l *QuerySubscribeListLogic) QuerySubscribeList() (resp *types.QuerySubscri
|
|||||||
}
|
}
|
||||||
list[i] = sub
|
list[i] = sub
|
||||||
// 通过服务组查询关联的节点数量
|
// 通过服务组查询关联的节点数量
|
||||||
servers, err := l.svcCtx.ServerModel.FindServerListByGroupIds(l.ctx, sub.ServerGroup)
|
if item.ServerGroup != "" {
|
||||||
if err != nil {
|
groupIds := tool.StringToInt64Slice(item.ServerGroup)
|
||||||
l.Errorw("[QuerySubscribeListLogic] FindServerListByGroupIds error", logger.Field("error", err.Error()))
|
servers, err := l.svcCtx.ServerModel.FindServerListByGroupIds(l.ctx, groupIds)
|
||||||
sub.ServerCount = 0
|
if err != nil {
|
||||||
|
l.Errorw("[QuerySubscribeListLogic] FindServerListByGroupIds error", logger.Field("error", err.Error()))
|
||||||
|
sub.ServerCount = 0
|
||||||
|
} else {
|
||||||
|
sub.ServerCount = int64(len(servers))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sub.ServerCount = int64(len(servers))
|
sub.ServerCount = 0
|
||||||
}
|
}
|
||||||
list[i] = sub
|
list[i] = sub
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user