调整商户注册逻辑
This commit is contained in:
@ -15,5 +15,5 @@ func (c *ControllerV1) MerchantAdminInfo(ctx context.Context, req *v1.MerchantAd
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.MerchantAdminInfoRes{Name: info.Name}, nil
|
||||
return &v1.MerchantAdminInfoRes{Username: info.Username, MerchantId: info.MerchantId, StoreId: info.StoreId}, nil
|
||||
}
|
||||
|
||||
@ -2,13 +2,23 @@ package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/user/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) {
|
||||
return nil, gerror.NewCode(gcode.CodeNotImplemented)
|
||||
fromCtx := g.RequestFromCtx(ctx)
|
||||
operatorId := fromCtx.Get("operatorId").Int64()
|
||||
operatorRole := fromCtx.Get("role").String()
|
||||
out, err := service.User().List(ctx, &model.UserListIn{Page: req.Page, Size: req.Size, OperatorId: operatorId, OperatorRole: operatorRole})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ListRes{
|
||||
List: out.List,
|
||||
Total: out.Total,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user