service

package
v0.0.0-...-c605425 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

type CommentService struct {
	Model *models.Comment
}

func (*CommentService) CountComment

func (c *CommentService) CountComment() int

统计评论的数量

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

type LinkService struct {
	Models *models.Link
}

func (*LinkService) Create

func (l *LinkService) Create(link models.Link) (models.Link, error)

创建链接

func (*LinkService) Delete

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 (*LinkService) MaxSort

func (l *LinkService) MaxSort() int

查询当前最大的排序

func (*LinkService) Update

func (l *LinkService) Update(link *models.Link) error

func (*LinkService) UpdateAttr

func (l *LinkService) UpdateAttr(link *models.Link, attr map[string]interface{}) error
func (l *LinkService) UpdateLink() error

type PageService

type PageService struct {
	Model *models.Page
}

func (*PageService) Create

func (p *PageService) Create(page models.Page) (models.Page, error)

func (*PageService) Delete

func (p *PageService) Delete(page models.Page) error

func (*PageService) FindPage

func (p *PageService) FindPage(id uint) (models.Page, error)

func (*PageService) GetModel

func (p *PageService) GetModel() (*models.Page, error)

func (*PageService) ListPage

func (p *PageService) ListPage(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Page, error)

func (*PageService) New

func (p *PageService) New() (models.Page, error)

func (*PageService) PublishPage

func (p *PageService) PublishPage(per, page uint, attr map[string]interface{}, columns []string) (pages []*models.Page, err error)

func (*PageService) SetModel

func (p *PageService) SetModel(model *models.Page) error

func (*PageService) TotalPage

func (p *PageService) TotalPage(attr map[string]interface{}) (total int, err error)

func (*PageService) Update

func (p *PageService) Update(page *models.Page) 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

type PostService struct {
	Model *models.Post
}

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

func (p *PostService) Create(post *models.Post) error

func (*PostService) Delete

func (p *PostService) Delete(id uint) error

func (*PostService) GetPostById

func (p *PostService) GetPostById(id uint, isTags bool) (*models.Post, error)

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 (p *PostService) NotPublishPost(per, page uint, attr map[string]interface{}, columns []string) (posts []*models.Post, err error)

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

func (p *PostService) Update(post *models.Post) error

func (*PostService) UpdateAttr

func (p *PostService) UpdateAttr(post *models.Post, attr map[string]interface{}) error

func (*PostService) UpdatePost

func (p *PostService) UpdatePost() 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

type TagService struct {
	Model *models.Tag
}

func (*TagService) Create

func (t *TagService) Create(tag models.Tag) (models.Tag, error)

func (*TagService) Delete

func (t *TagService) Delete(id uint) error

func (*TagService) DeletePostTagByPostId

func (t *TagService) DeletePostTagByPostId(postId uint) error

func (*TagService) ListTag

func (t *TagService) ListTag(per, page uint, attr map[string]interface{}, columns []string) (tags []models.Tag, err 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

type UserService struct {
	Model *models.User
}

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 (u *UserService) FirstOrCreate(user *models.User) (*models.User, error)

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

func (u *UserService) Insert() error

注册用户

func (*UserService) ListAdminUsers

func (u *UserService) ListAdminUsers(per, page int, columns []string) (users []*models.User, err error)

func (*UserService) Lock

func (u *UserService) Lock() error

func (*UserService) ReloadGithub

func (u *UserService) ReloadGithub(user *models.User) error

reloadGithub: 加载github

func (*UserService) SetModel

func (u *UserService) SetModel(user *models.User) error

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

Jump to

Keyboard shortcuts

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