consts

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2023 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTokenExpireDays = 7   // 用户登录token默认有效期
	SummaryLen             = 256 // 摘要长度
)
View Source
const (
	SysConfigSiteTitle          = "siteTitle"          // 站点标题
	SysConfigSiteDescription    = "siteDescription"    // 站点描述
	SysConfigSiteKeywords       = "siteKeywords"       // 站点关键字
	SysConfigSiteNavs           = "siteNavs"           // 站点导航
	SysConfigSiteNotification   = "siteNotification"   // 站点公告
	SysConfigRecommendTags      = "recommendTags"      // 推荐标签
	SysConfigUrlRedirect        = "urlRedirect"        // 是否开启链接跳转
	SysConfigScoreConfig        = "scoreConfig"        // 分数配置
	SysConfigDefaultNodeId      = "defaultNodeId"      // 发帖默认节点
	SysConfigArticlePending     = "articlePending"     // 是否开启文章审核
	SysConfigTopicCaptcha       = "topicCaptcha"       // 是否开启发帖验证码
	SysConfigUserObserveSeconds = "userObserveSeconds" // 新用户观察期
	SysConfigTokenExpireDays    = "tokenExpireDays"    // 登录Token有效天数
	SysConfigLoginMethod        = "loginMethod"        // 登录方式
)

系统配置

View Source
const (
	EntityArticle = "article"
	EntityTopic   = "topic"
	EntityComment = "comment"
	EntityTweet   = "tweet"
	EntityUser    = "user"
	EntityCheckIn = "checkIn"
)

EntityType

View Source
const (
	RoleOwner = "owner" // 站长
	RoleAdmin = "admin" // 管理员
	RoleUser  = "user"  // 用户
)

用户角色

View Source
const (
	OpTypeCreate          = "create"
	OpTypeDelete          = "delete"
	OpTypeUpdate          = "update"
	OpTypeForbidden       = "forbidden"
	OpTypeRemoveForbidden = "removeForbidden"
)

操作类型

View Source
const (
	StatusOk      = 1    // 正常
	StatusDisable = 1000 // 禁用
	StatusDeleted = 1001 // 删除
	StatusPending = 3    // 待审核
)

状态

View Source
const (
	UserTypeNormal = 0      // 普通用户
	UserTypeGzh    = 1      // 公众号用户
	UserDb         = "User" // 租户下用户db库标志

)

用户类型

View Source
const (
	ContentTypeHtml     = "html"
	ContentTypeMarkdown = "markdown"
	ContentTypeText     = "text"
)

内容类型

View Source
const (
	MsgStatusUnread   = 1 // 消息未读
	MsgStatusHaveRead = 2 // 消息已读
)

消息状态

View Source
const ADMIN_PERMISSION_KEY = "admin_permission_cache_%d_%s"
View Source
const APP_DB_CACHE_KEY = "db_cache_%d"
View Source
const APP_DB_KEY = "db_key_%d"
View Source
const MYSQL_APP_DB_NAME_KEY = "tenant_db_%d_%s" //应用数据库
View Source
const MYSQL_CREATE_DATABASE_SQL = "CREATE DATABASE IF NOT EXISTS %s DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci"
View Source
const MYSQL_CREATE_DB_USER_SQL = "CREATE USER `%s`@`%s` IDENTIFIED WITH mysql_native_password BY '%s';"
View Source
const MYSQL_GRANT_USER_DB_SQL = "" /* 215-byte string literal not displayed */
View Source
const (
	RoleAdministrator int64 = 1 // 超级管理员
)

用户角色id

View Source
const TENANTID_DB = "%d_%d"

字符串 permission InstanceDb

View Source
const TENANTID_DB_APP_KEY = "instance_db_%d_%d"
View Source
const TENANTID_USER_DB_APP_KEY = "instance_user_db_%d_%s"
View Source
const TENANTID_USER_DB_KEY = "tenant_db_%d" //数据用户名
View Source
const TENANTID_USER_DB_PASSWORD_KEY = "tenant_%d_%s" //数据库密码格式
View Source
const USER_CACAHE_KEY = "admin_cache_%d_%d"

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL