22 lines
540 B
Go
22 lines
540 B
Go
package controller
|
|
|
|
import (
|
|
"context"
|
|
|
|
"video-factory/shortdrama/model/dto"
|
|
"video-factory/shortdrama/service"
|
|
)
|
|
|
|
type config struct{}
|
|
|
|
var Config = new(config)
|
|
|
|
func (c *config) Get(ctx context.Context, req *dto.GetModelConfigReq) (res *dto.GetModelConfigRes, err error) {
|
|
cfg := service.ConfigService.Get(ctx)
|
|
return &dto.GetModelConfigRes{ModelConfig: cfg}, nil
|
|
}
|
|
|
|
func (c *config) Save(ctx context.Context, req *dto.SaveModelConfigReq) (res *struct{}, err error) {
|
|
return nil, service.ConfigService.Save(ctx, &req.ModelConfig)
|
|
}
|