Documentation ¶
Index ¶
- type AuthService
- type CommentService
- type IAuthService
- type ICommentService
- type ILinkService
- type IPageService
- type IPostService
- type ISubscriberService
- type ITagService
- type IUserService
- type LinkService
- func (l *LinkService) Create(link models.Link) (models.Link, error)
- func (l *LinkService) Delete(id uint) error
- func (l *LinkService) FirstLink(id uint) (models.Link, error)
- func (l *LinkService) ListAllLink(columns []string) (links []*models.Link, err error)
- func (l *LinkService) ListLink(per, page int, columns []string) (links []*models.Link, err error)
- func (l *LinkService) MaxSort() int
- func (l *LinkService) Update(link *models.Link) error
- func (l *LinkService) UpdateAttr(link *models.Link, attr map[string]interface{}) error
- func (l *LinkService) UpdateLink() error
- type PageService
- func (p *PageService) Create(page models.Page) (models.Page, error)
- func (p *PageService) Delete(page models.Page) error
- func (p *PageService) FindPage(id uint) (models.Page, error)
- func (p *PageService) GetModel() (*models.Page, error)
- func (p *PageService) ListPage(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Page, error)
- func (p *PageService) New() (models.Page, error)
- func (p *PageService) PublishPage(per, page uint, attr map[string]interface{}, columns []string) (pages []*models.Page, err error)
- func (p *PageService) SetModel(model *models.Page) error
- func (p *PageService) TotalPage(attr map[string]interface{}) (total int, err error)
- func (p *PageService) Update(page *models.Page) error
- func (p *PageService) UpdateAttr(page *models.Page, attr map[string]interface{}) error
- func (p *PageService) UpdatePage() error
- type PostService
- func (p *PostService) AllListPost(attr map[string]interface{}, columns []string) ([]*models.Post, error)
- func (p *PostService) CountPost(attr map[string]interface{}) (count int, err error)
- func (p *PostService) CountPostByTag(tag uint) (count int, err error)
- func (p *PostService) Create(post *models.Post) error
- func (p *PostService) Delete(id uint) error
- func (p *PostService) GetPostById(id uint, isTags bool) (*models.Post, error)
- func (p *PostService) ListMaxCommentPost(columns []string) (posts []*models.Post, err error)
- func (p *PostService) ListMaxReadPost(column []string) (posts []*models.Post, err error)
- func (p *PostService) ListPost(per, page uint, attr map[string]interface{}, columns []string) (posts []*models.Post, err error)
- func (p *PostService) NotPublishPost(per, page uint, attr map[string]interface{}, columns []string) (posts []*models.Post, err error)
- func (p *PostService) PublishPost(per, page uint, attr map[string]interface{}, columns []string, isTag bool) (posts []*models.Post, err error)
- func (p *PostService) TagsPost(per, page uint, attr map[string]interface{}, columns []string, tag string) (posts []*models.Post, err error)
- func (p *PostService) Update(post *models.Post) error
- func (p *PostService) UpdateAttr(post *models.Post, attr map[string]interface{}) error
- func (p *PostService) UpdatePost() error
- type SubscriberService
- type TagService
- func (t *TagService) Create(tag models.Tag) (models.Tag, error)
- func (t *TagService) Delete(id uint) error
- func (t *TagService) DeletePostTagByPostId(postId uint) error
- func (t *TagService) ListTag(per, page uint, attr map[string]interface{}, columns []string) (tags []models.Tag, err error)
- func (t *TagService) ListTagByPostId(postId uint) (tags []*models.Tag, err error)
- func (t *TagService) PostTagCreate(tag *models.PostTag) error
- func (t *TagService) PublishTagsList() ([]*models.Tag, error)
- type UserService
- func (u *UserService) FindUserAll(attr map[string]interface{}) (users []*models.User, err error)
- func (u *UserService) FindUserByEmail(email string) (models.User, error)
- func (u *UserService) FirstOrCreate(user *models.User) (*models.User, error)
- func (u *UserService) FirstUser() error
- func (u *UserService) GetModel() (*models.User, error)
- func (u *UserService) GetUserByID(id int64) (*models.User, error)
- func (u *UserService) Insert() error
- func (u *UserService) ListAdminUsers(per, page int, columns []string) (users []*models.User, err error)
- func (u *UserService) Lock() error
- func (u *UserService) ReloadGithub(user *models.User) error
- func (u *UserService) SetModel(user *models.User) error
- func (u *UserService) Update(user *models.User, attr map[string]interface{}) error
- func (u *UserService) UpdateUser() (err error)
- func (u *UserService) UpdateUserAttr(attr map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
Model *models.GithubUserInfo
}
func (*AuthService) FirstOrCreate ¶
func (g *AuthService) FirstOrCreate(github *models.GithubUserInfo) (*models.GithubUserInfo, error)
type CommentService ¶
func (*CommentService) ListCommentByPostID ¶
func (c *CommentService) ListCommentByPostID(postId uint) ([]*models.Comment, error)
func (*CommentService) ListUnreadComment ¶
func (c *CommentService) ListUnreadComment() ([]*models.Comment, error)
@method: 查询未读的评论
type IAuthService ¶
type IAuthService interface {
FirstOrCreate(github *models.GithubUserInfo) (*models.GithubUserInfo, error)
}
func NewAuthService ¶
func NewAuthService() IAuthService
type ICommentService ¶
type ICommentService interface { CountComment() int ListUnreadComment() ([]*models.Comment, error) ListCommentByPostID(postId uint) ([]*models.Comment, error) }
func NewCommentService ¶
func NewCommentService() ICommentService
type ILinkService ¶
type ILinkService interface { ListAllLink(columns []string) (links []*models.Link, err error) ListLink(per, page int, columns []string) (links []*models.Link, err error) Create(link models.Link) (models.Link, error) Update(link *models.Link) error UpdateAttr(link *models.Link, attr map[string]interface{}) error UpdateLink() error Delete(id uint) error MaxSort() int FirstLink(id uint) (models.Link, error) }
func NewLinkService ¶
func NewLinkService() ILinkService
type IPageService ¶
type IPageService interface { New() (models.Page, error) Create(page models.Page) (models.Page, error) UpdateAttr(page *models.Page, attr map[string]interface{}) error Update(page *models.Page) error UpdatePage() error Delete(page models.Page) error FindPage(id uint) (models.Page, error) ListPage(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Page, error) SetModel(model *models.Page) error GetModel() (*models.Page, error) PublishPage(per, page uint, attr map[string]interface{}, columns []string) (pages []*models.Page, err error) TotalPage(attr map[string]interface{}) (total int, err error) }
func NewPageService ¶
func NewPageService() IPageService
type IPostService ¶
type IPostService interface { PublishPost(per, page uint, attr map[string]interface{}, columns []string, isTag bool) ([]*models.Post, error) NotPublishPost(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Post, error) TagsPost(per, page uint, attr map[string]interface{}, columns []string, tag string) ([]*models.Post, error) ListPost(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Post, error) AllListPost(attr map[string]interface{}, columns []string) ([]*models.Post, error) Create(post *models.Post) error Delete(id uint) error GetPostById(id uint, isTags bool) (*models.Post, error) Update(post *models.Post) error UpdateAttr(post *models.Post, attr map[string]interface{}) error CountPostByTag(tag uint) (count int, err error) CountPost(attr map[string]interface{}) (count int, err error) ListMaxReadPost(column []string) ([]*models.Post, error) ListMaxCommentPost(columns []string) ([]*models.Post, error) }
func NewPostService ¶
func NewPostService() IPostService
type ISubscriberService ¶
type ISubscriberService interface { AllListSubscriber(attr map[string]interface{}, columns []string) ([]*models.Subscriber, error) ListSubscriber(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Subscriber, error) }
func NewSubscriberService ¶
func NewSubscriberService() ISubscriberService
type ITagService ¶
type ITagService interface { Create(tag models.Tag) (models.Tag, error) Delete(id uint) error PostTagCreate(tag *models.PostTag) error ListTagByPostId(postId uint) ([]*models.Tag, error) DeletePostTagByPostId(postId uint) error ListTag(per, page uint, attr map[string]interface{}, columns []string) ([]models.Tag, error) PublishTagsList() ([]*models.Tag, error) }
func NewTagService ¶
func NewTagService() ITagService
type IUserService ¶
type IUserService interface { FindUserByEmail(email string) (models.User, error) FirstUser() error Insert() error FirstOrCreate(user *models.User) (*models.User, error) GetUserByID(id int64) (*models.User, error) UpdateUser() (err error) Update(user *models.User, attr map[string]interface{}) error UpdateUserAttr(attr map[string]interface{}) error GetModel() (*models.User, error) SetModel(user *models.User) error FindUserAll(attr map[string]interface{}) ([]*models.User, error) ReloadGithub(user *models.User) error ListAdminUsers(per, page int, columns []string) ([]*models.User, error) Lock() error }
func NewUserService ¶
func NewUserService() IUserService
type LinkService ¶
func (*LinkService) ListAllLink ¶
func (l *LinkService) ListAllLink(columns []string) (links []*models.Link, err error)
func (*LinkService) UpdateAttr ¶
func (l *LinkService) UpdateAttr(link *models.Link, attr map[string]interface{}) error
func (*LinkService) UpdateLink ¶
func (l *LinkService) UpdateLink() error
type PageService ¶
func (*PageService) PublishPage ¶
func (*PageService) TotalPage ¶
func (p *PageService) TotalPage(attr map[string]interface{}) (total int, err error)
func (*PageService) UpdateAttr ¶
func (p *PageService) UpdateAttr(page *models.Page, attr map[string]interface{}) error
func (*PageService) UpdatePage ¶
func (p *PageService) UpdatePage() error
type PostService ¶
func (*PostService) AllListPost ¶
func (p *PostService) AllListPost(attr map[string]interface{}, columns []string) ([]*models.Post, error)
@title: 查询的博文 @description: @auth Xutaotao 2020.4.1 @param attr 需要过滤的条件 @param columns 需要查询的字段 @return
func (*PostService) CountPost ¶
func (p *PostService) CountPost(attr map[string]interface{}) (count int, err error)
func (*PostService) CountPostByTag ¶
func (p *PostService) CountPostByTag(tag uint) (count int, err error)
func (*PostService) Delete ¶
func (p *PostService) Delete(id uint) error
func (*PostService) GetPostById ¶
func (*PostService) ListMaxCommentPost ¶
func (p *PostService) ListMaxCommentPost(columns []string) (posts []*models.Post, err error)
func (*PostService) ListMaxReadPost ¶
func (p *PostService) ListMaxReadPost(column []string) (posts []*models.Post, err error)
func (*PostService) ListPost ¶
func (p *PostService) ListPost(per, page uint, attr map[string]interface{}, columns []string) (posts []*models.Post, err error)
@title: 查询的博文 @description: @auth Xutaotao 2020.4.1 @param attr 需要过滤的条件 @param columns 需要查询的字段 @param per limit @param page offset @return *gorm.DB
func (*PostService) NotPublishPost ¶
func (*PostService) PublishPost ¶
func (p *PostService) PublishPost(per, page uint, attr map[string]interface{}, columns []string, isTag bool) (posts []*models.Post, err error)
查询已经发布过的文章
func (*PostService) TagsPost ¶
func (p *PostService) TagsPost(per, page uint, attr map[string]interface{}, columns []string, tag string) (posts []*models.Post, err error)
@title: 查询包涵标签的博文
func (*PostService) UpdateAttr ¶
func (p *PostService) UpdateAttr(post *models.Post, attr map[string]interface{}) error
type SubscriberService ¶
type SubscriberService struct {
Model *models.Subscriber
}
func (SubscriberService) AllListSubscriber ¶
func (s SubscriberService) AllListSubscriber(attr map[string]interface{}, columns []string) ([]*models.Subscriber, error)
@title 查询所有的订阅者 @description 根据不同的查询条件和查询列,查询订阅者 @auth Xutaotao 2020.4.1 @param attr 需要过滤的条件 @param columns 需要查询的字段 @return
func (SubscriberService) ListSubscriber ¶
func (s SubscriberService) ListSubscriber(per, page uint, attr map[string]interface{}, columns []string) (subscribers []*models.Subscriber, err error)
@title 查询所有的订阅者 @description 根据不同的查询条件和查询列,查询订阅者 @auth Xutaotao 2020.4.1 @param per limit @param page offset @param attr 需要过滤的条件 @param columns 需要查询的字段 @return
type TagService ¶
func (*TagService) Delete ¶
func (t *TagService) Delete(id uint) error
func (*TagService) DeletePostTagByPostId ¶
func (t *TagService) DeletePostTagByPostId(postId uint) error
func (*TagService) ListTagByPostId ¶
func (t *TagService) ListTagByPostId(postId uint) (tags []*models.Tag, err error)
@title: list tags by post id
func (*TagService) PostTagCreate ¶
func (t *TagService) PostTagCreate(tag *models.PostTag) error
func (*TagService) PublishTagsList ¶
func (t *TagService) PublishTagsList() ([]*models.Tag, error)
type UserService ¶
func (*UserService) FindUserAll ¶
func (u *UserService) FindUserAll(attr map[string]interface{}) (users []*models.User, err error)
func (*UserService) FindUserByEmail ¶
func (u *UserService) FindUserByEmail(email string) (models.User, error)
查询user
func (*UserService) FirstOrCreate ¶
func (*UserService) FirstUser ¶
func (u *UserService) FirstUser() error
func (*UserService) GetModel ¶
func (u *UserService) GetModel() (*models.User, error)
get model value
func (*UserService) GetUserByID ¶
func (u *UserService) GetUserByID(id int64) (*models.User, error)
func (*UserService) ListAdminUsers ¶
func (*UserService) Lock ¶
func (u *UserService) Lock() error
func (*UserService) ReloadGithub ¶
func (u *UserService) ReloadGithub(user *models.User) error
reloadGithub: 加载github
func (*UserService) Update ¶
func (u *UserService) Update(user *models.User, attr map[string]interface{}) error
func (*UserService) UpdateUser ¶
func (u *UserService) UpdateUser() (err error)
根据不同的字段进行根据 TODO-taotao 根据用户
func (*UserService) UpdateUserAttr ¶
func (u *UserService) UpdateUserAttr(attr map[string]interface{}) error