feat: 管理员列表接口直接返回模板数据
移除调试打印语句
This commit is contained in:
@@ -144,8 +144,38 @@ func (s *flowUserService) Get(ctx context.Context, req *flowDto.GetFlowUserReq)
|
||||
}
|
||||
|
||||
func (s *flowUserService) List(ctx context.Context, req *flowDto.ListFlowUserReq) (res *flowDto.ListFlowRes, err error) {
|
||||
admin, err := IsAdmin(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if admin {
|
||||
var t int
|
||||
var l []*entity.FlowTemplate
|
||||
l, t, err = flowDao.FlowTemplateDao.List(ctx, &flowDto.ListFlowTemplateReq{
|
||||
Keyword: req.Keyword,
|
||||
Page: req.Page,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
r := &flowDto.ListFlowTemplateRes{
|
||||
Total: t,
|
||||
}
|
||||
err = gconv.Struct(l, &r.List)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = &flowDto.ListFlowRes{
|
||||
ListFlowUserRes: nil,
|
||||
ListFlowTemplateRes: r,
|
||||
IsAdmin: admin,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
l, t, err := flowDao.FlowTemplateDao.List(ctx, &flowDto.ListFlowTemplateReq{
|
||||
var t int
|
||||
var l []*entity.FlowTemplate
|
||||
l, t, err = flowDao.FlowTemplateDao.List(ctx, &flowDto.ListFlowTemplateReq{
|
||||
Keyword: req.Keyword,
|
||||
Page: req.Page,
|
||||
})
|
||||
@@ -171,10 +201,6 @@ func (s *flowUserService) List(ctx context.Context, req *flowDto.ListFlowUserReq
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
admin, err := IsAdmin(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = &flowDto.ListFlowRes{
|
||||
ListFlowUserRes: re,
|
||||
ListFlowTemplateRes: r,
|
||||
|
||||
@@ -478,7 +478,6 @@ func ImageModelLambda(ctx context.Context, input any) (any, error) {
|
||||
UserFiles: nodeInput.Global.FileUrl,
|
||||
SessionId: nodeInput.Global.SessionId,
|
||||
}
|
||||
fmt.Println(req)
|
||||
msg, err := ComposeMessages(ctx, &req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user