Documentation
¶
Index ¶
- Constants
- Variables
- func AutoTag(title, content string, num int) string
- func DisplayName(g *GiteaUser) string
- func FilterTxt(txt string) string
- func PublishFeed(object interface{}, objectExt interface{}, me *Me)
- type AddCommand
- type Advertisement
- type Article
- type ArticleGCTT
- type Authority
- type AutoCrawlRule
- type BindUser
- type Book
- type CData
- type Comment
- type CrawlRule
- type DefaultAvatar
- type DelCommand
- type DocMenu
- type Document
- type Download
- type Dynamic
- type Favorite
- type Feed
- type FooterNav
- type FriendLink
- type FriendLogo
- type GCTTGit
- type GCTTIssue
- type GCTTTimeLine
- type GCTTUser
- type Gift
- type GiftRedeem
- type GiteaUser
- type GithubUser
- type Highlighting
- type Image
- type IndexNav
- type IndexNavChild
- type InterviewQuestion
- type LearningMaterial
- type Like
- type Me
- type Message
- type Mission
- type MorningReading
- type NodeInfo
- type OftenTime
- func (self OftenTime) MarshalBinary() ([]byte, error)
- func (self OftenTime) MarshalJSON() ([]byte, error)
- func (self OftenTime) MarshalText() ([]byte, error)
- func (self OftenTime) String() string
- func (this *OftenTime) UnmarshalBinary(data []byte) error
- func (this *OftenTime) UnmarshalJSON(data []byte) (err error)
- func (this *OftenTime) UnmarshalText(data []byte) (err error)
- type OpenProject
- type PageAd
- type RecommendNode
- type Resource
- type ResourceCat
- type ResourceEx
- type ResourceInfo
- type ResponseBody
- type Role
- type RoleAuthority
- type SearchResponse
- type SearchStat
- type Subject
- type SubjectAdmin
- type SubjectArticle
- type SubjectArticles
- type SubjectFollower
- type SystemMessage
- type Topic
- type TopicAppend
- type TopicEx
- type TopicInfo
- type TopicNode
- type TopicUpEx
- type User
- type UserActive
- type UserBalanceDetail
- type UserExchangeRecord
- type UserLogin
- type UserLoginMission
- type UserRecharge
- type UserRole
- type UserSetting
- type ViewRecord
- type ViewSource
- type WechatAutoReply
- type WechatImage
- type WechatMsg
- type WechatReply
- type WechatUser
- type Wiki
Constants ¶
View Source
const ( ArticleStatusNew = iota ArticleStatusOnline ArticleStatusOffline )
View Source
const ( AutoCrawlOn = 0 AutoCrawOff = 1 )
View Source
const ( IsFreeFalse = iota IsFreeTrue )
View Source
const ( TypeTopic = iota // 主题 TypeArticle // 博文 TypeResource // 资源 TypeWiki // WIKI TypeProject // 开源项目 TypeBook // 图书 TypeInterview // 面试题 )
不要修改常量的顺序
View Source
const ( TypeComment = 100 // 置顶 TypeTop = 101 )
View Source
const ( TopicURI = "topics" ArticleURI = "articles" ResourceURI = "resources" WikiURI = "wiki" ProjectURI = "p" BookURI = "book" )
View Source
const ( DLArchived = iota DLStable DLFeatured DLUnstable )
View Source
const ( GCTTRoleTranslator = iota GCTTRoleLeader GCTTRoleSelecter // 选题 GCTTRoleChecker // 校对 GCTTRoleCore // 核心成员 )
View Source
const ( IssueOpened = iota IssueClosed )
View Source
const ( LabelUnClaim = "待认领" LabelClaimed = "已认领" )
View Source
const ( GiftStateOnline = 1 GiftStateExpired = 3 GiftTypRedeem = 0 GiftTypDiscount = 1 )
View Source
const ( FlagCancel = iota FlagLike // 喜欢 FlagUnlike // 不喜欢(暂时不支持) )
View Source
const ( FdelNotDel = "未删" FdelHasDel = "已删" TdelNotDel = "未删" TdelHasDel = "已删" HasRead = "已读" NotRead = "未读" )
View Source
const ( // 和comment中objtype保持一致(除了@) MsgtypeTopicReply = iota // 回复我的主题 MsgtypeArticleComment // 评论我的博文 MsgtypeResourceComment // 评论我的资源 MsgtypeWikiComment // 评论我的Wiki页 MsgtypeProjectComment // 评论我的项目 MsgtypeAtMe = 10 // 评论 @提到我 MsgtypePublishAtMe = 11 // 发布时提到我 MsgtypeSubjectContribute = 12 //专栏投稿 )
View Source
const ( MissionTypeLogin = 1 MissionTypeInitial = 2 MissionTypeAdd = 4 // 回复 MissionTypeReply = 51 // 创建 MissionTypeTopic = 52 MissionTypeArticle = 53 MissionTypeResource = 54 MissionTypeWiki = 55 MissionTypeProject = 56 MissionTypeBook = 57 MissionTypeAppend = 60 // 置顶 MissionTypeTop = 61 MissionTypeModify = 65 // 被回复 MissionTypeReplied = 70 // 额外赠予 MissionTypeAward = 80 // 活跃奖励 MissionTypeActive = 81 // 物品兑换 MissionTypeGift = 100 // 管理员操作后处罚 MissionTypePunish = 120 // 水 MissionTypeSpam = 127 )
View Source
const ( RtypeGo = iota // Go技术晨读 RtypeComp // 综合技术晨读 )
View Source
const ( ProjectStatusNew = 0 ProjectStatusOnline = 1 ProjectStatusOffline = 2 )
View Source
const ( LinkForm = "只是链接" ContentForm = "包括内容" )
View Source
const ( // Master 站长 Master = iota + 1 AssistantMaster Administrator TopicAdmin ResourceAdmin ArticleAdmin ReadingAdmin )
View Source
const ( ContributeStateNew = iota ContributeStateOnline ContributeStateOffline )
View Source
const ( FlagNoAudit = iota FlagNormal FlagAuditDelete FlagUserDelete )
View Source
const ( PermissionPublic = iota // 公开 PermissionLogin // 登录可见 PermissionFollow // 关注可见(暂未实现) PermissionPay // 知识星球或其他方式付费可见 PermissionOnlyMe // 自己可见 )
View Source
const ( UserStatusNoAudit = iota UserStatusAudit // 已激活 UserStatusRefuse UserStatusFreeze // 冻结 UserStatusOutage // 停用 )
View Source
const ( // 用户拥有的权限设置 DauAuthTopic = 1 << iota DauAuthArticle DauAuthResource DauAuthWiki DauAuthProject DauAuthBook DauAuthComment // 评论 DauAuthTop // 置顶 )
View Source
const ( BindTypeGithub = iota BindTypeGitea )
View Source
const ( KeyNewUserWait = "new_user_wait" // 新用户注册多久才能发布帖子,单位秒,0表示没限制 KeyCanEditTime = "can_edit_time" // 发布后多久内能够编辑,单位秒 KeyPublishTimes = "publish_times" // 一天发布次数大于该值,需要验证码 KeyPublishInterval = "publish_interval" // 发布时间间隔在该值内,需要验证码,单位秒 )
View Source
const ( TabRecommend = "recommend" TabAll = "all" )
View Source
const ( AutoReplyTypWord = iota // 关键词回复 AutoReplyTypNotFound // 收到消息(未命中关键词且未搜索到) AutoReplyTypSubscribe // 被关注回复 )
View Source
const ( WeMsgTypeText = "text" WeMsgTypeImage = "image" WeMsgTypeVoice = "voice" WeMsgTypeVideo = "video" WeMsgTypeShortVideo = "shortvideo" WeMsgTypeLocation = "location" WeMsgTypeLink = "link" WeMsgTypeEvent = "event" WeEventSubscribe = "subscribe" WeEventUnsubscribe = "unsubscribe" )
View Source
const AdminMinRoleId = 7 // 晨读管理员
角色分界点:roleid 大于该值,则没有管理权限
View Source
const (
// 最多附言条数
AppendMaxNum = 3
)
View Source
const DefaultAuth = DauAuthTopic | DauAuthArticle | DauAuthResource | DauAuthProject | DauAuthComment
View Source
const FeedOffline = 1
View Source
const (
InitialMissionId = 1
)
Variables ¶
View Source
var ArticleStatusSlice = []string{"未上线", "已上线", "已下线"}
View Source
var BalanceTypeMap = map[int]string{
MissionTypeLogin: "每日登录奖励",
MissionTypeInitial: "初始资本",
MissionTypeShare: "分享获得",
MissionTypeAdd: "充值获得",
MissionTypeReply: "创建回复",
MissionTypeTopic: "创建主题",
MissionTypeArticle: "发表文章",
MissionTypeResource: "分享资源",
MissionTypeWiki: "创建WIKI",
MissionTypeProject: "发布项目",
MissionTypeBook: "分享图书",
MissionTypeAppend: "增加附言",
MissionTypeTop: "置顶",
MissionTypeModify: "修改",
MissionTypeReplied: "回复收益",
MissionTypeAward: "额外赠予",
MissionTypeActive: "活跃奖励",
MissionTypeGift: "兑换物品",
MissionTypePunish: "处罚",
MissionTypeSpam: "Spam",
}
View Source
var GiftTypeMap = map[int]string{ GiftTypRedeem: "兑换码", GiftTypDiscount: "折扣", }
View Source
var LangSlice = []string{"中文", "英文"}
View Source
var PathUrlMap = map[int]string{ TypeTopic: "/topics/", TypeArticle: "/articles/", TypeResource: "/resources/", TypeWiki: "/wiki/", TypeProject: "/p/", TypeBook: "/book/", TypeInterview: "/interview/", }
View Source
var TypeNameMap = map[int]string{ TypeTopic: "主题", TypeArticle: "博文", TypeResource: "资源", TypeWiki: "Wiki", TypeProject: "项目", TypeBook: "图书", TypeInterview: "面试题", }
View Source
var WebsiteSetting = &websiteSetting{}
Functions ¶
func DisplayName ¶
func PublishFeed ¶
func PublishFeed(object interface{}, objectExt interface{}, me *Me)
PublishFeed 发布动态
Types ¶
type AddCommand ¶
type AddCommand struct {
Doc *Document `json:"doc"`
Boost float64 `json:"boost,omitempty"`
Overwrite bool `json:"overwrite"`
CommitWithin int `json:"commitWithin,omitempty"`
}
func NewAddCommand ¶
func NewAddCommand(doc *Document, boost float64, overwrite bool, commitWithin int) *AddCommand
func NewDefaultArgsAddCommand ¶
func NewDefaultArgsAddCommand(doc *Document) *AddCommand
type Advertisement ¶
type Article ¶
type Article struct {
Id int `json:"id" xorm:"pk autoincr"`
Domain string `json:"domain"`
Name string `json:"name"`
Title string `json:"title"`
Cover string `json:"cover"`
Author string `json:"author"`
AuthorTxt string `json:"author_txt"`
Lang int `json:"lang"`
PubDate string `json:"pub_date"`
Url string `json:"url"`
Content string `json:"content"`
Txt string `json:"txt"`
Tags string `json:"tags"`
Css string `json:"css"`
Viewnum int `json:"viewnum"`
Cmtnum int `json:"cmtnum"`
Likenum int `json:"likenum"`
Lastreplyuid int `json:"lastreplyuid"`
Lastreplytime OftenTime `json:"lastreplytime"`
Top uint8 `json:"top"`
Markdown bool `json:"markdown"`
GCTT bool `json:"gctt" xorm:"gctt"`
CloseReply bool `json:"close_reply"`
Status int `json:"status"`
OpUser string `json:"op_user"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Mtime OftenTime `json:"mtime" xorm:"<-"`
IsSelf bool `json:"is_self" xorm:"-"`
User *User `json:"-" xorm:"-"`
// 排行榜阅读量
RankView int `json:"rank_view" xorm:"-"`
LastReplyUser *User `json:"last_reply_user" xorm:"-"`
}
抓取的文章信息
func (*Article) AfterInsert ¶
func (this *Article) AfterInsert()
func (*Article) BeforeInsert ¶
func (this *Article) BeforeInsert()
type ArticleGCTT ¶
type ArticleGCTT struct {
ArticleID int `xorm:"article_id pk"`
Author string
AuthorURL string `xorm:"author_url"`
Translator string
Checker string
URL string `xorm:"url"`
Avatar string `xorm:"-"`
Checkers []string `xorm:"-"`
}
func (*ArticleGCTT) TableName ¶
func (*ArticleGCTT) TableName() string
type Authority ¶
type Authority struct {
Aid int `json:"aid" xorm:"pk autoincr"`
Name string `json:"name"`
Menu1 int `json:"menu1"`
Menu2 int `json:"menu2"`
Route string `json:"route"`
OpUser string `json:"op_user"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Mtime OftenTime `json:"mtime" xorm:"<-"`
}
权限信息
type AutoCrawlRule ¶
type AutoCrawlRule struct {
Id int `json:"id" xorm:"pk autoincr"`
Website string `json:"website"`
AllUrl string `json:"all_url"`
IncrUrl string `json:"incr_url"`
Keywords string `json:"keywords"`
ListSelector string `json:"list_selector"`
ResultSelector string `json:"result_selector"`
PageField string `json:"page_field"`
MaxPage int `json:"max_page"`
Ext string `json:"ext"`
OpUser string `json:"op_user"`
Mtime string `json:"mtime" xorm:"<-"`
ExtMap map[string]string `json:"-" xorm:"-"`
}
网站自动抓取规则
type BindUser ¶
type BindUser struct {
Id int `json:"id" xorm:"pk autoincr"`
Uid int `json:"uid"`
Type int `json:"type"`
Email string `json:"email"`
Tuid int `json:"tuid"`
Username string `json:"username"`
Name string `json:"name"`
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
Expire int `json:"expire"`
Avatar string `json:"avatar"`
CreatedAt time.Time `json:"created_at" xorm:"<-"`
}
type Book ¶
type Book struct {
Id int `json:"id" xorm:"pk autoincr"`
Name string `json:"name"`
Ename string `json:"ename"`
Cover string `json:"cover"`
Author string `json:"author"`
Translator string `json:"translator"`
Lang int `json:"lang"`
PubDate string `json:"pub_date"`
Desc string `json:"desc"`
Tags string `json:"tags"`
Catalogue string `json:"catalogue"`
IsFree bool `json:"is_free"`
OnlineUrl string `json:"online_url"`
DownloadUrl string `json:"download_url"`
BuyUrl string `json:"buy_url"`
Price float32 `json:"price"`
Lastreplyuid int `json:"lastreplyuid"`
Lastreplytime OftenTime `json:"lastreplytime"`
Viewnum int `json:"viewnum"`
Cmtnum int `json:"cmtnum"`
Likenum int `json:"likenum"`
Uid int `json:"uid"`
CreatedAt OftenTime `json:"created_at" xorm:"created"`
UpdatedAt OftenTime `json:"updated_at" xorm:"<-"`
// 排行榜阅读量
RankView int `json:"rank_view" xorm:"-"`
}
func (*Book) AfterInsert ¶
func (this *Book) AfterInsert()
type Comment ¶
type Comment struct {
Cid int `json:"cid" xorm:"pk autoincr"`
Objid int `json:"objid"`
Objtype int `json:"objtype"`
Content string `json:"content"`
Uid int `json:"uid"`
Floor int `json:"floor"`
Flag int `json:"flag"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Objinfo map[string]interface{} `json:"objinfo" xorm:"-"`
ReplyFloor int `json:"reply_floor" xorm:"-"` // 回复某一楼层
}
评论信息(通用)
type CrawlRule ¶
type CrawlRule struct {
Id int `json:"id" xorm:"pk autoincr"`
Domain string `json:"domain"`
Subpath string `json:"subpath"`
Lang int `json:"lang"`
Name string `json:"name"`
Title string `json:"title"`
Author string `json:"author"`
InUrl bool `json:"in_url"`
PubDate string `json:"pub_date"`
Content string `json:"content"`
Ext string `json:"ext"`
OpUser string `json:"op_user"`
Ctime string `json:"ctime" xorm:"<-"`
}
抓取网站文章的规则
type DefaultAvatar ¶
type DelCommand ¶
type DelCommand struct {
Id string `json:"id"`
}
func NewDelCommand ¶
func NewDelCommand(doc *Document) *DelCommand
type Document ¶
type Document struct {
Id string `json:"id"`
Objid int `json:"objid"`
Objtype int `json:"objtype"`
Title string `json:"title"`
Author string `json:"author"`
Uid int `json:"uid"`
PubTime string `json:"pub_time"`
Content string `json:"content"`
Tags string `json:"tags"`
Viewnum int `json:"viewnum"`
Cmtnum int `json:"cmtnum"`
Likenum int `json:"likenum"`
Lastreplyuid int `json:"lastreplyuid"`
Lastreplytime OftenTime `json:"lastreplytime"`
CreatedAt OftenTime `json:"created_at"`
UpdatedAt OftenTime `json:"updated_at"`
// 排序用的时间
SortTime OftenTime `json:"sort_time"`
Top uint8 `json:"top"`
Nid int `json:"nid"`
HlTitle string `json:",omitempty"` // 高亮的标题
HlContent string `json:",omitempty"` // 高亮的内容
}
文档对象(供solr使用)
func NewDocument ¶
func NewDocument(object interface{}, objectExt interface{}) *Document
type Download ¶
type Download struct {
Id int `xorm:"pk autoincr"`
Version string
Filename string
Kind string
OS string `xorm:"os"`
Arch string
Size int
Checksum string
Category int
IsRecommend bool
Seq int
CreatedAt time.Time `xorm:"created"`
}
Download go 下载
type Dynamic ¶
type Dynamic struct {
Id int `json:"id" xorm:"pk autoincr"`
Content string `json:"content"`
Dmtype int `json:"dmtype"`
Url string `json:"url"`
Seq int `json:"seq"`
Ctime time.Time `json:"ctime" xorm:"created"`
}
动态(go动态;本站动态等)
type Favorite ¶
type Favorite struct {
Uid int `json:"uid"`
Objtype int `json:"objtype"`
Objid int `json:"objid"`
Ctime string `json:"ctime" xorm:"<-"`
}
用户收藏(用户可以收藏文章、话题、资源等)
type Feed ¶
type Feed struct {
Id int `xorm:"pk autoincr"`
Title string
Objid int
Objtype int
Uid int
Author string
Nid int
Lastreplyuid int
Lastreplytime OftenTime
Tags string
Cmtnum int
Likenum int
Top uint8
Seq int
State int
CreatedAt OftenTime `xorm:"created"`
UpdatedAt OftenTime `json:"updated_at" xorm:"<-"`
User *User `xorm:"-"`
Lastreplyuser *User `xorm:"-"`
Node map[string]interface{} `xorm:"-"`
Uri string `xorm:"-"`
}
type FriendLink ¶
type FriendLogo ¶
type GCTTGit ¶
type GCTTIssue ¶
type GCTTTimeLine ¶
func (*GCTTTimeLine) TableName ¶
func (*GCTTTimeLine) TableName() string
type GCTTUser ¶
type Gift ¶
type GiftRedeem ¶
type GithubUser ¶
type Highlighting ¶
type Image ¶
type Image struct {
Pid int `xorm:"pk autoincr"`
Md5 string
Path string
Size int
Width int
Height int
}
图片
type IndexNavChild ¶
type IndexNavChild struct {
}
type InterviewQuestion ¶
type InterviewQuestion struct {
Id int `json:"id" xorm:"pk autoincr"`
Sn int64 `json:"sn"`
ShowSn string `json:"show_sn" xorm:"-"`
Question string `json:"question"`
Answer string `json:"answer"`
Level int `json:"level"`
Viewnum int `json:"viewnum"`
Cmtnum int `json:"cmtnum"`
Likenum int `json:"likenum"`
Source string `json:"source"`
CreatedAt time.Time `json:"created_at" xorm:"created"`
}
Go 面试题
func (*InterviewQuestion) AfterInsert ¶
func (iq *InterviewQuestion) AfterInsert()
type LearningMaterial ¶
type Like ¶
type Like struct {
Uid int `json:"uid"`
Objid int `json:"objid"`
Objtype int `json:"objtype"`
Flag int `json:"flag"`
Ctime time.Time `json:"ctime" xorm:"<-"`
}
赞(喜欢)
type Me ¶
type Me struct {
Uid int `json:"uid"`
Username string `json:"username"`
Name string `json:"name"`
Monlog string `json:"monlog"`
Email string `json:"email"`
Avatar string `json:"avatar"`
Status int `json:"status"`
MsgNum int `json:"msgnum"`
IsAdmin bool `json:"isadmin"`
IsRoot bool `json:"is_root"`
DauAuth int `json:"dau_auth"`
IsVip bool `json:"is_vip"`
CreatedAt time.Time `json:"created_at"`
Balance int `json:"balance"`
Gold int `json:"gold"`
Silver int `json:"silver"`
Copper int `json:"copper"`
RoleIds []int `json:"-"`
}
Me 代表当前用户
type Message ¶
type Message struct {
Id int `json:"id" xorm:"pk autoincr"`
Content string `json:"content"`
Hasread string `json:"hasread"`
From int `json:"from"`
Fdel string `json:"fdel"`
To int `json:"to"`
Tdel string `json:"tdel"`
Ctime OftenTime `json:"ctime" xorm:"created"`
}
短消息
type MorningReading ¶
type MorningReading struct {
Id int `json:"id" xorm:"pk autoincr"`
Content string `json:"content"`
Rtype int `json:"rtype"`
Inner int `json:"inner"`
Url string `json:"url"`
Moreurls string `json:"moreurls"`
Username string `json:"username"`
Clicknum int `json:"clicknum,omitempty"`
Ctime OftenTime `json:"ctime" xorm:"<-"`
// 晨读日期,从 ctime 中提取
Rdate string `json:"rdate,omitempty" xorm:"-"`
Urls []string `json:"urls" xorm:"-"`
}
技术晨读
type NodeInfo ¶
type NodeInfo struct {
RecommendNode `xorm:"extends"`
TopicNode `xorm:"extends"`
}
type OftenTime ¶
func NewOftenTime ¶
func NewOftenTime() OftenTime
func (OftenTime) MarshalBinary ¶
func (OftenTime) MarshalJSON ¶
func (OftenTime) MarshalText ¶
func (*OftenTime) UnmarshalBinary ¶
func (*OftenTime) UnmarshalJSON ¶
func (*OftenTime) UnmarshalText ¶
type OpenProject ¶
type OpenProject struct {
Id int `json:"id" xorm:"pk autoincr"`
Name string `json:"name"`
Category string `json:"category"`
Uri string `json:"uri"`
Home string `json:"home"`
Doc string `json:"doc"`
Download string `json:"download"`
Src string `json:"src"`
Logo string `json:"logo"`
Desc string `json:"desc"`
Repo string `json:"repo"`
Author string `json:"author"`
Licence string `json:"licence"`
Lang string `json:"lang"`
Os string `json:"os"`
Tags string `json:"tags"`
Username string `json:"username,omitempty"`
Viewnum int `json:"viewnum,omitempty"`
Cmtnum int `json:"cmtnum,omitempty"`
Likenum int `json:"likenum,omitempty"`
Lastreplyuid int `json:"lastreplyuid"`
Lastreplytime OftenTime `json:"lastreplytime"`
Status int `json:"status"`
Ctime OftenTime `json:"ctime,omitempty" xorm:"created"`
Mtime OftenTime `json:"mtime,omitempty" xorm:"<-"`
User *User `json:"user" xorm:"-"`
// 排行榜阅读量
RankView int `json:"rank_view" xorm:"-"`
LastReplyUser *User `json:"last_reply_user" xorm:"-"`
}
开源项目信息
func (*OpenProject) AfterInsert ¶
func (this *OpenProject) AfterInsert()
func (*OpenProject) AfterLoad ¶
func (this *OpenProject) AfterLoad()
func (*OpenProject) BeforeInsert ¶
func (this *OpenProject) BeforeInsert()
type RecommendNode ¶
type RecommendNode struct {
Id int `json:"id" xorm:"pk autoincr"`
Name string `json:"name"`
Parent int `json:"parent"`
Nid int `json:"nid"`
Seq int `json:"seq"`
CreatedAt time.Time `json:"created_at" xorm:"<-"`
}
推荐节点
type Resource ¶
type Resource struct {
Id int `json:"id" xorm:"pk autoincr"`
Title string `json:"title"`
Form string `json:"form"`
Content string `json:"content"`
Url string `json:"url"`
Uid int `json:"uid"`
Catid int `json:"catid"`
CatName string `json:"-" xorm:"-"`
Lastreplyuid int `json:"lastreplyuid"`
Lastreplytime OftenTime `json:"lastreplytime"`
Tags string `json:"tags"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Mtime OftenTime `json:"mtime" xorm:"<-"`
// 排行榜阅读量
RankView int `json:"rank_view" xorm:"-"`
}
资源信息
func (*Resource) BeforeInsert ¶
func (this *Resource) BeforeInsert()
type ResourceCat ¶
type ResourceCat struct {
Catid int `json:"catid" xorm:"pk autoincr"`
Name string `json:"name"`
Intro string `json:"intro"`
Ctime string `json:"ctime" xorm:"<-"`
}
资源分类信息
func (*ResourceCat) TableName ¶
func (*ResourceCat) TableName() string
type ResourceEx ¶
type ResourceEx struct {
Id int `json:"-" xorm:"pk"`
Viewnum int `json:"viewnum"`
Cmtnum int `json:"cmtnum"`
Likenum int `json:"likenum"`
Mtime time.Time `json:"mtime" xorm:"<-"`
}
资源扩展(计数)信息
type ResourceInfo ¶
type ResourceInfo struct {
Resource `xorm:"extends"`
ResourceEx `xorm:"extends"`
}
func (*ResourceInfo) TableName ¶
func (*ResourceInfo) TableName() string
type ResponseBody ¶
type Role ¶
type Role struct {
Roleid int `json:"roleid" xorm:"pk autoincr"`
Name string `json:"name"`
OpUser string `json:"op_user"`
Ctime string `json:"ctime,omitempty" xorm:"created"`
Mtime string `json:"mtime,omitempty" xorm:"<-"`
}
角色信息
type RoleAuthority ¶
type RoleAuthority struct {
Roleid int `json:"roleid" xorm:"pk autoincr"`
Aid int `json:"aid"`
OpUser string `json:"op_user"`
Ctime string `json:"ctime" xorm:"<-"`
}
角色权限信息
type SearchResponse ¶
type SearchResponse struct {
RespHeader map[string]interface{} `json:"responseHeader"`
RespBody *ResponseBody `json:"response"`
Highlight map[string]*Highlighting `json:"highlighting"`
}
type SearchStat ¶
type SearchStat struct {
Id int `json:"id" xorm:"pk autoincr"`
Keyword string `json:"keyword"`
Times int `json:"times"`
Ctime time.Time `json:"ctime" xorm:"<-"`
}
搜索词统计
type Subject ¶
type Subject struct {
Id int `xorm:"pk autoincr" json:"id"`
Name string `json:"name"`
Cover string `json:"cover"`
Description string `json:"description"`
Uid int `json:"uid"`
Contribute bool `json:"contribute"`
Audit bool `json:"audit"`
ArticleNum int `json:"article_num"`
CreatedAt OftenTime `json:"created_at" xorm:"created"`
UpdatedAt OftenTime `json:"updated_at" xorm:"<-"`
User *User `json:"user" xorm:"-"`
}
Subject 专栏
type SubjectAdmin ¶
type SubjectAdmin struct {
Id int `xorm:"pk autoincr" json:"id"`
Sid int `json:"sid"`
Uid int `json:"uid"`
CreatedAt time.Time `json:"created_at" xorm:"<-"`
}
SubjectAdmin 专栏管理员
type SubjectArticle ¶
type SubjectArticle struct {
Id int `xorm:"pk autoincr" json:"id"`
Sid int `json:"sid"`
ArticleId int `json:"article_id"`
State int `json:"state"`
CreatedAt time.Time `json:"created_at" xorm:"<-"`
}
SubjectArticle 专栏文章
type SubjectArticles ¶
SubjectArticles xorm join 需要
func (*SubjectArticles) TableName ¶
func (*SubjectArticles) TableName() string
type SubjectFollower ¶
type SubjectFollower struct {
Id int `xorm:"pk autoincr" json:"id"`
Sid int `json:"sid"`
Uid int `json:"uid"`
CreatedAt time.Time `json:"created_at" xorm:"<-"`
User *User `xorm:"-"`
TimeAgo string `xorm:"-"`
}
SubjectFollower 专栏关注者
type SystemMessage ¶
type SystemMessage struct {
Id int `json:"id" xorm:"pk autoincr"`
Msgtype int `json:"msgtype"`
Hasread string `json:"hasread"`
To int `json:"to"`
Ctime OftenTime `json:"ctime" xorm:"created"`
// 扩展信息,json格式
Ext string
}
系统消息
func (*SystemMessage) GetExt ¶
func (this *SystemMessage) GetExt() map[string]interface{}
func (*SystemMessage) SetExt ¶
func (this *SystemMessage) SetExt(ext map[string]interface{})
type Topic ¶
type Topic struct {
Tid int `xorm:"pk autoincr" json:"tid"`
Title string `json:"title"`
Content string `json:"content"`
Nid int `json:"nid"`
Uid int `json:"uid"`
Flag uint8 `json:"flag"`
Lastreplyuid int `json:"lastreplyuid"`
Lastreplytime OftenTime `json:"lastreplytime"`
EditorUid int `json:"editor_uid"`
Top uint8 `json:"top"`
TopTime int64 `json:"top_time"`
Tags string `json:"tags"`
Permission int `json:"permission"`
CloseReply bool `json:"close_reply"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Mtime OftenTime `json:"mtime" xorm:"<-"`
// 为了方便,加上Node(节点名称,数据表没有)
Node string `xorm:"-"`
// 排行榜阅读量
RankView int `json:"rank_view" xorm:"-"`
}
社区主题信息
func (*Topic) BeforeInsert ¶
func (this *Topic) BeforeInsert()
type TopicAppend ¶
type TopicEx ¶
type TopicEx struct {
Tid int `json:"-"`
View int `json:"view"`
Reply int `json:"reply"`
Like int `json:"like"`
Mtime time.Time `json:"mtime" xorm:"<-"`
}
社区主题扩展(计数)信息
type TopicNode ¶
type TopicNode struct {
Nid int `json:"nid" xorm:"pk autoincr"`
Parent int `json:"parent"`
Logo string `json:"logo"`
Name string `json:"name"`
Ename string `json:"ename"`
Seq int `json:"seq"`
Intro string `json:"intro"`
ShowIndex bool `json:"show_index"`
Ctime time.Time `json:"ctime" xorm:"<-"`
Level int `json:"-" xorm:"-"`
}
社区主题节点信息
type TopicUpEx ¶
type TopicUpEx struct {
Tid int `json:"-" xorm:"pk"`
View int `json:"view"`
Reply int `json:"reply"`
Like int `json:"like"`
Mtime time.Time `json:"mtime" xorm:"<-"`
}
社区主题扩展(计数)信息,用于 incr 更新
type User ¶
type User struct {
Uid int `json:"uid" xorm:"pk autoincr"`
Username string `json:"username" validate:"min=4,max=20,regexp=^[a-zA-Z0-9_]*$"`
Email string `json:"email"`
Open int `json:"open"`
Name string `json:"name"`
Avatar string `json:"avatar"`
City string `json:"city"`
Company string `json:"company"`
Github string `json:"github"`
Gitea string `json:"gitea"`
Weibo string `json:"weibo"`
Website string `json:"website"`
Monlog string `json:"monlog"`
Introduce string `json:"introduce"`
Unsubscribe int `json:"unsubscribe"`
Balance int `json:"balance"`
IsThird int `json:"is_third"`
DauAuth int `json:"dau_auth"`
IsVip bool `json:"is_vip"`
VipExpire int `json:"vip_expire"`
Status int `json:"status"`
IsRoot bool `json:"is_root"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Mtime time.Time `json:"mtime" xorm:"<-"`
// 非用户表中的信息,为了方便放在这里
Roleids []int `xorm:"-"`
Rolenames []string `xorm:"-"`
// 活跃度
Weight int `json:"weight" xorm:"-"`
Gold int `json:"gold" xorm:"-"`
Silver int `json:"silver" xorm:"-"`
Copper int `json:"copper" xorm:"-"`
IsOnline bool `json:"is_online" xorm:"-"`
}
用户基本信息
type UserActive ¶
type UserActive struct {
Uid int `json:"uid" xorm:"pk"`
Username string `json:"username"`
Email string `json:"email"`
Avatar string `json:"avatar"`
Weight int `json:"weight"`
Mtime time.Time `json:"mtime" xorm:"<-"`
}
活跃用户信息 活跃度规则:
1、注册成功后 +2 2、登录一次 +1 3、修改资料 +1 4、发帖子 + 10 5、评论 +5 6、创建Wiki页 +10
type UserBalanceDetail ¶
type UserExchangeRecord ¶
type UserLogin ¶
type UserLogin struct {
Uid int `json:"uid" xorm:"pk"`
Username string `json:"username"`
Passcode string `json:"passcode"` // 加密随机串
Passwd string `json:"passwd"`
Email string `json:"email"`
LoginIp string `json:"login_ip"`
LoginTime time.Time `json:"login_time" xorm:"<-"`
}
用户登录信息
type UserLoginMission ¶
type UserRecharge ¶
type UserRole ¶
type UserRole struct {
Uid int `json:"uid"`
Roleid int `json:"roleid"`
// contains filtered or unexported fields
}
用户角色信息
type UserSetting ¶
type ViewRecord ¶
type ViewSource ¶
type WechatAutoReply ¶
type WechatAutoReply struct {
Id int `xorm:"pk autoincr"`
Typ uint8
Word string
MsgType string
Content string
CreatedAt time.Time `xorm:"created"`
UpdatedAt time.Time `xorm:"<-"`
}
WechatAutoReply 微信自动回复
type WechatImage ¶
type WechatImage struct {
MediaId *CData
}
type WechatMsg ¶
type WechatMsg struct {
ToUserName string
FromUserName string
CreateTime int64
MsgType string
Content string
MsgId int64
// 图片消息
PicUrl string
MediaId string
// 音频消息
Format string
// 视频或短视频
ThumbMediaId string
// 地理位置消息
Location_X float64
Location_Y float64
Scale int
Label string
// 链接消息
Title string
Description string
Url string
// 事件
Event string
}
type WechatReply ¶
type WechatUser ¶
type WechatUser struct {
Id int `xorm:"pk autoincr"`
Openid string
Nickname string
Avatar string
SessionKey string
OpenInfo string
Uid int
CreatedAt time.Time `xorm:"created"`
UpdatedAt time.Time `xorm:"<-"`
}
微信绑定用户信息
type Wiki ¶
type Wiki struct {
Id int `json:"id" xorm:"pk autoincr"`
Title string `json:"title"`
Content string `json:"content"`
Uri string `json:"uri"`
Uid int `json:"uid"`
Cuid string `json:"cuid"`
Viewnum int `json:"viewnum"`
Tags string `json:"tags"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Mtime time.Time `json:"mtime" xorm:"<-"`
Users map[int]*User `xorm:"-"`
}
func (*Wiki) BeforeInsert ¶
func (this *Wiki) BeforeInsert()
Source Files
¶
- ad.go
- article.go
- authority.go
- auto_tag.go
- book.go
- comment.go
- default_avatar.go
- document.go
- download.go
- dynamic.go
- favorite.go
- feed.go
- friend_link.go
- gctt.go
- gift.go
- github_user.go
- image.go
- interview_question.go
- learning_material.go
- like.go
- message.go
- mission.go
- morning_reading.go
- openproject.go
- resource.go
- role.go
- search_stat.go
- subject.go
- topic.go
- type.go
- user.go
- user_rich.go
- user_setting.go
- view_record.go
- view_source.go
- website_setting.go
- wechat.go
- wechat_msg.go
- wiki.go
Click to show internal directories.
Click to hide internal directories.