feat: 长文本语音合成
This commit is contained in:
@@ -13,7 +13,7 @@ type CategoryService struct{}
|
||||
|
||||
// GetCategoryList 获取分类列表
|
||||
func (s *CategoryService) GetCategoryList(info radioReq.GetCategoryList) ([]radio.RadioCategory, int64, error) {
|
||||
db := global.DB.Model(&radio.RadioCategory{}).Preload("Icon").Preload("Cover")
|
||||
db := global.DB.Model(&radio.RadioCategory{})
|
||||
var list []radio.RadioCategory
|
||||
var total int64
|
||||
|
||||
@@ -43,9 +43,6 @@ func (s *CategoryService) GetCategoryTree() ([]radio.RadioCategory, error) {
|
||||
// Preload("Icon") 和 Preload("Cover") 用于加载 OSS 信息
|
||||
err := global.DB.Model(&radio.RadioCategory{}).
|
||||
Preload("Channels", "status = ?", 1). // 只加载启用的频道
|
||||
Preload("Channels.Cover"). // 级联加载频道的封面
|
||||
Preload("Icon").
|
||||
Preload("Cover").
|
||||
Order("sort desc").
|
||||
Find(&res).Error
|
||||
return res, err
|
||||
@@ -53,14 +50,14 @@ func (s *CategoryService) GetCategoryTree() ([]radio.RadioCategory, error) {
|
||||
|
||||
func (s *CategoryService) GetAllCategory() ([]radio.RadioCategory, error) {
|
||||
var res []radio.RadioCategory
|
||||
err := global.DB.Find(&res).Preload("Icon").Preload("Cover").Error
|
||||
err := global.DB.Find(&res).Error
|
||||
return res, err
|
||||
}
|
||||
|
||||
// GetCategoryById 获取分类详情
|
||||
func (s *CategoryService) GetCategoryById(id string) (*radio.RadioCategory, error) {
|
||||
var category radio.RadioCategory
|
||||
err := global.DB.Where("id = ?", id).Preload("Icon").Preload("Cover").First(&category).Error
|
||||
err := global.DB.Where("id = ?", id).First(&category).Error
|
||||
return &category, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user