书籍列表接口新增参数

This commit is contained in:
2025-08-13 15:19:42 +08:00
parent 6ccc87f2bf
commit 8afe651c64
201 changed files with 6987 additions and 1066 deletions

38
internal/consts/ads.go Normal file
View File

@ -0,0 +1,38 @@
package consts
// AdState 广告状态枚举
type AdState int
const (
StateFetchFailed AdState = iota + 1 // 拉取失败
StateFetchSuccess // 拉取成功
StateDisplayFailed // 显示失败
StateDisplaySuccess // 显示成功
StateNotWatched // 未观看完成
StateWatched // 观看完成
StateNotClicked // 未点击
StateClicked // 已点击
StateNotDownloaded // 未下载
StateDownloaded // 已下载
)
// GetStateDescription 获取状态描述
func GetStateDescription(state AdState) string {
descriptions := map[AdState]string{
StateFetchFailed: "拉取失败",
StateFetchSuccess: "拉取成功",
StateDisplayFailed: "显示失败",
StateDisplaySuccess: "显示成功",
StateNotWatched: "未观看完成",
StateWatched: "观看完成",
StateNotClicked: "未点击",
StateClicked: "已点击",
StateNotDownloaded: "未下载",
StateDownloaded: "已下载",
}
if desc, exists := descriptions[state]; exists {
return desc
}
return "未知状态"
}