修改上下文参数传递,实现门店登录

This commit is contained in:
2025-06-04 17:30:08 +08:00
parent caf3d42fe5
commit 5f55223cd5
19 changed files with 237 additions and 13 deletions

View File

@ -2,13 +2,18 @@ package merchantAdmin
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/merchantAdmin/v1"
)
func (c *ControllerV1) MerchantAdminInfo(ctx context.Context, req *v1.MerchantAdminInfoReq) (res *v1.MerchantAdminInfoRes, err error) {
return nil, gerror.NewCode(gcode.CodeNotImplemented)
merchantAdminId := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
info, err := service.MerchantAdmin().Info(ctx, &model.MerchantAdminInfoIn{MerchantAdminId: merchantAdminId})
if err != nil {
return nil, err
}
return &v1.MerchantAdminInfoRes{Name: info.Name}, nil
}