model

package
v0.0.0-...-e9e0146 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: GPL-3.0 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 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 ArticleSearchList

func ArticleSearchList(db *youdb.DB, where, kw string, limit, 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 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) []CategoryMini

func CategoryNewest

func CategoryNewest(db *youdb.DB, limit int) []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"`
}

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"`
	Name       string `json:"name"`
	Avatar     string `json:"avatar"`
	Content    string `json:"content"`
	ContentFmt template.HTML
	AddTime    uint64 `json:"addtime"`
	AddTimeFmt string `json:"addtimefmt"`
}

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) 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 QQ

type QQ struct {
	Uid    uint64 `json:"uid"`
	Name   string `json:"name"`
	Openid string `json:"openid"`
}

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"`
	Telephone         string `json:"telephone"`
	Coin              uint64 `json:"coin"`
	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"`
	EmailVerified     bool   `json:"emailverified"`
	TelephoneVerified bool   `json:"telephoneverified"`
	Hidden            bool   `json:"hidden"`
	Session           string `json:"session"`
}

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"`
}

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

type WeiBo

type WeiBo struct {
	Uid    uint64 `json:"uid"`
	Name   string `json:"name"`
	Openid string `json:"openid"`
}

Jump to

Keyboard shortcuts

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