models

package
v0.0.0-...-2bc18d8 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2017 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Engine    *xorm.Engine
	HasEngine bool

	DataType  = helper.DataType
	DBConnect = helper.DBConnect
)

Functions

func AddAttachment

func AddAttachment(content string, pid, cid, nid, uid int64) (int64, error)

func AddCategory

func AddCategory(title string, content string, attachment string, nid int64) (int64, error)
func AddLink(title string, content string, attachment string, nid int64, parent string) (int64, error)

func AddNode

func AddNode(title string, content string, attachment string, nid int64, cid int64, uid int64) (int64, error)

func AddNotification

func AddNotification(tid, rid, uid, ctype int64, subject, reply, author, avatar, avatarLarge, avatarMedium, avatarSmall string) (int64, error)

func AddPage

func AddPage(title string, content string, attachment string, nid int64) (int64, error)

func AddReply

func AddReply(tid, pid, uid, ctype int64, content, attachment, author, avatar, avatarLarge, avatarMedium, avatarSmall, author_signature, nickname, email, website string) (int64, error)

func AddTimeline

func AddTimeline(title string, content string, cid int64, nid int64, uid int64, author string, author_signature string) (int64, error)

func AddTopic

func AddTopic(title, content, avatar, avatarLarge, avatarMedium, avatarSmall string, pid, cid, nid, uid int64) (int64, error)

func AddUser

func AddUser(email string, username string, nickname string, realname string, password string, group string, content string, mobile string, gender int64, role int64) (int64, error)

func AllExistingNodes

func AllExistingNodes(offset int, limit int, field string) (*[]*Node, error)

返回所有存在的节点

func AvailableNodes

func AvailableNodes(offset int, limit int, field string) (*[]*Node, error)

func CacheInsert

func CacheInsert(orm *xorm.Engine, beans ...interface{}) (int64, error)

func ConDb

func ConDb() (*xorm.Engine, error)

func Counts

func Counts() (categories int, nodes int, topics int, users int, replys int)

func DelAttachment

func DelAttachment(id int64, uid int64, role int64) error

func DelBalance

func DelBalance(bid int64) error

func DelBalanceByRole

func DelBalanceByRole(id int64, uid int64, role int64) error

func DelBalancesByUid

func DelBalancesByUid(uid int64) error

func DelCategory

func DelCategory(id int64, uid int64, role int64) error

func DelFriend

func DelFriend(uid int64, fid int64) (int64, error)

func DelHistoryMessage

func DelHistoryMessage(id int64) error
func DelLink(id int64, uid int64, role int64) error

func DelMessage

func DelMessage(id int64) error

func DelNode

func DelNode(id int64, uid int64, role int64) error

func DelNotification

func DelNotification(rid int64) error

func DelNotificationByRole

func DelNotificationByRole(rid int64, uid int64, role int64) error

func DelNotificationsByPid

func DelNotificationsByPid(pid int64) error

func DelNotificationsByTid

func DelNotificationsByTid(tid int64) error

func DelPage

func DelPage(id int64, uid int64, role int64) error

func DelReply

func DelReply(rid int64) error

func DelReplyByRole

func DelReplyByRole(rid int64, uid int64, role int64) error

func DelReplyMark

func DelReplyMark(uid int64, rid int64)

func DelReplysByPid

func DelReplysByPid(pid int64) error

func DelReplysByTid

func DelReplysByTid(tid int64) error

func DelTimeline

func DelTimeline(lid int64) error

func DelTopic

func DelTopic(id int64, uid int64, role int64) error

func DelTopicMark

func DelTopicMark(uid, tid int64) (int64, error)
func DelTopicMark(uid int64, tid int64) {
	tpm := new(TopicMark)
	Engine.Where("uid=? and tid=?", uid, tid).Delete(tpm)
}

func DelTopicsByPid

func DelTopicsByPid(id int64, uid int64, role int64) (err error)

func DelUser

func DelUser(id int64, uid int64, role int64) error

DelUser id:被删除用户之ID,uid:当前用户之id,role:当前用户之角色

func GetAllBalance

func GetAllBalance() *[]*Balance

func GetAllNotification

func GetAllNotification() *[]Notification

func GetAllReply

func GetAllReply() *[]*Reply

func GetAttachmentCountByNid

func GetAttachmentCountByNid(nid int64) int64

func GetAttachments

func GetAttachments(offset int, limit int, field string) (*[]*Attachment, error)

func GetAttachmentsByCategory

func GetAttachmentsByCategory(category string, offset int, limit int, ctype int64, field string) *[]*Attachment

func GetAttachmentsByCategoryCount

func GetAttachmentsByCategoryCount(category string, offset int, limit int, field string) (int64, error)

func GetAttachmentsByCid

func GetAttachmentsByCid(cid int64, offset int, limit int, ctype int64, field string) *[]*Attachment

GetAttachmentsByCid大数据下如出现性能问题 可以使用 GetAttachmentsByCidOnBetween

func GetAttachmentsByCidOnBetween

func GetAttachmentsByCidOnBetween(cid int64, startid int64, endid int64, offset int, limit int, ctype int64, field string) *[]*Attachment

func GetAttachmentsByHotnessCategory

func GetAttachmentsByHotnessCategory(catlimit int, attachmentlimit int) []*[]*Attachment

func GetAttachmentsByHotnessNodes

func GetAttachmentsByHotnessNodes(nodelimit int, attachmentlimit int) []*[]*Attachment

func GetAttachmentsByNid

func GetAttachmentsByNid(nodeid int64, offset int, limit int, ctype int64, field string) *[]*Attachment

func GetAttachmentsByNode

func GetAttachmentsByNode(node string, offset int, limit int, field string) (*[]*Attachment, error)

func GetAttachmentsByPid

func GetAttachmentsByPid(pid int64, offset int, limit int, ctype int64, field string) *[]*Attachment

func GetAttachmentsByPid4Count

func GetAttachmentsByPid4Count(pid int64, offset int, limit int, ctype int64) (int64, error)

func GetAttachmentsByPidSinceCreated

func GetAttachmentsByPidSinceCreated(pid int64, offset int, limit int, ctype int64, field string, since int64) *[]*Attachment

func GetAttachmentsByScoreNodes

func GetAttachmentsByScoreNodes(nodelimit int, attachmentlimit int) []*[]*Attachment

func GetAttachmentsByUid

func GetAttachmentsByUid(uid int64, offset int, limit int, ctype int64, field string) *[]*Attachment

GetAttachmentsByUid不区分父子附件

func GetAttachmentsCount

func GetAttachmentsCount(offset int, limit int) (int64, error)

func GetAttachmentsCountByNode

func GetAttachmentsCountByNode(node string, offset int, limit int) (int64, error)

func GetBalancesByUid

func GetBalancesByUid(uid int64, ctype int64, offset int, limit int, field string) *[]*Balance

func GetBalancesByUidJoinUser

func GetBalancesByUidJoinUser(uid int64, ctype int64, offset int, limit int, field string) *[]*Balancejuser

func GetBalancesByUsername

func GetBalancesByUsername(username string, ctype int64, offset int, limit int, field string) *[]*Balance

func GetCategories

func GetCategories(offset int, limit int, field string) (*[]*Category, error)

func GetCategoriesByCtype

func GetCategoriesByCtype(offset int, limit int, ctype int64, field string) (*[]*Category, error)

func GetCategoriesByCtypeWithNid

func GetCategoriesByCtypeWithNid(offset int, limit int, ctype int64, nid int64, field string) (*[]*Category, error)

func GetCategoriesByCtypeWithPid

func GetCategoriesByCtypeWithPid(offset int, limit int, ctype int64, pid int64, field string) (*[]*Category, error)

func GetCategoriesByNid

func GetCategoriesByNid(nid int64, offset int, limit int, field string) (*[]*Category, error)

func GetCategoriesByNodeCount

func GetCategoriesByNodeCount(offset int, limit int, nodecount int64, field string) (*[]*Category, error)

func GetCategoriesByPid

func GetCategoriesByPid(pid int64, offset int, limit int, ctype int64, field string) *[]*Category

func GetCategoriesCount

func GetCategoriesCount(offset int, limit int) (int64, error)

func GetCategoriesViaPid

func GetCategoriesViaPid(pid int64, offset int, limit int, ctype int64, field string) *[]*Category

func GetCategoryCountByPid

func GetCategoryCountByPid(pid int64) int64

func GetFriends

func GetFriends(offset int, limit int, field string) (*[]*Friend, error)

func GetFriendsByUid

func GetFriendsByUid(uid int64, offset int, limit int, group string, field string) *[]*Friend

func GetFriendsByUidJoinUser

func GetFriendsByUidJoinUser(uid int64, offset int, limit int, group string, field string) *[]*Friendjuser

func GetHistoryMessages

func GetHistoryMessages(offset, limit int, field string) (*[]*HistoryMessage, error)

func GetHistoryMessagesViaKey

func GetHistoryMessagesViaKey(offset, limit int, key, field string) (*[]*HistoryMessage, error)

func GetHistoryMessagesViaReceiver

func GetHistoryMessagesViaReceiver(offset, limit int, username, field string) (*[]*HistoryMessage, error)

func GetHistoryMessagesViaReceiverWithSender

func GetHistoryMessagesViaReceiverWithSender(offset, limit int, receiver, sender, field string) (*[]*HistoryMessage, error)

func GetIssues

func GetIssues(offset int, limit int, field string, ctype int64) (*[]*IssueMark, error)

func GetLinkCountByPid

func GetLinkCountByPid(pid int64) int64
func GetLinks(offset int, limit int, field string) (*[]*Link, error)

func GetLinksByNodeCount

func GetLinksByNodeCount(offset int, limit int, nodecount int64, field string) (*[]*Link, error)

func GetMessages

func GetMessages(offset, limit int, field string) (*[]*Message, error)

func GetMessagesViaKey

func GetMessagesViaKey(offset, limit int, key, field string) (*[]*Message, error)

func GetMessagesViaReceiver

func GetMessagesViaReceiver(offset, limit int, username, field string) (*[]*Message, error)

func GetMessagesViaReceiverWithSender

func GetMessagesViaReceiverWithSender(offset, limit int, receiver, sender, field string) (*[]*Message, error)

func GetNodeCountByPid

func GetNodeCountByPid(cid int64) int64

func GetNodes

func GetNodes(offset int, limit int, field string) (*[]*Node, error)

func GetNodesByCid

func GetNodesByCid(cid int64, offset int, limit int, field string) (*[]*Node, error)
func GetNodesByCid(cid int64, offset int, limit int, field string) (*[]*Node, error) {
	nds := new([]*Node)
	err := Engine.Where("cid=?", cid).Limit(limit, offset).Desc(field).Find(nds)
	return nds, err
}

func GetNodesByCtype

func GetNodesByCtype(offset int, limit int, ctype int64, field string) (*[]*Node, error)

func GetNodesByCtypeWithCid

func GetNodesByCtypeWithCid(offset int, limit int, ctype int64, cid int64, field string) (*[]*Node, error)

func GetNodesByCtypeWithNid

func GetNodesByCtypeWithNid(offset int, limit int, ctype int64, nid int64, field string) (*[]*Node, error)

func GetNodesByCtypeWithPid

func GetNodesByCtypeWithPid(offset int, limit int, ctype int64, pid int64, field string) (*[]*Node, error)

func GetNodesByPid

func GetNodesByPid(pid int64, offset int, limit int, ctype int64, field string) *[]*Node

func GetNodesCount

func GetNodesCount(offset int, limit int) (int64, error)

func GetNodesViaPid

func GetNodesViaPid(pid int64, offset int, limit int, ctype int64, field string) *[]*Node

func GetNotificationCountByUid

func GetNotificationCountByUid(uid int64) int64

func GetNotificationsByTid

func GetNotificationsByTid(tid int64, ctype int64, offset int, limit int, field string) *[]Notification

func GetNotificationsByTidUid

func GetNotificationsByTidUid(tid int64, uid int64, ctype int64, offset int, limit int, field string) *[]Notification

func GetNotificationsByTidUsername

func GetNotificationsByTidUsername(tid int64, author string, ctype int64, offset int, limit int, field string) *[]Notification

func GetNotificationsByUid

func GetNotificationsByUid(uid int64, ctype int64, offset int, limit int, field string) *[]Notification

func GetNotificationsByUidJoinUser

func GetNotificationsByUidJoinUser(uid int64, ctype int64, offset int, limit int, field string) *[]Notificationjuser

func GetNotificationsByUidUsernameJoinTopic

func GetNotificationsByUidUsernameJoinTopic(uid int64, author string, ctype int64, offset int, limit int, field string) *[]Notificationjtopic

func GetPageCountByPid

func GetPageCountByPid(pid int64) int64

func GetPages

func GetPages(offset int, limit int, field string) (*[]*Page, error)

func GetPagesByNodeCount

func GetPagesByNodeCount(offset int, limit int, nodecount int64, field string) (*[]*Page, error)

func GetReplyCountByPid

func GetReplyCountByPid(pid int64) int64

func GetReplyCountByTid

func GetReplyCountByTid(tid int64) int64

func GetReplysByPid

func GetReplysByPid(pid int64, ctype int64, offset int, limit int, field string) *[]*Reply

func GetReplysByPid4Count

func GetReplysByPid4Count(pid int64, offset int, limit int, ctype int64) (int64, error)

func GetReplysByTid

func GetReplysByTid(tid int64, ctype int64, offset int, limit int, field string) *[]*Reply

func GetReplysByTidJoinUser

func GetReplysByTidJoinUser(tid int64, ctype int64, offset int, limit int, field string) *[]*Replyjuser

func GetReplysByTidUid

func GetReplysByTidUid(tid int64, uid int64, ctype int64, offset int, limit int, field string) *[]*Reply

func GetReplysByTidUsername

func GetReplysByTidUsername(tid int64, author string, ctype int64, offset int, limit int, field string) *[]*Reply

func GetReplysByTidUsernameJoinTopic

func GetReplysByTidUsernameJoinTopic(tid int64, author string, ctype int64, offset int, limit int, field string) *[]*Replyjtopic

func GetReports

func GetReports(offset int, limit int, field string, ctype int64) (*[]*ReportMark, error)

func GetSubAttachments

func GetSubAttachments(pid int64, offset int, limit int, field string) (*[]*Attachment, error)

func GetSubReplys

func GetSubReplys(pid int64, offset int, limit int, field string) (*[]*Reply, error)

func GetSubTopics

func GetSubTopics(pid int64, offset int, limit int, field string) (*[]*Topic, error)

func GetSubjectsByCategory

func GetSubjectsByCategory(category string, offset int, limit int, ctype int64, field string) *[]*Topic

func GetSubjectsByCategory4Count

func GetSubjectsByCategory4Count(category string, offset int, limit int, ctype int64) (int64, error)

func GetSubjectsByCategoryJoinUser

func GetSubjectsByCategoryJoinUser(category string, offset int, limit int, ctype int64, field string) *[]*Topicjuser

func GetSubjectsByCid

func GetSubjectsByCid(cid int64, offset int, limit int, ctype int64, field string) *[]*Topic

func GetSubjectsByCid4Count

func GetSubjectsByCid4Count(cid int64, offset int, limit int, ctype int64) (int64, error)

func GetSubjectsByCidJoinUser

func GetSubjectsByCidJoinUser(cid int64, offset int, limit int, ctype int64, field string) *[]*Topicjuser

func GetSubjectsByNid

func GetSubjectsByNid(nodeid int64, offset int, limit int, ctype int64, field string) *[]*Topic

func GetSubjectsByNid4Count

func GetSubjectsByNid4Count(nodeid int64, offset int, limit int, ctype int64) (int64, error)

func GetSubjectsByNidJoinUser

func GetSubjectsByNidJoinUser(nodeid int64, offset int, limit int, ctype int64, field string) *[]*Topicjuser

func GetSubjectsByNode

func GetSubjectsByNode(node string, offset int, limit int, ctype int64, field string) *[]*Topic

func GetSubjectsByNode4Count

func GetSubjectsByNode4Count(node string, offset int, limit int, ctype int64) (int64, error)

func GetSubjectsByNodeJoinUser

func GetSubjectsByNodeJoinUser(node string, offset int, limit int, ctype int64, field string) *[]*Topicjuser

func GetSubjectsByUid

func GetSubjectsByUid(uid int64, offset int, limit int, ctype int64, field string) *[]*Topic

func GetSubjectsByUser

func GetSubjectsByUser(username string, offset int, limit int, ctype int64, field string) *[]*Topic

func GetSubjectsByUser4Count

func GetSubjectsByUser4Count(user string, offset int, limit int, ctype int64) (int64, error)

func GetSubjectsByUserJoinUser

func GetSubjectsByUserJoinUser(username string, offset int, limit int, ctype int64, field string) *[]*Topicjuser

func GetSubjectsByUsername

func GetSubjectsByUsername(author string, offset int, limit int, ctype int64, field string) *[]*Topic

func GetSubjectsCountByUsername

func GetSubjectsCountByUsername(author string, offset int, limit int, ctype int64) (int64, error)

func GetTimelines

func GetTimelines(offset int, limit int, path string, uid int64) (*[]*Timeline, error)

func GetTopicCountByNid

func GetTopicCountByNid(nid int64) int64

func GetTopicMarksViaUid

func GetTopicMarksViaUid(offset, limit int, uid int64, field string) (*[]*TopicMark, error)

func GetTopicMarksViaUidWithCid

func GetTopicMarksViaUidWithCid(offset, limit int, uid, cid int64, field string) (*[]*TopicMark, error)

func GetTopics

func GetTopics(offset int, limit int, field string) (*[]*Topic, error)

func GetTopicsByCategory

func GetTopicsByCategory(category string, offset int, limit int, ctype int64, field string) *[]*Topic

func GetTopicsByCategoryCount

func GetTopicsByCategoryCount(category string, offset int, limit int, field string) (int64, error)

func GetTopicsByCid

func GetTopicsByCid(cid int64, offset int, limit int, ctype int64, field string) *[]*Topic

GetTopicsByCid大数据下如出现性能问题 可以使用 GetTopicsByCidOnBetween

func GetTopicsByCidOnBetween

func GetTopicsByCidOnBetween(cid int64, startid int64, endid int64, offset int, limit int, ctype int64, field string) *[]*Topic

func GetTopicsByHotnessCategory

func GetTopicsByHotnessCategory(catlimit int, topiclimit int) []*[]*Topic

func GetTopicsByHotnessNodes

func GetTopicsByHotnessNodes(nodelimit int, topiclimit int) []*[]*Topic

func GetTopicsByNid

func GetTopicsByNid(nodeid int64, offset int, limit int, ctype int64, field string) *[]*Topic

func GetTopicsByNode

func GetTopicsByNode(node string, offset int, limit int, field string) (*[]*Topic, error)

func GetTopicsByPid

func GetTopicsByPid(pid int64, offset int, limit int, ctype int64, field string) *[]*Topic

func GetTopicsByPid4Count

func GetTopicsByPid4Count(pid int64, offset int, limit int, ctype int64) (int64, error)

func GetTopicsByPidJoinTopicmark

func GetTopicsByPidJoinTopicmark(pid int64, offset int, limit int, ctype int64, field string) *[]*Topicjtopicmark

func GetTopicsByPidJoinUser

func GetTopicsByPidJoinUser(pid int64, offset int, limit int, ctype int64, field string) *[]*Topicjuser

func GetTopicsByPidJoinUserSinceCreated

func GetTopicsByPidJoinUserSinceCreated(pid int64, offset int, limit int, ctype int64, field string, since int64) *[]*Topicjuser

func GetTopicsByPidSinceCreated

func GetTopicsByPidSinceCreated(pid int64, offset int, limit int, ctype int64, field string, since int64) *[]*Topic

func GetTopicsByScoreNodes

func GetTopicsByScoreNodes(nodelimit int, topiclimit int) []*[]*Topic

func GetTopicsByUid

func GetTopicsByUid(uid int64, offset int, limit int, ctype int64, field string) *[]*Topic

GetTopicsByUid不区分父子话题

func GetTopicsCount

func GetTopicsCount(offset int, limit int) (int64, error)

func GetTopicsCountByNode

func GetTopicsCountByNode(node string, offset int, limit int) (int64, error)

func GetTopicsViaPid

func GetTopicsViaPid(pid int64, offset int, limit int, ctype int64, field string) *[]*Topic

func GetUsers

func GetUsers(offset int, limit int, field string) (*[]*User, error)

func GetUsersByRole

func GetUsersByRole(role int64, offset int, limit int, field string) (*[]*User, error)

func GetUsersCount

func GetUsersCount(offset int, limit int) (int64, error)

func GetUsersOnConfidence

func GetUsersOnConfidence(offset int, limit int, field string) (*[]*User, error)

func GetUsersOnHotness

func GetUsersOnHotness(offset int, limit int, field string) (*[]*User, error)

func HasCategory

func HasCategory(title string) (int64, bool)

func HasNode

func HasNode(title string) (int64, bool)

func HasUser

func HasUser(username string) (int64, bool)

func IsFriend

func IsFriend(uid, fid int64) bool

func IsIssueMark

func IsIssueMark(uid int64, rid int64, ctype int64) bool

func IsNodeMark

func IsNodeMark(uid int64, nid int64) bool

func IsReplyMark

func IsReplyMark(uid int64, rid int64) bool

func IsReportMark

func IsReportMark(uid int64, rid int64, ctype int64) bool

func IsTailinfoOfUser

func IsTailinfoOfUser(tid, uid int64) bool

func IsTopicMark

func IsTopicMark(uid int64, tid int64) bool

func IsUserMark

func IsUserMark(uid int64, UserID int64) bool

func JoinTopicmarkJoinUserForGetTopicsByPid

func JoinTopicmarkJoinUserForGetTopicsByPid(pid int64, offset int, limit int, field string) *[]*Topicjtopicmarkjuser

func JoinTopicmarkJoinUserForGetTopicsByUid

func JoinTopicmarkJoinUserForGetTopicsByUid(uid int64, offset int, limit int, field string) *[]*Topicjtopicmarkjuser

func NewEngine

func NewEngine() error

func NodesOfNavor

func NodesOfNavor(offset int, limit int, field string) (*[]*Node, error)

func NodesOfNodes

func NodesOfNodes(offset int, limit int, field string) (*[]*Node, error)

func Ping

func Ping() error

func PostAttachment

func PostAttachment(obj *Attachment) (int64, error)

发布附件 返回 附件id,错误

func PostCategory

func PostCategory(cat *Category) (int64, error)

func PostHistoryMessage

func PostHistoryMessage(m *HistoryMessage) (int64, error)

func PostMessage

func PostMessage(m *Message) (int64, error)

func PostNode

func PostNode(node *Node) (int64, error)

func PostNotification

func PostNotification(tid int64, rp *Notification) (int64, error)

func PostReply

func PostReply(tid int64, rp *Reply) (int64, error)

func PostTopic

func PostTopic(tp *Topic) (int64, error)

发布话题 返回 话题id,错误

func PostUser

func PostUser(m *User) (int64, error)

func PutAttachment

func PutAttachment(tid int64, obj *Attachment) (int64, error)

func PutAttachmentViaVersion

func PutAttachmentViaVersion(tid int64, attachment *Attachment) (int64, error)

func PutCategory

func PutCategory(cid int64, cat *Category) (int64, error)

func PutHistoryMessage

func PutHistoryMessage(mid int64, msg *HistoryMessage) (int64, error)

func PutHistoryMessageViaKey

func PutHistoryMessageViaKey(key string, msg *HistoryMessage) (int64, error)
func PutLink(cid int64, cat *Link) (int64, error)

func PutMessage

func PutMessage(mid int64, msg *Message) (int64, error)

func PutMessageViaKey

func PutMessageViaKey(key string, msg *Message) (int64, error)

func PutNode

func PutNode(nid int64, nd *Node) (int64, error)

func PutNotification

func PutNotification(rid int64, rp *Notification) (int64, error)

func PutPage

func PutPage(cid int64, obj *Page) (int64, error)

func PutReply

func PutReply(rid int64, rp *Reply) (int64, error)

func PutSignin2User

func PutSignin2User(uid, LastSigninTime, SigninCount int64, LastSigninIp string) (int64, error)

func PutSignout2User

func PutSignout2User(uid, LastSigninTime int64, LastSigninIp string) (int64, error)

func PutSort2AttachmentViaVersion

func PutSort2AttachmentViaVersion(tid int64, attachment *Attachment) (int64, error)

func PutSort2Attachment(tid int64, sort int64) (int64, error) {

func PutSort2TopicViaVersion

func PutSort2TopicViaVersion(tid int64, topic *Topic) (int64, error)

func PutSort2Topic(tid int64, sort int64) (int64, error) {

func PutTailinfo2Topic

func PutTailinfo2Topic(tid int64, Tailinfo string) (int64, error)

func PutTopic

func PutTopic(tid int64, tp *Topic) (int64, error)

func PutTopicViaVersion

func PutTopicViaVersion(tid int64, topic *Topic) (int64, error)

func PutUser

func PutUser(uid int64, usr *User) (int64, error)

func PutViews2AttachmentViaVersion

func PutViews2AttachmentViaVersion(tid int64, attachment *Attachment) (int64, error)

func PutViews2TopicViaVersion

func PutViews2TopicViaVersion(tid int64, topic *Topic) (int64, error)

func ReplyMarkCount

func ReplyMarkCount(rid int64) (int64, error)

func ReplyMarkCountByUid

func ReplyMarkCountByUid(uid int64) (int64, error)

func SearchCategory

func SearchCategory(content string, offset int, limit int, field string) (*[]*Category, error)

SearchCategory 搜索分类

func SearchNode

func SearchNode(content string, offset int, limit int, field string) (*[]*Node, error)

SearchNode 搜索节点

func SearchSubject

func SearchSubject(content string, offset int, limit int, field string) (*[]*Topic, error)

func SearchSubjectJoinUser

func SearchSubjectJoinUser(content string, offset int, limit int, field string) (*[]*Topicjuser, error)

func SearchTopic

func SearchTopic(content string, offset int, limit int, field string) (*[]*Topic, error)

func SearchUser

func SearchUser(content string, offset int, limit int, field string) (*[]*User, error)

SearchUser 搜索用户

func SetAmountById

func SetAmountById(id, uid, ctype, amount int64, description string) error

func SetAmountByUid

func SetAmountByUid(uid, ctype, amount int64, description string) error

func SetAttachment

func SetAttachment(tid int64, obj *Attachment) (int64, error)

func SetBalance

func SetBalance(balance *Balance) error

func SetBalanceForUser

func SetBalanceForUser(uid, balance int64) error

func SetCategory

func SetCategory(cid int64, cat *Category) (int64, error)

func SetEngine

func SetEngine() (*xorm.Engine, error)

func SetFriend

func SetFriend(uid, fid, accept int64, content, group string) (int64, error)

func SetFriendTo

func SetFriendTo(fromUid, toFid, accept int64, content, group string) (int64, error)

func SetIssueMark

func SetIssueMark(uid int64, rid int64, ctype int64, content string) (int64, error)

SetIssueMark 设置举报标记

func SetNode

func SetNode(nid int64, nd *Node) (int64, error)

func SetNodeMark

func SetNodeMark(uid int64, nid int64) (int64, error)

func SetNotificationContentByRid

func SetNotificationContentByRid(rid int64, Content string) error

func SetNotificationCount

func SetNotificationCount(uid int64, count int64) (int64, error)

func SetNotificationCountByUid

func SetNotificationCountByUid(uid int64) (int64, error)

func SetPage

func SetPage(pageid int64, p *Page) (int64, error)

func SetReply

func SetReply(rid int64, rp *Reply) (int64, error)

func SetReplyContentByRid

func SetReplyContentByRid(rid int64, Content string) error

func SetReplyCountByPid

func SetReplyCountByPid(qid int64) (int64, error)

func SetReplyCountByTid

func SetReplyCountByTid(tid int64) (int64, error)

func SetReplyMark

func SetReplyMark(uid int64, rid int64) (int64, error)

func SetReportMark

func SetReportMark(uid int64, rid int64, ctype int64, content string) (int64, error)

SetReportMark 设置举报标记

func SetTopic

func SetTopic(tid int64, tp *Topic) (int64, error)

func SetTopicMark

func SetTopicMark(uid, cid, tid int64) (int64, error)

func SetUser

func SetUser(uid int64, usr *User) (int64, error)

func SetUserMark

func SetUserMark(uid int64, UserID int64) (int64, error)

func SetUserNewpassword

func SetUserNewpassword(username string, email string, oldpassword string, newpassword string) (bool, error)

func TopicMarkCount

func TopicMarkCount(tid int64) (int64, error)

func TopicMarkCountByUid

func TopicMarkCountByUid(uid int64) (int64, error)

func UpdateCategory

func UpdateCategory(cid int64, catmap *map[string]interface{}) error

map[string]interface{}{"ctype": ctype}

func UpdateLink(cid int64, catmap *map[string]interface{}) error

map[string]interface{}{"ctype": ctype}

func UpdateNode

func UpdateNode(nid int64, nodemap *map[string]interface{}) error

map[string]interface{}{"ctype": ctype}

func UpdatePage

func UpdatePage(cid int64, objmap *map[string]interface{}) error

map[string]interface{}{"ctype": ctype}

Types

type Attachment

type Attachment struct {
	Id            int64
	Pid           int64   `xorm:"index"` //为0代表没有上级,本身就是顶层附件 大于0则本身是子附件,而该数字代表上级附件的id
	Cid           int64   `xorm:"index"`
	Nid           int64   `xorm:"index"` //nodeid
	Uid           int64   `xorm:"index"`
	Sort          int64   `xorm:"index"` //排序字段 需要手动对附件排序置顶等操作时使用
	Ctype         int64   `xorm:"index"` //ctype作用在于区分附件的类型
	Content       string  `xorm:"text"`  //资源URL
	Tags          string  `xorm:"index"`
	Created       int64   `xorm:"created index"`
	Updated       int64   `xorm:"updated"`
	Hotness       float64 `xorm:"index"`
	Confidence    float64 `xorm:"index"` //信任度数值
	Hotup         int64   `xorm:"index"`
	Hotdown       int64   `xorm:"index"`
	Hotscore      int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote       int64   `xorm:"index"` //Hotup  + Hotdown
	Views         int64
	Author        string `xorm:"index"`
	Category      string `xorm:"index"`
	Node          string `xorm:"index"` //nodename
	FavoriteCount int64
	Latitude      float64 `xorm:"index"`   //纬度
	Longitude     float64 `xorm:"index"`   //经度
	Version       int64   `xorm:"version"` //乐观锁
}

func GetAttachment

func GetAttachment(id int64) (*Attachment, error)

type Balance

type Balance struct {
	Id          int64  `xorm:"index"`
	Uid         int64  `xorm:"index"`   //钱包拥有者
	Time        int64  `xorm:"index"`   //发生时间 为保证时间的正确性 此处使用时间戳
	Ctype       int64  `xorm:"index"`   //动作类型
	Amount      int64  `xorm:"index"`   //数额
	Balance     int64  `xorm:"index"`   //余额
	Description string `xorm:"text"`    //描述
	Version     int64  `xorm:"version"` //乐观锁
}

时间 类型 数额 余额 描述 Time Ctype Amount Balance Description

func GetBalanceById

func GetBalanceById(id int64) (*Balance, error)

func GetBalanceByUid

func GetBalanceByUid(uid int64) *Balance

type Balancejuser

type Balancejuser struct {
	Balance `xorm:"extends"`
	User    `xorm:"extends"`
}

type Category

type Category struct {
	Id             int64
	Pid            int64 `xorm:"index"` //小于等于0 代表分类本身是顶层分类, pid大于0 代表属于某分类id的下级
	Nid            int64 `xorm:"index"` //小于等于0 代表本分类不属于某节点,大于0 代表属于某节点id的下级 本系统围绕node设计,分类亦可以是节点的下级
	Uid            int64 `xorm:"index"`
	Sort           int64
	Ctype          int64   `xorm:"index"`
	Title          string  `xorm:"index"`
	Content        string  `xorm:"text"`
	Attachment     string  `xorm:"text"`
	Created        int64   `xorm:"created index"`
	Updated        int64   `xorm:"updated"`
	Hotness        float64 `xorm:"index"`
	Confidence     float64 `xorm:"index"` //信任度数值
	Hotup          int64   `xorm:"index"`
	Hotdown        int64   `xorm:"index"`
	Hotscore       int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote        int64   `xorm:"index"` //Hotup  + 	Hotdown
	Views          int64
	Author         string `xorm:"index"` //这里指本分类创建者
	Parent         string `xorm:"index"` //父级分类名称
	NodeTime       int64
	NodeCount      int64
	NodeLastUserId int64
	Template       string `xorm:"index"`
}

func GetCategory

func GetCategory(id int64) (*Category, error)

func GetCategoryByTitle

func GetCategoryByTitle(title string) (*Category, error)

type Count

type Count struct {
	Id      int64
	Key     string `xorm:"index"`
	Value   int64  `xorm:"index"`
	Version int64  `xorm:"version"` //乐观锁
}

type Friend

type Friend struct {
	Id      int64
	Uid     int64  `xorm:"index"`
	Fid     int64  `xorm:"index"`
	Content string `xorm:"index"`         //申请留言
	Group   string `xorm:"index"`         //好友分组
	Accept  int64  `xorm:"index"`         //是否通过好友申请,即是大于0就是所有好友 3为特别关注  2为普通 1为待处理 0为缺省值 -1为拒绝  -2黑名单
	Created int64  `xorm:"created index"` //何时相交
}

好友关联表 包含 用户 ID,好友 ID

func GetRelationship

func GetRelationship(uid, fid int64) *Friend

type Friendjuser

type Friendjuser struct {
	Friend `xorm:"extends",json:"Friend"`
	User   `xorm:"extends",json:"User"`
}

type HistoryMessage

type HistoryMessage struct {
	Id       int64
	Key      string `xorm:"index"`
	Uid      int64  `xorm:"index"` //发送者之用户ID
	Sender   string `xorm:"index"` //发送者之用户名称
	Avatar   string `xorm:"index"` //发送者之头像
	Receiver string `xorm:"index"` //接收者之用户名称
	Content  string `xorm:"index"` //搜索功能需要索引
	Created  int64  `xorm:"index"`
}

func GetHistoryMessage

func GetHistoryMessage(id int64) (*HistoryMessage, error)

func GetHistoryMessageViaKey

func GetHistoryMessageViaKey(key string) (*HistoryMessage, error)

type IssueMark

type IssueMark struct {
	Id      int64
	Uid     int64  `xorm:"index"` //举报人
	Rid     int64  `xorm:"index"` //被举报项id
	Ctype   int64  `xorm:"index"` // 1为topic类型  -1是comment类型
	Title   string `xorm:"index"` //举报标题
	Content string `xorm:"text"`  //举报内容
}

func GetIssue

func GetIssue(rid int64) (*IssueMark, error)
type Link struct {
	Id             int64
	Pid            int64 `xorm:"index"` //小于等于0 代表链接本身是顶层链接, pid大于0 代表属于某节点id的下级 本系统围绕node设计,链接亦可以是节点的下级
	Uid            int64 `xorm:"index"`
	Sort           int64
	Ctype          int64   `xorm:"index"`
	Title          string  `xorm:"index"`
	Content        string  `xorm:"text"`
	Attachment     string  `xorm:"text"`
	Created        int64   `xorm:"created index"`
	Updated        int64   `xorm:"updated"`
	Hotness        float64 `xorm:"index"`
	Hotup          int64   `xorm:"index"`
	Hotdown        int64   `xorm:"index"`
	Hotscore       int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote        int64   `xorm:"index"` //Hotup  + 	Hotdown
	Views          int64
	Author         string `xorm:"index"` //这里指本链接创建者
	Parent         string `xorm:"index"` //父级节点名称
	NodeTime       int64
	NodeCount      int64
	NodeLastUserId int64
}
func GetLink(id int64) (*Link, error)

func GetLinkByTitle

func GetLinkByTitle(title string) (*Link, error)

type Message

type Message struct {
	Id       int64
	Key      string `xorm:"index"`
	Uid      int64  `xorm:"index"` //发送者之用户ID
	Sender   string `xorm:"index"` //发送者之用户名称
	Avatar   string `xorm:"index"` //发送者之头像
	Receiver string `xorm:"index"` //接收者之用户名称
	Content  string `xorm:"index"` //搜索功能需要索引
	Created  int64  `xorm:"index"`
}

func GetMessage

func GetMessage(id int64) (*Message, error)

func GetMessageViaKey

func GetMessageViaKey(key string) (*Message, error)

type Node

type Node struct {
	Id              int64
	Pid             int64 `xorm:"index"` //pid为0 代表节点本身是顶层节点, pid大于0 代表上级节点id , 编写逻辑的时候注意判断此pid不能等于自身id
	Cid             int64 `xorm:"index"` //所属分类的id
	Uid             int64 `xorm:"index"`
	Sort            int64
	Ctype           int64   `xorm:"index"`
	Title           string  `xorm:"index"`
	Content         string  `xorm:"text"`
	Attachment      string  `xorm:"text"`
	Created         int64   `xorm:"created index"`
	Updated         int64   `xorm:"updated"`
	Hotness         float64 `xorm:"index"`
	Confidence      float64 `xorm:"index"` //信任度数值
	Hotup           int64   `xorm:"index"`
	Hotdown         int64   `xorm:"index"`
	Hotscore        int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote         int64   `xorm:"index"` //Hotup  + 	Hotdown
	Views           int64
	Author          string `xorm:"index"` //节点的创建者
	Parent          string `xorm:"index"` //父级节点名称
	Category        string `xorm:"index"` //所属分类标题
	Tid             int64  //最后一次发布的topic的Tid
	Topic           int64  //最后一次发布的topic的标题
	TopicTime       int64
	TopicCount      int64
	TopicLastUserId int64
	FavoriteCount   int64  `xorm:"index"`
	Template        string `xorm:"index"`
}

func GetNode

func GetNode(id int64) (*Node, error)

func GetNodeByTitle

func GetNodeByTitle(title string) (*Node, error)

type NodeBookmark

type NodeBookmark struct {
	Id     int64
	Userid int64 `xorm:"index"`
	Nodeid int64 `xorm:"index"`
}

type NodeMark

type NodeMark struct {
	Id  int64
	Uid int64 `xorm:"index"`
	Nid int64 `xorm:"index"` //node id
}

type Notification

type Notification struct {
	Id           int64
	Uid          int64  `xorm:"index"`
	Tid          int64  `xorm:"index"`
	Rid          int64  `xorm:"index"`
	Ctype        int64  `xorm:"index"` //0普通通知 1通知作者 -1忽略
	Subject      string `xorm:"text"`
	Reply        string `xorm:"text"`
	Author       string `xorm:"index"`
	Avatar       string `xorm:"index"` //200x200
	AvatarLarge  string `xorm:"index"` //100x100
	AvatarMedium string `xorm:"index"` //48x48
	AvatarSmall  string `xorm:"index"` //32x32
	Created      int64  `xorm:"created index"`
}

func GetNotification

func GetNotification(id int64) (*Notification, error)

type Notificationjtopic

type Notificationjtopic struct {
	Notification `xorm:"extends"`
	Topic        `xorm:"extends"`
}

type Notificationjuser

type Notificationjuser struct {
	Notification `xorm:"extends"`
	User         `xorm:"extends"`
}

type Page

type Page struct {
	Id         int64
	Pid        int64 `xorm:"index"` //小于等于0 代表页面本身是顶层页面, pid大于0 代表属于某节点id的下级 本系统围绕node设计,页面亦可以是节点的下级
	Uid        int64 `xorm:"index"`
	Sort       int64
	Ctype      int64   `xorm:"index"`
	Title      string  `xorm:"index"`
	Content    string  `xorm:"text"`
	Attachment string  `xorm:"text"`
	Created    int64   `xorm:"created index"`
	Updated    int64   `xorm:"updated"`
	Hotness    float64 `xorm:"index"`
	Hotup      int64   `xorm:"index"`
	Hotdown    int64   `xorm:"index"`
	Hotscore   int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote    int64   `xorm:"index"` //Hotup  + 	Hotdown
	Views      int64
	Author     string `xorm:"index"` //这里指本页面创建者
	Template   string `xorm:"index"`
}

func GetPage

func GetPage(id int64) (*Page, error)

func GetPageByTitle

func GetPageByTitle(title string) (*Page, error)

type Reply

type Reply struct {
	Id                int64
	Pid               int64 `xorm:"index"` //上级Reply id
	Uid               int64 `xorm:"index"`
	Tid               int64 `xorm:"index"`
	Sort              int64
	Ctype             int64   `xorm:"index"`
	Content           string  `xorm:"text"`
	Tailinfo          int64   `xorm:"index"`
	Attachment        string  `xorm:"text"`
	Avatar            string  `xorm:"index"` //200x200
	AvatarLarge       string  `xorm:"index"` //100x100
	AvatarMedium      string  `xorm:"index"` //48x48
	AvatarSmall       string  `xorm:"index"` //32x32
	Created           int64   `xorm:"created index"`
	Updated           int64   `xorm:"updated"`
	Hotness           float64 `xorm:"index"`
	Confidence        float64 `xorm:"index"`
	Hotup             int64   `xorm:"index"`
	Hotdown           int64   `xorm:"index"`
	Hotscore          int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote           int64   `xorm:"index"` //Hotup  + Hotdown
	Views             int64
	Author            string `xorm:"index"`
	AuthorSignature   string `xorm:"index"`
	Email             string `xorm:"index"`
	Website           string `xorm:"index"`
	ReplyTime         int64
	ReplyCount        int64
	ReplyLastUserId   int64
	ReplyLastUsername string
	ReplyLastNickname string
	ReplyLastTopic    string  //最后回复的话题之标题
	Latitude          float64 `xorm:"index"`
	Longitude         float64 `xorm:"index"`
}

func GetReply

func GetReply(id int64) (*Reply, error)

type ReplyMark

type ReplyMark struct {
	Id  int64
	Uid int64 `xorm:"index"`
	Rid int64 `xorm:"index"` //Reply id
}

type Replyjtopic

type Replyjtopic struct {
	Reply `xorm:"extends"`
	Topic `xorm:"extends"`
}

type Replyjuser

type Replyjuser struct {
	Reply `xorm:"extends"`
	User  `xorm:"extends"`
}

type ReportMark

type ReportMark struct {
	Id      int64
	Uid     int64  `xorm:"index"` //举报人
	Rid     int64  `xorm:"index"` //被举报项id
	Ctype   int64  `xorm:"index"` // 1为topic类型  -1是comment类型
	Title   string `xorm:"index"` //举报标题
	Content string `xorm:"text"`  //举报内容
}

func GetReport

func GetReport(rid int64) (*ReportMark, error)

type Timeline

type Timeline struct {
	Id                int64
	Cid               int64 `xorm:"index"`
	Nid               int64 `xorm:"index"`
	Uid               int64 `xorm:"index"`
	Sort              int64
	Ctype             int64   `xorm:"index"`
	Title             string  `xorm:"index"`
	Content           string  `xorm:"text"`
	Attachment        string  `xorm:"text"`
	Created           int64   `xorm:"created index"`
	Updated           int64   `xorm:"updated"`
	Hotness           float64 `xorm:"index"`
	Hotup             int64   `xorm:"index"`
	Hotdown           int64   `xorm:"index"`
	Hotscore          int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote           int64   `xorm:"index"` //Hotup  +		Hotdown
	Views             int64   `xorm:"index"`
	Author            string  `xorm:"index"`
	AuthorSignature   string  `xorm:"index"`
	Category          string  `xorm:"index"`
	Node              string  `xorm:"index"`
	ReplyTime         int64
	ReplyCount        int64 `xorm:"index"`
	ReplyLastUserId   int64
	ReplyLastUsername string
	ReplyLastNickname string
}

func GetTimeline

func GetTimeline(lid int64) (*Timeline, error)

type Topic

type Topic struct {
	Id                int64
	Pid               int64   `xorm:"index"` //为0代表没有上级,本身就是顶层话题 大于0则本身是子话题,而该数字代表上级话题的id
	Cid               int64   `xorm:"index"`
	Nid               int64   `xorm:"index"` //nodeid
	Uid               int64   `xorm:"index"`
	Sort              int64   `xorm:"index"` //排序字段 需要手动对话题排序置顶等操作时使用
	Ctype             int64   `xorm:"index"` //ctype作用在于区分话题的类型
	Title             string  `xorm:"index"`
	Excerpt           string  `xorm:"index"` //摘录
	Content           string  `xorm:"text"`
	Tailinfo          string  `xorm:"index"` //尾巴信息 附带内容,譬如回复可见类型的话题时作为存储评论者UID集合
	Attachment        string  `xorm:"text"`  //附件 JSON
	Thumbnails        string  `xorm:"index"` //Original remote file
	ThumbnailsLarge   string  `xorm:"index"` //200x300
	ThumbnailsMedium  string  `xorm:"index"` //200x150
	ThumbnailsSmall   string  `xorm:"index"` //70x70
	Avatar            string  `xorm:"index"` //200x200
	AvatarLarge       string  `xorm:"index"` //100x100
	AvatarMedium      string  `xorm:"index"` //48x48
	AvatarSmall       string  `xorm:"index"` //32x32
	Tags              string  `xorm:"index"`
	Created           int64   `xorm:"created index"`
	Updated           int64   `xorm:"updated"`
	Hotness           float64 `xorm:"index"`
	Confidence        float64 `xorm:"index"` //信任度数值
	Hotup             int64   `xorm:"index"`
	Hotdown           int64   `xorm:"index"`
	Hotscore          int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote           int64   `xorm:"index"` //Hotup  + Hotdown
	Views             int64
	Author            string `xorm:"index"`
	Template          string `xorm:"index"`
	Category          string `xorm:"index"`
	Node              string `xorm:"index"` //nodename
	ReplyTime         int64
	ReplyCount        int64
	ReplyLastUserId   int64
	ReplyLastUsername string
	ReplyLastNickname string
	FavoriteCount     int64
	Latitude          float64 `xorm:"index"`   //纬度
	Longitude         float64 `xorm:"index"`   //经度
	Version           int64   `xorm:"version"` //乐观锁
}

func GetTopic

func GetTopic(id int64) (*Topic, error)

type TopicMark

type TopicMark struct {
	Id  int64
	Uid int64 `xorm:"index"`
	Cid int64 `xorm:"index"` //该话题所属于的分类
	Tid int64 `xorm:"index"` //Topic id
}

type Topicjtopicmark

type Topicjtopicmark struct {
	Topic     `xorm:"extends"`
	TopicMark `xorm:"extends"`
}

type Topicjtopicmarkjuser

type Topicjtopicmarkjuser struct {
	Topic     `xorm:"extends"`
	TopicMark `xorm:"extends"`
	User      `xorm:"extends"`
}

type Topicjuser

type Topicjuser struct {
	Topic `xorm:"extends"`
	User  `xorm:"extends"`
}

type User

type User struct {
	Id                int64
	Pid               int64  `xorm:"index"` //用在归属地 归属学校 归属组织 等方面
	Group             string `xorm:"index"` //小组名称集合
	Email             string `xorm:"index"`
	Password          string `xorm:"index" json:"-"` //禁止Json输出Password字段
	Username          string `xorm:"index"`
	Nickname          string `xorm:"index"`
	Realname          string `xorm:"index"`
	Content           string `xorm:"text"`
	Avatar            string `xorm:"index"` //200x200
	AvatarLarge       string `xorm:"index"` //100x100
	AvatarMedium      string `xorm:"index"` //48x48
	AvatarSmall       string `xorm:"index"` //32x32
	Birth             int64
	Province          string
	City              string
	Occupation        string //职业
	Company           string
	Address           string
	Postcode          string
	Mobile            string `xorm:"index"`
	Website           string
	Gender            int64 `xorm:"index"` // 1==男 -1==女
	Age               int64
	School            string
	Weight            int64
	Height            int64
	ZodiacSign        string //星座
	Qq                string
	Weixin            string
	WeixinOpenId      string `xorm:"index"` //微信移动端OpenId
	Weibo             string
	Ctype             int64   `xorm:"index"`
	Role              int64   `xorm:"index"` //角色属性同时也是权限属性 类似linux权限的形式 ,譬如:664/755/777,TODO
	Created           int64   `xorm:"created index"`
	Updated           int64   `xorm:"updated"`
	Hotness           float64 `xorm:"index"`
	Confidence        float64 `xorm:"index"` //信任度数值
	Hotup             int64   `xorm:"index"`
	Hotdown           int64   `xorm:"index"`
	Hotscore          int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote           int64   `xorm:"index"` //Hotup  + 	Hotdown
	Views             int64
	LastSigninTime    int64
	LastSigninIp      string `xorm:"index"`
	SigninCount       int64  `xorm:"index"`
	NodeTime          int64
	NodeCount         int64
	NodeLastTid       int64
	NodeLastTopic     string
	TopicTime         int64
	TopicCount        int64
	TopicLastNid      int64
	TopicLastNode     string
	ReplyTime         int64
	ReplyCount        int64
	ReplyLastTid      int64
	ReplyLastTopic    string //topic title
	FavoriteCount     int64
	NotificationCount int64
	Balance           int64
}

func GetUser

func GetUser(id int64) (*User, error)

func GetUserByEmail

func GetUserByEmail(email string) (*User, error)

返回值尽量返回指针 不然会出现诡异的问题

func GetUserByMobile

func GetUserByMobile(mobile string) (*User, error)

func GetUserByNickname

func GetUserByNickname(nickname string) (*User, error)

func GetUserByRole

func GetUserByRole(role int64) (*User, error)

func GetUserByUsername

func GetUserByUsername(username string) (*User, error)

type UserMark

type UserMark struct {
	Id   int64
	Uid  int64 `xorm:"index"` //投票本人
	User int64 `xorm:"index"` //user id,被投票人
}

type Usergroup

type Usergroup struct {
	Id             int64
	Pid            int64 `xorm:"index"`
	Uid            int64 `xorm:"index"` //创建者ID
	Sort           int64
	Ctype          int64   `xorm:"index"`
	Title          string  `xorm:"index"`
	Content        string  `xorm:"text"`
	Attachment     string  `xorm:"text"`
	Created        int64   `xorm:"created index"`
	Updated        int64   `xorm:"updated"`
	Hotness        float64 `xorm:"index"`
	Hotup          int64   `xorm:"index"`
	Hotdown        int64   `xorm:"index"`
	Hotscore       int64   `xorm:"index"` //Hotup  -	Hotdown
	Hotvote        int64   `xorm:"index"` //Hotup  +	Hotdown
	Views          int64
	Author         string `xorm:"index"` //这里指本用户组创建者
	UserTime       int64
	UserCount      int64
	UserLastUserId int64
}

Usergroup,Pid:root

Jump to

Keyboard shortcuts

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