Documentation ¶
Index ¶
- Constants
- Variables
- func InsertArticleEx(ctx context.Context, cv cv) error
- func InsertTag(ctx context.Context, name string) error
- func InsertUserCount(ctx context.Context, uid int64) error
- func InsertUserFollow(ctx context.Context, uid, fuid int64) error
- func RemoveArticle(ctx context.Context, id int64) error
- func RemoveComment(ctx context.Context, id int64) error
- func RemoveReply(ctx context.Context, id int64) error
- func RemoveUserFollow(ctx context.Context, uid, fuid int64) error
- func UpdateArticle(ctx context.Context, cv cv, id int64) error
- func UpdateArticleEx(ctx context.Context, aid int64, add bool, columns ...string) error
- func UpdateComment(ctx context.Context, id int64, cv cv, add bool, columns ...string) error
- func UpdateUser(ctx context.Context, cv cv, where where) error
- func UpdateUserCount(ctx context.Context, uid int64, add bool, columns ...string) error
- type Article
- type ArticleEx
- type Comment
- type CommentReply
- type Tag
- type User
- type UserCount
- type UserFollow
Constants ¶
View Source
const ( Unaudited = "Unaudited" Online = "Online" Offline = "offline" Deleted = "deleted" )
View Source
const ( Man = "man" Woman = "woman" Unknown = "unknown" )
View Source
const ( Unsign = "unsign" Normal = "normal" Forbidden = "forbidden" Freeze = "freeze" )
Variables ¶
View Source
var (
DB *sqlx.DB
)
Functions ¶
func InsertArticleEx ¶
func UpdateArticleEx ¶
func UpdateComment ¶
func UpdateUser ¶
Types ¶
type Article ¶
type Article struct { Id int64 `json:"id" db:"id"` Sn string `json:"sn" db:"sn"` Title string `json:"title" db:"title"` Uid int64 `json:"uid" db:"uid"` Cover string `json:"cover" db:"cover"` Content string `json:"content" db:"content"` Tags []string `json:"tags" db:"tags"` State string `json:"state" db:"state"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` DeletedAt time.Time `json:"deletedAt" db:"deleted_at"` }
func GetArticle ¶
func GetArticles ¶
type ArticleEx ¶
type ArticleEx struct { Aid int64 `json:"aid" db:"aid"` ViewNum int `json:"viewNum" db:"view_num"` CmtNum int `json:"cmtNum" db:"cmt_num"` ZanNum int `json:"zanNum" db:"zan_num"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` DeletedAt time.Time `json:"deletedAt" db:"deleted_at"` }
type Comment ¶
type Comment struct { Id int64 `json:"id" db:"id"` Aid int64 `json:"aid" db:"aid"` Uid int64 `json:"uid" db:"uid"` Content int64 `json:"content" db:"content"` ZanNum int64 `json:"zanNum" db:"zan_num"` Floor int64 `json:"floor" db:"floor"` State string `json:"state" db:"state"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` DeletedAt time.Time `json:"deletedAt" db:"deleted_at"` }
type CommentReply ¶
type CommentReply struct { Id int64 `json:"id" db:"id"` Cid int64 `json:"cid" db:"cid"` Uid int64 `json:"uid" db:"uid"` Content string `json:"content" db:"content"` State string `json:"state" db:"state"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` DeletedAt time.Time `json:"deletedAt" db:"deleted_at"` }
func GetReplies ¶
func GetReplies(ctx context.Context, cid int64) ([]CommentReply, error)
func InsertReply ¶
func InsertReply(ctx context.Context, cv cv) (CommentReply, error)
type Tag ¶
type User ¶
type User struct { Id int64 `json:"id" db:"id"` Username string `json:"username" db:"username"` Email string `json:"email" db:"email"` Password string `json:"password" db:"password"` Avatar string `json:"avatar" db:"avatar"` Gender string `json:"gender" db:"gender"` Introduce string `json:"introduce" db:"introduce"` State string `json:"state" db:"state"` Root bool `json:"root" db:"root"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` DeletedAt time.Time `json:"deletedAt" db:"deleted_at"` }
type UserCount ¶
type UserCount struct { Uid int64 `json:"uid" db:"uid"` FansNum int32 `json:"fansNum" db:"fans_num"` FollowNum int32 `json:"followNum" db:"follow_num"` ArticleNum int32 `json:"articleNum" db:"article_num"` Words int32 `json:"words" db:"words"` ZanNum int32 `json:"zanNum" db:"zan_num"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` DeletedAt time.Time `json:"deletedAt" db:"deleted_at"` }
type UserFollow ¶
type UserFollow struct { Id int64 `json:"id" db:"id"` Uid int64 `json:"uid" db:"uid"` Fuid int64 `json:"fuid" db:"fuid"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` DeletedAt time.Time `json:"deletedAt" db:"deleted_at"` }
func GetFollowUserList ¶
func GetFollowUserList(ctx context.Context, uid int64) ([]UserFollow, error)
获取用户粉丝列表
func GetUserFollowList ¶
func GetUserFollowList(ctx context.Context, fuid int64) ([]UserFollow, error)
获取用户关注列表
Click to show internal directories.
Click to hide internal directories.