feat: 订阅列表和免费列表

This commit is contained in:
Blizzard
2026-03-03 17:09:37 +08:00
parent d79beb4663
commit 042c99aa46
21 changed files with 4182 additions and 209 deletions
+1 -1
View File
@@ -70,4 +70,4 @@
## 部署说明 (参考)
项目支持跨平台编译:
- **Windows**: `GOOS=windows GOARCH=amd64 go build -o planting-fun.exe`
- **Linux**: `GOOS=linux GOARCH=amd64 go build -o sundynix-plant`
- **Linux**: `GOOS=linux GOARCH=amd64 go build -o sundynix-radio`
+19
View File
@@ -42,6 +42,25 @@ func (a *CategoryApi) GetCategoryPage(c *gin.Context) {
}, c)
}
// GetCategoryTree 获取分类tree
// @Tags 分类管理
// @Summary 获取分类列表
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response
// @Router /radio/category/tree [get]
func (a *CategoryApi) GetCategoryTree(c *gin.Context) {
list, err := categoryService.GetCategoryTree()
if err != nil {
global.Logger.Error("获取分类列表失败!", zap.Error(err))
response.FailWithMsg(err.Error(), c)
return
}
response.OkWithData(response.ListResult{
List: list,
}, c)
}
// GetCategoryList 获取分类列表
// @Tags 分类管理
// @Summary 获取分类列表
+30
View File
@@ -14,6 +14,36 @@ import (
type ChannelApi struct{}
// GetFreeChannelList 获取免费频道列表
// @Tags 频道管理
// @Summary 获取频道列表
// @Accept application/json
// @Produce application/json
// @Param data body request.GetChannelList true "分页查询"
// @Success 200 {object} response.Response
// @Router /radio/channel/freeList [post]
func (a *ChannelApi) GetFreeChannelList(c *gin.Context) {
var req common.PageInfo
err := c.ShouldBindJSON(&req)
if err != nil {
response.FailWithMsg("参数错误: "+err.Error(), c)
return
}
list, total, err := channelService.GetFreeChannelList(req)
if err != nil {
global.Logger.Error("获取频道列表失败!", zap.Error(err))
response.FailWithMsg(err.Error(), c)
return
}
response.OkWithData(response.PageResult{
List: list,
Total: total,
Page: req.Current,
PageSize: req.PageSize,
}, c)
}
// GetChannelList 获取频道列表
// @Tags 频道管理
// @Summary 获取频道列表
+4 -4
View File
@@ -1,5 +1,5 @@
system:
addr: 8889
addr: 8888
db-type: mysql
router-prefix: ""
enable-captcha: 0
@@ -12,10 +12,10 @@ jwt:
issuer: sundynix
signing-key: 9149f2eb-d517-4a50-a03a-231dbcf0d872
# 早安电台微信小程序
# 电台微信小程序
mini-program:
app-id: wxb463820bf36dd5d6
app-secret: 731784a74c76c6d31fa00bb847af2c7d
app-id: wx52dfc635739a9c19
app-secret: 84c6ddab1f24d0222da57bedb681c81f
# 微信支付
wechat-pay:
+1479 -28
View File
File diff suppressed because it is too large Load Diff
+1479 -27
View File
File diff suppressed because it is too large Load Diff
+993 -27
View File
File diff suppressed because it is too large Load Diff
+9 -8
View File
@@ -8,14 +8,15 @@ import (
// RadioCategory 电台分类表
type RadioCategory struct {
global.BaseModel
Name string `gorm:"size:50" json:"name"` // 分类名称
Description string `gorm:"size:255" json:"description"` // 分类描述
IconId string `gorm:"size:50" json:"iconId"` // 图标OSS ID
Icon *system.Oss `gorm:"foreignKey:IconId" json:"icon"` // 图标OSS
CoverId string `gorm:"size:50" json:"coverId"` // 封面图OSS ID
Cover *system.Oss `gorm:"foreignKey:CoverId" json:"cover"` // 封面图OSS
Sort int `gorm:"default:0" json:"sort"` // 排序
Status int `gorm:"default:1" json:"status"` // 状态 0:禁用 1:启用
Name string `gorm:"size:50" json:"name"` // 分类名称
Description string `gorm:"size:255" json:"description"` // 分类描述
IconId string `gorm:"size:50" json:"iconId"` // 图标OSS ID
Icon *system.Oss `gorm:"foreignKey:IconId" json:"icon"` // 图标OSS
CoverId string `gorm:"size:50" json:"coverId"` // 封面图OSS ID
Cover *system.Oss `gorm:"foreignKey:CoverId" json:"cover"` // 封面图OSS
Sort int `gorm:"default:0" json:"sort"` // 排序
Status int `gorm:"default:1" json:"status"` // 状态 0:禁用 1:启用
Channels []*RadioChannel `gorm:"foreignKey:CategoryId" json:"channels"`
}
func (RadioCategory) TableName() string {
+15 -11
View File
@@ -8,17 +8,21 @@ import (
// RadioChannel 电台频道表
type RadioChannel struct {
global.BaseModel
CategoryId string `gorm:"size:50;index" json:"categoryId"` // 分类ID
Name string `gorm:"size:50" json:"name"` // 频道名称
Description string `gorm:"size:500" json:"description"` // 频道描述
Price int `gorm:"default:0;comment:价格,单位,分 " json:"price"` //价格 单位:分
CoverId string `gorm:"size:50" json:"coverId"` // 封面图OSS ID
Cover *system.Oss `gorm:"foreignKey:CoverId" json:"cover"` // 封面图OSS
Tags string `gorm:"size:255" json:"tags"` // 标签,逗号分隔
IsVipOnly int `gorm:"default:0" json:"isVipOnly"` // 是否VIP专享 0:否 1:是
Sort int `gorm:"default:0" json:"sort"` // 排序
Status int `gorm:"default:1" json:"status"` // 状态 0:禁用 1:启用
HasSubscribed int `gorm:"-" json:"hasSubscribed"` // 状态 0:未订阅 1:已订阅
CategoryId string `gorm:"size:50;index" json:"categoryId"` // 分类ID
Name string `gorm:"size:50" json:"name"` // 频道名称
Description string `gorm:"size:500" json:"description"` // 频道描述
IsFree int `gorm:"default:0" json:"isFree"` //是否永久免费 0:否 1:是
IsVipOnly int `gorm:"default:0" json:"isVipOnly"` // 是否VIP专享 0:否 1:是
MonthlyPrice int `gorm:"default:0;comment:价格,单位,分 " json:"monthlyPrice"` //包月价格 单位:分
QuarterlyPrice int `gorm:"default:0;comment:价格,单位,分 " json:"quarterlyPrice"` //包季度价格 单位:分
AnnualPrice int `gorm:"default:0;comment:价格,单位,分 " json:"annualPrice"` //包年价格 单位:分
CoverId string `gorm:"size:50" json:"coverId"` // 封面图OSS ID
Cover *system.Oss `gorm:"foreignKey:CoverId" json:"cover"` // 封面图OSS
Tags string `gorm:"size:255" json:"tags"` // 标签,逗号分隔
Sort int `gorm:"default:0" json:"sort"` // 排序
Status int `gorm:"default:1" json:"status"` // 状态 0:禁用 1:启用
HasSubscribed int `gorm:"-" json:"hasSubscribed"` // 状态 0:未订阅 1:已订阅
Programs []*RadioProgram `gorm:"foreignKey:ChannelId" json:"programs"` //频道下的节目
}
func (RadioChannel) TableName() string {
+5 -4
View File
@@ -7,10 +7,11 @@ import (
// RadioHistory 用户收听历史表
type RadioHistory struct {
global.BaseModel
UserId string `gorm:"size:50;index" json:"userId"` // 用户ID
ProgramId string `gorm:"size:50;index" json:"programId"` // 节目ID
Progress int `gorm:"default:0" json:"progress"` // 播放进度(秒)
Duration int `gorm:"default:0" json:"duration"` // 节目总时长(秒)
UserId string `gorm:"size:50;index" json:"userId"` // 用户ID
ProgramId string `gorm:"size:50;index" json:"programId"` // 节目ID
Progress int `gorm:"default:0" json:"progress"` // 播放进度(秒)
Duration int `gorm:"default:0" json:"duration"` // 节目总时长(秒)
RadioProgram *RadioProgram `gorm:"foreignKey:ProgramId" json:"program"`
}
func (RadioHistory) TableName() string {
+14 -13
View File
@@ -8,19 +8,20 @@ import (
// RadioProgram 电台节目表
type RadioProgram struct {
global.BaseModel
ChannelId string `gorm:"size:50;index" json:"channelId"` // 频道ID
Title string `gorm:"size:100" json:"title"` // 节目标题
Description string `gorm:"size:500" json:"description"` // 节目描述
Content string `gorm:"type:text" json:"content"`
CoverId string `gorm:"size:50" json:"coverId"` // 封面图OSS ID
Cover *system.Oss `gorm:"foreignKey:CoverId" json:"coverUrl"` // 封面图OSS
AudioId string `gorm:"size:50" json:"audioId"` // 音频OSS ID
Audio *system.Oss `gorm:"foreignKey:AudioId" json:"audio"` // 音频OSS
Duration int `gorm:"default:0" json:"duration"` // 时长(秒)
Tags string `gorm:"size:255" json:"tags"` // 标签,逗号分隔
PlayCount int `gorm:"default:0" json:"playCount"` // 播放次数
LikeCount int `gorm:"default:0" json:"likeCount"` // 点赞次数
Status int `gorm:"default:1" json:"status"` // 状态 0:下架 1:上架
ChannelId string `gorm:"size:50;index" json:"channelId"` // 频道ID
Title string `gorm:"size:100" json:"title"` // 节目标题
Description string `gorm:"size:500" json:"description"` // 节目描述
Content string `gorm:"type:text" json:"content"`
CoverId string `gorm:"size:50" json:"coverId"` // 封面图OSS ID
Cover *system.Oss `gorm:"foreignKey:CoverId" json:"cover"` // 封面图OSS
AudioId string `gorm:"size:50" json:"audioId"` // 音频OSS ID
Audio *system.Oss `gorm:"foreignKey:AudioId" json:"audio"` // 音频OSS
Duration int `gorm:"default:0" json:"duration"` // 时长(秒)
Tags string `gorm:"size:255" json:"tags"` // 标签,逗号分隔
PlayCount int `gorm:"default:0" json:"playCount"` // 播放次数
LikeCount int `gorm:"default:0" json:"likeCount"` // 点赞次数
Status int `gorm:"default:1" json:"status"` // 状态 0:下架 1:上架
Channel *RadioChannel `gorm:"foreignKey:ChannelId" json:"channel"`
}
func (RadioProgram) TableName() string {
+4 -3
View File
@@ -7,9 +7,10 @@ import (
// RadioSubscription 用户订阅表
type RadioSubscription struct {
global.BaseModel
UserId string `gorm:"size:50;index;not null;uniqueIndex:idx_user_channel" json:"userId"` // 用户ID
ChannelId string `gorm:"size:50;index;uniqueIndex:idx_user_channel" json:"channelId"` // 频道ID
Status int `gorm:"type:tinyint;default:1"` //1-订阅中,2-已取消
UserId string `gorm:"size:50;index;not null;uniqueIndex:idx_user_channel" json:"userId"` // 用户ID
ChannelId string `gorm:"size:50;index;uniqueIndex:idx_user_channel" json:"channelId"` // 频道ID
Status int `gorm:"type:tinyint;default:1"` //1-订阅中,2-已取消
Channel *RadioChannel `gorm:"foreignKey:ChannelId" json:"channel"`
}
func (RadioSubscription) TableName() string {
-1
View File
@@ -11,7 +11,6 @@ type GetCategoryList struct {
// SaveCategory 保存分类请求
type SaveCategory struct {
Id string `json:"id" form:"id"` // 分类ID(更新时使用)
Name string `json:"name" binding:"required"` // 分类名称
Description string `json:"description"` // 分类描述
IconId string `json:"iconId"` // 图标URL
+25 -18
View File
@@ -12,26 +12,33 @@ type GetChannelList struct {
// SaveChannel 保存频道请求
type SaveChannel struct {
Id string `json:"id" form:"id"` // 频道ID(更新时使用)
CategoryId string `json:"categoryId" binding:"required"` // 分类ID
Name string `json:"name" binding:"required"` // 频道名称
Description string `json:"description"` // 频道描述
CoverId string `json:"coverId"` // 封面图URL
Tags string `json:"tags"` // 标签
IsVipOnly int `json:"isVipOnly"` // 是否VIP专享
Sort int `json:"sort"` // 排序
Status int `json:"status"` // 状态
CategoryId string `json:"categoryId" binding:"required"` // 分类ID
Name string `json:"name" binding:"required"` // 频道名称
Description string `json:"description"` // 频道描述
CoverId string `json:"coverId"` // 封面图URL
Tags string `json:"tags"` // 标签
IsFree int `json:"isFree"` //是否永久免费
IsVipOnly int `json:"isVipOnly"` //是否vip专享
MonthlyPrice int `json:"monthlyPrice"` //包月价格
QuarterlyPrice int `json:"quarterlyPrice"` //包季价格
AnnualPrice int `json:"annualPrice"` //包季价格
Sort int `json:"sort"` // 排序
Status int `json:"status"` // 状态
}
// UpdateChannel 更新频道请求
type UpdateChannel struct {
Id string `json:"id" binding:"required"` // 频道ID
CategoryId string `json:"categoryId"` // 分类ID
Name string `json:"name"` // 频道名称
Description string `json:"description"` // 频道描述
CoverId string `json:"coverId"` // 封面图URL
Tags string `json:"tags"` // 标签
IsVipOnly int `json:"isVipOnly"` // 是否VIP专享
Sort int `json:"sort"` // 排序
Status int `json:"status"` // 状态
Id string `json:"id" binding:"required"` // 频道ID
CategoryId string `json:"categoryId"` // 分类ID
Name string `json:"name"` // 频道名称
Description string `json:"description"` // 频道描述
CoverId string `json:"coverId"` // 封面图URL
Tags string `json:"tags"` // 标签
IsFree int `json:"isFree"`
IsVipOnly int `json:"isVipOnly"` //是否vip专享
MonthlyPrice int `json:"monthlyPrice"` //包月价格
QuarterlyPrice int `json:"quarterlyPrice"` //包季价格
AnnualPrice int `json:"annualPrice"` //包季价格
Sort int `json:"sort"` // 排序
Status int `json:"status"` // 状态
}
+3 -4
View File
@@ -5,14 +5,13 @@ import common "sundynix-go/model/commom/request"
// GetProgramList 获取节目列表请求
type GetProgramList struct {
common.PageInfo
ChannelId string `json:"channelId" form:"channelId"` // 频道ID
Title string `json:"title" form:"title"` // 节目标题
Status int `json:"status" form:"status"` // 状态
ChannelId string `json:"channelId" binding:"required" form:"channelId"` // 频道ID
Title string `json:"title" form:"title"` // 节目标题
Status int `json:"status" form:"status"` // 状态
}
// SaveProgram 保存节目请求
type SaveProgram struct {
Id string `json:"id" form:"id"` // 节目ID(更新时使用)
ChannelId string `json:"channelId" binding:"required"` // 频道ID
Title string `json:"title" binding:"required"` // 节目标题
Description string `json:"description"` // 节目描述
+2 -1
View File
@@ -10,7 +10,8 @@ func (r *CategoryRouter) InitCategoryRouter(Router *gin.RouterGroup) {
categoryRouter := Router.Group("/radio/category")
{
categoryRouter.POST("page", categoryApi.GetCategoryPage)
categoryRouter.POST("list", categoryApi.GetCategoryList)
categoryRouter.GET("tree", categoryApi.GetCategoryTree)
categoryRouter.GET("list", categoryApi.GetCategoryList)
categoryRouter.GET("detail", categoryApi.GetCategoryDetail)
categoryRouter.POST("save", categoryApi.SaveCategory)
categoryRouter.POST("update", categoryApi.UpdateCategory)
+1
View File
@@ -10,6 +10,7 @@ func (r *ChannelRouter) InitChannelRouter(Router *gin.RouterGroup) {
channelRouter := Router.Group("/radio/channel")
{
channelRouter.POST("list", channelApi.GetChannelList)
channelRouter.POST("freeList", channelApi.GetFreeChannelList)
channelRouter.GET("detail", channelApi.GetChannelDetail)
channelRouter.POST("save", channelApi.SaveChannel)
channelRouter.POST("update", channelApi.UpdateChannel)
+18 -1
View File
@@ -34,9 +34,26 @@ func (s *CategoryService) GetCategoryList(info radioReq.GetCategoryList) ([]radi
return list, total, err
}
// GetCategoryTree 返回带频道的分类树
func (s *CategoryService) GetCategoryTree() ([]radio.RadioCategory, error) {
var res []radio.RadioCategory
// 1. 查询分类并预加载关联的频道
// Preload("Channels") 会自动根据 CategoryId 匹配
// 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
}
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).Preload("Icon").Preload("Cover").Error
return res, err
}
+47 -50
View File
@@ -2,8 +2,8 @@ package radio
import (
"errors"
"sundynix-go/global"
common "sundynix-go/model/commom/request"
"sundynix-go/model/radio"
radioReq "sundynix-go/model/radio/request"
@@ -12,6 +12,23 @@ import (
type ChannelService struct{}
func (s *ChannelService) GetFreeChannelList(req common.PageInfo) ([]radio.RadioChannel, int64, error) {
db := global.DB.Model(&radio.RadioChannel{}).Where("is_free = 1")
var list []radio.RadioChannel
var total int64
err := db.Count(&total).Error
if err != nil {
return nil, 0, err
}
offset := (req.Current - 1) * req.PageSize
err = db.Offset(offset).Limit(req.PageSize).Order("sort ASC").Find(&list).Error
if err != nil {
return nil, 0, err
}
return list, total, nil
}
// GetChannelList 获取频道列表
func (s *ChannelService) GetChannelList(userId string, info radioReq.GetChannelList) ([]radio.RadioChannel, int64, error) {
db := global.DB.Model(&radio.RadioChannel{})
@@ -34,33 +51,19 @@ func (s *ChannelService) GetChannelList(userId string, info radioReq.GetChannelL
}
offset := (info.Current - 1) * info.PageSize
err = db.Offset(offset).Limit(info.PageSize).Order("sort ASC").Find(&list).Error
err = db.Offset(offset).Limit(info.PageSize).Order("is_free desc,sort ASC").Find(&list).Error
if err != nil {
return nil, 0, err
}
// 批量查询用户订阅的频道,避免N+1问题
if userId != "" {
subService := &SubscriptionService{}
subscribedChannelIds, _ := subService.GetUserSubscriptionHistory(userId)
// 转换为map以便快速查找
subscribedMap := make(map[string]bool)
for _, cid := range subscribedChannelIds {
subscribedMap[cid] = true
}
// 填充HasSubscribed字段
for i := range list {
if subscribedMap[list[i].Id] {
list[i].HasSubscribed = 1
} else {
list[i].HasSubscribed = 0
}
}
}
return list, total, nil
}
func (s *ChannelService) GetAllChannelList(categoryId, userId string) ([]radio.RadioChannel, error) {
var res []radio.RadioChannel
err := global.DB.Where("category_id = ?", categoryId).Find(&res).Preload("Cover").Error
return res, err
}
// GetChannelById 获取频道详情
func (s *ChannelService) GetChannelById(userId, id string) (radio.RadioChannel, error) {
var channel radio.RadioChannel
@@ -68,32 +71,23 @@ func (s *ChannelService) GetChannelById(userId, id string) (radio.RadioChannel,
if err != nil {
return channel, err
}
// 填充HasSubscribed字段
if userId != "" {
subService := &SubscriptionService{}
hasSub, _ := subService.HasSubscription(userId, channel.Id)
if hasSub {
channel.HasSubscribed = 1
} else {
channel.HasSubscribed = 0
}
}
return channel, nil
}
// SaveChannel 保存频道
func (s *ChannelService) SaveChannel(req radioReq.SaveChannel) error {
channel := radio.RadioChannel{
CategoryId: req.CategoryId,
Name: req.Name,
Description: req.Description,
CoverId: req.CoverId,
Tags: req.Tags,
IsVipOnly: req.IsVipOnly,
Sort: req.Sort,
Status: req.Status,
CategoryId: req.CategoryId,
Name: req.Name,
Description: req.Description,
CoverId: req.CoverId,
Tags: req.Tags,
IsVipOnly: req.IsVipOnly,
MonthlyPrice: req.MonthlyPrice,
QuarterlyPrice: req.QuarterlyPrice,
AnnualPrice: req.AnnualPrice,
Sort: req.Sort,
Status: req.Status,
}
return global.DB.Create(&channel).Error
}
@@ -101,14 +95,17 @@ func (s *ChannelService) SaveChannel(req radioReq.SaveChannel) error {
// UpdateChannel 更新频道
func (s *ChannelService) UpdateChannel(req radioReq.UpdateChannel) error {
updates := map[string]interface{}{
"category_id": req.CategoryId,
"name": req.Name,
"description": req.Description,
"cover_id": req.CoverId,
"tags": req.Tags,
"is_vip_only": req.IsVipOnly,
"sort": req.Sort,
"status": req.Status,
"category_id": req.CategoryId,
"name": req.Name,
"description": req.Description,
"cover_id": req.CoverId,
"tags": req.Tags,
"is_vip_only": req.IsVipOnly,
"monthly_price": req.MonthlyPrice,
"quarterly_price": req.QuarterlyPrice,
"annual_price": req.AnnualPrice,
"sort": req.Sort,
"status": req.Status,
}
return global.DB.Model(&radio.RadioChannel{}).Where("id = ?", req.Id).Updates(updates).Error
}
+1 -1
View File
@@ -41,7 +41,7 @@ func (s *InteractionService) AddHistory(userId string, req radioReq.AddHistory)
// GetHistoryList 获取收听历史列表
func (s *InteractionService) GetHistoryList(userId string, info radioReq.GetHistoryList) ([]radio.RadioHistory, int64, error) {
db := global.DB.Model(&radio.RadioHistory{}).Where("user_id = ?", userId)
db := global.DB.Model(&radio.RadioHistory{}).Where("user_id = ?", userId).Preload("RadioProgram")
var list []radio.RadioHistory
var total int64
+33 -7
View File
@@ -16,18 +16,44 @@ const MaxFreeSubscription = 2
// GetUserSubscription 获取用户订阅列表
func (s *SubscriptionService) GetUserSubscription(userId string, info common.PageInfo) ([]radio.RadioSubscription, int64, error) {
db := global.DB.Model(&radio.RadioSubscription{}).Where("user_id = ?", userId)
var list []radio.RadioSubscription
var subscriptions []radio.RadioSubscription
var total int64
err := db.Count(&total).Error
db := global.DB // 替换为你实际的 GORM 变量
// 2. 统计该用户订阅的总数 (Status=1 表示订阅中)
err := db.Model(&radio.RadioSubscription{}).
Where("user_id = ? AND status = 1", userId).
Count(&total).Error
if err != nil {
return nil, 0, err
}
// 3. 执行分页关联查询
err = db.Model(&radio.RadioSubscription{}).
Where("user_id = ? AND status = 1", userId).
Limit(info.PageSize).
Offset((info.Current-1)*info.PageSize).
Order("created_at DESC").
// 级联加载频道及其封面
Preload("Channel").
Preload("Channel.Cover").
// 关键:子查询过滤——只预加载每个频道 ID 最大的那一条节目
Preload("Channel.Programs", func(db *gorm.DB) *gorm.DB {
// 子查询:找到每个频道下 ID 最大的节目(通常 ID 越大代表越新,也可以用 CreatedAt)
subQuery := db.Table("sundynix_radio_program").
Select("id").
Where("status = 1"). // 只找上架的
Where("created_at = (SELECT MAX(created_at) FROM sundynix_radio_program AS rp WHERE rp.channel_id = sundynix_radio_program.channel_id AND rp.status = 1)")
offset := (info.Current - 1) * info.PageSize
err = db.Offset(offset).Limit(info.PageSize).Order("created_at DESC").Find(&list).Error
return list, total, err
// 嵌套预加载:节目里的音频和封面也一并带出来
return db.Where("id IN (?)", subQuery).
Preload("Cover").
Preload("Audio")
}).
Find(&subscriptions).Error
if err != nil {
return nil, total, err
}
return subscriptions, total, err
}
// GetUserSubscriptionHistory 获取用户历史订阅过的频道ID列表