1
This commit is contained in:
@@ -15,25 +15,9 @@ type avatar struct{}
|
||||
var Avatar = new(avatar)
|
||||
|
||||
func (c *avatar) Build(ctx context.Context, req *dto.AvatarBuildReq) (res *dto.AvatarBuildRes, err error) {
|
||||
a, err := service.AvatarService.Build(ctx, common.GetUserId(g.RequestFromCtx(ctx)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dto.AvatarBuildRes{AvatarId: a.Id, Status: a.BuildStatus}, nil
|
||||
return service.AvatarService.Build(ctx, common.GetUserId(g.RequestFromCtx(ctx)))
|
||||
}
|
||||
|
||||
func (c *avatar) Get(ctx context.Context, req *dto.AvatarGetReq) (res *dto.AvatarGetRes, err error) {
|
||||
a, err := service.AvatarService.Get(ctx, common.GetUserId(g.RequestFromCtx(ctx)))
|
||||
if err != nil || a == nil {
|
||||
return &dto.AvatarGetRes{}, nil
|
||||
}
|
||||
return &dto.AvatarGetRes{
|
||||
FaceTemplateId: a.FaceTemplateId,
|
||||
BodyTemplateId: a.BodyTemplateId,
|
||||
SkinToneIndex: a.SkinToneIndex,
|
||||
GlbUrl: a.GlbUrl,
|
||||
FramesUrl: a.FramesUrl,
|
||||
BuildStatus: a.BuildStatus,
|
||||
Error: a.Error,
|
||||
}, nil
|
||||
return service.AvatarService.Get(ctx, common.GetUserId(g.RequestFromCtx(ctx)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user