Documentation ¶
Index ¶
- Variables
- type ArticleService
- func (this *ArticleService) AddArticleTag(articleId, tagId int64)
- func (this *ArticleService) CreateDailyShare(title, summary string, userIds []int64)
- func (this *ArticleService) DelArticleTag(articleId, tagId int64)
- func (this *ArticleService) Delete(id int64) error
- func (this *ArticleService) GenerateRss()
- func (this *ArticleService) GenerateSitemap()
- func (this *ArticleService) Get(id int64) *model.Article
- func (this *ArticleService) GetArticleInIds(articleIds []int64) []model.Article
- func (this *ArticleService) GetDailyContent(userIds []int64) string
- func (this *ArticleService) GetRelatedArticles(articleId int64) []model.Article
- func (this *ArticleService) GetTagArticles(tagId int64, page int) (articles []model.Article, paging *simple.Paging)
- func (this *ArticleService) GetUserNewestArticles(userId int64) []model.Article
- func (this *ArticleService) Publish(userId int64, title, summary, content, contentType string, categoryId int64, ...) (article *model.Article, err error)
- func (this *ArticleService) Query(queries *simple.ParamQueries) (list []model.Article, paging *simple.Paging)
- func (this *ArticleService) QueryCnd(cnd *simple.QueryCnd) (list []model.Article, err error)
- func (this *ArticleService) Scan(cb ScanArticleCallback)
- func (this *ArticleService) ScanWithDate(dateFrom, dateTo int64, cb ScanArticleCallback)
- func (this *ArticleService) Take(where ...interface{}) *model.Article
- func (this *ArticleService) Update(t *model.Article) error
- func (this *ArticleService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *ArticleService) Updates(id int64, columns map[string]interface{}) error
- type ArticleShareService
- func (this *ArticleShareService) Create(t *model.ArticleShare) error
- func (this *ArticleShareService) Delete(id int64)
- func (this *ArticleShareService) Get(id int64) *model.ArticleShare
- func (this *ArticleShareService) Query(queries *simple.ParamQueries) (list []model.ArticleShare, paging *simple.Paging)
- func (this *ArticleShareService) QueryCnd(cnd *simple.QueryCnd) (list []model.ArticleShare, err error)
- func (this *ArticleShareService) Scan(cb ScanArticleShareCallback)
- func (this *ArticleShareService) ScanWithDate(dateFrom, dateTo int64, cb ScanArticleShareCallback)
- func (this *ArticleShareService) Take(where ...interface{}) *model.ArticleShare
- func (this *ArticleShareService) Update(t *model.ArticleShare) error
- func (this *ArticleShareService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *ArticleShareService) Updates(id int64, columns map[string]interface{}) error
- type ArticleTagService
- func (this *ArticleTagService) Create(t *model.ArticleTag) error
- func (this *ArticleTagService) Delete(id int64)
- func (this *ArticleTagService) Get(id int64) *model.ArticleTag
- func (this *ArticleTagService) Query(queries *simple.ParamQueries) (list []model.ArticleTag, paging *simple.Paging)
- func (this *ArticleTagService) QueryCnd(cnd *simple.QueryCnd) (list []model.ArticleTag, err error)
- func (this *ArticleTagService) Take(where ...interface{}) *model.ArticleTag
- func (this *ArticleTagService) Update(t *model.ArticleTag) error
- func (this *ArticleTagService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *ArticleTagService) Updates(id int64, columns map[string]interface{}) error
- type CategoryService
- func (this *CategoryService) Create(t *model.Category) error
- func (this *CategoryService) Delete(id int64)
- func (this *CategoryService) FindByName(name string) *model.Category
- func (this *CategoryService) Get(id int64) *model.Category
- func (this *CategoryService) GetCategories() ([]model.Category, error)
- func (this *CategoryService) GetOrCreate(name string) *model.Category
- func (this *CategoryService) Query(queries *simple.ParamQueries) (list []model.Category, paging *simple.Paging)
- func (this *CategoryService) QueryCnd(cnd *simple.QueryCnd) (list []model.Category, err error)
- func (this *CategoryService) Take(where ...interface{}) *model.Category
- func (this *CategoryService) Update(t *model.Category) error
- func (this *CategoryService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *CategoryService) Updates(id int64, columns map[string]interface{}) error
- type CommentService
- func (this *CommentService) Create(t *model.Comment) error
- func (this *CommentService) Delete(id int64)
- func (this *CommentService) Get(id int64) *model.Comment
- func (this *CommentService) List(entityType string, entityId int64, cursor int64) (list []model.Comment, err error)
- func (this *CommentService) Query(queries *simple.ParamQueries) (list []model.Comment, paging *simple.Paging)
- func (this *CommentService) QueryCnd(cnd *simple.QueryCnd) (list []model.Comment, err error)
- func (this *CommentService) Take(where ...interface{}) *model.Comment
- func (this *CommentService) Update(t *model.Comment) error
- func (this *CommentService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *CommentService) Updates(id int64, columns map[string]interface{}) error
- type FavoriteService
- func (this *FavoriteService) AddArticleFavorite(userId, articleId int64) error
- func (this *FavoriteService) AddTopicFavorite(userId, topicId int64) error
- func (this *FavoriteService) Create(t *model.Favorite) error
- func (this *FavoriteService) Delete(id int64)
- func (this *FavoriteService) Get(id int64) *model.Favorite
- func (this *FavoriteService) GetBy(entityType string, entityId int64) *model.Favorite
- func (this *FavoriteService) Query(queries *simple.ParamQueries) (list []model.Favorite, paging *simple.Paging)
- func (this *FavoriteService) QueryCnd(cnd *simple.QueryCnd) (list []model.Favorite, err error)
- func (this *FavoriteService) Take(where ...interface{}) *model.Favorite
- func (this *FavoriteService) Update(t *model.Favorite) error
- func (this *FavoriteService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *FavoriteService) Updates(id int64, columns map[string]interface{}) error
- type GithubUserService
- func (this *GithubUserService) Create(t *model.GithubUser) error
- func (this *GithubUserService) Delete(id int64)
- func (this *GithubUserService) Get(id int64) *model.GithubUser
- func (this *GithubUserService) GetByGithubId(githubId int64) *model.GithubUser
- func (this *GithubUserService) Query(queries *simple.ParamQueries) (list []model.GithubUser, paging *simple.Paging)
- func (this *GithubUserService) QueryCnd(cnd *simple.QueryCnd) (list []model.GithubUser, err error)
- func (this *GithubUserService) Take(where ...interface{}) *model.GithubUser
- func (this *GithubUserService) Update(t *model.GithubUser) error
- func (this *GithubUserService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *GithubUserService) Updates(id int64, columns map[string]interface{}) error
- type MessageService
- func (this *MessageService) Create(t *model.Message) error
- func (this *MessageService) Delete(id int64)
- func (this *MessageService) Get(id int64) *model.Message
- func (this *MessageService) GetUnReadCount(userId int64) (count int64)
- func (this *MessageService) MarkReadAll(userId int64)
- func (this *MessageService) Query(queries *simple.ParamQueries) (list []model.Message, paging *simple.Paging)
- func (this *MessageService) QueryCnd(cnd *simple.QueryCnd) (list []model.Message, err error)
- func (this *MessageService) Read(id int64) *model.Message
- func (this *MessageService) Send(userId int64, content, quoteContent string, msgType int, ...)
- func (this *MessageService) SendCommentMsg(comment *model.Comment)
- func (this *MessageService) Take(where ...interface{}) *model.Message
- func (this *MessageService) Update(t *model.Message) error
- func (this *MessageService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *MessageService) Updates(id int64, columns map[string]interface{}) error
- type OauthClientService
- func (this *OauthClientService) Create(t *model.OauthClient) error
- func (this *OauthClientService) Delete(id int64)
- func (this *OauthClientService) Get(id int64) *model.OauthClient
- func (this *OauthClientService) GetByClientId(clientId string) *model.OauthClient
- func (this *OauthClientService) Query(queries *simple.ParamQueries) (list []model.OauthClient, paging *simple.Paging)
- func (this *OauthClientService) QueryCnd(cnd *simple.QueryCnd) (list []model.OauthClient, err error)
- func (this *OauthClientService) Take(where ...interface{}) *model.OauthClient
- func (this *OauthClientService) Update(t *model.OauthClient) error
- func (this *OauthClientService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *OauthClientService) Updates(id int64, columns map[string]interface{}) error
- type OauthTokenService
- func (this *OauthTokenService) Create(t *model.OauthToken) error
- func (this *OauthTokenService) Delete(id int64)
- func (this *OauthTokenService) Get(id int64) *model.OauthToken
- func (this *OauthTokenService) Query(queries *simple.ParamQueries) (list []model.OauthToken, paging *simple.Paging)
- func (this *OauthTokenService) QueryCnd(cnd *simple.QueryCnd) (list []model.OauthToken, err error)
- func (this *OauthTokenService) Take(where ...interface{}) *model.OauthToken
- func (this *OauthTokenService) Update(t *model.OauthToken) error
- func (this *OauthTokenService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *OauthTokenService) Updates(id int64, columns map[string]interface{}) error
- type ScanArticleCallback
- type ScanArticleShareCallback
- type ScanTopicCallback
- type TagService
- func (this *TagService) Create(t *model.Tag) error
- func (this *TagService) Delete(id int64)
- func (this *TagService) Get(id int64) *model.Tag
- func (this *TagService) GetByName(name string) *model.Tag
- func (this *TagService) GetOrCreate(name string) (*model.Tag, error)
- func (this *TagService) GetTagInIds(tagIds []int64) []model.Tag
- func (this *TagService) GetTags() []model.TagResponse
- func (this *TagService) ListAll(categoryId int64) ([]model.Tag, error)
- func (this *TagService) Query(queries *simple.ParamQueries) (list []model.Tag, paging *simple.Paging)
- func (this *TagService) QueryCnd(cnd *simple.QueryCnd) (list []model.Tag, err error)
- func (this *TagService) Take(where ...interface{}) *model.Tag
- func (this *TagService) Update(t *model.Tag) error
- func (this *TagService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *TagService) Updates(id int64, columns map[string]interface{}) error
- type TopicService
- func (this *TopicService) Create(t *model.Topic) error
- func (this *TopicService) Delete(id int64)
- func (this *TopicService) Get(id int64) *model.Topic
- func (this *TopicService) GetTopicTags(topicId int64) []model.Tag
- func (this *TopicService) IncrViewCount(topicId int64)
- func (this *TopicService) Publish(userId int64, tags []string, title, content string) (*model.Topic, *simple.CodeError)
- func (this *TopicService) Query(queries *simple.ParamQueries) (list []model.Topic, paging *simple.Paging)
- func (this *TopicService) QueryCnd(cnd *simple.QueryCnd) (list []model.Topic, err error)
- func (this *TopicService) Scan(cb ScanTopicCallback)
- func (this *TopicService) SetLastCommentTime(topicId, lastCommentTime int64)
- func (this *TopicService) Take(where ...interface{}) *model.Topic
- func (this *TopicService) Update(t *model.Topic) error
- func (this *TopicService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *TopicService) Updates(id int64, columns map[string]interface{}) error
- type TopicTagService
- func (this *TopicTagService) Create(t *model.TopicTag) error
- func (this *TopicTagService) Delete(id int64)
- func (this *TopicTagService) Get(id int64) *model.TopicTag
- func (this *TopicTagService) Query(queries *simple.ParamQueries) (list []model.TopicTag, paging *simple.Paging)
- func (this *TopicTagService) QueryCnd(cnd *simple.QueryCnd) (list []model.TopicTag, err error)
- func (this *TopicTagService) Take(where ...interface{}) *model.TopicTag
- func (this *TopicTagService) Update(t *model.TopicTag) error
- func (this *TopicTagService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *TopicTagService) Updates(id int64, columns map[string]interface{}) error
- type UserArticleTagService
- func (this *UserArticleTagService) AddUserTag(userId int64, name string) error
- func (this *UserArticleTagService) Create(t *model.UserArticleTag) error
- func (this *UserArticleTagService) Delete(id int64)
- func (this *UserArticleTagService) Get(id int64) *model.UserArticleTag
- func (this *UserArticleTagService) GetBy(userId, tagId int64) *model.UserArticleTag
- func (this *UserArticleTagService) GetUserTags(userId int64) (tags []model.Tag)
- func (this *UserArticleTagService) Query(queries *simple.ParamQueries) (list []model.UserArticleTag, paging *simple.Paging)
- func (this *UserArticleTagService) QueryCnd(cnd *simple.QueryCnd) (list []model.UserArticleTag, err error)
- func (this *UserArticleTagService) Take(where ...interface{}) *model.UserArticleTag
- func (this *UserArticleTagService) Update(t *model.UserArticleTag) error
- func (this *UserArticleTagService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *UserArticleTagService) Updates(id int64, columns map[string]interface{}) error
- type UserService
- func (this *UserService) Bind(githubId int64, ...) (user *model.User, err error)
- func (this *UserService) Create(t *model.User) error
- func (this *UserService) Delete(id int64)
- func (this *UserService) Get(id int64) *model.User
- func (this *UserService) GetByEmail(email string) *model.User
- func (this *UserService) GetByUsername(username string) *model.User
- func (this *UserService) Query(queries *simple.ParamQueries) (list []model.User, paging *simple.Paging)
- func (this *UserService) QueryCnd(cnd *simple.QueryCnd) (list []model.User, err error)
- func (this *UserService) SignIn(username, password string) (*model.User, error)
- func (this *UserService) SignUp(username, email, password, rePassword, nickname, avatar string) (*model.User, error)
- func (this *UserService) Take(where ...interface{}) *model.User
- func (this *UserService) Update(t *model.User) error
- func (this *UserService) UpdateColumn(id int64, name string, value interface{}) error
- func (this *UserService) Updates(id int64, columns map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // services UserServiceInstance = NewUserService() GithubUserServiceInstance = NewGithubUserService() CategoryServiceInstance = NewCategoryService() TagServiceInstance = NewTagService() ArticleServiceInstance = NewArticleService() CommentServiceInstance = NewCommentService() FavoriteServiceInstance = NewFavoriteService() ArticleTagServiceInstance = NewArticleTagService() UserArticleTagServiceInstance = NewUserArticleTagService() TopicServiceInstance = NewTopicService() TopicTagServiceInstance = NewTopicTagService() MessageServiceInstance = NewMessageService() OauthClientServiceInstance = NewOauthClientService() OauthTokenServiceInstance = NewOauthTokenService() Instances = []interface{}{ UserServiceInstance, GithubUserServiceInstance, CategoryServiceInstance, TagServiceInstance, ArticleServiceInstance, CommentServiceInstance, FavoriteServiceInstance, ArticleShareServiceInstance, ArticleTagServiceInstance, UserArticleTagServiceInstance, TopicServiceInstance, TopicTagServiceInstance, MessageServiceInstance, OauthClientServiceInstance, OauthTokenServiceInstance, } )
Functions ¶
This section is empty.
Types ¶
type ArticleService ¶
type ArticleService struct { ArticleRepository *repositories.ArticleRepository ArticleTagRepository *repositories.ArticleTagRepository TagRepository *repositories.TagRepository }
func NewArticleService ¶
func NewArticleService() *ArticleService
func (*ArticleService) AddArticleTag ¶
func (this *ArticleService) AddArticleTag(articleId, tagId int64)
添加文章标签
func (*ArticleService) CreateDailyShare ¶
func (this *ArticleService) CreateDailyShare(title, summary string, userIds []int64)
每日分享 title: 标题,最终文章标题为:title + yyyy-MM-dd summary: 分享专题的描述 userIds: 用户编号
func (*ArticleService) DelArticleTag ¶
func (this *ArticleService) DelArticleTag(articleId, tagId int64)
删除文章标签
func (*ArticleService) Delete ¶
func (this *ArticleService) Delete(id int64) error
func (*ArticleService) GetArticleInIds ¶
func (this *ArticleService) GetArticleInIds(articleIds []int64) []model.Article
根据文章编号批量获取文章
func (*ArticleService) GetDailyContent ¶
func (this *ArticleService) GetDailyContent(userIds []int64) string
func (*ArticleService) GetRelatedArticles ¶
func (this *ArticleService) GetRelatedArticles(articleId int64) []model.Article
相关文章
func (*ArticleService) GetTagArticles ¶
func (this *ArticleService) GetTagArticles(tagId int64, page int) (articles []model.Article, paging *simple.Paging)
标签文章列表
func (*ArticleService) GetUserNewestArticles ¶
func (this *ArticleService) GetUserNewestArticles(userId int64) []model.Article
最新文章
func (*ArticleService) Publish ¶
func (this *ArticleService) Publish(userId int64, title, summary, content, contentType string, categoryId int64, tagIds []int64, sourceUrl string) (article *model.Article, err error)
发布文章
func (*ArticleService) Query ¶
func (this *ArticleService) Query(queries *simple.ParamQueries) (list []model.Article, paging *simple.Paging)
func (*ArticleService) ScanWithDate ¶
func (this *ArticleService) ScanWithDate(dateFrom, dateTo int64, cb ScanArticleCallback)
扫描
func (*ArticleService) Take ¶
func (this *ArticleService) Take(where ...interface{}) *model.Article
func (*ArticleService) UpdateColumn ¶
func (this *ArticleService) UpdateColumn(id int64, name string, value interface{}) error
type ArticleShareService ¶
type ArticleShareService struct {
}func NewArticleShareService ¶
func NewArticleShareService() *ArticleShareService
func (*ArticleShareService) Create ¶
func (this *ArticleShareService) Create(t *model.ArticleShare) error
func (*ArticleShareService) Delete ¶
func (this *ArticleShareService) Delete(id int64)
func (*ArticleShareService) Get ¶
func (this *ArticleShareService) Get(id int64) *model.ArticleShare
func (*ArticleShareService) Query ¶
func (this *ArticleShareService) Query(queries *simple.ParamQueries) (list []model.ArticleShare, paging *simple.Paging)
func (*ArticleShareService) QueryCnd ¶
func (this *ArticleShareService) QueryCnd(cnd *simple.QueryCnd) (list []model.ArticleShare, err error)
func (*ArticleShareService) Scan ¶
func (this *ArticleShareService) Scan(cb ScanArticleShareCallback)
扫描
func (*ArticleShareService) ScanWithDate ¶
func (this *ArticleShareService) ScanWithDate(dateFrom, dateTo int64, cb ScanArticleShareCallback)
扫描
func (*ArticleShareService) Take ¶
func (this *ArticleShareService) Take(where ...interface{}) *model.ArticleShare
func (*ArticleShareService) Update ¶
func (this *ArticleShareService) Update(t *model.ArticleShare) error
func (*ArticleShareService) UpdateColumn ¶
func (this *ArticleShareService) UpdateColumn(id int64, name string, value interface{}) error
type ArticleTagService ¶
type ArticleTagService struct {
ArticleTagRepository *repositories.ArticleTagRepository
}
func NewArticleTagService ¶
func NewArticleTagService() *ArticleTagService
func (*ArticleTagService) Create ¶
func (this *ArticleTagService) Create(t *model.ArticleTag) error
func (*ArticleTagService) Delete ¶
func (this *ArticleTagService) Delete(id int64)
func (*ArticleTagService) Get ¶
func (this *ArticleTagService) Get(id int64) *model.ArticleTag
func (*ArticleTagService) Query ¶
func (this *ArticleTagService) Query(queries *simple.ParamQueries) (list []model.ArticleTag, paging *simple.Paging)
func (*ArticleTagService) QueryCnd ¶
func (this *ArticleTagService) QueryCnd(cnd *simple.QueryCnd) (list []model.ArticleTag, err error)
func (*ArticleTagService) Take ¶
func (this *ArticleTagService) Take(where ...interface{}) *model.ArticleTag
func (*ArticleTagService) Update ¶
func (this *ArticleTagService) Update(t *model.ArticleTag) error
func (*ArticleTagService) UpdateColumn ¶
func (this *ArticleTagService) UpdateColumn(id int64, name string, value interface{}) error
type CategoryService ¶
type CategoryService struct {
CategoryRepository *repositories.CategoryRepository
}
func NewCategoryService ¶
func NewCategoryService() *CategoryService
func (*CategoryService) Delete ¶
func (this *CategoryService) Delete(id int64)
func (*CategoryService) FindByName ¶
func (this *CategoryService) FindByName(name string) *model.Category
func (*CategoryService) GetCategories ¶
func (this *CategoryService) GetCategories() ([]model.Category, error)
func (*CategoryService) GetOrCreate ¶
func (this *CategoryService) GetOrCreate(name string) *model.Category
func (*CategoryService) Query ¶
func (this *CategoryService) Query(queries *simple.ParamQueries) (list []model.Category, paging *simple.Paging)
func (*CategoryService) Take ¶
func (this *CategoryService) Take(where ...interface{}) *model.Category
func (*CategoryService) UpdateColumn ¶
func (this *CategoryService) UpdateColumn(id int64, name string, value interface{}) error
type CommentService ¶
type CommentService struct {
CommentRepository *repositories.CommentRepository
}
func NewCommentService ¶
func NewCommentService() *CommentService
func (*CommentService) Delete ¶
func (this *CommentService) Delete(id int64)
func (*CommentService) Query ¶
func (this *CommentService) Query(queries *simple.ParamQueries) (list []model.Comment, paging *simple.Paging)
func (*CommentService) Take ¶
func (this *CommentService) Take(where ...interface{}) *model.Comment
func (*CommentService) UpdateColumn ¶
func (this *CommentService) UpdateColumn(id int64, name string, value interface{}) error
type FavoriteService ¶
type FavoriteService struct { FavoriteRepository *repositories.FavoriteRepository ArticleRepository *repositories.ArticleRepository TopicRepository *repositories.TopicRepository }
func NewFavoriteService ¶
func NewFavoriteService() *FavoriteService
func (*FavoriteService) AddArticleFavorite ¶
func (this *FavoriteService) AddArticleFavorite(userId, articleId int64) error
收藏文章
func (*FavoriteService) AddTopicFavorite ¶
func (this *FavoriteService) AddTopicFavorite(userId, topicId int64) error
收藏帖子
func (*FavoriteService) Delete ¶
func (this *FavoriteService) Delete(id int64)
func (*FavoriteService) GetBy ¶
func (this *FavoriteService) GetBy(entityType string, entityId int64) *model.Favorite
func (*FavoriteService) Query ¶
func (this *FavoriteService) Query(queries *simple.ParamQueries) (list []model.Favorite, paging *simple.Paging)
func (*FavoriteService) Take ¶
func (this *FavoriteService) Take(where ...interface{}) *model.Favorite
func (*FavoriteService) UpdateColumn ¶
func (this *FavoriteService) UpdateColumn(id int64, name string, value interface{}) error
type GithubUserService ¶
type GithubUserService struct {
GithubUserRepository *repositories.GithubUserRepository
}
func NewGithubUserService ¶
func NewGithubUserService() *GithubUserService
func (*GithubUserService) Create ¶
func (this *GithubUserService) Create(t *model.GithubUser) error
func (*GithubUserService) Delete ¶
func (this *GithubUserService) Delete(id int64)
func (*GithubUserService) Get ¶
func (this *GithubUserService) Get(id int64) *model.GithubUser
func (*GithubUserService) GetByGithubId ¶
func (this *GithubUserService) GetByGithubId(githubId int64) *model.GithubUser
func (*GithubUserService) Query ¶
func (this *GithubUserService) Query(queries *simple.ParamQueries) (list []model.GithubUser, paging *simple.Paging)
func (*GithubUserService) QueryCnd ¶
func (this *GithubUserService) QueryCnd(cnd *simple.QueryCnd) (list []model.GithubUser, err error)
func (*GithubUserService) Take ¶
func (this *GithubUserService) Take(where ...interface{}) *model.GithubUser
func (*GithubUserService) Update ¶
func (this *GithubUserService) Update(t *model.GithubUser) error
func (*GithubUserService) UpdateColumn ¶
func (this *GithubUserService) UpdateColumn(id int64, name string, value interface{}) error
type MessageService ¶
type MessageService struct { MessageRepository *repositories.MessageRepository UserRepository *repositories.UserRepository CommentRepository *repositories.CommentRepository ArticleRepository *repositories.ArticleRepository TopicRepository *repositories.TopicRepository }
func NewMessageService ¶
func NewMessageService() *MessageService
func (*MessageService) Delete ¶
func (this *MessageService) Delete(id int64)
func (*MessageService) GetUnReadCount ¶
func (this *MessageService) GetUnReadCount(userId int64) (count int64)
func (*MessageService) MarkReadAll ¶
func (this *MessageService) MarkReadAll(userId int64)
将所有消息标记为已读
func (*MessageService) Query ¶
func (this *MessageService) Query(queries *simple.ParamQueries) (list []model.Message, paging *simple.Paging)
func (*MessageService) Send ¶
func (this *MessageService) Send(userId int64, content, quoteContent string, msgType int, extraData map[string]interface{})
func (*MessageService) SendCommentMsg ¶
func (this *MessageService) SendCommentMsg(comment *model.Comment)
func (*MessageService) Take ¶
func (this *MessageService) Take(where ...interface{}) *model.Message
func (*MessageService) UpdateColumn ¶
func (this *MessageService) UpdateColumn(id int64, name string, value interface{}) error
type OauthClientService ¶
type OauthClientService struct {
OauthClientRepository *repositories.OauthClientRepository
}
func NewOauthClientService ¶
func NewOauthClientService() *OauthClientService
func (*OauthClientService) Create ¶
func (this *OauthClientService) Create(t *model.OauthClient) error
func (*OauthClientService) Delete ¶
func (this *OauthClientService) Delete(id int64)
func (*OauthClientService) Get ¶
func (this *OauthClientService) Get(id int64) *model.OauthClient
func (*OauthClientService) GetByClientId ¶
func (this *OauthClientService) GetByClientId(clientId string) *model.OauthClient
func (*OauthClientService) Query ¶
func (this *OauthClientService) Query(queries *simple.ParamQueries) (list []model.OauthClient, paging *simple.Paging)
func (*OauthClientService) QueryCnd ¶
func (this *OauthClientService) QueryCnd(cnd *simple.QueryCnd) (list []model.OauthClient, err error)
func (*OauthClientService) Take ¶
func (this *OauthClientService) Take(where ...interface{}) *model.OauthClient
func (*OauthClientService) Update ¶
func (this *OauthClientService) Update(t *model.OauthClient) error
func (*OauthClientService) UpdateColumn ¶
func (this *OauthClientService) UpdateColumn(id int64, name string, value interface{}) error
type OauthTokenService ¶
type OauthTokenService struct {
OauthTokenRepository *repositories.OauthTokenRepository
}
func NewOauthTokenService ¶
func NewOauthTokenService() *OauthTokenService
func (*OauthTokenService) Create ¶
func (this *OauthTokenService) Create(t *model.OauthToken) error
func (*OauthTokenService) Delete ¶
func (this *OauthTokenService) Delete(id int64)
func (*OauthTokenService) Get ¶
func (this *OauthTokenService) Get(id int64) *model.OauthToken
func (*OauthTokenService) Query ¶
func (this *OauthTokenService) Query(queries *simple.ParamQueries) (list []model.OauthToken, paging *simple.Paging)
func (*OauthTokenService) QueryCnd ¶
func (this *OauthTokenService) QueryCnd(cnd *simple.QueryCnd) (list []model.OauthToken, err error)
func (*OauthTokenService) Take ¶
func (this *OauthTokenService) Take(where ...interface{}) *model.OauthToken
func (*OauthTokenService) Update ¶
func (this *OauthTokenService) Update(t *model.OauthToken) error
func (*OauthTokenService) UpdateColumn ¶
func (this *OauthTokenService) UpdateColumn(id int64, name string, value interface{}) error
type ScanArticleCallback ¶
type ScanArticleShareCallback ¶
type ScanArticleShareCallback func(shares []model.ArticleShare)
type ScanTopicCallback ¶
type TagService ¶
type TagService struct { TagRepository *repositories.TagRepository CategoryRepository *repositories.CategoryRepository }
func NewTagService ¶
func NewTagService() *TagService
func (*TagService) Delete ¶
func (this *TagService) Delete(id int64)
func (*TagService) GetOrCreate ¶
func (this *TagService) GetOrCreate(name string) (*model.Tag, error)
func (*TagService) GetTagInIds ¶
func (this *TagService) GetTagInIds(tagIds []int64) []model.Tag
func (*TagService) GetTags ¶
func (this *TagService) GetTags() []model.TagResponse
func (*TagService) Query ¶
func (this *TagService) Query(queries *simple.ParamQueries) (list []model.Tag, paging *simple.Paging)
func (*TagService) Take ¶
func (this *TagService) Take(where ...interface{}) *model.Tag
func (*TagService) UpdateColumn ¶
func (this *TagService) UpdateColumn(id int64, name string, value interface{}) error
type TopicService ¶
type TopicService struct { TopicRepository *repositories.TopicRepository TagRepository *repositories.TagRepository TopicTagRepository *repositories.TopicTagRepository }
func NewTopicService ¶
func NewTopicService() *TopicService
func (*TopicService) Delete ¶
func (this *TopicService) Delete(id int64)
func (*TopicService) GetTopicTags ¶
func (this *TopicService) GetTopicTags(topicId int64) []model.Tag
帖子标签
func (*TopicService) Publish ¶
func (this *TopicService) Publish(userId int64, tags []string, title, content string) (*model.Topic, *simple.CodeError)
发表
func (*TopicService) Query ¶
func (this *TopicService) Query(queries *simple.ParamQueries) (list []model.Topic, paging *simple.Paging)
func (*TopicService) SetLastCommentTime ¶
func (this *TopicService) SetLastCommentTime(topicId, lastCommentTime int64)
更新最后回复时间
func (*TopicService) Take ¶
func (this *TopicService) Take(where ...interface{}) *model.Topic
func (*TopicService) UpdateColumn ¶
func (this *TopicService) UpdateColumn(id int64, name string, value interface{}) error
type TopicTagService ¶
type TopicTagService struct {
TopicTagRepository *repositories.TopicTagRepository
}
func NewTopicTagService ¶
func NewTopicTagService() *TopicTagService
func (*TopicTagService) Delete ¶
func (this *TopicTagService) Delete(id int64)
func (*TopicTagService) Query ¶
func (this *TopicTagService) Query(queries *simple.ParamQueries) (list []model.TopicTag, paging *simple.Paging)
func (*TopicTagService) Take ¶
func (this *TopicTagService) Take(where ...interface{}) *model.TopicTag
func (*TopicTagService) UpdateColumn ¶
func (this *TopicTagService) UpdateColumn(id int64, name string, value interface{}) error
type UserArticleTagService ¶
type UserArticleTagService struct { UserArticleTagRepository *repositories.UserArticleTagRepository TagRepository *repositories.TagRepository }
func NewUserArticleTagService ¶
func NewUserArticleTagService() *UserArticleTagService
func (*UserArticleTagService) AddUserTag ¶
func (this *UserArticleTagService) AddUserTag(userId int64, name string) error
func (*UserArticleTagService) Create ¶
func (this *UserArticleTagService) Create(t *model.UserArticleTag) error
func (*UserArticleTagService) Delete ¶
func (this *UserArticleTagService) Delete(id int64)
func (*UserArticleTagService) Get ¶
func (this *UserArticleTagService) Get(id int64) *model.UserArticleTag
func (*UserArticleTagService) GetBy ¶
func (this *UserArticleTagService) GetBy(userId, tagId int64) *model.UserArticleTag
func (*UserArticleTagService) GetUserTags ¶
func (this *UserArticleTagService) GetUserTags(userId int64) (tags []model.Tag)
func (*UserArticleTagService) Query ¶
func (this *UserArticleTagService) Query(queries *simple.ParamQueries) (list []model.UserArticleTag, paging *simple.Paging)
func (*UserArticleTagService) QueryCnd ¶
func (this *UserArticleTagService) QueryCnd(cnd *simple.QueryCnd) (list []model.UserArticleTag, err error)
func (*UserArticleTagService) Take ¶
func (this *UserArticleTagService) Take(where ...interface{}) *model.UserArticleTag
func (*UserArticleTagService) Update ¶
func (this *UserArticleTagService) Update(t *model.UserArticleTag) error
func (*UserArticleTagService) UpdateColumn ¶
func (this *UserArticleTagService) UpdateColumn(id int64, name string, value interface{}) error
type UserService ¶
type UserService struct { UserRepository *repositories.UserRepository GithubUserRepository *repositories.GithubUserRepository }
func NewUserService ¶
func NewUserService() *UserService
func (*UserService) Delete ¶
func (this *UserService) Delete(id int64)
func (*UserService) GetByEmail ¶
func (this *UserService) GetByEmail(email string) *model.User
func (*UserService) GetByUsername ¶
func (this *UserService) GetByUsername(username string) *model.User
func (*UserService) Query ¶
func (this *UserService) Query(queries *simple.ParamQueries) (list []model.User, paging *simple.Paging)
func (*UserService) SignIn ¶
func (this *UserService) SignIn(username, password string) (*model.User, error)
func (*UserService) SignUp ¶
func (this *UserService) SignUp(username, email, password, rePassword, nickname, avatar string) (*model.User, error)
func (*UserService) Take ¶
func (this *UserService) Take(where ...interface{}) *model.User
func (*UserService) UpdateColumn ¶
func (this *UserService) UpdateColumn(id int64, name string, value interface{}) error
Source Files ¶
- article_service.go
- article_share_service.go
- article_tag_service.go
- category_service.go
- comment_service.go
- favorite_service.go
- github_user_service.go
- instances.go
- message_service.go
- oauth_client_service.go
- oauth_token_service.go
- tag_service.go
- topic_service.go
- topic_tag_service.go
- user_article_tag_service.go
- user_service.go
Click to show internal directories.
Click to hide internal directories.