Documentation ¶
Index ¶
- Variables
- func AddAnswer(qid int64, uid int64, ctype int64, content string, author string, ...) (int64, error)
- func AddCategory(title string, content string) (int64, error)
- func AddImage(path string, pid int64, ctype int64, uid int64) (int64, error)
- func AddNode(title string, content string, cid int64, uid int64) (int64, error)
- func AddReply(tid int64, uid int64, ctype int64, content string, author string, ...) (int64, error)
- func AddTimeline(title string, content string, cid int64, nid int64, uid int64, author string, ...) (int64, error)
- func AddTopic(title string, content string, cid int64, nid int64, uid int64) (int64, error)
- func AddUser(email string, username string, nickname string, realname string, ...) (int64, error)
- func AtLinksPostImagesOnTopic(content string) (int64, string, error)
- func ConDb() (*xorm.Engine, error)
- func CreatTables() error
- func DelAnswer(aid int64, uid int64, role int64) error
- func DelImageByLocation(location string) error
- func DelImageByMid(mid int64) error
- func DelQuestion(id int64, uid int64, role int64) error
- func DelReply(rid int64) error
- func DelReplysByPid(pid int64) error
- func DelTimeline(lid int64) error
- func DelTopic(id int64, uid int64, role int64) error
- func GetAScoresByPid(pid int64) int64
- func GetAllReply() (allr *[]Reply)
- func GetAnswersByPid(id int64, ctype int64, offset int, limit int, path string) *[]Reply
- func GetCategoryCountByPid(pid int64) int64
- func GetImagesByCtype(ctype int64) (*[]Image, error)
- func GetImagesByCtypeWidthCid(ctype int64, cid int64) (*[]Image, error)
- func GetImagesByCtypeWidthNid(ctype int64, nid int64) (*[]Image, error)
- func GetImagesByCtypeWithUid(ctype int64, uid int64) (*[]Image, error)
- func GetImagesByCtypeWithUidAndTid(ctype int64, uid int64, tid int64) (*[]Image, error)
- func GetImagesByHotnessFingerprint(usrlimit int, imagelimit int) []*[]Image
- func GetImagesByUidAndTid(uid int64, tid int64) (*[]Image, error)
- func GetImagesOnViewsHotnessFingerprintByUid(uid int64) (*[]Image, error)
- func GetImagesOnViewsHotnessFingerprintByUidExcludeCid(uid int64, cid int64) (*[]Image, error)
- func GetNodeCountByPid(cid int64) int64
- func GetNodes(offset int, limit int, path string) (*[]Node, error)
- func GetQuestions(offset int, limit int, path string) (*[]Question, error)
- func GetQuestionsByCid(cid int64, offset int, limit int, ctype int64, path string) *[]Question
- func GetQuestionsCount(offset int, limit int, path string) (int64, error)
- func GetReplyCountByPid(tid int64) int64
- func GetReplysByPid(id int64, ctype int64, offset int, limit int, path string) *[]Reply
- func GetTimelines(offset int, limit int, path string, uid int64) (*[]Timeline, error)
- func GetTopicCountByNid(nid int64) int64
- func GetTopics(offset int, limit int, path string) (*[]Topic, error)
- func GetTopicsByCategory(category string, offset int, limit int, ctype int64, path string) *[]Topic
- func GetTopicsByCategoryCount(category string, offset int, limit int, path string) (int64, error)
- func GetTopicsByCid(cid int64, offset int, limit int, ctype int64, path string) *[]Topic
- func GetTopicsByHotnessCategory(catlimit int, topiclimit int) []*[]Topic
- func GetTopicsByHotnessNodes(nodelimit int, topiclimit int) []*[]Topic
- func GetTopicsByNid(nodeid int64, offset int, limit int, ctype int64, path string) *[]Topic
- func GetTopicsByNode(node string, offset int, limit int, path string) (*[]Topic, error)
- func GetTopicsByScoreNodes(nodelimit int, topiclimit int) []*[]Topic
- func GetTopicsByUid(uid int64, offset int, limit int, ctype int64, path string) *[]Topic
- func GetTopicsCount(offset int, limit int, path string) (int64, error)
- func GetUsersOnHotness(offset int, limit int, path string) (*[]User, error)
- func IsAnswerMark(uid int64, aid int64) bool
- func IsQuestionMark(uid int64, qid int64) bool
- func PostImage(img *Image) (int64, error)
- func PostTopic(tp *Topic) (int64, error)
- func PutAnswer(aid int64, ans *Reply) (int64, error)
- func PutCategory(cid int64, cat *Category) (int64, error)
- func PutImage(mid int64, img *Image) (int64, error)
- func PutNode(nid int64, nd *Node) (int64, error)
- func PutQuestion(qid int64, qs *Question) (int64, error)
- func PutReply(rid int64, rp *Reply) (int64, error)
- func PutTimeline(lid int64, tl *Timeline) (int64, error)
- func PutTopic(tid int64, tp *Topic) (int64, error)
- func PutUser(uid int64, usr *User) (int64, error)
- func SearchCategory(content string, offset int, limit int, path string) (*[]Category, error)
- func SearchNode(content string, offset int, limit int, path string) (*[]Node, error)
- func SearchQuestion(content string, offset int, limit int, path string) (*[]Question, error)
- func SearchTopic(content string, offset int, limit int, path string) (*[]Topic, error)
- func SetAcceptAnswer(qid int64, aid int64, uid int64, role int64) error
- func SetAnswerMark(uid int64, aid int64) (int64, error)
- func SetCtypeforQuestion(qid int64, uid int64, role int64, ctype int64) error
- func SetEngine() (*xorm.Engine, error)
- func SetIgnoreAnswer(qid int64, aid int64, uid int64, role int64) error
- func SetImageByLocationWithUid(location string, uid int64, tid int64, ctype int64) error
- func SetImageCtypeByLocation(location string, ctype int64) error
- func SetImageCtypeByLocationWithUid(location string, uid int64, ctype int64) error
- func SetImageCtypeByLocationWithUidAndTid(location string, uid int64, tid int64, ctype int64) error
- func SetImageCtypeByMid(mid int64, ctype int64) error
- func SetQuestionMark(uid int64, qid int64) (int64, error)
- func SetRecordforImageOnEdit(tid int64, uid int64)
- func SetRecordforImageOnPost(tid int64, uid int64)
- func SetReplyContentByRid(rid int64, Content string) error
- func SetReplyCountByPid(qid int64) (int64, error)
- func SetTimelineContentByRid(lid int64, Content string) error
- func UpdateAnswer(aid int64, answermap map[string]interface{}) error
- func UpdateCategory(cid int64, catmap *map[string]interface{}) error
- func UpdateNode(nid int64, nodemap *map[string]interface{}) error
- type Ads
- type AnswerMark
- type Category
- type File
- type Image
- type Node
- type Question
- type QuestionMark
- type Reply
- type Timeline
- type Topic
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Engine *xorm.Engine
)
Functions ¶
func AddTimeline ¶
func AtLinksPostImagesOnTopic ¶
最终发布到topic
func CreatTables ¶
func CreatTables() error
func DelImageByLocation ¶
func DelImageByMid ¶
func DelReplysByPid ¶
func DelTimeline ¶
func GetAScoresByPid ¶
func GetAllReply ¶
func GetAllReply() (allr *[]Reply)
func GetAnswersByPid ¶
func GetCategoryCountByPid ¶
func GetImagesByCtype ¶
func GetImagesByCtypeWithUid ¶
func GetNodeCountByPid ¶
func GetQuestionsByCid ¶
func GetReplyCountByPid ¶
func GetReplysByPid ¶
func GetTimelines ¶
func GetTopicCountByNid ¶
func GetTopicsByCategory ¶
func GetTopicsByCid ¶
大数据下会出现极其严重的性能问题 亟待改善
func GetTopicsByHotnessNodes ¶
func GetTopicsByNid ¶
func GetTopicsByNode ¶
func GetTopicsByScoreNodes ¶
func GetTopicsByUid ¶
func GetUsersOnHotness ¶
func IsAnswerMark ¶
func IsQuestionMark ¶
func SearchCategory ¶
func SearchNode ¶
func SearchQuestion ¶
func SearchTopic ¶
func SetCtypeforQuestion ¶
func SetImageCtypeByLocation ¶
func SetImageCtypeByMid ¶
func SetRecordforImageOnEdit ¶
func SetRecordforImageOnPost ¶
func SetReplyContentByRid ¶
func SetReplyCountByPid ¶
func SetTimelineContentByRid ¶
func UpdateAnswer ¶
map[string]interface{}{"ctype": ctype}
func UpdateCategory ¶
map[string]interface{}{"ctype": ctype}
func UpdateNode ¶
map[string]interface{}{"ctype": ctype}
Types ¶
type Ads ¶
type Ads struct { Id int64 Cid int64 `xorm:"index"` Nid int64 `xorm:"index"` Uid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Title string `xorm:"index"` Content string `xorm:"text index"` Attachment string `xorm:"text"` Begintime time.Time Endtime time.Time Created time.Time `xorm:"created index"` Updated time.Time `xorm:"updated index"` 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"` Category string `xorm:"index"` Node string `xorm:"index"` ReplyTime time.Time ReplyCount int64 `xorm:"index"` ReplyLastUserId int64 ReplyLastUsername string ReplyLastNickname string }
type AnswerMark ¶
type Category ¶
type Category struct { Id int64 Pid int64 `xorm:"index"` Uid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Title string `xorm:"index"` Content string `xorm:"text index"` Attachment string `xorm:"text"` Created time.Time `xorm:"created index"` Updated time.Time `xorm:"updated index"` 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"` //这里指本分类创建者 NodeTime time.Time NodeCount int64 `xorm:"index"` NodeLastUserId int64 }
category,Pid:root
func GetCategory ¶
type File ¶
type File struct { Id int64 Uid int64 `xorm:"index"` Cid int64 `xorm:"index"` Nid int64 `xorm:"index"` Pid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Filename string Content string `xorm:"text index"` Hash string Location string `xorm:"index"` Url string `xorm:"index"` Size int64 Created time.Time `xorm:"created index"` Updated time.Time `xorm:"updated index"` 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"` ReplyTime time.Time ReplyCount int64 `xorm:"index"` ReplyLastUserId int64 }
type Image ¶
type Image struct { Id int64 Uid int64 `xorm:"index"` Cid int64 `xorm:"index"` Nid int64 `xorm:"index"` Pid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Fingerprint string `xorm:"index"` Filename string `xorm:"index"` Content string `xorm:"text index"` Hash string `xorm:"index"` Location string `xorm:"index"` Url string `xorm:"index"` Size int64 Width int64 Height int64 Created time.Time `xorm:"created index"` Updated time.Time `xorm:"updated index"` 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"` ReplyTime time.Time ReplyCount int64 `xorm:"index"` ReplyLastUserId int64 }
type Node ¶
type Node struct { Id int64 Pid int64 `xorm:"index"` Uid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Title string `xorm:"index"` Content string `xorm:"text index"` Attachment string `xorm:"text"` Created time.Time `xorm:"created index"` Updated time.Time `xorm:"updated index"` 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"` //节点的创建者 TopicTime time.Time TopicCount int64 `xorm:"index"` TopicLastUserId int64 }
node,Pid:category
func GetNodeByTitle ¶
type Question ¶
type Question struct { Id int64 Cid int64 `xorm:"index"` Nid int64 `xorm:"index"` Uid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Title string `xorm:"index"` Content string `xorm:"text index"` Attachment string `xorm:"text index"` Thumbnails string `xorm:"index"` //Original remote file ThumbnailsLarge string `xorm:"index"` //200x300 ThumbnailsMedium string `xorm:"index"` //200x150 ThumbnailsSmall string `xorm:"index"` //70x70 Tags string `xorm:"index"` Created time.Time `xorm:"created index"` Updated time.Time `xorm:"index"` 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"` Category string `xorm:"index"` Node string `xorm:"index"` ReplyTime time.Time ReplyCount int64 `xorm:"index"` ReplyHotscore int64 `xorm:"index"` //Hotup - Hotdown ReplyLastUserId int64 ReplyLastUsername string ReplyLastNickname string FavoriteCount int64 `xorm:"index"` }
由于cid nid uid都可以是topic的上级所以默认不设置pid字段,这里默认Pid是nid
func GetQuestion ¶
type QuestionMark ¶
type Reply ¶
type Reply struct { Id int64 Uid int64 `xorm:"index"` Pid int64 `xorm:"index"` //Topic id Order int64 Ctype int64 `xorm:"index"` Content string `xorm:"text index"` Attachment string `xorm:"text"` Created time.Time `xorm:"created index"` Updated time.Time `xorm:"index"` 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"` Email string `xorm:"index"` Website string `xorm:"index"` ReplyTime time.Time ReplyCount int64 `xorm:"index"` ReplyLastUserId int64 ReplyLastUsername string ReplyLastNickname string }
reply,Pid:topic
type Timeline ¶
type Timeline struct { Id int64 Cid int64 `xorm:"index"` Nid int64 `xorm:"index"` Uid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Title string `xorm:"index"` Content string `xorm:"text index"` Attachment string `xorm:"text index"` Created time.Time `xorm:"created index"` Updated time.Time `xorm:"updated index"` 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 time.Time ReplyCount int64 `xorm:"index"` ReplyLastUserId int64 ReplyLastUsername string ReplyLastNickname string }
func GetTimeline ¶
type Topic ¶
type Topic struct { Id int64 Cid int64 `xorm:"index"` Nid int64 `xorm:"index"` Uid int64 `xorm:"index"` Order int64 Ctype int64 `xorm:"index"` Title string `xorm:"index"` Content string `xorm:"text index"` Attachment string `xorm:"text index"` Thumbnails string `xorm:"index"` //Original remote file ThumbnailsLarge string `xorm:"index"` //200x300 ThumbnailsMedium string `xorm:"index"` //200x150 ThumbnailsSmall string `xorm:"index"` //70x70 Tags string `xorm:"index"` Created time.Time `xorm:"created index"` Updated time.Time `xorm:"index"` 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"` Category string `xorm:"index"` Node string `xorm:"index"` ReplyTime time.Time ReplyCount int64 `xorm:"index"` ReplyLastUserId int64 ReplyLastUsername string ReplyLastNickname string }
由于cid nid uid都可以是topic的上级所以默认不设置pid字段,这里默认Pid是nid
type User ¶
type User struct { Id int64 Pid int64 //用在归属地 归属学校 归属组织 等方面 Email string `xorm:"index"` Password string `xorm:"index"` Username string `xorm:"index"` Nickname string `xorm:"index"` Realname string `xorm:"index"` Content string `xorm:"text index"` Avatar string AvatarLarge string AvatarMedium string AvatarSmall string Birth time.Time Province string City string Company string Address string Postcode string Mobile string Website string Sex int64 Qq string Msn string Weibo string Ctype int64 `xorm:"index"` Role int64 `xorm:"index"` Created time.Time `xorm:"created index"` Updated time.Time `xorm:"updated index"` 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"` LastLoginTime time.Time LastLoginIp string LoginCount int64 `xorm:"index"` }
func GetUserByNickname ¶
func GetUserByRole ¶
func GetUserByUsername ¶
Click to show internal directories.
Click to hide internal directories.