Documentation ¶
Index ¶
- type AdminService
- func (s *AdminService) All(selfID uint) []*model.Admin
- func (s *AdminService) AssertPwd(pwd string, enPwd string) bool
- func (s *AdminService) CheckToken(token string) (*model.Admin, error)
- func (s *AdminService) Delete(id int) error
- func (s *AdminService) GenToken(admin *model.Admin)
- func (s *AdminService) Get(id int) *model.Admin
- func (s *AdminService) GetByUsername(username string) *model.Admin
- func (s *AdminService) Save(admin *model.Admin) error
- func (s *AdminService) TrieGet(id uint) *model.Admin
- type ArticlePageQuery
- type ArticleService
- func (s *ArticleService) Delete(ids []int) error
- func (s *ArticleService) DraftCount() int
- func (s *ArticleService) Edit(article *model.ArticlePublish) error
- func (s *ArticleService) GetById(id int) *model.Article
- func (s *ArticleService) GetContent(tableName string, id int) *model.ArticleContent
- func (s *ArticleService) NoCategoryCount() int
- func (s *ArticleService) Page(page int, query *ArticlePageQuery) *orm.Page
- func (s *ArticleService) Publish(article *model.ArticlePublish, adminID uint) error
- func (s *ArticleService) TotalCount() int
- type CacheService
- func (s *CacheService) Delete(key string) error
- func (s *CacheService) Get(key string, i interface{}) error
- func (s *CacheService) GetInt(key string) (int, error)
- func (s *CacheService) GetStr(key string) (string, error)
- func (s *CacheService) Inc(key string, val int) error
- func (s *CacheService) Set(key string, val interface{}, exp time.Duration) error
- func (s *CacheService) SetExp(key string, exp time.Duration) error
- type CategoryQuery
- type CategoryService
- func (s *CategoryService) Get(id int) (*model.Category, error)
- func (s *CategoryService) Page(page int, query *CategoryQuery) *orm.Page
- func (s *CategoryService) Save(category *model.Category) error
- func (s *CategoryService) Sort(sort *CategorySort) error
- func (s *CategoryService) Tree() []*CategoryTree
- func (s *CategoryService) TrieGet(id uint) *model.Category
- type CategorySort
- type CategoryTree
- type DictService
- type LocalUpload
- type RoleService
- func (s *RoleService) All() []*model.Role
- func (s *RoleService) AllPermission() []*model.Permission
- func (s *RoleService) Get(id int) (*model.Role, error)
- func (s *RoleService) Init()
- func (s *RoleService) Page(page int) *orm.Page
- func (s *RoleService) Save(role model.Role, permissions []*model.Permission) error
- type SkinInfo
- type SkinService
- type TagQuery
- type TagService
- func (s *TagService) Get(id int) (*model.Tag, error)
- func (s *TagService) GetByArticleID(id int) []*model.Tag
- func (s *TagService) GetByName(name string) *model.Tag
- func (s *TagService) GetHotTag(count int) []*model.Tag
- func (s *TagService) Page(page int, query *TagQuery) *orm.Page
- func (s *TagService) PrefixFind(prefix string) []string
- func (s *TagService) PutPrefix(tag *model.Tag)
- func (s *TagService) Save(tag *model.Tag) error
- type UpyunUpload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminService ¶
type AdminService struct { ORM *orm.ORM `ioc:"auto"` CacheService *CacheService `ioc:"auto"` RoleService *RoleService `ioc:"auto"` // contains filtered or unexported fields }
func (*AdminService) CheckToken ¶
func (s *AdminService) CheckToken(token string) (*model.Admin, error)
func (*AdminService) Delete ¶
func (s *AdminService) Delete(id int) error
func (*AdminService) GenToken ¶
func (s *AdminService) GenToken(admin *model.Admin)
func (*AdminService) GetByUsername ¶
func (s *AdminService) GetByUsername(username string) *model.Admin
type ArticlePageQuery ¶
type ArticleService ¶
type ArticleService struct { CategoryService *CategoryService `ioc:"auto"` AdminService *AdminService `ioc:"auto"` TagService *TagService `ioc:"auto"` ORM *orm.ORM `ioc:"auto"` PageSize int `val:"${website.page_size}"` TableSize int `val:"${website.article_table_size}"` TablePrefix string `val:"${db.table_prefix}"` // contains filtered or unexported fields }
func (*ArticleService) Delete ¶
func (s *ArticleService) Delete(ids []int) error
func (*ArticleService) DraftCount ¶
func (s *ArticleService) DraftCount() int
func (*ArticleService) Edit ¶
func (s *ArticleService) Edit(article *model.ArticlePublish) error
func (*ArticleService) GetContent ¶
func (s *ArticleService) GetContent(tableName string, id int) *model.ArticleContent
func (*ArticleService) NoCategoryCount ¶
func (s *ArticleService) NoCategoryCount() int
func (*ArticleService) Page ¶
func (s *ArticleService) Page(page int, query *ArticlePageQuery) *orm.Page
func (*ArticleService) Publish ¶
func (s *ArticleService) Publish(article *model.ArticlePublish, adminID uint) error
func (*ArticleService) TotalCount ¶
func (s *ArticleService) TotalCount() int
type CacheService ¶
type CacheService struct { CacheType string `val:"${cache.type}"` Address string `val:"${cache.url}"` Password string `val:"${cache.password}"` DB int `val:"${cache.db}"` CacheSize int `val:"${cache.cache_size}"` // cache memory size :MB // contains filtered or unexported fields }
func (*CacheService) Delete ¶
func (s *CacheService) Delete(key string) error
func (*CacheService) Get ¶
func (s *CacheService) Get(key string, i interface{}) error
type CategoryQuery ¶
type CategoryQuery struct {
Keyword string `json:"keyword"`
}
type CategoryService ¶
type CategoryService struct { ArticleService *ArticleService `ioc:"auto"` PageSize int `val:"${website.page_size}"` ORM *orm.ORM `ioc:"auto"` // contains filtered or unexported fields }
func (*CategoryService) Page ¶
func (s *CategoryService) Page(page int, query *CategoryQuery) *orm.Page
func (*CategoryService) Sort ¶
func (s *CategoryService) Sort(sort *CategorySort) error
func (*CategoryService) Tree ¶
func (s *CategoryService) Tree() []*CategoryTree
type CategorySort ¶
type CategoryTree ¶
type CategoryTree struct { ID uint `json:"id"` Name string `json:"name"` Children []*CategoryTree `json:"children"` Category *model.Category `json:"category"` }
type DictService ¶
func (*DictService) All ¶
func (s *DictService) All() []*model.Dict
func (*DictService) Init ¶
func (s *DictService) Init()
func (*DictService) Save ¶
func (s *DictService) Save(dict *model.Dict)
func (*DictService) Update ¶
func (s *DictService) Update(dict *model.Dict)
type LocalUpload ¶
type LocalUpload struct { StaticDir string `val:"${server.static}"` UploadDir string `val:"${upload.local_dir}"` MaxSize int `val:"${upload.max_size}"` ORM *orm.ORM `ioc:"auto"` }
func (*LocalUpload) Upload ¶
func (s *LocalUpload) Upload(file *multipart.FileHeader) (*model.Upload, error)
func (*LocalUpload) UploadBase64 ¶
func (s *LocalUpload) UploadBase64(base64Data string) (*model.Upload, error)
type RoleService ¶
type RoleService struct { ORM *orm.ORM `ioc:"auto"` AdminService *AdminService `ioc:"auto"` PageSize int `val:"${website.page_size}"` // contains filtered or unexported fields }
func (*RoleService) All ¶
func (s *RoleService) All() []*model.Role
func (*RoleService) AllPermission ¶
func (s *RoleService) AllPermission() []*model.Permission
func (*RoleService) Init ¶
func (s *RoleService) Init()
func (*RoleService) Save ¶
func (s *RoleService) Save(role model.Role, permissions []*model.Permission) error
type SkinService ¶
type SkinService struct { ORM *orm.ORM `ioc:"auto"` SkinDir string `val:"${server.skin_template_dir}"` StaticDir string `val:"${server.static}"` }
func (*SkinService) AllSkin ¶
func (s *SkinService) AllSkin() ([]*SkinInfo, error)
type TagService ¶
type TagService struct { PageSize int `val:"${website.page_size}"` ORM *orm.ORM `ioc:"auto"` // contains filtered or unexported fields }
func (*TagService) GetByArticleID ¶
func (s *TagService) GetByArticleID(id int) []*model.Tag
func (*TagService) PrefixFind ¶
func (s *TagService) PrefixFind(prefix string) []string
func (*TagService) PutPrefix ¶
func (s *TagService) PutPrefix(tag *model.Tag)
type UpyunUpload ¶
type UpyunUpload struct { }
func (*UpyunUpload) Upload ¶
func (s *UpyunUpload) Upload(file *multipart.FileHeader) (*model.Upload, error)
func (*UpyunUpload) UploadBase64 ¶
func (s *UpyunUpload) UploadBase64(base64 string) (*model.Upload, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.