1
This commit is contained in:
@@ -3,8 +3,8 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"video-factory/common"
|
||||
|
||||
"video-factory/shortdrama/middleware"
|
||||
"video-factory/shortdrama/model/dto"
|
||||
"video-factory/shortdrama/service"
|
||||
|
||||
@@ -17,9 +17,9 @@ var UserModelConfig = new(userModelConfig)
|
||||
|
||||
func (c *userModelConfig) GetUserConfig(ctx context.Context, req *dto.GetUserModelConfigReq) (res *dto.GetUserModelConfigRes, err error) {
|
||||
r := g.RequestFromCtx(ctx)
|
||||
userId := middleware.GetUserId(r)
|
||||
userId := common.GetUserId(r)
|
||||
if userId <= 0 {
|
||||
return nil, fmt.Errorf("未登录")
|
||||
return nil, fmt.Errorf("not logged in")
|
||||
}
|
||||
cfg := service.UserModelConfigService.GetUserConfig(ctx, userId, req.ModelType)
|
||||
return &dto.GetUserModelConfigRes{UserModelConfig: cfg}, nil
|
||||
@@ -27,16 +27,16 @@ func (c *userModelConfig) GetUserConfig(ctx context.Context, req *dto.GetUserMod
|
||||
|
||||
func (c *userModelConfig) SaveUserConfig(ctx context.Context, req *dto.SaveUserModelConfigReq) (res *struct{}, err error) {
|
||||
r := g.RequestFromCtx(ctx)
|
||||
userId := middleware.GetUserId(r)
|
||||
userId := common.GetUserId(r)
|
||||
if userId <= 0 {
|
||||
return nil, fmt.Errorf("未登录")
|
||||
return nil, fmt.Errorf("not logged in")
|
||||
}
|
||||
return nil, service.UserModelConfigService.SaveUserConfigs(ctx, userId, req.Configs)
|
||||
}
|
||||
|
||||
func (c *userModelConfig) GetUserModelList(ctx context.Context, req *dto.GetUserModelListReq) (res *dto.GetUserModelListRes, err error) {
|
||||
r := g.RequestFromCtx(ctx)
|
||||
userId := middleware.GetUserId(r)
|
||||
userId := common.GetUserId(r)
|
||||
if req.Page <= 0 {
|
||||
req.Page = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user