model

package
v0.0.0-...-5f88e8a Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommentDelByKey

func CommentDelByKey(db *youdb.DB, aid string, cid uint64) error

func CommentSetByKey

func CommentSetByKey(db *youdb.DB, aid string, cid uint64, obj Comment) error

func LinkSet

func LinkSet(db *youdb.DB, obj Link)

func UserGetIdByName

func UserGetIdByName(db *youdb.DB, name string) string

func UserUpdate

func UserUpdate(db *youdb.DB, obj User) error

Types

type Article

type Article struct {
	Id           uint64 `json:"id"`
	Uid          uint64 `json:"uid"`
	Cid          uint64 `json:"cid"`
	RUid         uint64 `json:"ruid"`
	Title        string `json:"title"`
	Content      string `json:"content"`
	ClientIp     string `json:"clientip"`
	Tags         string `json:"tags"`
	AddTime      uint64 `json:"addtime"`
	EditTime     uint64 `json:"edittime"`
	Comments     uint64 `json:"comments"`
	CloseComment bool   `json:"closecomment"`
	Hidden       bool   `json:"hidden"`
}

func ArticleGetById

func ArticleGetById(db *youdb.DB, aid string) (Article, error)

type ArticleFeedListItem

type ArticleFeedListItem struct {
	Id          uint64
	Uid         uint64
	Name        string
	Cname       string
	Title       string
	AddTimeFmt  string
	EditTimeFmt string
	Des         string
}

func ArticleFeedCategoryList

func ArticleFeedCategoryList(db *youdb.DB, cid string, limit, tz int) []ArticleFeedListItem

func ArticleFeedList

func ArticleFeedList(db *youdb.DB, limit, tz int) []ArticleFeedListItem

type ArticleLi

type ArticleLi struct {
	Id    uint64 `json:"id"`
	Title string `json:"title"`
	Tags  string `json:"tags"`
}

type ArticleListItem

type ArticleListItem struct {
	Id          uint64 `json:"id"`
	Uid         uint64 `json:"uid"`
	Name        string `json:"name"`
	Avatar      string `json:"avatar"`
	Cid         uint64 `json:"cid"`
	Cname       string `json:"cname"`
	Ruid        uint64 `json:"ruid"`
	Rname       string `json:"rname"`
	Title       string `json:"title"`
	EditTime    uint64 `json:"edittime"`
	EditTimeFmt string `json:"edittimefmt"`
	Comments    uint64 `json:"comments"`
}

type ArticleMini

type ArticleMini struct {
	Id       uint64 `json:"id"`
	Uid      uint64 `json:"uid"`
	Cid      uint64 `json:"cid"`
	Ruid     uint64 `json:"ruid"`
	Title    string `json:"title"`
	EditTime uint64 `json:"edittime"`
	Comments uint64 `json:"comments"`
	Hidden   bool   `json:"hidden"`
}

type ArticlePageInfo

type ArticlePageInfo struct {
	Items      []ArticleListItem `json:"items"`
	HasPrev    bool              `json:"hasprev"`
	HasNext    bool              `json:"hasnext"`
	FirstKey   uint64            `json:"firstkey"`
	FirstScore uint64            `json:"firstscore"`
	LastKey    uint64            `json:"lastkey"`
	LastScore  uint64            `json:"lastscore"`
}

func ArticleList

func ArticleList(db *youdb.DB, cmd, tb, key, score string, limit, tz int) ArticlePageInfo

func ArticleNotificationList

func ArticleNotificationList(db *youdb.DB, ids string, tz int) ArticlePageInfo

func UserArticleList

func UserArticleList(db *youdb.DB, cmd, tb, key string, limit, tz int) ArticlePageInfo

type ArticleRelative

type ArticleRelative struct {
	Articles []ArticleLi
	Tags     []string
}

func ArticleGetRelative

func ArticleGetRelative(db *youdb.DB, aid uint64, tags string) ArticleRelative

type ArticleTag

type ArticleTag struct {
	Id      uint64
	OldTags string
	NewTags string
}

文章添加、编辑后传给后台任务的信息

type Category

type Category struct {
	Id       uint64 `json:"id"`
	Name     string `json:"name"`
	Articles uint64 `json:"articles"`
	About    string `json:"about"`
	Hidden   bool   `json:"hidden"`
}

func CategoryGetById

func CategoryGetById(db *youdb.DB, cid string) (Category, error)

type CategoryMini

type CategoryMini struct {
	Id   uint64 `json:"id"`
	Name string `json:"name"`
}

func CategoryGetMain

func CategoryGetMain(db *youdb.DB, currentCobj Category) []CategoryMini

func CategoryHot

func CategoryHot(db *youdb.DB, limit int, hide string) []CategoryMini

type CategoryPageInfo

type CategoryPageInfo struct {
	Items    []Category `json:"items"`
	HasPrev  bool       `json:"hasprev"`
	HasNext  bool       `json:"hasnext"`
	FirstKey uint64     `json:"firstkey"`
	LastKey  uint64     `json:"lastkey"`
}

func CategoryList

func CategoryList(db *youdb.DB, cmd, key string, limit int) CategoryPageInfo

type Comment

type Comment struct {
	Id       uint64 `json:"id"`
	Aid      uint64 `json:"aid"`
	Uid      uint64 `json:"uid"`
	Content  string `json:"content"`
	ClientIp string `json:"clientip"`
	AddTime  uint64 `json:"addtime"`
	Fold     bool   `json:"fold"`
}

func CommentGetByKey

func CommentGetByKey(db *youdb.DB, aid string, cid uint64) (Comment, error)

type CommentListItem

type CommentListItem struct {
	Id         uint64 `json:"id"`
	Aid        uint64 `json:"aid"`
	Uid        uint64 `json:"uid"`
	Flag       int    `json:"flag"`
	Name       string `json:"name"`
	Avatar     string `json:"avatar"`
	Content    string `json:"content"`
	ContentFmt template.HTML
	AddTime    uint64 `json:"addtime"`
	AddTimeFmt string `json:"addtimefmt"`
	Fold       bool   `json:"fold"`
}

type CommentPageInfo

type CommentPageInfo struct {
	Items    []CommentListItem `json:"items"`
	HasPrev  bool              `json:"hasprev"`
	HasNext  bool              `json:"hasnext"`
	FirstKey uint64            `json:"firstkey"`
	LastKey  uint64            `json:"lastkey"`
}

func CommentList

func CommentList(db *youdb.DB, cmd, tb, key string, limit, tz int, ignorelimitedusers bool) CommentPageInfo
type Link struct {
	Id    uint64 `json:"id"`
	Name  string `json:"name"`
	Url   string `json:"url"`
	Score int    `json:"score"`
}

func LinkGetById

func LinkGetById(db *youdb.DB, lid string) Link
func LinkList(db *youdb.DB, getAll bool) []Link

type User

type User struct {
	Id                 uint64 `json:"id"`
	Name               string `json:"name"`
	Gender             string `json:"gender"`
	Flag               int    `json:"flag"`
	Avatar             string `json:"avatar"`
	Password           string `json:"password"`
	Email              string `json:"email"`
	Url                string `json:"url"`
	Articles           uint64 `json:"articles"`
	Replies            uint64 `json:"replies"`
	RegTime            uint64 `json:"regtime"`
	LastPostTime       uint64 `json:"lastposttime"`
	LastReplyTime      uint64 `json:"lastreplytime"`
	LastLoginTime      uint64 `json:"lastlogintime"`
	About              string `json:"about"`
	Notice             string `json:"notice"`
	NoticeNum          int    `json:"noticenum"`
	Hidden             bool   `json:"hidden"`
	Session            string `json:"session"`
	IgnoreNode         string `json:"ignorenode"`
	IgnoreUser         string `json:"ignoreuser"`
	Theme              string `json:"theme"`
	IgnoreLimitedUsers bool   `json:"ignorelimitedusers"`
}

func UserGetById

func UserGetById(db *youdb.DB, uid uint64) (User, error)

func UserGetByName

func UserGetByName(db *youdb.DB, name string) (User, error)

type UserMini

type UserMini struct {
	Id     uint64 `json:"id"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
	Flag   int    `json:"flag"`
}

type UserPageInfo

type UserPageInfo struct {
	Items    []User `json:"items"`
	HasPrev  bool   `json:"hasprev"`
	HasNext  bool   `json:"hasnext"`
	FirstKey uint64 `json:"firstkey"`
	LastKey  uint64 `json:"lastkey"`
}

func UserListByFlag

func UserListByFlag(db *youdb.DB, cmd, tb, key string, limit int) UserPageInfo

Jump to

Keyboard shortcuts

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