1、新增自定义用户私人价格2、优化api服务鉴权缓存3、新增管理员端对公充值
This commit is contained in:
53
apps/admin/internal/logic/user/getuserlistlogic.go
Normal file
53
apps/admin/internal/logic/user/getuserlistlogic.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"tianyuan-api/apps/user/user"
|
||||
|
||||
"tianyuan-api/apps/admin/internal/svc"
|
||||
"tianyuan-api/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetUserListLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserListLogic {
|
||||
return &GetUserListLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetUserListLogic) GetUserList(req *types.UserListRequest) (resp *types.UserListResponse, err error) {
|
||||
list, err := l.svcCtx.UserRpc.GetUserList(l.ctx, &user.UserListRequest{
|
||||
Page: req.Page,
|
||||
PageSize: req.PageSize,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var listResp []types.UserItem
|
||||
for _, item := range list.List {
|
||||
listResp = append(listResp, types.UserItem{
|
||||
Id: item.Id,
|
||||
Username: item.Username,
|
||||
Phone: item.Phone,
|
||||
Disable: item.Disable,
|
||||
Balance: item.Balance,
|
||||
QuotaExceeded: item.QuotaExceeded,
|
||||
CreatedAt: item.CreatedAt,
|
||||
UpdatedAt: item.UpdatedAt,
|
||||
})
|
||||
}
|
||||
return &types.UserListResponse{
|
||||
List: listResp,
|
||||
Total: list.Total,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user