Documentation ¶
Index ¶
- Constants
- Variables
- type Activity
- type ActivityRankSum
- type AdminSetAnswerStatusRequest
- type Answer
- type AnswerSearch
- type CmsAnswerSearch
- type Collection
- type CollectionGroup
- type CollectionSearch
- type Comment
- type Config
- type Meta
- type Notification
- type Question
- type QuestionTag
- type Report
- type Revision
- type SiteInfo
- type Tag
- type TagRel
- type Uniqid
- type User
- type UserCacheInfo
- type UserSearch
- type Version
Constants ¶
View Source
const ( ActivityAvailable = 0 ActivityCancelled = 1 )
View Source
const ( AnswerSearchOrderByDefault = "default" AnswerSearchOrderByTime = "updated" AnswerSearchOrderByVote = "vote" AnswerStatusAvailable = 1 AnswerStatusDeleted = 10 )
View Source
const ( CommentStatusAvailable = 1 CommentStatusDeleted = 10 )
View Source
const ( QuestionEditSummaryKey = "question.edit.summary" QuestionCloseReasonKey = "question.close.reason" AnswerEditSummaryKey = "answer.edit.summary" TagEditSummaryKey = "tag.edit.summary" )
View Source
const ( QuestionStatusAvailable = 1 QuestionStatusclosed = 2 QuestionStatusDeleted = 10 )
View Source
const ( ReportStatusPending = 1 ReportStatusCompleted = 2 ReportStatusDeleted = 10 )
View Source
const ( TagStatusAvailable = 1 TagStatusDeleted = 10 )
View Source
const ( TagRelStatusAvailable = 1 TagRelStatusDeleted = 10 )
View Source
const ( UserStatusAvailable = 1 UserStatusSuspended = 9 UserStatusDeleted = 10 )
View Source
const ( EmailStatusAvailable = 1 EmailStatusToBeVerified = 2 )
View Source
const (
UserAdminFlag = 1
)
Variables ¶
View Source
var CmsAnswerSearchStatus = map[string]int{ "available": AnswerStatusAvailable, "deleted": AnswerStatusDeleted, }
View Source
var CmsQuestionSearchStatus = map[string]int{ "available": QuestionStatusAvailable, "closed": QuestionStatusclosed, "deleted": QuestionStatusDeleted, }
View Source
var CmsQuestionSearchStatusIntToString = map[int]string{ QuestionStatusAvailable: "available", QuestionStatusclosed: "closed", QuestionStatusDeleted: "deleted", }
View Source
var ( ReportStatus = map[string]int{ "pending": ReportStatusPending, "completed": ReportStatusCompleted, "deleted": ReportStatusDeleted, } )
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` UserID string `xorm:"not null index BIGINT(20) user_id"` TriggerUserID int64 `xorm:"not null default 0 index BIGINT(20) trigger_user_id"` ObjectID string `xorm:"not null default 0 index BIGINT(20) object_id"` ActivityType int `xorm:"not null INT(11) activity_type"` Cancelled int `xorm:"not null default 0 TINYINT(4) cancelled"` Rank int `xorm:"not null default 0 INT(11) rank"` HasRank int `xorm:"not null default 0 TINYINT(4) has_rank"` }
Activity activity
type ActivityRankSum ¶
type ActivityRankSum struct {
Rank int `xorm:"not null default 0 INT(11) rank"`
}
type Answer ¶
type Answer struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created not null default CURRENT_TIMESTAMP TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP TIMESTAMP updated_at"` QuestionID string `xorm:"not null default 0 BIGINT(20) question_id"` UserID string `xorm:"not null default 0 BIGINT(20) INDEX user_id"` OriginalText string `xorm:"not null MEDIUMTEXT original_text"` ParsedText string `xorm:"not null MEDIUMTEXT parsed_text"` Status int `xorm:"not null default 1 INT(11) status"` Adopted int `xorm:"not null default 1 INT(11) adopted"` CommentCount int `xorm:"not null default 0 INT(11) comment_count"` VoteCount int `xorm:"not null default 0 INT(11) vote_count"` RevisionID string `xorm:"not null default 0 BIGINT(20) revision_id"` }
Answer answer
type AnswerSearch ¶
type CmsAnswerSearch ¶
type CmsAnswerSearch struct { Page int `json:"page" form:"page"` // Query number of pages PageSize int `json:"page_size" form:"page_size"` // Search page size Status int `json:"-" form:"-"` StatusStr string `json:"status" form:"status"` // Status 1 Available 2 closed 10 Deleted Query string `validate:"omitempty,gt=0,lte=100" json:"query" form:"query" ` //Query string QuestionID string `validate:"omitempty,gt=0,lte=24" json:"question_id" form:"question_id" ` //Query string }
type Collection ¶
type Collection struct { ID string `xorm:"not null pk default 0 BIGINT(20) id"` CreatedAt time.Time `xorm:"created not null default CURRENT_TIMESTAMP TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated not null default CURRENT_TIMESTAMP TIMESTAMP updated_at"` UserID string `xorm:"not null default 0 BIGINT(20) INDEX user_id"` ObjectID string `xorm:"not null default 0 BIGINT(20) object_id"` UserCollectionGroupID string `xorm:"not null default 0 BIGINT(20) user_collection_group_id"` }
Collection collection
type CollectionGroup ¶
type CollectionGroup struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created not null default CURRENT_TIMESTAMP TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated not null default CURRENT_TIMESTAMP TIMESTAMP updated_at"` UserID string `xorm:"not null default 0 BIGINT(20) INDEX user_id"` Name string `xorm:"not null default '' VARCHAR(50) name"` DefaultGroup int `xorm:"not null default 1 INT(11) default_group"` }
CollectionGroup collection group
func (CollectionGroup) TableName ¶
func (CollectionGroup) TableName() string
TableName collection group table name
type CollectionSearch ¶
type CollectionSearch struct { Collection Page int `json:"page" form:"page"` //Query number of pages PageSize int `json:"page_size" form:"page_size"` //Search page size }
type Comment ¶
type Comment struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` UserID string `xorm:"not null default 0 BIGINT(20) user_id"` ReplyUserID sql.NullInt64 `xorm:"BIGINT(20) reply_user_id"` ReplyCommentID sql.NullInt64 `xorm:"BIGINT(20) reply_comment_id"` ObjectID string `xorm:"not null default 0 BIGINT(20) INDEX object_id"` QuestionID string `xorm:"not null default 0 BIGINT(20) question_id"` VoteCount int `xorm:"not null default 0 INT(11) vote_count"` Status int `xorm:"not null default 0 TINYINT(4) status"` OriginalText string `xorm:"not null MEDIUMTEXT original_text"` ParsedText string `xorm:"not null MEDIUMTEXT parsed_text"` }
Comment comment
func (*Comment) GetReplyCommentID ¶
GetReplyCommentID get reply comment id
func (*Comment) GetReplyUserID ¶
GetReplyUserID get reply user id
func (*Comment) SetReplyCommentID ¶
SetReplyCommentID set reply comment id
func (*Comment) SetReplyUserID ¶
SetReplyUserID set reply user id
type Config ¶
type Config struct { ID int `xorm:"not null pk autoincr INT(11) id"` Key string `xorm:"unique VARCHAR(32) key"` Value string `xorm:"TEXT value"` }
Config config
type Meta ¶
type Meta struct { ID int `xorm:"not null pk autoincr INT(10) id"` CreatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP updated TIMESTAMP updated_at"` ObjectID string `xorm:"not null default 0 INDEX BIGINT(20) object_id"` Key string `xorm:"not null VARCHAR(100) key"` Value string `xorm:"not null MEDIUMTEXT value"` }
Meta meta
type Notification ¶
type Notification struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"TIMESTAMP updated_at"` UserID string `xorm:"not null default 0 BIGINT(20) INDEX user_id"` ObjectID string `xorm:"not null default 0 INDEX BIGINT(20) object_id"` Content string `xorm:"not null TEXT content"` Type int `xorm:"not null default 0 INT(11) type"` IsRead int `xorm:"not null default 1 INT(11) is_read"` Status int `xorm:"not null default 1 INT(11) status"` }
Notification notification
func (Notification) TableName ¶
func (Notification) TableName() string
TableName notification table name
type Question ¶
type Question struct { ID string `xorm:"not null pk BIGINT(20) id"` CreatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP TIMESTAMP updated_at"` UserID string `xorm:"not null default 0 BIGINT(20) INDEX user_id"` Title string `xorm:"not null default '' VARCHAR(150) title"` OriginalText string `xorm:"not null MEDIUMTEXT original_text"` ParsedText string `xorm:"not null MEDIUMTEXT parsed_text"` Status int `xorm:"not null default 1 INT(11) status"` ViewCount int `xorm:"not null default 0 INT(11) view_count"` UniqueViewCount int `xorm:"not null default 0 INT(11) unique_view_count"` VoteCount int `xorm:"not null default 0 INT(11) vote_count"` AnswerCount int `xorm:"not null default 0 INT(11) answer_count"` CollectionCount int `xorm:"not null default 0 INT(11) collection_count"` FollowCount int `xorm:"not null default 0 INT(11) follow_count"` AcceptedAnswerID string `xorm:"not null default 0 BIGINT(20) accepted_answer_id"` LastAnswerID string `xorm:"not null default 0 BIGINT(20) last_answer_id"` PostUpdateTime time.Time `xorm:"default CURRENT_TIMESTAMP TIMESTAMP post_update_time"` RevisionID string `xorm:"not null default 0 BIGINT(20) revision_id"` }
Question question
type QuestionTag ¶
type Report ¶
type Report struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` UserID string `xorm:"not null BIGINT(20) user_id"` ObjectID string `xorm:"not null BIGINT(20) object_id"` ReportedUserID string `xorm:"not null default 0 BIGINT(20) reported_user_id"` ObjectType int `xorm:"not null default 0 INT(11) object_type"` ReportType int `xorm:"not null default 0 INT(11) report_type"` Content string `xorm:"not null TEXT content"` FlaggedType int `xorm:"not null default 0 INT(11) flagged_type"` FlaggedContent string `xorm:"TEXT flagged_content"` Status int `xorm:"not null default 1 INT(11) status"` }
Report report
type Revision ¶
type Revision struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` UserID string `xorm:"not null default 0 BIGINT(20) user_id"` ObjectType int `xorm:"not null default 0 ) INT(11) object_type"` ObjectID string `xorm:"not null default 0 BIGINT(20) INDEX object_id"` Title string `xorm:"not null default '' VARCHAR(255) title"` Content string `xorm:"not null TEXT content"` Log string `xorm:"VARCHAR(255) log"` // Status todo: this field is not used, will be removed in the future Status int `xorm:"not null default 1 INT(11) status"` }
Revision revision
type SiteInfo ¶
type SiteInfo struct { ID string `xorm:"not null pk autoincr INT(11) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` Type string `xorm:"not null VARCHAR(64) type"` Content string `xorm:"not null MEDIUMTEXT content"` Status int `xorm:"not null default 1 INT(11) status"` }
SiteInfo site information setting
type Tag ¶
type Tag struct { ID string `xorm:"not null pk comment('tag_id') BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` MainTagID int64 `xorm:"not null default 0 BIGINT(20) main_tag_id"` MainTagSlugName string `xorm:"not null default '' VARCHAR(35) main_tag_slug_name"` SlugName string `xorm:"not null default '' unique VARCHAR(35) slug_name"` DisplayName string `xorm:"not null default '' VARCHAR(35) display_name"` OriginalText string `xorm:"not null MEDIUMTEXT original_text"` ParsedText string `xorm:"not null MEDIUMTEXT parsed_text"` FollowCount int `xorm:"not null default 0 INT(11) follow_count"` QuestionCount int `xorm:"not null default 0 INT(11) question_count"` Status int `xorm:"not null default 1 INT(11) status"` Recommend bool `xorm:"not null default false BOOL recommend"` Reserved bool `xorm:"not null default false BOOL reserved"` RevisionID string `xorm:"not null default 0 BIGINT(20) revision_id"` }
Tag tag
type TagRel ¶
type TagRel struct { ID int64 `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` ObjectID string `xorm:"not null INDEX UNIQUE(s) BIGINT(20) object_id"` TagID string `xorm:"not null INDEX UNIQUE(s) BIGINT(20) tag_id"` Status int `xorm:"not null default 1 INT(11) status"` }
TagRel tag relation
type Uniqid ¶
type Uniqid struct { ID int64 `xorm:"not null pk autoincr BIGINT(20) id"` UniqidType int `xorm:"not null default 0 INT(11) uniqid_type"` }
Uniqid uniqid
type User ¶
type User struct { ID string `xorm:"not null pk autoincr BIGINT(20) id"` CreatedAt time.Time `xorm:"created TIMESTAMP created_at"` UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"` SuspendedAt time.Time `xorm:"TIMESTAMP suspended_at"` DeletedAt time.Time `xorm:"TIMESTAMP deleted_at"` LastLoginDate time.Time `xorm:"TIMESTAMP last_login_date"` Username string `xorm:"not null default '' VARCHAR(50) UNIQUE username"` Pass string `xorm:"not null default '' VARCHAR(255) pass"` EMail string `xorm:"not null VARCHAR(100) e_mail"` MailStatus int `xorm:"not null default 2 TINYINT(4) mail_status"` NoticeStatus int `xorm:"not null default 2 INT(11) notice_status"` FollowCount int `xorm:"not null default 0 INT(11) follow_count"` AnswerCount int `xorm:"not null default 0 INT(11) answer_count"` QuestionCount int `xorm:"not null default 0 INT(11) question_count"` Rank int `xorm:"not null default 0 INT(11) rank"` Status int `xorm:"not null default 1 INT(11) status"` AuthorityGroup int `xorm:"not null default 1 INT(11) authority_group"` DisplayName string `xorm:"not null default '' VARCHAR(30) display_name"` Avatar string `xorm:"not null default '' VARCHAR(255) avatar"` Mobile string `xorm:"not null VARCHAR(20) mobile"` Bio string `xorm:"not null TEXT bio"` BioHTML string `xorm:"not null TEXT bio_html"` Website string `xorm:"not null default '' VARCHAR(255) website"` Location string `xorm:"not null default '' VARCHAR(100) location"` IPInfo string `xorm:"not null default '' VARCHAR(255) ip_info"` IsAdmin bool `xorm:"not null default false BOOL is_admin"` Language string `xorm:"not null default '' VARCHAR(100) language"` }
User user
type UserCacheInfo ¶
type UserCacheInfo struct { UserID string `json:"user_id"` UserStatus int `json:"user_status"` EmailStatus int `json:"email_status"` IsAdmin bool `json:"is_admin"` }
UserCacheInfo User Cache Information
type UserSearch ¶
Source Files ¶
- activity_entity.go
- answer_entity.go
- auth_user_entity.go
- collection_entity.go
- collection_group_entity.go
- comment_entity.go
- config_entity.go
- meta_entity.go
- notification_entity.go
- question_entity.go
- report_entity.go
- revision_entity.go
- site_info.go
- tag_entity.go
- tag_rel_entity.go
- uniqid_entity.go
- user_entity.go
- version_entity.go
Click to show internal directories.
Click to hide internal directories.