コード例 #1
0
ファイル: tag_service.go プロジェクト: gophergala2016/source
func (s TagService) FindPopularTagByCollection(limit, offset int) ([]models.Tag, error) {
	tagRepository := models.NewTagRepository(s.ctx)
	return tagRepository.FindPopularByCollection(limit, offset)
}
コード例 #2
0
ファイル: tag_service.go プロジェクト: gophergala2016/source
func (s TagService) CreateTag(name, color string, score uint) (*models.Tag, error) {
	tag := models.NewTag(name, color, score)
	tagRepository := models.NewTagRepository(s.ctx)
	return tagRepository.Create(tag)
}
コード例 #3
0
ファイル: tag_service.go プロジェクト: gophergala2016/source
func (s TagService) FindTagByIDs(ids []uint64) ([]models.Tag, error) {
	tagRepository := models.NewTagRepository(s.ctx)
	return tagRepository.FindByIDs(ids)
}
コード例 #4
0
ファイル: tag_service.go プロジェクト: gophergala2016/source
func (s TagService) FindTagByNames(names []string) ([]models.Tag, error) {
	tagRepository := models.NewTagRepository(s.ctx)
	return tagRepository.FindByNames(names)
}
コード例 #5
0
ファイル: tag_service.go プロジェクト: gophergala2016/source
// GetTagByID get  entity by id from db
func (s TagService) GetTagByID(id uint64) (*models.Tag, error) {
	tagRepository := models.NewTagRepository(s.ctx)
	return tagRepository.GetByID(id)
}