Documentation ¶
Index ¶
- Variables
- func AddBalance(balance *ConsumptionRecord) bool
- func AddBrowseRecordNum(record *BrowseRecord) bool
- func AddFavorites(favorite *Favorites) bool
- func AddFileRecord(record *UploadFileRecord) (bool, int)
- func AddFileViewsNum(id int) bool
- func AddMember(member *Member) bool
- func AddNewResetRecord(resetInformation, memberId string, recordType int) (int, string)
- func AddNode(node *Node) bool
- func AddNodeModerators(memberId, nodeId string) bool
- func AddNotification(notification *Notification) bool
- func AddPlane(plane *Plane) bool
- func AddReply(reply *Reply) (bool, int)
- func AddReplyNotification(senderId, content string, objectId, topicId int)
- func AddReplyThanksNum(id int) bool
- func AddSensitiveWord(word string)
- func AddTab(tab *Tab) bool
- func AddTopic(topic *Topic) (bool, int)
- func AddTopicHitCount(topicId int) bool
- func AddTopicNotification(objectId int, author, content string)
- func ChangeExpiredDataStatus(recordType int, date string) int
- func ChangeMemberEmailReminder(id, status string) bool
- func ChangeTopicFavoriteCount(topicId int, num int) bool
- func ChangeTopicLastReplyUser(topicId int, memberId string, updateTime string) bool
- func ChangeTopicReplyCount(topicId int, num int) bool
- func ChangeTopicTopExpiredTime(id int, date, topType string) bool
- func CheckMemberLogin(information, password string) (string, string)
- func CheckMemberSignup(member string, password string) string
- func CheckMemberSignupWithEmail(member string, email string) string
- func CheckMemberSignupWithPhone(member string, phoneNumber string) string
- func CheckMemberSignupWithQQ(member string, qqOpenId string) string
- func CheckMemberSignupWithWeChat(member string, wechatOpenId string) string
- func CheckModIdentity(memberId string) bool
- func CheckNodeModerator(memberId, nodeId string) bool
- func CheckResetCodeExpired(id string) bool
- func CheckValidateCodeExpired(id string) bool
- func ContainsSensitiveWord(str string) bool
- func CreateReplyConsumption(consumerId string, id int) bool
- func CreateTopicConsumption(consumerId string, id int) bool
- func DeleteFavorites(memberId string, objectId string, favoritesType int) bool
- func DeleteFileRecord(id int) bool
- func DeleteMember(id string) bool
- func DeleteNode(id string) bool
- func DeleteNodeModerators(memberId, nodeId string) bool
- func DeleteNotification(id string) bool
- func DeletePlane(id string) bool
- func DeleteReply(id int) bool
- func DeleteSensitiveWord(word string)
- func DeleteTab(id string) bool
- func DeleteTopic(id int) bool
- func DeletedExpiredData(recordType int, date string) bool
- func ExpireResetRecord(date string) int
- func ExpireTopTopic() int
- func ExpireValidateCode(date string) int
- func ExpiredMemberOnlineStatus(date string) int
- func FileEditable(memberId, author string) bool
- func GetBrowseRecordNum(recordType int, objectId string) int
- func GetCaptcha() (string, []byte)
- func GetConsumptionRecordCount() int
- func GetCreatedTopicsNum(memberId string) int
- func GetDefaultTab() string
- func GetFavoritesCount() int
- func GetFavoritesNum(favoritesType int, memberId string) int
- func GetFavoritesStatus(memberId string, objectId string, favoritesType int) bool
- func GetFilesNum(memberId string) int
- func GetFollowingNum(id string) int
- func GetForumVersion() string
- func GetHighestOnlineNum() int
- func GetLastRecordId() int
- func GetLatestSyncedRecordId() int
- func GetMemberAvatar(id string) string
- func GetMemberBalance(id string) int
- func GetMemberCheckinDate(id string) string
- func GetMemberConsumptionRecordNum(memberId string) int
- func GetMemberEditorType(id string) string
- func GetMemberEmailReminder(id string) (bool, string)
- func GetMemberFileQuota(memberId string) int
- func GetMemberLanguage(id string) string
- func GetMemberMail(id string) string
- func GetMemberNum() int
- func GetMemberOnlineNum() int
- func GetMemberRepliesNum(memberId string) int
- func GetMemberResetFrequency(memberId, date string) int
- func GetMemberStatus(id string) int
- func GetNewValidateCode(information string) (string, string)
- func GetNodeFavoritesNum(id string) int
- func GetNodeModerators(id string) []string
- func GetNodeTopicNum(id string) int
- func GetNodesNum() int
- func GetNotificationCount() int
- func GetNotificationNum(memberId string) int
- func GetOnlineMemberNum() int
- func GetPlaneNodesNum(id string) int
- func GetReplyAuthor(id int) string
- func GetReplyBonus(author, consumerId string, id int)
- func GetReplyCount() int
- func GetReplyEditableStatus(member, author, createdTime string) bool
- func GetReplyTopicTitle(id int) string
- func GetSensitiveWords() []string
- func GetThanksStatus(memberId string, id, recordType int) bool
- func GetTopicAuthor(id int) string
- func GetTopicCount() int
- func GetTopicEditableStatus(member, author, nodeId, createdTime string) bool
- func GetTopicNodeId(id int) string
- func GetTopicNum() int
- func GetTopicReplyNum(topicId int) int
- func GetTopicTitle(id int) string
- func GetUnreadNotificationNum(memberId string) int
- func HasGithubAccount(githubAccount string) string
- func HasGoogleAccount(googleAccount string) string
- func HasMail(email string) string
- func HasMember(memberId string) bool
- func HasNode(id string) bool
- func HasPhone(phoneNumber string) string
- func HasPlane(id string) bool
- func HasQQAccount(qqOpenId string) string
- func HasTab(id string) bool
- func HasWeChatAccount(wechatOpenId string) string
- func InitAdapter()
- func InitForumBasicInfo()
- func InitTimer()
- func IsForbidden(id string) bool
- func IsMuted(id string) bool
- func IsPasswordCorrect(memberId string, password string) bool
- func IsSensitiveWord(word string) bool
- func LinkMemberAccount(memberId, field, value string) bool
- func MemberPasswordLogin(information, password string) string
- func ReplyDeletable(date, memberId, author string) bool
- func TopTopicConsumption(consumerId string, id int) bool
- func UpdateFileDescribe(id int, fileName, desc string) bool
- func UpdateHighestOnlineNum(num int) bool
- func UpdateHotNode(last int) int
- func UpdateHotTopic(last int) int
- func UpdateLatestSyncedRecordId(id int) bool
- func UpdateMember(id string, member *Member) bool
- func UpdateMemberAvatar(id string, avatar string) bool
- func UpdateMemberBalances(id string, amount int) bool
- func UpdateMemberCheckinDate(id, date string) bool
- func UpdateMemberEditorType(id string, editorType string) bool
- func UpdateMemberInfo(id string, member *Member) bool
- func UpdateMemberLanguage(id string, language string) bool
- func UpdateMemberOnlineStatus(id string, onlineStatus bool, lastActionDate string) bool
- func UpdateMemberPassword(id, password string) bool
- func UpdateNode(id string, node *Node) bool
- func UpdateNodeHotInfo(nodeId string, hot int) bool
- func UpdateOnlineMemberNum()
- func UpdatePlane(id string, plane *Plane) bool
- func UpdateReadStatus(id string) bool
- func UpdateReply(id int, reply *Reply) bool
- func UpdateReplyWithLimitCols(id int, reply *Reply) bool
- func UpdateTab(id string, tab *Tab) bool
- func UpdateTopic(id int, topic *Topic) bool
- func UpdateTopicHotInfo(topicId string, hot int) bool
- func UpdateTopicWithLimitCols(id int, topic *Topic) bool
- func VerifyCaptcha(id, digits string) bool
- func VerifyResetInformation(id, validateCode, memberId string, recordType int) bool
- func VerifyValidateCode(id, validateCode, information string) bool
- type Adapter
- type AdminMemberInfo
- type AdminPlaneInfo
- type AdminTabInfo
- type AdminTopicInfo
- type BalanceResponse
- type BasicInfo
- type BrowseRecord
- type CasbinSensitiveWord
- type CommunityHealth
- type ConsumptionRecord
- type CronJob
- type Favorites
- type LatestReply
- type Member
- func GetGithubAccount(githubAccount string) *Member
- func GetGoogleAccount(googleAccount string) *Member
- func GetMail(email string) *Member
- func GetMember(id string) *Member
- func GetMembers() []*Member
- func GetPhoneNumber(phoneNumber string) *Member
- func GetQQAccount(qqOpenId string) *Member
- func GetRankingRich() []*Member
- func GetWechatAccount(wechatOpenId string) *Member
- type Node
- type NodeFavoritesRes
- type NodeNavigationResponse
- type NodeRelation
- type NodeTopic
- type Notification
- type NotificationResponse
- type Plane
- type PlaneWithNodes
- type Reply
- type ReplyWithAvatar
- type ResetRecord
- type Session
- type Tab
- type Topic
- type TopicWithAvatar
- func GetFollowingNewAction(memberId string, limit int, offset int) []*TopicWithAvatar
- func GetHotTopic(limit int) []*TopicWithAvatar
- func GetTopicWithAvatar(id int, memberId string) *TopicWithAvatar
- func GetTopics(limit int, offset int) []*TopicWithAvatar
- func GetTopicsFromFavorites(memberId string, limit int, offset int) []*TopicWithAvatar
- func GetTopicsWithTab(tab string, limit, offset int) []*TopicWithAvatar
- type UpdateJob
- type UploadFileRecord
- type ValidateCode
Constants ¶
This section is empty.
Variables ¶
var ( DefaultPageNum = 20 DefaultHomePageNum = 50 DefaultTopicPageReplyNum = 50 DefaultNotificationPageNum = 10 DefaultBalancePageNum = 25 DefaultFilePageNum = 25 DefaultMemberAdminPageNum = 100 UserNamingRestrictions = true HomePageNodeNum = 8 TopicThanksCost = 15 ReplyThanksCost = 10 CreateTopicCost = 20 CreateReplyCost = 5 TopTopicCost = 200 ReceiveReplyBonus = 5 MaxDailyCheckinBonus = 20 LatestNodeNum = 20 HotNodeNum = 15 HotTopicNum = 10 TopicEditableTime = 10.0 // minutes ReplyEditableTime = 10.0 // minutes ReplyDeletableTime = 5.0 // minutes NodeHitRecordExpiredTime = 1 // month TopicHitRecordExpiredTime = 1 // day ValidateCodeExpiredTime = 20 // minutes DefaultTopTopicTime = 10 // minutes OnlineMemberExpiedTime = 10 // minutes UseOAuthProxy = false DefaultUploadFileQuota = 50 Domain = "forum.casbin.com" // domain DefaultCronJobs = []*CronJob{ { Id: "updateExpiredData", BumpTime: "0:0", State: "active", }, { Id: "updateHotInfo", BumpTime: "*/1:*", State: "active", }, { Id: "expireData", BumpTime: "*/1:*", State: "active", }, } DefaultCronUpdates = []*UpdateJob{ { Id: "expireData", JobId: "updateExpiredData", State: "active", }, { Id: "hotInfo", JobId: "updateHotInfo", State: "active", }, { Id: "expireValidateCode", JobId: "expireData", State: "active", }, { Id: "expireTopTopic", JobId: "expireData", State: "active", }, { Id: "expireOnlineMember", JobId: "expireData", State: "active", }, } )
Functions ¶
func AddBalance ¶
func AddBalance(balance *ConsumptionRecord) bool
func AddBrowseRecordNum ¶
func AddBrowseRecordNum(record *BrowseRecord) bool
func AddFavorites ¶
func AddFileRecord ¶
func AddFileRecord(record *UploadFileRecord) (bool, int)
func AddFileViewsNum ¶
func AddNewResetRecord ¶
AddValidateCode: return validate code
func AddNodeModerators ¶
func AddNotification ¶
func AddNotification(notification *Notification) bool
func AddReplyNotification ¶
func AddReplyThanksNum ¶
AddReplyThanksNum updates reply's thanks num.
func AddSensitiveWord ¶
func AddSensitiveWord(word string)
func AddTopicHitCount ¶
func AddTopicNotification ¶
func ChangeExpiredDataStatus ¶
func ChangeMemberEmailReminder ¶
ChangeMemberEmailReminder change member's email reminder status
func ChangeTopicReplyCount ¶
func ChangeTopicTopExpiredTime ¶
ChangeTopicTopExpiredTime changes topic's top expired time. topType: tab, node or homePage.
func CheckMemberLogin ¶
CheckMemberLogin needs password, and information, which could be username, phone number or email.
func CheckMemberSignup ¶
func CheckMemberSignupWithQQ ¶
func CheckModIdentity ¶
func CheckNodeModerator ¶
func CheckResetCodeExpired ¶
func CheckValidateCodeExpired ¶
CheckValidateCodeExpired checks whether the verification code has expired.
func ContainsSensitiveWord ¶
func CreateReplyConsumption ¶
func CreateTopicConsumption ¶
func DeleteFavorites ¶
func DeleteFileRecord ¶
func DeleteMember ¶
DeleteMember change this function to update member status.
func DeleteNode ¶
func DeleteNodeModerators ¶
func DeleteNotification ¶
func DeletePlane ¶
func DeleteSensitiveWord ¶
func DeleteSensitiveWord(word string)
func DeleteTopic ¶
func DeletedExpiredData ¶
func ExpireResetRecord ¶
func ExpireTopTopic ¶
func ExpireTopTopic() int
ExpireTopTopic searches and expires expired top topic.
func ExpireValidateCode ¶
ExpireValidateCode expires validate code according to date, return effects num.
func FileEditable ¶
func GetBrowseRecordNum ¶
func GetCaptcha ¶
func GetConsumptionRecordCount ¶
func GetConsumptionRecordCount() int
func GetCreatedTopicsNum ¶
func GetDefaultTab ¶
func GetDefaultTab() string
func GetFavoritesCount ¶
func GetFavoritesCount() int
func GetFavoritesNum ¶
func GetFavoritesStatus ¶
func GetFilesNum ¶
func GetFollowingNum ¶
func GetForumVersion ¶
func GetForumVersion() string
func GetHighestOnlineNum ¶
func GetHighestOnlineNum() int
func GetLastRecordId ¶
func GetLastRecordId() int
func GetLatestSyncedRecordId ¶
func GetLatestSyncedRecordId() int
func GetMemberAvatar ¶
func GetMemberBalance ¶
func GetMemberCheckinDate ¶
func GetMemberEditorType ¶
func GetMemberEmailReminder ¶
GetMemberEmailReminder return member's email reminder status, and his email adress.
func GetMemberFileQuota ¶
func GetMemberLanguage ¶
func GetMemberNum ¶
func GetMemberNum() int
func GetMemberOnlineNum ¶
func GetMemberOnlineNum() int
func GetMemberRepliesNum ¶
GetMemberRepliesNum returns member's all replies num.
func GetMemberResetFrequency ¶
func GetMemberStatus ¶
GetMemberStatus returns member's account status, default 3(forbidden).
func GetNewValidateCode ¶
AddValidateCode: return validate code and validate code ID
func GetNodeFavoritesNum ¶
func GetNodeModerators ¶
func GetNodeTopicNum ¶
func GetNodesNum ¶
func GetNodesNum() int
func GetNotificationCount ¶
func GetNotificationCount() int
func GetNotificationNum ¶
func GetOnlineMemberNum ¶
func GetOnlineMemberNum() int
GetOnlineMemberNum returns online member num.
func GetPlaneNodesNum ¶
func GetReplyAuthor ¶
GetReplyAuthor only returns reply's topic author.
func GetReplyBonus ¶
func GetReplyCount ¶
func GetReplyCount() int
GetReplyCount returns all replies num so far, both deleted and not deleted.
func GetReplyEditableStatus ¶
GetReplyEditableStatus checks whether the reply can be edited.
func GetReplyTopicTitle ¶
GetReplyTopicTitle only returns reply's topic title.
func GetSensitiveWords ¶
func GetSensitiveWords() []string
func GetThanksStatus ¶
func GetTopicAuthor ¶
func GetTopicCount ¶
func GetTopicCount() int
func GetTopicEditableStatus ¶
func GetTopicNodeId ¶
func GetTopicNum ¶
func GetTopicNum() int
func GetTopicReplyNum ¶
GetTopicReplyNum returns topic's reply num.
func GetTopicTitle ¶
func HasGithubAccount ¶
func HasGoogleAccount ¶
func HasQQAccount ¶
func HasWeChatAccount ¶
func InitAdapter ¶
func InitAdapter()
func InitForumBasicInfo ¶
func InitForumBasicInfo()
func IsPasswordCorrect ¶
func IsSensitiveWord ¶
func LinkMemberAccount ¶
func MemberPasswordLogin ¶
MemberPasswordLogin needs information and password to check member login. Information could be phone member, email or username. If success, return username.
func ReplyDeletable ¶
ReplyDeletable checks whether the reply can be deleted.
func TopTopicConsumption ¶
func UpdateFileDescribe ¶
func UpdateHighestOnlineNum ¶
func UpdateHotNode ¶
func UpdateHotTopic ¶
func UpdateMember ¶
UpdateMember could update member's file quota and account status.
func UpdateMemberAvatar ¶
func UpdateMemberBalances ¶
func UpdateMemberCheckinDate ¶
func UpdateMemberEditorType ¶
func UpdateMemberInfo ¶
func UpdateMemberLanguage ¶
func UpdateMemberOnlineStatus ¶
UpdateMemberOnlineStatus updates member's online information.
func UpdateMemberPassword ¶
func UpdateNode ¶
func UpdateNodeHotInfo ¶
func UpdateOnlineMemberNum ¶
func UpdateOnlineMemberNum()
UpdateOnlineMemberNum updates online member num and updates highest online member num at the same time.
func UpdatePlane ¶
func UpdateReadStatus ¶
func UpdateReply ¶
UpdateReply updates reply's all field.
func UpdateReplyWithLimitCols ¶
UpdateReplyWithLimitCols updates reply's not null field.
func UpdateTopic ¶
func UpdateTopicHotInfo ¶
func VerifyCaptcha ¶
func VerifyResetInformation ¶
func VerifyValidateCode ¶
VerifyValidateCode verifies validate code.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter represents the MySQL adapter for policy storage.
func NewAdapter ¶
NewAdapter is the constructor for Adapter.
type AdminMemberInfo ¶
type AdminMemberInfo struct { Member FileQuota int `json:"fileQuota"` FileUploadNum int `json:"fileUploadNum"` Status int `json:"status"` TopicNum int `json:"topicNum"` ReplyNum int `json:"replyNum"` LatestLogin string `json:"latestLogin"` }
func GetMemberAdmin ¶
func GetMemberAdmin(id string) *AdminMemberInfo
func GetMembersAdmin ¶
func GetMembersAdmin(cs, us, un string, limit int, offset int) ([]*AdminMemberInfo, int)
GetMembersAdmin cs, us: 1 means Asc, 2 means Desc, 0 means no effect.
type AdminPlaneInfo ¶
type AdminPlaneInfo struct { Plane Sorter int `json:"sorter"` Visible bool `json:"visible"` NodesNum int `json:"nodesNum"` Nodes []*Node `json:"nodes"` }
func GetAllPlanes ¶
func GetAllPlanes() []*AdminPlaneInfo
func GetPlaneAdmin ¶
func GetPlaneAdmin(id string) *AdminPlaneInfo
type AdminTabInfo ¶
type AdminTabInfo struct { Id string `json:"id"` Name string `json:"name"` Sorter int `json:"sorter"` CreatedTime string `json:"createdTime"` DefaultNode string `json:"defaultNode"` HomePage bool `json:"homePage"` NodesNum int `json:"nodesNum"` TopicsNum int `json:"topicsNum"` }
func GetAllTabsAdmin ¶
func GetAllTabsAdmin() []*AdminTabInfo
func GetTabAdmin ¶
func GetTabAdmin(id string) *AdminTabInfo
GetTabAdmin returns more tab information for admin.
type AdminTopicInfo ¶
func GetTopicAdmin ¶
func GetTopicAdmin(id int) *AdminTopicInfo
func GetTopicsAdmin ¶
func GetTopicsAdmin(usernameSearchKw, titleSearchKw, contentSearchKw, showDeletedTopic, createdTimeSort, lastReplySort, usernameSort, replyCountSort, hotSort, favCountSort string, limit int, offset int) ([]*AdminTopicInfo, int)
GetTopicsAdmin *sort: 1 means Asc, 2 means Desc, 0 means no effect.
type BalanceResponse ¶
type BalanceResponse struct { Amount int `json:"amount"` Title string `json:"title"` Length int `json:"length"` Balance int `json:"balance"` ObjectId int `json:"objectId"` ReceiverId string `json:"receiverId"` ConsumerId string `json:"consumerId"` CreatedTime string `json:"createdTime"` ConsumptionType int `json:"consumptionType"` }
func GetMemberConsumptionRecord ¶
func GetMemberConsumptionRecord(id string, limit, offset int) []*BalanceResponse
type BrowseRecord ¶
type BrowseRecord struct { Id int `xorm:"int notnull pk autoincr" json:"id"` MemberId string `xorm:"varchar(100)" json:"memberId"` RecordType int `xorm:"int" json:"recordType"` ObjectId string `xorm:"varchar(100) index" json:"objectId"` CreatedTime string `xorm:"varchar(40) index" json:"createdTime"` Expired bool `xorm:"bool" json:"expired"` }
RecordType: 1 means node hit record
type CasbinSensitiveWord ¶
type CommunityHealth ¶
type ConsumptionRecord ¶
type ConsumptionRecord struct { Id int `xorm:"int notnull pk autoincr" json:"id"` Amount int `xorm:"int" json:"amount"` Balance int `xorm:"int" json:"balance"` ConsumerId string `xorm:"varchar(100) index" json:"consumerId"` ObjectId int `xorm:"int index" json:"objectId"` ReceiverId string `xorm:"varchar(100) index" json:"receiverId"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` ConsumptionType int `xorm:"int" json:"consumptionType"` }
ConsumptionType 1-9 means: login bonus, receive thanks(topic), receive thanks(reply), thanks(topic) thanks(reply), new reply, receive reply bonus, new topic, top topic.
func GetBalances ¶
func GetBalances() []*ConsumptionRecord
func GetMemberBalances ¶
func GetMemberBalances(id string, limit, offset int) []*ConsumptionRecord
type CronJob ¶
type CronJob struct { Id string `json:"id"` BumpTime string `json:"bumpTime"` State string `json:"state"` }
func GetCronJobs ¶
func GetCronJobs() []*CronJob
type Favorites ¶
type Favorites struct { Id int `xorm:"int notnull pk autoincr" json:"id"` FavoritesType int `xorm:"int index" json:"favoritesType"` ObjectId string `xorm:"varchar(100) index" json:"objectId"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` MemberId string `xorm:"varchar(100) index" json:"memberId"` }
Favorites using figure 1-3 to choose type, 1 means topic, 2 means people, 3 means node.
type LatestReply ¶
type LatestReply struct { TopicId int `xorm:"id" json:"topicId"` NodeId string `json:"nodeId"` NodeName string `json:"nodeName"` Author string `json:"author"` ReplyContent string `xorm:"content" json:"replyContent"` TopicTitle string `xorm:"title" json:"topicTitle"` ReplyTime string `xorm:"created_time" json:"replyTime"` }
func GetLatestReplies ¶
func GetLatestReplies(author string, limit int, offset int) []*LatestReply
GetLatestReplies returns member's latest replies.
type Member ¶
type Member struct { Id string `xorm:"varchar(100) notnull pk" json:"id"` Password string `xorm:"varchar(100) notnull" json:"-"` No int `json:"no"` IsModerator bool `xorm:"bool" json:"isModerator"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Phone string `xorm:"varchar(100)" json:"phone"` AreaCode string `xorm:"varchar(10)" json:"areaCode"` // phone area code PhoneVerifiedTime string `xorm:"varchar(40)" json:"phoneVerifiedTime"` Avatar string `xorm:"varchar(150)" json:"avatar"` Email string `xorm:"varchar(100)" json:"email"` EmailVerifiedTime string `xorm:"varchar(40)" json:"emailVerifiedTime"` Tagline string `xorm:"varchar(100)" json:"tagline"` Company string `xorm:"varchar(100)" json:"company"` CompanyTitle string `xorm:"varchar(100)" json:"companyTitle"` Ranking int `json:"ranking"` ScoreCount int `json:"scoreCount"` Bio string `xorm:"varchar(100)" json:"bio"` Website string `xorm:"varchar(100)" json:"website"` Location string `xorm:"varchar(100)" json:"location"` Language string `xorm:"varchar(10)" json:"language"` EditorType string `xorm:"varchar(10)" json:"editorType"` FileQuota int `xorm:"int" json:"fileQuota"` GoogleAccount string `xorm:"varchar(100)" json:"googleAccount"` GithubAccount string `xorm:"varchar(100)" json:"githubAccount"` WechatAccount string `xorm:"varchar(100)" json:"weChatAccount"` WechatOpenId string `xorm:"varchar(100)" json:"-"` WechatVerifiedTime string `xorm:"varchar(40)" json:"WechatVerifiedTime"` QQAccount string `xorm:"qq_account varchar(100)" json:"qqAccount"` QQOpenId string `xorm:"qq_open_id varchar(100)" json:"-"` QQVerifiedTime string `xorm:"qq_verified_time varchar(40)" json:"qqVerifiedTime"` EmailReminder bool `xorm:"bool" json:"emailReminder"` CheckinDate string `xorm:"varchar(20)" json:"-"` OnlineStatus bool `xorm:"bool" json:"onlineStatus"` LastActionDate string `xorm:"varchar(40)" json:"-"` Status int `xorm:"int" json:"-"` }
Member using figure 1-3 to show member's account status, 1 means normal, 2 means mute(couldn't reply or post new topic), 3 means forbidden(couldn't login).
func GetGithubAccount ¶
func GetGoogleAccount ¶
func GetMembers ¶
func GetMembers() []*Member
func GetPhoneNumber ¶
func GetQQAccount ¶
func GetRankingRich ¶
func GetRankingRich() []*Member
func GetWechatAccount ¶
type Node ¶
type Node struct { Id string `xorm:"varchar(100) notnull pk" json:"id"` Name string `xorm:"varchar(100)" json:"name"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Desc string `xorm:"varchar(500)" json:"desc"` Image string `xorm:"varchar(200)" json:"image"` BackgroundImage string `xorm:"varchar(200)" json:"backgroundImage"` BackgroundColor string `xorm:"varchar(20)" json:"backgroundColor"` BackgroundRepeat string `xorm:"varchar(20)" json:"backgroundRepeat"` TabId string `xorm:"varchar(100)" json:"tab"` ParentNode string `xorm:"varchar(200)" json:"parentNode"` PlaneId string `xorm:"varchar(50)" json:"planeId"` Sorter int `xorm:"int" json:"sorter"` Hot int `xorm:"int" json:"hot"` Moderators []string `xorm:"varchar(200)" json:"moderators"` }
func GetHotNode ¶
func GetLatestNode ¶
func GetNodeFromPlane ¶
func GetNodeFromTab ¶
func GetNodesByTab ¶
type NodeFavoritesRes ¶
func GetNodesFromFavorites ¶
func GetNodesFromFavorites(memberId string, limit int, offset int) []*NodeFavoritesRes
type NodeNavigationResponse ¶
type NodeNavigationResponse struct {}
func GetNodeNavigation ¶
func GetNodeNavigation() []*NodeNavigationResponse
type NodeRelation ¶
type NodeRelation struct { ParentNode *Node `json:"parentNode"` RelatedNode []*Node `json:"relatedNode"` ChildNode []*Node `json:"childNode"` }
func GetNodeRelation ¶
func GetNodeRelation(id string) *NodeRelation
type NodeTopic ¶
type Notification ¶
type Notification struct { Id int `xorm:"int notnull pk autoincr" json:"id"` NotificationType int `xorm:"int index" json:"notificationType"` ObjectId int `xorm:"int index" json:"objectId"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` SenderId string `xorm:"varchar(100)" json:"senderId"` ReceiverId string `xorm:"varchar(100) index" json:"receiverId"` Status int `xorm:"tinyint" json:"-"` }
NotificationType 1-6 means: reply(topic), mentioned(reply), mentioned(topic), favorite(topic), thanks(topic), thanks(reply) Status 1-3 means: unread, have read, deleted
type NotificationResponse ¶
type NotificationResponse struct { *Notification `xorm:"extends"` Title string `json:"title"` Content string `json:"content"` Avatar string `json:"avatar"` }
func GetNotifications ¶
func GetNotifications(memberId string, limit int, offset int) []*NotificationResponse
type Plane ¶
type Plane struct { Id string `xorm:"varchar(50) notnull pk" json:"id"` Name string `xorm:"varchar(50)" json:"name"` Sorter int `xorm:"int" json:"-"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Image string `xorm:"varchar(200)" json:"image"` BackgroundColor string `xorm:"varchar(20)" json:"backgroundColor"` Color string `xorm:"varchar(20)" json:"color"` Visible bool `xorm:"bool" json:"-"` }
type PlaneWithNodes ¶
func GetPlaneList ¶
func GetPlaneList() []*PlaneWithNodes
type Reply ¶
type Reply struct { Id int `xorm:"int notnull pk autoincr" json:"id"` Author string `xorm:"varchar(100) index" json:"author"` TopicId int `xorm:"int index" json:"topicId"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Deleted bool `xorm:"bool" json:"-"` ThanksNum int `xorm:"int" json:"thanksNum"` EditorType string `xorm:"varchar(40)" json:"editorType"` Content string `xorm:"mediumtext" json:"content"` }
func GetLatestReplyInfo ¶
GetLatestReplyInfo returns topic's latest reply information.
type ReplyWithAvatar ¶
type ReplyWithAvatar struct { Reply `xorm:"extends"` Avatar string `json:"avatar"` ThanksStatus bool `json:"thanksStatus"` Deletable bool `json:"deletable"` Editable bool `json:"editable"` ConsumptionAmount int `xorm:"amount" json:"amount"` }
func GetReplies ¶
func GetReplies(topicId int, memberId string, limit int, offset int) []*ReplyWithAvatar
GetReplies returns more information about reply of a topic.
func GetReplyWithDetails ¶
func GetReplyWithDetails(memberId string, id int) *ReplyWithAvatar
GetReplyWithDetails returns more information about reply, including avatar, thanks status, deletable and editable.
type ResetRecord ¶
type ResetRecord struct { Id int `xorm:"int notnull pk autoincr" json:"id"` MemberId string `xorm:"varchar(100) index" json:"memberId"` RecordType int `xorm:"int" json:"recordType"` ResetInformation string `xorm:"varchar(100)" json:"resetInformation"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Expired bool `xorm:"bool" json:"expired"` ValidateCode string `xorm:"varchar(100)" json:"validateCode"` }
RecordType: 1 means phone, 2 means email, resetInformation means phone number or email.
type Tab ¶
type Tab struct { Id string `xorm:"varchar(100) notnull pk" json:"id"` Name string `xorm:"varchar(100)" json:"name"` Sorter int `xorm:"int" json:"-"` CreatedTime string `xorm:"varchar(40)" json:"-"` DefaultNode string `xorm:"varchar(100)" json:"defaultNode"` HomePage bool `xorm:"bool" json:"-"` }
func GetAllTabs ¶
func GetAllTabs() []*Tab
func GetHomePageTabs ¶
func GetHomePageTabs() []*Tab
type Topic ¶
type Topic struct { Id int `xorm:"int notnull pk autoincr" json:"id"` Author string `xorm:"varchar(100) index" json:"author"` NodeId string `xorm:"varchar(100) index" json:"nodeId"` NodeName string `xorm:"varchar(100)" json:"nodeName"` Title string `xorm:"varchar(100)" json:"title"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Tags []string `xorm:"varchar(200)" json:"tags"` LastReplyUser string `xorm:"varchar(100)" json:"lastReplyUser"` LastReplyTime string `xorm:"varchar(40)" json:"lastReplyTime"` ReplyCount int `json:"replyCount"` UpCount int `json:"upCount"` HitCount int `json:"hitCount"` Hot int `json:"hot"` FavoriteCount int `json:"favoriteCount"` HomePageTopTime string `xorm:"varchar(40)" json:"homePageTopTime"` TabTopTime string `xorm:"varchar(40)" json:"tabTopTime"` NodeTopTime string `xorm:"varchar(40)" json:"nodeTopTime"` Deleted bool `xorm:"bool" json:"-"` EditorType string `xorm:"varchar(40)" json:"editorType"` Content string `xorm:"mediumtext" json:"content"` }
func GetAllCreatedTopics ¶
func GetTopicBasicInfo ¶
type TopicWithAvatar ¶
type TopicWithAvatar struct { Topic `xorm:"extends"` Avatar string `json:"avatar"` ThanksStatus bool `json:"thanksStatus"` Editable bool `json:"editable"` NodeModerator bool `json:"nodeModerator"` }
func GetFollowingNewAction ¶
func GetFollowingNewAction(memberId string, limit int, offset int) []*TopicWithAvatar
func GetHotTopic ¶
func GetHotTopic(limit int) []*TopicWithAvatar
func GetTopicWithAvatar ¶
func GetTopicWithAvatar(id int, memberId string) *TopicWithAvatar
func GetTopics ¶
func GetTopics(limit int, offset int) []*TopicWithAvatar
func GetTopicsFromFavorites ¶
func GetTopicsFromFavorites(memberId string, limit int, offset int) []*TopicWithAvatar
func GetTopicsWithTab ¶
func GetTopicsWithTab(tab string, limit, offset int) []*TopicWithAvatar
type UpdateJob ¶
type UpdateJob struct { Id string `json:"id"` JobId string `json:"jobId"` State string `json:"state"` Url string `json:"url"` Content string `json:"content"` }
func GetCronUpdateJobs ¶
func GetCronUpdateJobs() []*UpdateJob
func GetUpdateJob ¶
func GetUpdateJobs ¶
type UploadFileRecord ¶
type UploadFileRecord struct { Id int `xorm:"int notnull pk autoincr" json:"id"` FileName string `xorm:"varchar(100)" json:"fileName"` FilePath string `xorm:"varchar(100)" json:"filePath"` FileUrl string `xorm:"varchar(100)" json:"fileUrl"` FileType string `xorm:"varchar(10)" json:"fileType"` FileExt string `xorm:"varchar(20)" json:"fileExt"` MemberId string `xorm:"varchar(100) index" json:"memberId"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Size int `xorm:"int" json:"size"` Views int `xorm:"int" json:"views"` Desc string `xorm:"varchar(500)" json:"desc"` Deleted bool `xorm:"bool" json:"-"` }
func GetFile ¶
func GetFile(id int) *UploadFileRecord
func GetFiles ¶
func GetFiles(memberId string, limit, offset int) []*UploadFileRecord
type ValidateCode ¶
type ValidateCode struct { Id string `xorm:"varchar(100) notnull pk" json:"id"` Code string `xorm:"varchar(100)" json:"code"` Information string `xorm:"varchar(100)" json:"information"` CreatedTime string `xorm:"varchar(40)" json:"createdTime"` Expired bool `xorm:"bool" json:"expired"` }
ValidateCode table records validate code, for sign up, sign in or reset password using phone or email.