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) {
|
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,
|
Keyword: req.Keyword,
|
||||||
Page: req.Page,
|
Page: req.Page,
|
||||||
})
|
})
|
||||||
@@ -171,10 +201,6 @@ func (s *flowUserService) List(ctx context.Context, req *flowDto.ListFlowUserReq
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
admin, err := IsAdmin(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
res = &flowDto.ListFlowRes{
|
res = &flowDto.ListFlowRes{
|
||||||
ListFlowUserRes: re,
|
ListFlowUserRes: re,
|
||||||
ListFlowTemplateRes: r,
|
ListFlowTemplateRes: r,
|
||||||
|
|||||||
@@ -478,7 +478,6 @@ func ImageModelLambda(ctx context.Context, input any) (any, error) {
|
|||||||
UserFiles: nodeInput.Global.FileUrl,
|
UserFiles: nodeInput.Global.FileUrl,
|
||||||
SessionId: nodeInput.Global.SessionId,
|
SessionId: nodeInput.Global.SessionId,
|
||||||
}
|
}
|
||||||
fmt.Println(req)
|
|
||||||
msg, err := ComposeMessages(ctx, &req)
|
msg, err := ComposeMessages(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user