feat: 添加获取全局选项接口,支持动态状态和曲种选择
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"quyun/v2/app/errorx"
|
||||
common_dto "quyun/v2/app/http/v1/dto"
|
||||
"quyun/v2/app/requests"
|
||||
"quyun/v2/database/fields"
|
||||
"quyun/v2/database/models"
|
||||
"quyun/v2/pkg/consts"
|
||||
@@ -22,6 +23,21 @@ type common struct {
|
||||
storage *storage.Storage
|
||||
}
|
||||
|
||||
func (s *common) Options(ctx context.Context) (*common_dto.OptionsResponse, error) {
|
||||
return &common_dto.OptionsResponse{
|
||||
ContentStatus: consts.ContentStatusItems(),
|
||||
ContentGenre: []requests.KV{
|
||||
requests.NewKV("Jingju", "京剧"),
|
||||
requests.NewKV("Kunqu", "昆曲"),
|
||||
requests.NewKV("Yueju", "越剧"),
|
||||
requests.NewKV("Yuju", "豫剧"),
|
||||
requests.NewKV("Huangmeixi", "黄梅戏"),
|
||||
requests.NewKV("Pingju", "评剧"),
|
||||
requests.NewKV("Qinqiang", "秦腔"),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *common) Upload(ctx context.Context, userID int64, file *multipart.FileHeader, typeArg string) (*common_dto.UploadResult, error) {
|
||||
// Mock Upload to S3/MinIO (Here we just generate key, actual upload handling via direct upload or stream is better)
|
||||
// But this Upload endpoint accepts file. So we save it.
|
||||
|
||||
Reference in New Issue
Block a user