Initial commit: web_hghl_server
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package pubdef
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Page struct {
|
||||
PageNum int64 `form:"pageNum" json:"pageNum,omitempty"`
|
||||
PageSize int64 `form:"pageSize" json:"pageSize,omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
DateISO = "2006-01-02"
|
||||
TimeISO = "2006-01-02 15:04:05"
|
||||
AppId = 1046 // 91pron
|
||||
AppName = "海角社区"
|
||||
DefaultChannelCode = "hjsq"
|
||||
|
||||
// CompanyPlatform 是内容中台授权的产品名,对应 company_platform 字段
|
||||
CompanyPlatform = "海角社区"
|
||||
// seoPushEnabled 对外推送总开关。需要推送时改为 true 后重新发版。
|
||||
// false 时不登记任务,开启后再按当前页面地址生成并推送。
|
||||
// 真正提交还要求 runMod=prod,测试环境即使打开开关也只 dry-run。
|
||||
seoPushEnabled = false
|
||||
)
|
||||
|
||||
func ReportAppId() string {
|
||||
return fmt.Sprintf("JHA-%d", AppId)
|
||||
}
|
||||
|
||||
// Enabled 业务开关是否打开(不含环境判断)。
|
||||
func Enabled() bool {
|
||||
return seoPushEnabled
|
||||
}
|
||||
|
||||
const PageSize int64 = 40
|
||||
|
||||
func GetTotalPage(total int64, page int64) int64 {
|
||||
totalPage := total / PageSize
|
||||
if total%PageSize > 0 {
|
||||
totalPage++
|
||||
}
|
||||
return totalPage
|
||||
}
|
||||
|
||||
type SeoValue struct {
|
||||
Title string `json:"title" bson:"webTitle"` // 网站SEO标题
|
||||
Keyworld []string `json:"keyworld" bson:"webKeyworld"` // 网站SEO关键字
|
||||
Description string `json:"description" bson:"webDescription"` // 网站SEO描述
|
||||
}
|
||||
|
||||
// DisplayMode 分类展示方式
|
||||
type DisplayMode int64
|
||||
|
||||
const (
|
||||
DisplayModeDefault DisplayMode = 0 // 默认(上图下标题多列)
|
||||
DisplayModeCardCarousel DisplayMode = 1 // 卡片层叠轮播
|
||||
DisplayModeAvatarList DisplayMode = 2 // 头像列表
|
||||
DisplayModeImageText DisplayMode = 3 // 图文列表(左图右标题多列)
|
||||
DisplayModeBigCover DisplayMode = 4 // 大封面列表(一大图两列)
|
||||
)
|
||||
|
||||
// CategoryDisplayPosition 分类显示位置
|
||||
type CategoryDisplayPosition int64
|
||||
|
||||
const (
|
||||
CategoryDisplayPositionTabOnly CategoryDisplayPosition = 0 // 仅TAB
|
||||
CategoryDisplayPositionHomeOnly CategoryDisplayPosition = 1 // 仅首页
|
||||
CategoryDisplayPositionBoth CategoryDisplayPosition = 2 // TAB和首页都显示
|
||||
)
|
||||
|
||||
// CategorySortType 首页分类内容排序方式。
|
||||
type CategorySortType int64
|
||||
|
||||
const (
|
||||
CategorySortTypeAddedTimeDesc CategorySortType = 0 // 上架时间降序
|
||||
CategorySortTypeWatchDesc CategorySortType = 1 // 观看次数降序
|
||||
CategorySortTypeLikeDesc CategorySortType = 2 // 点赞(收藏)次数降序
|
||||
CategorySortTypeAddedTimeAsc CategorySortType = 3 // 上架时间升序
|
||||
CategorySortTypeWatchAsc CategorySortType = 4 // 观看次数升序
|
||||
CategorySortTypeLikeAsc CategorySortType = 5 // 点赞(收藏)次数升序
|
||||
CategorySortTypeUpdateTimeDesc CategorySortType = 6 // 更新时间降序
|
||||
CategorySortTypeUpdateTimeAsc CategorySortType = 7 // 更新时间升序
|
||||
CategorySortTypeSortType CategorySortType = 8 // 自定义排序
|
||||
)
|
||||
Reference in New Issue
Block a user