feat(subscription): implement FilterList method for subscription queries and update related logic

This commit is contained in:
Chang lue Tsen
2025-09-04 10:20:35 -04:00
parent 8f11380e7a
commit 0636a4bddf
7 changed files with 156 additions and 103 deletions
@@ -21,7 +21,7 @@ type GetServerConfigLogic struct {
svcCtx *svc.ServiceContext
}
// Get server config
// NewGetServerConfigLogic Get server config
func NewGetServerConfigLogic(ctx *gin.Context, svcCtx *svc.ServiceContext) *GetServerConfigLogic {
return &GetServerConfigLogic{
Logger: logger.WithContext(ctx.Request.Context()),
@@ -7,6 +7,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/perfect-panel/server/internal/model/node"
"github.com/perfect-panel/server/internal/model/subscribe"
"github.com/perfect-panel/server/internal/svc"
"github.com/perfect-panel/server/internal/types"
@@ -73,7 +74,12 @@ func (l *GetServerUserListLogic) GetServerUserList(req *types.GetServerUserListR
}
}
subs, err := l.svcCtx.SubscribeModel.QuerySubscribeIdsByNodeIdAndNodeTag(l.ctx, nodeIds, nodeTag)
_, subs, err := l.svcCtx.SubscribeModel.FilterList(l.ctx, &subscribe.FilterParams{
Page: 1,
Size: 9999,
Node: nodeIds,
Tags: nodeTag,
})
if err != nil {
l.Errorw("QuerySubscribeIdsByServerIdAndServerGroupId error", logger.Field("error", err.Error()))
return nil, err