api-header
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m23s
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m23s
This commit is contained in:
parent
507ee16a30
commit
6f6943f295
@ -7,6 +7,8 @@ import (
|
||||
"github.com/perfect-panel/server/internal/model/subscribe"
|
||||
"github.com/perfect-panel/server/internal/svc"
|
||||
"github.com/perfect-panel/server/internal/types"
|
||||
"github.com/perfect-panel/server/pkg/apiversion"
|
||||
"github.com/perfect-panel/server/pkg/constant"
|
||||
"github.com/perfect-panel/server/pkg/logger"
|
||||
"github.com/perfect-panel/server/pkg/tool"
|
||||
"github.com/perfect-panel/server/pkg/xerr"
|
||||
@ -57,6 +59,15 @@ func (l *QuerySubscribeListLogic) QuerySubscribeList(req *types.QuerySubscribeLi
|
||||
}
|
||||
list[i] = sub
|
||||
}
|
||||
|
||||
// 老版本(无 api-header)去掉排序最后一个套餐
|
||||
rawVersion, _ := l.ctx.Value(constant.CtxKeyAPIHeaderRaw).(string)
|
||||
useLatest := apiversion.UseLatest(rawVersion, apiversion.DefaultThreshold)
|
||||
if !useLatest && len(list) > 0 {
|
||||
list = list[:len(list)-1]
|
||||
}
|
||||
|
||||
resp.List = list
|
||||
resp.Total = int64(len(list))
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user