entity

package
v1.3.1-RC2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityAvailable = 0
	ActivityCancelled = 1
)
View Source
const (
	AnswerSearchOrderByDefault = "default"
	AnswerSearchOrderByTime    = "updated"
	AnswerSearchOrderByVote    = "vote"
	AnswerSearchOrderByTimeAsc = "created"

	AnswerStatusAvailable = 1
	AnswerStatusDeleted   = 10
	AnswerStatusPending   = 11
)
View Source
const (
	CaptchaActionEmail            = "email"
	CaptchaActionPassword         = "password"
	CaptchaActionEditUserinfo     = "edit_userinfo"
	CaptchaActionQuestion         = "question"
	CaptchaActionAnswer           = "answer"
	CaptchaActionComment          = "comment"
	CaptchaActionEdit             = "edit"
	CaptchaActionInvitationAnswer = "invitation_answer"
	CaptchaActionSearch           = "search"
	CaptchaActionReport           = "report"
	CaptchaActionDelete           = "delete"
	CaptchaActionVote             = "vote"
)
View Source
const (
	CommentStatusAvailable = 1
	CommentStatusDeleted   = 10
	CommentStatusPending   = 11
)
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
	QuestionStatusPending   = 11
	QuestionUnPin           = 1
	QuestionPin             = 2
	QuestionShow            = 1
	QuestionHide            = 2
)
View Source
const (
	ReportStatusPending   = 1
	ReportStatusCompleted = 2
	ReportStatusIgnore    = 3
	ReportStatusDeleted   = 10
)
View Source
const (
	ReviewStatusPending  = 1
	ReviewStatusApproved = 2
	ReviewStatusRejected = 3
)
View Source
const (
	// RevisioNnormalStatus this revision is Nnormal
	RevisioNnormalStatus = 0
	// RevisionUnreviewedStatus this revision is unreviewed
	RevisionUnreviewedStatus = 1
	// RevisionReviewPassStatus this revision is reviewed and approved by operator
	RevisionReviewPassStatus = 2
	// RevisionReviewRejectStatus this revision is reviewed and rejected by operator
	RevisionReviewRejectStatus = 3
)
View Source
const (
	TagStatusAvailable = 1
	TagStatusDeleted   = 10
)
View Source
const (
	TagRelStatusAvailable = 1
	TagRelStatusHide      = 2
	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 AdminAnswerSearchStatus = map[string]int{
	"available": AnswerStatusAvailable,
	"deleted":   AnswerStatusDeleted,
	"pending":   AnswerStatusPending,
}
View Source
var AdminQuestionSearchStatus = map[string]int{
	"available": QuestionStatusAvailable,
	"closed":    QuestionStatusClosed,
	"deleted":   QuestionStatusDeleted,
	"pending":   QuestionStatusPending,
}
View Source
var AdminQuestionSearchStatusIntToString = map[int]string{
	QuestionStatusAvailable: "available",
	QuestionStatusClosed:    "closed",
	QuestionStatusDeleted:   "deleted",
	QuestionStatusPending:   "pending",
}
View Source
var (
	ReportStatus = map[string]int{
		"pending":   ReportStatusPending,
		"completed": ReportStatusCompleted,
		"deleted":   ReportStatusDeleted,
	}
)
View Source
var TagStatusDisplayMapping = map[int]string{
	TagStatusAvailable: "available",
	TagStatusDeleted:   "deleted",
}

Functions

This section is empty.

Types

type ActionRecordInfo

type ActionRecordInfo struct {
	LastTime int64  `json:"last_time"`
	Num      int    `json:"num"`
	Config   string `json:"config"`
}

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"`
	CancelledAt      time.Time `xorm:"TIMESTAMP cancelled_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"`
	OriginalObjectID string    `xorm:"not null default 0 BIGINT(20) original_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"`
	RevisionID       int64     `xorm:"not null default 0 BIGINT(20) revision_id"`
}

Activity activity

func (Activity) TableName

func (Activity) TableName() string

TableName activity table name

type ActivityRankSum

type ActivityRankSum struct {
	Rank int `xorm:"not null default 0 INT(11) rank"`
}

type ActivityUserRankStat

type ActivityUserRankStat struct {
	UserID string `xorm:"user_id"`
	Rank   int    `xorm:"rank_amount"`
}

type ActivityUserVoteStat

type ActivityUserVoteStat struct {
	UserID    string `xorm:"user_id"`
	VoteCount int    `xorm:"vote_count"`
}

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:"updated_at TIMESTAMP"`
	QuestionID     string    `xorm:"not null default 0 BIGINT(20) question_id"`
	UserID         string    `xorm:"not null default 0 BIGINT(20) INDEX user_id"`
	LastEditUserID string    `xorm:"not null default 0 BIGINT(20) last_edit_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"`
	Accepted       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

func (Answer) TableName

func (Answer) TableName() string

TableName answer table name

type AnswerSearch

type AnswerSearch struct {
	Answer
	IncludeDeleted bool   `json:"include_deleted"`
	LoginUserID    string `json:"login_user_id"`
	Order          string `json:"order_by"`                   // default or updated
	Page           int    `json:"page" form:"page"`           // Query number of pages
	PageSize       int    `json:"page_size" form:"page_size"` // Search page size
}

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

func (Collection) TableName

func (Collection) TableName() string

TableName collection table name

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

func (c *Comment) GetReplyCommentID() string

GetReplyCommentID get reply comment id

func (*Comment) GetReplyUserID

func (c *Comment) GetReplyUserID() string

GetReplyUserID get reply user id

func (*Comment) SetReplyCommentID

func (c *Comment) SetReplyCommentID(str string)

SetReplyCommentID set reply comment id

func (*Comment) SetReplyUserID

func (c *Comment) SetReplyUserID(str string)

SetReplyUserID set reply user id

func (*Comment) TableName

func (c *Comment) TableName() string

TableName comment table name

type Config

type Config struct {
	ID    int    `xorm:"not null pk autoincr INT(11) id"`
	Key   string `xorm:"unique VARCHAR(128) key"`
	Value string `xorm:"TEXT value"`
}

Config config

func (*Config) BuildByJSON

func (c *Config) BuildByJSON(data []byte)

func (*Config) GetArrayStringValue

func (c *Config) GetArrayStringValue() []string

GetArrayStringValue get array string value

func (*Config) GetByteValue

func (c *Config) GetByteValue() []byte

GetByteValue get byte value

func (*Config) GetIntValue

func (c *Config) GetIntValue() int

GetIntValue get int value

func (*Config) JsonString

func (c *Config) JsonString() string

func (*Config) TableName

func (c *Config) TableName() string

TableName config table name

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

func (Meta) TableName

func (Meta) TableName() string

TableName meta table name

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"`
	MsgType   int       `xorm:"not null default 0 INT(11) msg_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 PersonalAnswerPageQueryCond added in v1.3.0

type PersonalAnswerPageQueryCond struct {
	Page        int
	PageSize    int
	UserID      string
	Order       string
	ShowPending bool
}

type PluginConfig

type PluginConfig struct {
	ID             int    `xorm:"not null pk autoincr INT(11) id"`
	PluginSlugName string `xorm:"unique VARCHAR(128) plugin_slug_name"`
	Value          string `xorm:"TEXT value"`
}

PluginConfig plugin config

func (PluginConfig) TableName

func (PluginConfig) TableName() string

TableName config table name

type PluginUserConfig added in v1.2.5

type PluginUserConfig struct {
	ID             int    `xorm:"not null pk autoincr INT(11) id"`
	UserID         string `xorm:"not null default 0 BIGINT(20) UNIQUE(uk_up) user_id"`
	PluginSlugName string `xorm:"VARCHAR(128) UNIQUE(uk_up) plugin_slug_name"`
	Value          string `xorm:"TEXT value"`
}

PluginUserConfig plugin config

func (PluginUserConfig) TableName added in v1.2.5

func (PluginUserConfig) TableName() string

TableName config table name

type Power

type Power struct {
	ID          int       `xorm:"not null pk autoincr INT(11) id"`
	CreatedAt   time.Time `xorm:"created TIMESTAMP created_at"`
	UpdatedAt   time.Time `xorm:"updated TIMESTAMP updated_at"`
	Name        string    `xorm:"not null default '' VARCHAR(50) name"`
	PowerType   string    `xorm:"not null default '' VARCHAR(100) power_type"`
	Description string    `xorm:"not null default '' VARCHAR(200) description"`
}

Power power

func (Power) TableName

func (Power) TableName() string

TableName power 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:"updated_at TIMESTAMP"`
	UserID           string    `xorm:"not null default 0 BIGINT(20) INDEX user_id"`
	InviteUserID     string    `xorm:"TEXT invite_user_id"`
	LastEditUserID   string    `xorm:"not null default 0 BIGINT(20) last_edit_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"`
	Pin              int       `xorm:"not null default 1 INT(11) pin"`
	Show             int       `xorm:"not null default 1 INT(11) show"`
	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:"post_update_time TIMESTAMP"`
	RevisionID       string    `xorm:"not null default 0 BIGINT(20) revision_id"`
}

Question question

func (Question) TableName

func (Question) TableName() string

TableName question table name

type QuestionWithTagsRevision

type QuestionWithTagsRevision struct {
	Question
	Tags []*TagSimpleInfoForRevision `json:"tags"`
}

QuestionWithTagsRevision question

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

func (Report) TableName

func (Report) TableName() string

TableName report table name

type Review added in v1.3.0

type Review struct {
	ID             int       `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"`
	ObjectType     int       `xorm:"not null default 0 INT(11) object_type"`
	ReviewerUserID string    `xorm:"not null default 0 BIGINT(20) reviewer_user_id"`
	Submitter      string    `xorm:"not null default '' VARCHAR(100) submitter"`
	Reason         string    `xorm:"not null TEXT reason"`
	Status         int       `xorm:"not null default 0 INT(11) status"`
}

Review review

func (Review) TableName added in v1.3.0

func (Review) TableName() string

TableName review table name

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 MEDIUMTEXT content"`
	Log          string    `xorm:"VARCHAR(255) log"`
	Status       int       `xorm:"not null default 1 INT(11) status"`
	ReviewUserID int64     `xorm:"not null default 0 BIGINT(20) review_user_id"`
}

Revision revision

func (Revision) TableName

func (Revision) TableName() string

TableName revision table name

type Role

type Role struct {
	ID          int       `xorm:"not null pk autoincr INT(11) id"`
	CreatedAt   time.Time `xorm:"created TIMESTAMP created_at"`
	UpdatedAt   time.Time `xorm:"updated TIMESTAMP updated_at"`
	Name        string    `xorm:"not null default '' VARCHAR(50) name"`
	Description string    `xorm:"not null default '' VARCHAR(200) description"`
}

Role role

func (Role) TableName

func (Role) TableName() string

TableName user table name

type RolePowerRel

type RolePowerRel struct {
	ID        int       `xorm:"not null pk autoincr INT(11) id"`
	CreatedAt time.Time `xorm:"created TIMESTAMP created_at"`
	UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"`
	RoleID    int       `xorm:"not null default 0 INT(11) role_id"`
	PowerType string    `xorm:"not null default '' VARCHAR(200) power_type"`
}

RolePowerRel role power rel

func (RolePowerRel) TableName

func (RolePowerRel) TableName() string

TableName role power rel table name

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

func (*SiteInfo) TableName

func (*SiteInfo) TableName() string

TableName table name

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"`
	UserID          string    `xorm:"not null default 0 BIGINT(20) user_id"`
}

Tag tag

func (Tag) TableName

func (Tag) TableName() string

TableName tag table name

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

func (TagRel) TableName

func (TagRel) TableName() string

TableName tag list table name

type TagSimpleInfoForRevision

type TagSimpleInfoForRevision struct {
	ID              string `xorm:"not null pk comment('tag_id') BIGINT(20) id"`
	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"`
	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"`
}

TagSimpleInfoForRevision tag simple info for revision

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

func (Uniqid) TableName

func (Uniqid) TableName() string

TableName uniqid table name

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(1024) 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"`
	ColorScheme    string    `xorm:"not null default '' VARCHAR(100) color_scheme"`
}

User user

func (User) TableName

func (User) TableName() string

TableName user table name

type UserCacheInfo

type UserCacheInfo struct {
	UserID      string `json:"user_id"`
	UserStatus  int    `json:"user_status"`
	EmailStatus int    `json:"email_status"`
	RoleID      int    `json:"role_id"`
	ExternalID  string `json:"external_id"`
	VisitToken  string `json:"visit_token"`
}

UserCacheInfo User Cache Information

type UserExternalLogin

type UserExternalLogin 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"`
	UserID     string    `xorm:"not null default 0 BIGINT(20) user_id"`
	Provider   string    `xorm:"not null default '' VARCHAR(100) provider"`
	ExternalID string    `xorm:"not null default '' VARCHAR(128) external_id"`
	MetaInfo   string    `xorm:"TEXT meta_info"`
}

UserExternalLogin user external login

func (UserExternalLogin) TableName

func (UserExternalLogin) TableName() string

TableName table name

type UserNotificationConfig

type UserNotificationConfig 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 INDEX UNIQUE(uk_us) BIGINT(20) INDEX user_id"`
	Source    string    `xorm:"not null default '' INDEX UNIQUE(uk_us) VARCHAR(64) source"`
	Channels  string    `xorm:"not null TEXT channels"`
	Enabled   bool      `xorm:"not null default false BOOL enabled"`
}

UserNotificationConfig user notification config

func (UserNotificationConfig) TableName

func (UserNotificationConfig) TableName() string

TableName notification table name

type UserRoleRel

type UserRoleRel struct {
	ID        int       `xorm:"not null pk autoincr INT(11) 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"`
	RoleID    int       `xorm:"not null default 0 INT(11) role_id"`
}

UserRoleRel role

func (UserRoleRel) TableName

func (UserRoleRel) TableName() string

TableName user role rel table name

type UserSearch

type UserSearch struct {
	User
	Page     int `json:"page" form:"page"`           // Query number of pages
	PageSize int `json:"page_size" form:"page_size"` // Search page size
}

type Version

type Version struct {
	ID            int   `xorm:"not null pk autoincr INT(11) id"`
	VersionNumber int64 `xorm:"not null default 0 INT(11) version_number"`
}

Version version

func (Version) TableName

func (Version) TableName() string

TableName config table name

Jump to

Keyboard shortcuts

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