解决 bug
This commit is contained in:
@ -9,9 +9,9 @@ import (
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Detail(ctx context.Context, req *v1.DetailReq) (res *v1.DetailRes, err error) {
|
||||
out, err := service.Store().Detail(ctx, &model.StoreDetailIn{NetbarAccount: req.NetbarAccount})
|
||||
out, err := service.Store().Detail(ctx, &model.StoreDetailIn{StoreId: req.StoreId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.DetailRes{Id: out.Id}, nil
|
||||
return &v1.DetailRes{Id: out.Id, NetbarAccount: out.NetbarAccount}, nil
|
||||
}
|
||||
|
||||
@ -3,14 +3,17 @@ package storeAdmin
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/storeAdmin/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Info(ctx context.Context, req *v1.InfoReq) (res *v1.InfoRes, err error) {
|
||||
g.RequestFromCtx(ctx)
|
||||
return nil, gerror.NewCode(gcode.CodeNotImplemented)
|
||||
storeAdminId := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
|
||||
out, err := service.StoreAdmin().Info(ctx, &model.StoreAdminInfoIn{StoreAdminId: storeAdminId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.InfoRes{Id: out.Id, StoreId: out.StoreId, Username: out.Username, Realname: out.RealName, IsPrimary: out.IsPrimary}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user