Documentation
¶
Index ¶
- Variables
- type ApiDO
- type ApiDOList
- type ApiDOListOption
- type ApiGroupDO
- type ApiGroupDOList
- type ApiGroupDOListOption
- type ApiGroupRepo
- type ApiGroupUsecase
- func (uc *ApiGroupUsecase) Create(ctx context.Context, obj *ApiGroupDO) (*ApiGroupDO, error)
- func (uc *ApiGroupUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *ApiGroupUsecase) FindOneByID(ctx context.Context, id uint64) (*ApiGroupDO, error)
- func (uc *ApiGroupUsecase) ListAll(ctx context.Context, opts ApiGroupDOListOption) (*ApiGroupDOList, error)
- func (uc *ApiGroupUsecase) Update(ctx context.Context, obj *ApiGroupDO) (*ApiGroupDO, error)
- type ApiRepo
- type ApiTreeDO
- type ApiUsecase
- func (uc *ApiUsecase) Create(ctx context.Context, obj *ApiDO) (*ApiDO, error)
- func (uc *ApiUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *ApiUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *ApiUsecase) FindOneByID(ctx context.Context, id uint64) (*ApiDO, error)
- func (uc *ApiUsecase) ListAll(ctx context.Context, opts ApiDOListOption) (*ApiDOList, error)
- func (uc *ApiUsecase) TreeAll(ctx context.Context) ([]*ApiTreeDO, error)
- func (uc *ApiUsecase) Update(ctx context.Context, obj *ApiDO) (*ApiDO, error)
- type ArticleContentDO
- type ArticleContentRepo
- type ArticleContentUsecase
- func (uc *ArticleContentUsecase) Create(ctx context.Context, g *ArticleContentDO) (*ArticleContentDO, error)
- func (uc *ArticleContentUsecase) CreateByArticle(ctx context.Context, g *ArticleDO) (*ArticleContentDO, error)
- func (uc *ArticleContentUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *ArticleContentUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *ArticleContentUsecase) FindOneByID(ctx context.Context, id uint64) (*ArticleContentDO, error)
- func (uc *ArticleContentUsecase) ListAll(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
- func (uc *ArticleContentUsecase) Update(ctx context.Context, g *ArticleContentDO) (*ArticleContentDO, error)
- func (uc *ArticleContentUsecase) UpdateByArticle(ctx context.Context, g *ArticleDO) (*ArticleContentDO, error)
- type ArticleDO
- type ArticleDOList
- type ArticleDOListOption
- type ArticleRepo
- type ArticleResourceDO
- type ArticleResourceRepo
- type ArticleResourceUsecase
- func (uc *ArticleResourceUsecase) CountByArticleID(ctx context.Context, articleId uint64) int64
- func (uc *ArticleResourceUsecase) FindAllByArticleID(ctx context.Context, aid uint64) ([]*ArticleResourceDO, error)
- func (uc *ArticleResourceUsecase) FindAllByArticlePermaLink(ctx context.Context, permaLink string) ([]*ArticleResourceDO, error)
- func (uc *ArticleResourceUsecase) SaveResourcesForArticle(ctx context.Context, articleID uint64, articleResources []*ArticleResourceDO) error
- func (uc *ArticleResourceUsecase) UpdateResourcesByOldFiles(ctx context.Context, articleID uint64, needLen int, ...) error
- func (uc *ArticleResourceUsecase) UpdateResourcesForArticle(ctx context.Context, articleID uint64, articleResources []*ArticleResourceDO) error
- type ArticleTagsDO
- type ArticleTagsRepo
- type ArticleTagsUsecase
- type ArticleUsecase
- func (uc *ArticleUsecase) AddPostViewCount(ctx context.Context, id uint64, ip string)
- func (uc *ArticleUsecase) Create(ctx context.Context, g *ArticleDO) (*ArticleDO, error)
- func (uc *ArticleUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *ArticleUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *ArticleUsecase) FindOneByAgentID(ctx context.Context, id uint64) (*ArticleDO, error)
- func (uc *ArticleUsecase) FindOneByID(ctx context.Context, id uint64) (*ArticleDO, error)
- func (uc *ArticleUsecase) FindOneByLink(ctx context.Context, link string) (*ArticleDO, error)
- func (uc *ArticleUsecase) GeneratorMapListAll(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
- func (uc *ArticleUsecase) GetPostViewCount(ctx context.Context, id uint64) int64
- func (uc *ArticleUsecase) InitArticlePermaLink(ctx context.Context, title string) string
- func (uc *ArticleUsecase) ListAll(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
- func (uc *ArticleUsecase) ListAllForWeb(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
- func (uc *ArticleUsecase) Update(ctx context.Context, g *ArticleDO) (*ArticleDO, error)
- func (uc *ArticleUsecase) UpdateAllPostsCount(ctx context.Context)
- func (uc *ArticleUsecase) UpdateCommentContByAgentIds(ctx context.Context) error
- type ArticleVisitorDO
- type ArticleVisitorRepo
- type ArticleVisitorUsecase
- type CasbinRuleDO
- type CasbinRuleRepo
- type CasbinRuleUsecase
- type CategoryDO
- type CategoryDOList
- type CategoryDOListOption
- type CategoryRepo
- type CategoryUsecase
- func (uc *CategoryUsecase) Create(ctx context.Context, obj *CategoryDO) (*CategoryDO, error)
- func (uc *CategoryUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *CategoryUsecase) FindByIdentifier(ctx context.Context, name string) (*CategoryDO, error)
- func (uc *CategoryUsecase) FindOneByID(ctx context.Context, id uint64) (*CategoryDO, error)
- func (uc *CategoryUsecase) ListAll(ctx context.Context, opts CategoryDOListOption) (*CategoryDOList, error)
- func (uc *CategoryUsecase) Update(ctx context.Context, obj *CategoryDO) (*CategoryDO, error)
- type CommentAgentDO
- type CommentAgentRepo
- type CommentAgentUsecase
- func (uc *CommentAgentUsecase) CreateCommentAgent(ctx context.Context, g *CommentAgentDO) (*CommentAgentDO, error)
- func (uc *CommentAgentUsecase) FindByID(ctx context.Context, id uint64) (*CommentAgentDO, error)
- func (uc *CommentAgentUsecase) Update(ctx context.Context, g *CommentAgentDO) (*CommentAgentDO, error)
- func (uc *CommentAgentUsecase) UpdateAddCountById(ctx context.Context, id uint64, isRoot bool) error
- func (uc *CommentAgentUsecase) UpdateMinusCountById(ctx context.Context, id uint64, isRoot bool) error
- type CommentContentDO
- type CommentContentDOList
- type CommentContentDOListOption
- type CommentContentRepo
- type CommentContentUsecase
- func (uc *CommentContentUsecase) CountAll(ctx context.Context) *CommentCount
- func (uc *CommentContentUsecase) CreateCommentContent(ctx context.Context, g *CommentContentDO) (*CommentContentDO, error)
- func (uc *CommentContentUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *CommentContentUsecase) FindAllByParentID(ctx context.Context, id uint64, size int) ([]*CommentContentDO, error)
- func (uc *CommentContentUsecase) FindByID(ctx context.Context, id uint64) (*CommentContentDO, error)
- func (uc *CommentContentUsecase) ListAll(ctx context.Context, opts CommentContentDOListOption) (*CommentContentDOList, error)
- func (uc *CommentContentUsecase) UpdaeCommentById(ctx context.Context, id uint64, comment string) error
- func (uc *CommentContentUsecase) UpdaeEmailStateById(ctx context.Context, id uint64, state int32) error
- func (uc *CommentContentUsecase) Update(ctx context.Context, g *CommentContentDO) (*CommentContentDO, error)
- func (uc *CommentContentUsecase) UpdateStateByIDs(ctx context.Context, ids []uint64, state int) error
- type CommentCount
- type CommentDO
- type CommentDOList
- type CommentIndexDO
- type CommentIndexRepo
- type CommentIndexUsecase
- func (uc *CommentIndexUsecase) CreateCommentIndex(ctx context.Context, g *CommentIndexDO) (*CommentIndexDO, error)
- func (uc *CommentIndexUsecase) CreateCommentIndexByContent(ctx context.Context, g *CommentContentDO) (*CommentIndexDO, error)
- func (uc *CommentIndexUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *CommentIndexUsecase) FindAllByParentID(ctx context.Context, id uint64) ([]*CommentIndexDO, error)
- func (uc *CommentIndexUsecase) FindByID(ctx context.Context, id uint64) (*CommentIndexDO, error)
- func (uc *CommentIndexUsecase) Update(ctx context.Context, g *CommentIndexDO) (*CommentIndexDO, error)
- func (uc *CommentIndexUsecase) UpdateAddCountById(ctx context.Context, id uint64, isRoot bool) error
- func (uc *CommentIndexUsecase) UpdateMinusCountById(ctx context.Context, id uint64, isRoot bool) error
- func (uc *CommentIndexUsecase) UpdateObjIdByAgentIds(ctx context.Context) error
- func (uc *CommentIndexUsecase) UpdateStateByIDs(ctx context.Context, ids []uint64, state int) error
- type CommentUsecase
- func (uc *CommentUsecase) CreateComment(ctx context.Context, g *CommentDO) (*CommentContentDO, error)
- func (uc *CommentUsecase) CreateCommentWeb(ctx context.Context, g *CommentDO, conf *conf.Qycms) (*CommentContentDO, error)
- func (uc *CommentUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *CommentUsecase) EmailToNotSend(ctx context.Context, conf *conf.Qycms)
- func (uc *CommentUsecase) EmailToSend(ctx context.Context, items []*CommentContentDO, conf *conf.Qycms, ...)
- func (uc *CommentUsecase) ListAllForWeb(ctx context.Context, opts CommentContentDOListOption) *CommentDOList
- func (uc *CommentUsecase) ListAllNeedEmail(ctx context.Context, opts CommentContentDOListOption) *CommentDOList
- func (uc *CommentUsecase) UpdateAddCount(ctx context.Context, idx *CommentIndexDO)
- func (uc *CommentUsecase) UpdateCommentComent(ctx context.Context, g *CommentDO) error
- func (uc *CommentUsecase) UpdateCommentState(ctx context.Context, ids []uint64, state int) error
- func (uc *CommentUsecase) UpdateContentCountAndObjIds(ctx context.Context) error
- func (uc *CommentUsecase) UpdateMinusCount(ctx context.Context, idx *CommentIndexDO)
- type FileLibConfigDO
- type FileLibConfigRepo
- type FileLibConfigUsecase
- func (uc *FileLibConfigUsecase) FindById(ctx context.Context, id uint64) (*FileLibConfigDO, error)
- func (uc *FileLibConfigUsecase) FindByTypeId(ctx context.Context, id uint64) (*FileLibConfigDO, error)
- func (uc *FileLibConfigUsecase) GetTokenByTypeId(ctx context.Context, id uint64) (string, error)
- func (uc *FileLibConfigUsecase) SaveOrUpdate(ctx context.Context, data *FileLibConfigDO) (*FileLibConfigDO, error)
- func (uc *FileLibConfigUsecase) SetTokenByTypeId(ctx context.Context, id uint64, token string) bool
- type FileLibDO
- type FileLibDOList
- type FileLibDOListOption
- type FileLibRepo
- type FileLibTypeDO
- type FileLibTypeDOList
- type FileLibTypeDOListOption
- type FileLibTypeRepo
- type FileLibTypeUsecase
- func (uc *FileLibTypeUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *FileLibTypeUsecase) ListAll(ctx context.Context, opts FileLibTypeDOListOption) (*FileLibTypeDOList, error)
- func (uc *FileLibTypeUsecase) Save(ctx context.Context, data *FileLibTypeDO) (*FileLibTypeDO, error)
- func (uc *FileLibTypeUsecase) Update(ctx context.Context, data *FileLibTypeDO) (*FileLibTypeDO, error)
- type FileLibUsecase
- func (uc *FileLibUsecase) CountByMd5(ctx context.Context, fmd5 string) int64
- func (uc *FileLibUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *FileLibUsecase) FindByMd5(ctx context.Context, fmd5 string) (*FileLibDO, error)
- func (uc *FileLibUsecase) ListAll(ctx context.Context, opts FileLibDOListOption) (*FileLibDOList, error)
- func (uc *FileLibUsecase) Save(ctx context.Context, data *FileLibDO) (*FileLibDO, error)
- func (uc *FileLibUsecase) Update(ctx context.Context, data *FileLibDO) (*FileLibDO, error)
- type LinkDO
- type LinkDOList
- type LinkDOListOption
- type LinkRepo
- type LinkUsecase
- func (uc *LinkUsecase) Create(ctx context.Context, obj *LinkDO) (*LinkDO, error)
- func (uc *LinkUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *LinkUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *LinkUsecase) FindAllWitchCache(ctx context.Context) ([]*LinkDO, error)
- func (uc *LinkUsecase) FindIndexLinkAllWitchCache(ctx context.Context) ([]*LinkDO, error)
- func (uc *LinkUsecase) FindOneByID(ctx context.Context, id uint64) (*LinkDO, error)
- func (uc *LinkUsecase) ListAll(ctx context.Context, opts LinkDOListOption) (*LinkDOList, error)
- func (uc *LinkUsecase) Update(ctx context.Context, obj *LinkDO) (*LinkDO, error)
- type MenusAdminDO
- type MenusAdminDOList
- type MenusAdminDOListOption
- type MenusAdminRepo
- type MenusAdminUsecase
- func (uc *MenusAdminUsecase) Create(ctx context.Context, obj *MenusAdminDO) (*MenusAdminDO, error)
- func (uc *MenusAdminUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *MenusAdminUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *MenusAdminUsecase) FindAllByRoleID(ctx context.Context, rid uint64) ([]*MenusAdminDO, error)
- func (uc *MenusAdminUsecase) FindOneByID(ctx context.Context, id uint64) (*MenusAdminDO, error)
- func (uc *MenusAdminUsecase) ListAll(ctx context.Context, opts MenusAdminDOListOption) (*MenusAdminDOList, error)
- func (uc *MenusAdminUsecase) ListAllChildren(ctx context.Context, opts MenusAdminDOListOption) (*MenusAdminDOList, error)
- func (uc *MenusAdminUsecase) Update(ctx context.Context, obj *MenusAdminDO) (*MenusAdminDO, error)
- type MenusAgentDO
- type MenusAgentDOList
- type MenusAgentDOListOption
- type MenusAgentRepo
- type MenusAgentUsecase
- func (uc *MenusAgentUsecase) Create(ctx context.Context, obj *MenusAgentDO) (*MenusAgentDO, error)
- func (uc *MenusAgentUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *MenusAgentUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *MenusAgentUsecase) FindOneByID(ctx context.Context, id uint64) (*MenusAgentDO, error)
- func (uc *MenusAgentUsecase) ListAll(ctx context.Context, opts MenusAgentDOListOption) (*MenusAgentDOList, error)
- func (uc *MenusAgentUsecase) Update(ctx context.Context, obj *MenusAgentDO) (*MenusAgentDO, error)
- type MenusDO
- type MenusDOList
- type MenusDOListOption
- type MenusRepo
- type MenusUsecase
- func (uc *MenusUsecase) Create(ctx context.Context, obj *MenusDO) (*MenusDO, error)
- func (uc *MenusUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *MenusUsecase) DeleteList(ctx context.Context, ids []uint64, targetId uint64) error
- func (uc *MenusUsecase) FindOneByID(ctx context.Context, id uint64) (*MenusDO, error)
- func (uc *MenusUsecase) ListAll(ctx context.Context, opts MenusDOListOption) (*MenusDOList, error)
- func (uc *MenusUsecase) Update(ctx context.Context, obj *MenusDO) (*MenusDO, error)
- type RoleApiDO
- type RoleApiRepo
- type RoleApiUsecase
- type RoleDO
- type RoleDOList
- type RoleDOListOption
- type RoleMenusDO
- type RoleMenusRepo
- type RoleMenusUsecase
- type RoleRepo
- type RoleUsecase
- func (uc *RoleUsecase) Create(ctx context.Context, obj *RoleDO) (*RoleDO, error)
- func (uc *RoleUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *RoleUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *RoleUsecase) FindByKey(ctx context.Context, objname string) (*RoleDO, error)
- func (uc *RoleUsecase) FindByUserId(ctx context.Context, userId uint64) ([]*RoleDO, error)
- func (uc *RoleUsecase) FindOneByID(ctx context.Context, id uint64) (*RoleDO, error)
- func (uc *RoleUsecase) ListAll(ctx context.Context, opts RoleDOListOption) (*RoleDOList, error)
- func (uc *RoleUsecase) Update(ctx context.Context, obj *RoleDO) (*RoleDO, error)
- type ShortLinkDO
- type ShortLinkDOList
- type ShortLinkDOListOption
- type ShortLinkRepo
- type ShortLinkUsecase
- func (uc *ShortLinkUsecase) Create(ctx context.Context, obj *ShortLinkDO) (*ShortLinkDO, error)
- func (uc *ShortLinkUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *ShortLinkUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *ShortLinkUsecase) FindAllWitchCache(ctx context.Context) ([]*ShortLinkDO, error)
- func (uc *ShortLinkUsecase) FindOneByID(ctx context.Context, id uint64) (*ShortLinkDO, error)
- func (uc *ShortLinkUsecase) ListAll(ctx context.Context, opts ShortLinkDOListOption) (*ShortLinkDOList, error)
- func (uc *ShortLinkUsecase) Update(ctx context.Context, obj *ShortLinkDO) (*ShortLinkDO, error)
- type SiteConfigDO
- type SiteConfigDOList
- type SiteConfigDOListOption
- type SiteConfigRepo
- type SiteConfigUsecase
- func (uc *SiteConfigUsecase) FindValueByKey(ctx context.Context, key string) string
- func (uc *SiteConfigUsecase) ListAll(ctx context.Context, opts SiteConfigDOListOption) ([]*SiteConfigDO, error)
- func (uc *SiteConfigUsecase) Save(ctx context.Context, data *SiteConfigDO) (*SiteConfigDO, error)
- func (uc *SiteConfigUsecase) Update(ctx context.Context, data *SiteConfigDO) (*SiteConfigDO, error)
- func (uc *SiteConfigUsecase) UpdateInBatches(ctx context.Context, data []*SiteConfigDO) error
- type SiteMapUsecase
- type TagsDO
- type TagsDOList
- type TagsDOListOption
- type TagsRepo
- type TagsUsecase
- func (uc *TagsUsecase) Create(ctx context.Context, obj *TagsDO) (*TagsDO, error)
- func (uc *TagsUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *TagsUsecase) FindAllByArticleID(ctx context.Context, articleId uint64) ([]*TagsDO, error)
- func (uc *TagsUsecase) FindOneByID(ctx context.Context, id uint64) (*TagsDO, error)
- func (uc *TagsUsecase) FindOneByIdentifier(ctx context.Context, name string) (*TagsDO, error)
- func (uc *TagsUsecase) FindOneByName(ctx context.Context, name string) (*TagsDO, error)
- func (uc *TagsUsecase) ListAll(ctx context.Context, opts TagsDOListOption) (*TagsDOList, error)
- func (uc *TagsUsecase) Update(ctx context.Context, obj *TagsDO) (*TagsDO, error)
- type UserDO
- type UserDOList
- type UserDOListOption
- type UserInfoDO
- type UserRepo
- type UserRoleDO
- type UserRoleRepo
- type UserRoleUsecase
- type UserUsecase
- func (uc *UserUsecase) ChangePassword(ctx context.Context, user *UserDO) error
- func (uc *UserUsecase) CreateUser(ctx context.Context, user *UserDO) (*UserDO, error)
- func (uc *UserUsecase) Delete(ctx context.Context, id uint64) error
- func (uc *UserUsecase) DeleteList(ctx context.Context, ids []uint64) error
- func (uc *UserUsecase) FindOneByID(ctx context.Context, id uint64) (*UserDO, error)
- func (uc *UserUsecase) FindOneByUsername(ctx context.Context, username string) (*UserDO, error)
- func (uc *UserUsecase) ListAll(ctx context.Context, opts UserDOListOption) (*UserDOList, error)
- func (uc *UserUsecase) Update(ctx context.Context, user *UserDO) (*UserDO, error)
- func (uc *UserUsecase) VerifyPassword(ctx context.Context, u *UserDO, authConf *conf.Auth) (*UserInfoDO, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrApiGroupNotFound is api group not found. ErrApiGroupNotFound = errors.NotFound("102404", "api group not found") )
var ( // ErrApiNotFound is api not found. ErrApiNotFound = errors.NotFound("101404", "api not found") )
var ( // ErrArticleContentNotFound is article content not found. ErrArticleContentNotFound = errors.NotFound("104404", "article content not found") )
var ( // ErrArticleNotFound is article not found. ErrArticleNotFound = errors.NotFound("103404", "article not found") )
var ( // ErrCategoryNotFound is category not found. ErrCategoryNotFound = errors.NotFound("105404", "category not found") )
var ( // ErrCommentAgentNotFound is common agent not found. ErrCommentAgentNotFound = errors.NotFound("106404", "common agent not found") )
var ( // ErrCommentContentNotFound is comment content not found. ErrCommentContentNotFound = errors.NotFound("107404", "comment content not found") )
var ( // ErrCommentIndexNotFound is comment index not found. ErrCommentIndexNotFound = errors.NotFound("108404", "comment index not found") )
var ( // ErrFileLibConfigNotFound is file lib config not found. ErrFileLibConfigNotFound = errors.NotFound("110404", "file lib config not found") )
var ( // ErrFileLibNotFound is file lib not found. ErrFileLibNotFound = errors.NotFound("109404", "file lib not found") )
var ( // ErrFileLibTypeNotFound is file lib type not found. ErrFileLibTypeNotFound = errors.NotFound("111404", "file lib type not found") )
var ( // ErrLinkNotFound is link not found. ErrLinkNotFound = errors.NotFound("112404", "link not found") )
var ( // ErrMenusAgentNotFound is menus agent not found. ErrMenusAgentNotFound = errors.NotFound("114404", "menus agent not found") )
var ( // ErrMenusNotFound is menus not found. ErrMenusNotFound = errors.NotFound("113404", "menus not found") )
var ( // ErrRoleNotFound is role not found. ErrRoleNotFound = errors.NotFound("115404", "role not found") )
var ( // ErrShortLinkNotFound is short link not found. ErrShortLinkNotFound = errors.NotFound("116404", "short link not found") )
var ( // ErrSiteConfigNotFound is site config not found. ErrSiteConfigNotFound = errors.NotFound("117404", "site config not found") )
var ( // ErrTagNotFound is tag not found. ErrTagNotFound = errors.NotFound("118404", "tag not found") )
var ( // ErrUserNotFound is user not found. ErrUserNotFound = kerrors.NotFound("1002404", "user not found") )
var ProviderSet = wire.NewSet( NewUserRoleUsecase, NewRoleMenusUsecase, NewRoleApiUsecase, NewRoleUsecase, NewUserUsecase, NewSiteConfigUsecase, NewApiUsecase, NewMenusAdminUsecase, NewApiGroupUsecase, NewCasbinRuleUsecase, NewFileLibTypeUsecase, NewFileLibConfigUsecase, NewFileLibUsecase, NewArticleUsecase, NewArticleContentUsecase, NewCommentAgentUsecase, NewCommentIndexUsecase, NewCommentContentUsecase, NewLinkUsecase, NewShortLinkUsecase, NewMenusUsecase, NewMenusAgentUsecase, NewTagsUsecase, NewCategoryUsecase, NewArticleTagsUsecase, NewCommentUsecase, NewSiteMapUsecase, NewArticleVisitorUsecase, NewArticleResourceUsecase, )
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type ApiDOListOption ¶
type ApiDOListOption struct {
metaV1.ListOptions `json:"page"`
ApiDO `json:"item"`
}
type ApiGroupDO ¶
type ApiGroupDO struct {
metaV1.ObjectMeta
Name string
Identifier string
}
type ApiGroupDOList ¶
type ApiGroupDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*ApiGroupDO `json:"items"`
}
type ApiGroupDOListOption ¶
type ApiGroupDOListOption struct {
metaV1.ListOptions `json:"page"`
ApiGroupDO `json:"item"`
}
type ApiGroupRepo ¶
type ApiGroupRepo interface {
Save(context.Context, *ApiGroupDO) (*ApiGroupDO, error)
Update(context.Context, *ApiGroupDO) (*ApiGroupDO, error)
//Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*ApiGroupDO, error)
ListAll(c context.Context, opts ApiGroupDOListOption) (*ApiGroupDOList, error)
}
type ApiGroupUsecase ¶
type ApiGroupUsecase struct {
// contains filtered or unexported fields
}
func NewApiGroupUsecase ¶
func NewApiGroupUsecase(repo ApiGroupRepo, logger log.Logger) *ApiGroupUsecase
func (*ApiGroupUsecase) Create ¶
func (uc *ApiGroupUsecase) Create(ctx context.Context, obj *ApiGroupDO) (*ApiGroupDO, error)
func (*ApiGroupUsecase) DeleteList ¶
func (uc *ApiGroupUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除用户
func (*ApiGroupUsecase) FindOneByID ¶
func (uc *ApiGroupUsecase) FindOneByID(ctx context.Context, id uint64) (*ApiGroupDO, error)
FindOneByID 根据ID查询用户信息
func (*ApiGroupUsecase) ListAll ¶
func (uc *ApiGroupUsecase) ListAll(ctx context.Context, opts ApiGroupDOListOption) (*ApiGroupDOList, error)
ListAll 批量查询
func (*ApiGroupUsecase) Update ¶
func (uc *ApiGroupUsecase) Update(ctx context.Context, obj *ApiGroupDO) (*ApiGroupDO, error)
Update 更新用户
type ApiRepo ¶
type ApiRepo interface {
Save(context.Context, *ApiDO) (*ApiDO, error)
Update(context.Context, *ApiDO) (*ApiDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*ApiDO, error)
ListAll(c context.Context, opts ApiDOListOption) (*ApiDOList, error)
}
type ApiUsecase ¶
type ApiUsecase struct {
// contains filtered or unexported fields
}
func NewApiUsecase ¶
func NewApiUsecase(repo ApiRepo, acg *ApiGroupUsecase, casbRepo CasbinRuleRepo, logger log.Logger) *ApiUsecase
func (*ApiUsecase) Delete ¶
func (uc *ApiUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除用户
func (*ApiUsecase) DeleteList ¶
func (uc *ApiUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除用户
func (*ApiUsecase) FindOneByID ¶
FindOneByID 根据ID查询用户信息
func (*ApiUsecase) ListAll ¶
func (uc *ApiUsecase) ListAll(ctx context.Context, opts ApiDOListOption) (*ApiDOList, error)
ListAll 批量查询
type ArticleContentDO ¶
type ArticleContentRepo ¶
type ArticleContentRepo interface {
Save(context.Context, *ArticleContentDO) (*po.ArticleContentPO, error)
Update(context.Context, *ArticleContentDO) (*po.ArticleContentPO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*po.ArticleContentPO, error)
ListAll(context.Context) ([]*po.ArticleContentPO, error)
}
ArticleContentRepo is a Greater repo.
type ArticleContentUsecase ¶
type ArticleContentUsecase struct {
// contains filtered or unexported fields
}
ArticleContentUsecase is a ArticleDO usecase.
func NewArticleContentUsecase ¶
func NewArticleContentUsecase(repo ArticleContentRepo, logger log.Logger) *ArticleContentUsecase
NewArticleContentUsecase new a ArticleDO usecase.
func (*ArticleContentUsecase) Create ¶
func (uc *ArticleContentUsecase) Create(ctx context.Context, g *ArticleContentDO) (*ArticleContentDO, error)
Create creates a ArticleDO, and returns the new ArticleDO.
func (*ArticleContentUsecase) CreateByArticle ¶
func (uc *ArticleContentUsecase) CreateByArticle(ctx context.Context, g *ArticleDO) (*ArticleContentDO, error)
func (*ArticleContentUsecase) Delete ¶
func (uc *ArticleContentUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除
func (*ArticleContentUsecase) DeleteList ¶
func (uc *ArticleContentUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除
func (*ArticleContentUsecase) FindOneByID ¶
func (uc *ArticleContentUsecase) FindOneByID(ctx context.Context, id uint64) (*ArticleContentDO, error)
FindOneByID 根据ID查询信息
func (*ArticleContentUsecase) ListAll ¶
func (uc *ArticleContentUsecase) ListAll(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
ListAll 批量查询
func (*ArticleContentUsecase) Update ¶
func (uc *ArticleContentUsecase) Update(ctx context.Context, g *ArticleContentDO) (*ArticleContentDO, error)
Update 更新
func (*ArticleContentUsecase) UpdateByArticle ¶
func (uc *ArticleContentUsecase) UpdateByArticle(ctx context.Context, g *ArticleDO) (*ArticleContentDO, error)
type ArticleDO ¶
type ArticleDO struct {
metaV1.ObjectMeta
Title string
PermaLink string
CanonicalLink string
Summary string
Thumbnail string
Password string
Atype int
CategoryId uint64
CategoryName string
CommentAgentId uint64
CommentFlag bool
Published bool
ViewCount int32
CommentCount int32
LikeCount int32
HateCount int32
Nickname string
PublishedAt time.Time
TagStrings []string
Tags []*TagsDO
Category *CategoryDO
Content string
ContentHtml string
TagName string
Resource []*ArticleResourceDO
ResourceStrings []string
ResourceCount int64
}
ArticleDO is a ArticleDO model.
type ArticleDOList ¶
type ArticleDOListOption ¶
type ArticleDOListOption struct {
metaV1.ListOptions `json:"page"`
ArticleDO `json:"item"`
}
type ArticleRepo ¶
type ArticleRepo interface {
Save(context.Context, *ArticleDO) (*ArticleDO, error)
Update(context.Context, *ArticleDO) (*ArticleDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*ArticleDO, error)
FindByAgentID(context.Context, uint64) (*ArticleDO, error)
CountByPermaLink(ctx context.Context, str string) (int64, error)
ListAll(context.Context, ArticleDOListOption) (*ArticleDOList, error)
FindByLink(ctx context.Context, link string) (*ArticleDO, error)
SetArticleCache(ctx context.Context, user *ArticleDO, key string)
GetUserFromCache(ctx context.Context, key string) (*ArticleDO, error)
UpdateCommentContByAgentIds(context.Context) error
UpdateAllPostsCount(context.Context)
AddPostViewCount(context.Context, uint64, string)
GetPostViewCount(context.Context, uint64) int64
}
ArticleRepo is a Greater repo.
type ArticleResourceDO ¶
type ArticleResourceRepo ¶
type ArticleResourceRepo interface {
CreateInBatches(ctx context.Context, articleID uint64, articleResource []*ArticleResourceDO) error
UpdateInBatches(ctx context.Context, articleResource []*ArticleResourceDO) error
FindAllByArticleID(ctx context.Context, articleId uint64) ([]*ArticleResourceDO, error)
FindAllByArticlePermaLink(ctx context.Context, permaLink string) ([]*ArticleResourceDO, error)
DeleteByArticleID(ctx context.Context, articleId uint64) error
DeleteByIDs(ctx context.Context, ids []uint64) error
CountByArticleID(ctx context.Context, articleId uint64) (int64, error)
}
type ArticleResourceUsecase ¶
type ArticleResourceUsecase struct {
// contains filtered or unexported fields
}
func NewArticleResourceUsecase ¶
func NewArticleResourceUsecase(repo ArticleResourceRepo, logger log.Logger) *ArticleResourceUsecase
NewArticleResourceUsecase new a ArticleResourceDO usecase.
func (*ArticleResourceUsecase) CountByArticleID ¶
func (uc *ArticleResourceUsecase) CountByArticleID(ctx context.Context, articleId uint64) int64
func (*ArticleResourceUsecase) FindAllByArticleID ¶
func (uc *ArticleResourceUsecase) FindAllByArticleID(ctx context.Context, aid uint64) ([]*ArticleResourceDO, error)
func (*ArticleResourceUsecase) FindAllByArticlePermaLink ¶
func (uc *ArticleResourceUsecase) FindAllByArticlePermaLink(ctx context.Context, permaLink string) ([]*ArticleResourceDO, error)
func (*ArticleResourceUsecase) SaveResourcesForArticle ¶
func (uc *ArticleResourceUsecase) SaveResourcesForArticle(ctx context.Context, articleID uint64, articleResources []*ArticleResourceDO) error
func (*ArticleResourceUsecase) UpdateResourcesByOldFiles ¶
func (uc *ArticleResourceUsecase) UpdateResourcesByOldFiles(ctx context.Context, articleID uint64, needLen int, oldList []*ArticleResourceDO, articleResources []*ArticleResourceDO) error
func (*ArticleResourceUsecase) UpdateResourcesForArticle ¶
func (uc *ArticleResourceUsecase) UpdateResourcesForArticle(ctx context.Context, articleID uint64, articleResources []*ArticleResourceDO) error
type ArticleTagsDO ¶
type ArticleTagsRepo ¶
type ArticleTagsUsecase ¶
type ArticleTagsUsecase struct {
// contains filtered or unexported fields
}
func NewArticleTagsUsecase ¶
func NewArticleTagsUsecase(repo ArticleTagsRepo, tu *TagsUsecase, logger log.Logger) *ArticleTagsUsecase
NewArticleTagsUsecase new a ArticleDO usecase.
func (*ArticleTagsUsecase) FindAllByArticleID ¶
func (*ArticleTagsUsecase) SaveTagsForArticle ¶
func (uc *ArticleTagsUsecase) SaveTagsForArticle(ctx context.Context, article *ArticleDO) error
func (*ArticleTagsUsecase) UpdateRoleForUser ¶
func (uc *ArticleTagsUsecase) UpdateRoleForUser(ctx context.Context, article *ArticleDO) error
type ArticleUsecase ¶
type ArticleUsecase struct {
// contains filtered or unexported fields
}
ArticleUsecase is a ArticleDO usecase.
func NewArticleUsecase ¶
func NewArticleUsecase(repo ArticleRepo, logger log.Logger, ac *ArticleContentUsecase, at *ArticleTagsUsecase, ca *CommentAgentUsecase, cu *CategoryUsecase, fu *ArticleResourceUsecase, ) *ArticleUsecase
NewArticleUsecase new a ArticleDO usecase.
func (*ArticleUsecase) AddPostViewCount ¶
func (uc *ArticleUsecase) AddPostViewCount(ctx context.Context, id uint64, ip string)
func (*ArticleUsecase) Delete ¶
func (uc *ArticleUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除
func (*ArticleUsecase) DeleteList ¶
func (uc *ArticleUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除
func (*ArticleUsecase) FindOneByAgentID ¶
FindOneByAgentID 根据ID查询信息
func (*ArticleUsecase) FindOneByID ¶
FindOneByID 根据ID查询信息
func (*ArticleUsecase) FindOneByLink ¶
func (*ArticleUsecase) GeneratorMapListAll ¶
func (uc *ArticleUsecase) GeneratorMapListAll(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
func (*ArticleUsecase) GetPostViewCount ¶
func (uc *ArticleUsecase) GetPostViewCount(ctx context.Context, id uint64) int64
func (*ArticleUsecase) InitArticlePermaLink ¶
func (uc *ArticleUsecase) InitArticlePermaLink(ctx context.Context, title string) string
func (*ArticleUsecase) ListAll ¶
func (uc *ArticleUsecase) ListAll(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
ListAll 批量查询
func (*ArticleUsecase) ListAllForWeb ¶
func (uc *ArticleUsecase) ListAllForWeb(ctx context.Context, opts ArticleDOListOption) (*ArticleDOList, error)
func (*ArticleUsecase) UpdateAllPostsCount ¶
func (uc *ArticleUsecase) UpdateAllPostsCount(ctx context.Context)
func (*ArticleUsecase) UpdateCommentContByAgentIds ¶
func (uc *ArticleUsecase) UpdateCommentContByAgentIds(ctx context.Context) error
UpdateCommentContByAgentIds 更新评论总数
type ArticleVisitorDO ¶
type ArticleVisitorRepo ¶
type ArticleVisitorRepo interface {
Save(context.Context, *ArticleVisitorDO) (*ArticleVisitorDO, error)
}
type ArticleVisitorUsecase ¶
type ArticleVisitorUsecase struct {
// contains filtered or unexported fields
}
func NewArticleVisitorUsecase ¶
func NewArticleVisitorUsecase(repo ArticleVisitorRepo, logger log.Logger) *ArticleVisitorUsecase
func (*ArticleVisitorUsecase) Create ¶
func (uc *ArticleVisitorUsecase) Create(ctx context.Context, g *ArticleVisitorDO) (*ArticleVisitorDO, error)
type CasbinRuleDO ¶
type CasbinRuleRepo ¶
type CasbinRuleRepo interface {
SaveRoleForUser(ctx context.Context, user string, roles []string, domain ...string) (bool, error)
UpdateRoleForUser(ctx context.Context, user string, roles []string, domain ...string) (bool, error)
SavePolicies(ctx context.Context, rules [][]string) (bool, error)
CleanPolicy(ctx context.Context, p ...string) (bool, error)
UpdatePolicies(ctx context.Context, oldApi, newApi *ApiDO) (bool, error)
DeleteRoleForUser(ctx context.Context, user string, domain ...string) (bool, error)
}
type CasbinRuleUsecase ¶
type CasbinRuleUsecase struct {
// contains filtered or unexported fields
}
func NewCasbinRuleUsecase ¶
func NewCasbinRuleUsecase(repo CasbinRuleRepo, logger log.Logger) *CasbinRuleUsecase
type CategoryDO ¶
type CategoryDO struct {
metaV1.ObjectMeta
Name string
Identifier string
Description string
ParentId uint64
Children []*CategoryDO // 子集
}
type CategoryDOList ¶
type CategoryDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*CategoryDO `json:"items"`
}
type CategoryDOListOption ¶
type CategoryDOListOption struct {
metaV1.ListOptions `json:"page"`
CategoryDO `json:"item"`
}
type CategoryRepo ¶
type CategoryRepo interface {
Save(context.Context, *CategoryDO) (*CategoryDO, error)
Update(context.Context, *CategoryDO) (*CategoryDO, error)
//Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*CategoryDO, error)
CountByIdentifier(ctx context.Context, str string) (int64, error)
ListAll(c context.Context, opts CategoryDOListOption) (*CategoryDOList, error)
ListAllWithChildren(c context.Context, opts CategoryDOListOption) (*CategoryDOList, error)
FindByIdentifier(ctx context.Context, name string) (*CategoryDO, error)
}
type CategoryUsecase ¶
type CategoryUsecase struct {
// contains filtered or unexported fields
}
func NewCategoryUsecase ¶
func NewCategoryUsecase(repo CategoryRepo, logger log.Logger) *CategoryUsecase
func (*CategoryUsecase) Create ¶
func (uc *CategoryUsecase) Create(ctx context.Context, obj *CategoryDO) (*CategoryDO, error)
func (*CategoryUsecase) DeleteList ¶
func (uc *CategoryUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除用户
func (*CategoryUsecase) FindByIdentifier ¶
func (uc *CategoryUsecase) FindByIdentifier(ctx context.Context, name string) (*CategoryDO, error)
func (*CategoryUsecase) FindOneByID ¶
func (uc *CategoryUsecase) FindOneByID(ctx context.Context, id uint64) (*CategoryDO, error)
FindOneByID 根据ID查询用户信息
func (*CategoryUsecase) ListAll ¶
func (uc *CategoryUsecase) ListAll(ctx context.Context, opts CategoryDOListOption) (*CategoryDOList, error)
ListAll 批量查询
func (*CategoryUsecase) Update ¶
func (uc *CategoryUsecase) Update(ctx context.Context, obj *CategoryDO) (*CategoryDO, error)
Update 更新
type CommentAgentDO ¶
type CommentAgentDO struct {
metaV1.ObjectMeta
ObjId uint64
ObjType int32
MemberId uint64
Count int32
RootCount int32
AllCount int32
Attrs string
}
CommentAgentDO is a CommentAgentDO model.
type CommentAgentRepo ¶
type CommentAgentRepo interface {
Save(context.Context, *CommentAgentDO) (*CommentAgentDO, error)
Update(context.Context, *CommentAgentDO) (*CommentAgentDO, error)
FindByID(context.Context, uint64) (*CommentAgentDO, error)
UpdateAddCountById(context.Context, uint64, bool) error
UpdateMinusCountById(context.Context, uint64, bool) error
}
CommentAgentRepo is a Greater repo.
type CommentAgentUsecase ¶
type CommentAgentUsecase struct {
// contains filtered or unexported fields
}
CommentIndexUsecase is a CommentAgentDO usecase.
func NewCommentAgentUsecase ¶
func NewCommentAgentUsecase(repo CommentAgentRepo, logger log.Logger) *CommentAgentUsecase
NewCommentAgentUsecase new a CommentAgentDO usecase.
func (*CommentAgentUsecase) CreateCommentAgent ¶
func (uc *CommentAgentUsecase) CreateCommentAgent(ctx context.Context, g *CommentAgentDO) (*CommentAgentDO, error)
CreateCommentAgent creates a CommentAgentDO, and returns the new CommentAgentDO.
func (*CommentAgentUsecase) FindByID ¶
func (uc *CommentAgentUsecase) FindByID(ctx context.Context, id uint64) (*CommentAgentDO, error)
FindByID 根据ID查询
func (*CommentAgentUsecase) Update ¶
func (uc *CommentAgentUsecase) Update(ctx context.Context, g *CommentAgentDO) (*CommentAgentDO, error)
Update 更新
func (*CommentAgentUsecase) UpdateAddCountById ¶
func (*CommentAgentUsecase) UpdateMinusCountById ¶
type CommentContentDO ¶
type CommentContentDO struct {
metaV1.ObjectMeta
AgentId uint64
MemberId uint64
AtMemberIds string
Agent string
MemberName string
Ip string
Email string
Url string
RootId uint64
Content string
Attrs string
ParentUserName string
ObjTitle string
ObjLink string
Avatar string
Count int32
RootCount int32
EmailState int32
Children []*CommentContentDO
}
type CommentContentDOList ¶
type CommentContentDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*CommentContentDO `json:"items"`
}
type CommentContentDOListOption ¶
type CommentContentDOListOption struct {
metaV1.ListOptions `json:"page"`
CommentContentDO `json:"item"`
IsWeb bool
IsChild bool
}
type CommentContentRepo ¶
type CommentContentRepo interface {
Save(context.Context, *CommentContentDO) (*CommentContentDO, error)
Update(context.Context, *CommentContentDO) (*CommentContentDO, error)
UpdaeStateByIDs(context.Context, []uint64, int) error
UpdaeCommentById(context.Context, uint64, string) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*CommentContentDO, error)
FindParentByID(context.Context, uint64) (*CommentContentDO, error)
ListAll(context.Context, CommentContentDOListOption) (*CommentContentDOList, error)
CountByState(context.Context, int) (int64, error)
UpdaeEmailStateById(context.Context, uint64, int32) error
FindAllByParentID(context.Context, uint64, int) ([]*CommentContentDO, error)
}
CommentAgentRepo is a Greater repo.
type CommentContentUsecase ¶
type CommentContentUsecase struct {
// contains filtered or unexported fields
}
CommentContentUsecase is a CommentAgentDO usecase.
func NewCommentContentUsecase ¶
func NewCommentContentUsecase(repo CommentContentRepo, logger log.Logger, au *ArticleUsecase, ci *CommentIndexUsecase, uu *UserUsecase, ) *CommentContentUsecase
NewCommentContentUsecase new a CommentContentDO usecase.
func (*CommentContentUsecase) CountAll ¶
func (uc *CommentContentUsecase) CountAll(ctx context.Context) *CommentCount
func (*CommentContentUsecase) CreateCommentContent ¶
func (uc *CommentContentUsecase) CreateCommentContent(ctx context.Context, g *CommentContentDO) (*CommentContentDO, error)
CreateCommentContent creates a CommentContentDO, and returns the new CommentContentDO.
func (*CommentContentUsecase) DeleteList ¶
func (uc *CommentContentUsecase) DeleteList(ctx context.Context, ids []uint64) error
func (*CommentContentUsecase) FindAllByParentID ¶
func (uc *CommentContentUsecase) FindAllByParentID(ctx context.Context, id uint64, size int) ([]*CommentContentDO, error)
func (*CommentContentUsecase) FindByID ¶
func (uc *CommentContentUsecase) FindByID(ctx context.Context, id uint64) (*CommentContentDO, error)
FindByID 根据ID查询
func (*CommentContentUsecase) ListAll ¶
func (uc *CommentContentUsecase) ListAll(ctx context.Context, opts CommentContentDOListOption) (*CommentContentDOList, error)
func (*CommentContentUsecase) UpdaeCommentById ¶
func (*CommentContentUsecase) UpdaeEmailStateById ¶
func (*CommentContentUsecase) Update ¶
func (uc *CommentContentUsecase) Update(ctx context.Context, g *CommentContentDO) (*CommentContentDO, error)
Update 更新
func (*CommentContentUsecase) UpdateStateByIDs ¶
type CommentCount ¶
type CommentDOList ¶
type CommentDOList struct {
metaV1.ListMeta
Agent *CommentAgentDO
Items []*CommentContentDO
}
type CommentIndexDO ¶
type CommentIndexRepo ¶
type CommentIndexRepo interface {
Save(context.Context, *CommentIndexDO) (*CommentIndexDO, error)
Update(context.Context, *CommentIndexDO) (*CommentIndexDO, error)
UpdaeStateByIDs(context.Context, []uint64, int) error
UpdateAddCountById(context.Context, uint64, bool) error
UpdateMinusCountById(context.Context, uint64, bool) error
FindByID(context.Context, uint64) (*CommentIndexDO, error)
FindAllByParentID(context.Context, uint64) ([]*CommentIndexDO, error)
DeleteList(c context.Context, uids []uint64) error
UpdateObjIdByAgentIds(context.Context) error
}
CommentAgentRepo is a Greater repo.
type CommentIndexUsecase ¶
type CommentIndexUsecase struct {
// contains filtered or unexported fields
}
CommentIndexUsecase is a CommentAgentDO usecase.
func NewCommentIndexUsecase ¶
func NewCommentIndexUsecase(repo CommentIndexRepo, logger log.Logger) *CommentIndexUsecase
NewCommentIndexUsecase new a CommentIndexDO usecase.
func (*CommentIndexUsecase) CreateCommentIndex ¶
func (uc *CommentIndexUsecase) CreateCommentIndex(ctx context.Context, g *CommentIndexDO) (*CommentIndexDO, error)
CreateCommentIndex creates a CommentIndexDO, and returns the new CommentIndexDO.
func (*CommentIndexUsecase) CreateCommentIndexByContent ¶
func (uc *CommentIndexUsecase) CreateCommentIndexByContent(ctx context.Context, g *CommentContentDO) (*CommentIndexDO, error)
func (*CommentIndexUsecase) DeleteList ¶
func (uc *CommentIndexUsecase) DeleteList(ctx context.Context, ids []uint64) error
func (*CommentIndexUsecase) FindAllByParentID ¶
func (uc *CommentIndexUsecase) FindAllByParentID(ctx context.Context, id uint64) ([]*CommentIndexDO, error)
func (*CommentIndexUsecase) FindByID ¶
func (uc *CommentIndexUsecase) FindByID(ctx context.Context, id uint64) (*CommentIndexDO, error)
FindByID 根据ID查询
func (*CommentIndexUsecase) Update ¶
func (uc *CommentIndexUsecase) Update(ctx context.Context, g *CommentIndexDO) (*CommentIndexDO, error)
Update 更新
func (*CommentIndexUsecase) UpdateAddCountById ¶
func (*CommentIndexUsecase) UpdateMinusCountById ¶
func (*CommentIndexUsecase) UpdateObjIdByAgentIds ¶
func (uc *CommentIndexUsecase) UpdateObjIdByAgentIds(ctx context.Context) error
func (*CommentIndexUsecase) UpdateStateByIDs ¶
type CommentUsecase ¶
type CommentUsecase struct {
// contains filtered or unexported fields
}
func NewCommentUsecase ¶
func NewCommentUsecase(logger log.Logger, ca *CommentAgentUsecase, ci *CommentIndexUsecase, uu *UserUsecase, au *ArticleUsecase, cc *CommentContentUsecase, site *SiteConfigUsecase, ) *CommentUsecase
func (*CommentUsecase) CreateComment ¶
func (uc *CommentUsecase) CreateComment(ctx context.Context, g *CommentDO) (*CommentContentDO, error)
CreateComment 新增评论
func (*CommentUsecase) CreateCommentWeb ¶
func (uc *CommentUsecase) CreateCommentWeb(ctx context.Context, g *CommentDO, conf *conf.Qycms) (*CommentContentDO, error)
CreateCommentWeb 新增评论
func (*CommentUsecase) DeleteList ¶
func (uc *CommentUsecase) DeleteList(ctx context.Context, ids []uint64) error
func (*CommentUsecase) EmailToNotSend ¶
func (uc *CommentUsecase) EmailToNotSend(ctx context.Context, conf *conf.Qycms)
func (*CommentUsecase) EmailToSend ¶
func (uc *CommentUsecase) EmailToSend(ctx context.Context, items []*CommentContentDO, conf *conf.Qycms, siteInfo map[string]string)
func (*CommentUsecase) ListAllForWeb ¶
func (uc *CommentUsecase) ListAllForWeb(ctx context.Context, opts CommentContentDOListOption) *CommentDOList
func (*CommentUsecase) ListAllNeedEmail ¶
func (uc *CommentUsecase) ListAllNeedEmail(ctx context.Context, opts CommentContentDOListOption) *CommentDOList
func (*CommentUsecase) UpdateAddCount ¶
func (uc *CommentUsecase) UpdateAddCount(ctx context.Context, idx *CommentIndexDO)
func (*CommentUsecase) UpdateCommentComent ¶
func (uc *CommentUsecase) UpdateCommentComent(ctx context.Context, g *CommentDO) error
UpdateCommentComent 更新评论内容
func (*CommentUsecase) UpdateCommentState ¶
UpdateCommentState 更新状态
func (*CommentUsecase) UpdateContentCountAndObjIds ¶
func (uc *CommentUsecase) UpdateContentCountAndObjIds(ctx context.Context) error
UpdateContentCountAndObjIds 更新文章的评论数和评论的objId等
func (*CommentUsecase) UpdateMinusCount ¶
func (uc *CommentUsecase) UpdateMinusCount(ctx context.Context, idx *CommentIndexDO)
type FileLibConfigDO ¶
type FileLibConfigRepo ¶
type FileLibConfigRepo interface {
Save(ctx context.Context, data *FileLibConfigDO) (*FileLibConfigDO, error)
Update(context.Context, *FileLibConfigDO) (*FileLibConfigDO, error)
FindByID(context.Context, uint64) (*FileLibConfigDO, error)
FindByTypeId(context.Context, uint64) (*FileLibConfigDO, error)
SetTokenByTypeId(context.Context, uint64, string) (bool, error)
GetTokenByTypeId(context.Context, uint64) (string, error)
}
type FileLibConfigUsecase ¶
type FileLibConfigUsecase struct {
// contains filtered or unexported fields
}
func NewFileLibConfigUsecase ¶
func NewFileLibConfigUsecase(repo FileLibConfigRepo, logger log.Logger) *FileLibConfigUsecase
func (*FileLibConfigUsecase) FindById ¶
func (uc *FileLibConfigUsecase) FindById(ctx context.Context, id uint64) (*FileLibConfigDO, error)
func (*FileLibConfigUsecase) FindByTypeId ¶
func (uc *FileLibConfigUsecase) FindByTypeId(ctx context.Context, id uint64) (*FileLibConfigDO, error)
func (*FileLibConfigUsecase) GetTokenByTypeId ¶
func (*FileLibConfigUsecase) SaveOrUpdate ¶
func (uc *FileLibConfigUsecase) SaveOrUpdate(ctx context.Context, data *FileLibConfigDO) (*FileLibConfigDO, error)
func (*FileLibConfigUsecase) SetTokenByTypeId ¶
type FileLibDO ¶
type FileLibDO struct {
metaV1.ObjectMeta
OriginFileName string // 原始名称
Fname string // 文件名
Fsize uint64 // 文件大小
Extention string // 文件扩展名
MimeType string // 资源的 MIME 类型
Fhash string // 文件的HASH值
Fmd5 string // 文件md5值
RelativePath string // 通过浏览器访问的相对路径
Ftype int // 文件的存储类型,0为普通存储,1为低频存储
EndUser string // 文件上传时设置的endUser 七牛
Domain string // 域名
DefUrl string // 文件链接
}
type FileLibDOList ¶
type FileLibDOListOption ¶
type FileLibDOListOption struct {
metaV1.ListOptions `json:"page"`
FileLibDO `json:"item"`
}
type FileLibRepo ¶
type FileLibRepo interface {
Save(ctx context.Context, data *FileLibDO) (*FileLibDO, error)
Update(context.Context, *FileLibDO) (*FileLibDO, error)
FindByMd5(context.Context, string) (*FileLibDO, error)
CountByMd5(ctx context.Context, fmd5 string) (int64, error)
DeleteList(c context.Context, uids []uint64) error
ListAll(c context.Context, opts FileLibDOListOption) (*FileLibDOList, error)
}
type FileLibTypeDO ¶
type FileLibTypeDO struct {
metaV1.ObjectMeta
Name string
Identifier int
Ftype string
}
type FileLibTypeDOList ¶
type FileLibTypeDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*FileLibTypeDO `json:"items"`
}
type FileLibTypeDOListOption ¶
type FileLibTypeDOListOption struct {
metaV1.ListOptions `json:"page"`
FileLibTypeDO `json:"item"`
}
type FileLibTypeRepo ¶
type FileLibTypeRepo interface {
Save(ctx context.Context, data *FileLibTypeDO) (*FileLibTypeDO, error)
Update(context.Context, *FileLibTypeDO) (*FileLibTypeDO, error)
DeleteList(c context.Context, uids []uint64) error
ListAll(c context.Context, opts FileLibTypeDOListOption) (*FileLibTypeDOList, error)
}
type FileLibTypeUsecase ¶
type FileLibTypeUsecase struct {
// contains filtered or unexported fields
}
func NewFileLibTypeUsecase ¶
func NewFileLibTypeUsecase(repo FileLibTypeRepo, logger log.Logger) *FileLibTypeUsecase
NewFileLibTypeUsecase new a UserDO usecase.
func (*FileLibTypeUsecase) DeleteList ¶
func (uc *FileLibTypeUsecase) DeleteList(ctx context.Context, ids []uint64) error
func (*FileLibTypeUsecase) ListAll ¶
func (uc *FileLibTypeUsecase) ListAll(ctx context.Context, opts FileLibTypeDOListOption) (*FileLibTypeDOList, error)
func (*FileLibTypeUsecase) Save ¶
func (uc *FileLibTypeUsecase) Save(ctx context.Context, data *FileLibTypeDO) (*FileLibTypeDO, error)
func (*FileLibTypeUsecase) Update ¶
func (uc *FileLibTypeUsecase) Update(ctx context.Context, data *FileLibTypeDO) (*FileLibTypeDO, error)
type FileLibUsecase ¶
type FileLibUsecase struct {
// contains filtered or unexported fields
}
func NewFileLibUsecase ¶
func NewFileLibUsecase(repo FileLibRepo, logger log.Logger) *FileLibUsecase
NewFileLibUsecase new a UserDO usecase.
func (*FileLibUsecase) CountByMd5 ¶
func (uc *FileLibUsecase) CountByMd5(ctx context.Context, fmd5 string) int64
func (*FileLibUsecase) DeleteList ¶
func (uc *FileLibUsecase) DeleteList(ctx context.Context, ids []uint64) error
func (*FileLibUsecase) ListAll ¶
func (uc *FileLibUsecase) ListAll(ctx context.Context, opts FileLibDOListOption) (*FileLibDOList, error)
type LinkDOList ¶
type LinkDOListOption ¶
type LinkDOListOption struct {
metaV1.ListOptions `json:"page"`
LinkDO `json:"item"`
}
type LinkRepo ¶
type LinkRepo interface {
Save(context.Context, *LinkDO) (*LinkDO, error)
Update(context.Context, *LinkDO) (*LinkDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*LinkDO, error)
ListAll(c context.Context, opts LinkDOListOption) (*LinkDOList, error)
FindIndexLinkAllWitchCache(context.Context) ([]*LinkDO, error)
FindAllWitchCache(context.Context) ([]*LinkDO, error)
}
type LinkUsecase ¶
type LinkUsecase struct {
// contains filtered or unexported fields
}
func NewLinkUsecase ¶
func NewLinkUsecase(repo LinkRepo, logger log.Logger) *LinkUsecase
func (*LinkUsecase) Delete ¶
func (uc *LinkUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除
func (*LinkUsecase) DeleteList ¶
func (uc *LinkUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除
func (*LinkUsecase) FindAllWitchCache ¶
func (uc *LinkUsecase) FindAllWitchCache(ctx context.Context) ([]*LinkDO, error)
func (*LinkUsecase) FindIndexLinkAllWitchCache ¶
func (uc *LinkUsecase) FindIndexLinkAllWitchCache(ctx context.Context) ([]*LinkDO, error)
func (*LinkUsecase) FindOneByID ¶
FindOneByID 根据ID查询信息
func (*LinkUsecase) ListAll ¶
func (uc *LinkUsecase) ListAll(ctx context.Context, opts LinkDOListOption) (*LinkDOList, error)
ListAll 批量查询
type MenusAdminDO ¶
type MenusAdminDO struct {
metaV1.ObjectMeta
Name string // 展示名称
BreadcrumbName string // 标签页名称
Identifier string // 路由名称
ParentId uint64 // 父菜单ID
Icon string // Icon图标
MType int // 路由类型
Path string // 路由 path
Redirect string // 路由重定向
Component string // 对应前端文件路径
Sort int // 排序标记
Children []*MenusAdminDO // 子集
HasChildren bool // 子集
}
type MenusAdminDOList ¶
type MenusAdminDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*MenusAdminDO `json:"items"`
}
type MenusAdminDOListOption ¶
type MenusAdminDOListOption struct {
metaV1.ListOptions `json:"page"`
MenusAdminDO `json:"item"`
}
type MenusAdminRepo ¶
type MenusAdminRepo interface {
Save(context.Context, *MenusAdminDO) (*MenusAdminDO, error)
Update(context.Context, *MenusAdminDO) (*MenusAdminDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*MenusAdminDO, error)
//FindByKey(c context.Context, key string) (*po.MenusAdminPO, error)
ListAll(c context.Context, opts MenusAdminDOListOption) (*MenusAdminDOList, error)
FindAllByRoleID(ctx context.Context, rid uint64) ([]*MenusAdminDO, error)
}
type MenusAdminUsecase ¶
type MenusAdminUsecase struct {
// contains filtered or unexported fields
}
func NewMenusAdminUsecase ¶
func NewMenusAdminUsecase(repo MenusAdminRepo, logger log.Logger) *MenusAdminUsecase
func (*MenusAdminUsecase) Create ¶
func (uc *MenusAdminUsecase) Create(ctx context.Context, obj *MenusAdminDO) (*MenusAdminDO, error)
func (*MenusAdminUsecase) Delete ¶
func (uc *MenusAdminUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除用户
func (*MenusAdminUsecase) DeleteList ¶
func (uc *MenusAdminUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除用户
func (*MenusAdminUsecase) FindAllByRoleID ¶
func (uc *MenusAdminUsecase) FindAllByRoleID(ctx context.Context, rid uint64) ([]*MenusAdminDO, error)
func (*MenusAdminUsecase) FindOneByID ¶
func (uc *MenusAdminUsecase) FindOneByID(ctx context.Context, id uint64) (*MenusAdminDO, error)
FindOneByID 根据ID查询用户信息
func (*MenusAdminUsecase) ListAll ¶
func (uc *MenusAdminUsecase) ListAll(ctx context.Context, opts MenusAdminDOListOption) (*MenusAdminDOList, error)
ListAll 批量查询
func (*MenusAdminUsecase) ListAllChildren ¶
func (uc *MenusAdminUsecase) ListAllChildren(ctx context.Context, opts MenusAdminDOListOption) (*MenusAdminDOList, error)
func (*MenusAdminUsecase) Update ¶
func (uc *MenusAdminUsecase) Update(ctx context.Context, obj *MenusAdminDO) (*MenusAdminDO, error)
Update 更新用户
type MenusAgentDO ¶
type MenusAgentDO struct {
metaV1.ObjectMeta
Name string
Ftype string
}
type MenusAgentDOList ¶
type MenusAgentDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*MenusAgentDO `json:"items"`
}
type MenusAgentDOListOption ¶
type MenusAgentDOListOption struct {
metaV1.ListOptions `json:"page"`
MenusAgentDO `json:"item"`
}
type MenusAgentRepo ¶
type MenusAgentRepo interface {
Save(context.Context, *MenusAgentDO) (*MenusAgentDO, error)
Update(context.Context, *MenusAgentDO) (*MenusAgentDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*MenusAgentDO, error)
ListAll(c context.Context, opts MenusAgentDOListOption) (*MenusAgentDOList, error)
}
type MenusAgentUsecase ¶
type MenusAgentUsecase struct {
// contains filtered or unexported fields
}
func NewMenusAgentUsecase ¶
func NewMenusAgentUsecase(repo MenusAgentRepo, logger log.Logger) *MenusAgentUsecase
func (*MenusAgentUsecase) Create ¶
func (uc *MenusAgentUsecase) Create(ctx context.Context, obj *MenusAgentDO) (*MenusAgentDO, error)
func (*MenusAgentUsecase) Delete ¶
func (uc *MenusAgentUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除
func (*MenusAgentUsecase) DeleteList ¶
func (uc *MenusAgentUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除
func (*MenusAgentUsecase) FindOneByID ¶
func (uc *MenusAgentUsecase) FindOneByID(ctx context.Context, id uint64) (*MenusAgentDO, error)
FindOneByID 根据ID查询信息
func (*MenusAgentUsecase) ListAll ¶
func (uc *MenusAgentUsecase) ListAll(ctx context.Context, opts MenusAgentDOListOption) (*MenusAgentDOList, error)
ListAll 批量查询
func (*MenusAgentUsecase) Update ¶
func (uc *MenusAgentUsecase) Update(ctx context.Context, obj *MenusAgentDO) (*MenusAgentDO, error)
Update 更新
type MenusDOList ¶
type MenusDOListOption ¶
type MenusDOListOption struct {
metaV1.ListOptions `json:"page"`
MenusDO `json:"item"`
}
type MenusRepo ¶
type MenusRepo interface {
Save(context.Context, *MenusDO) (*MenusDO, error)
Update(context.Context, *MenusDO) (*MenusDO, error)
Delete(context.Context, uint64) error
DeleteList(context.Context, []uint64, uint64) error
FindByID(context.Context, uint64) (*MenusDO, error)
ListAll(c context.Context, opts MenusDOListOption) (*MenusDOList, error)
ListAllWithChildren(c context.Context, opts MenusDOListOption) (*MenusDOList, error)
}
type MenusUsecase ¶
type MenusUsecase struct {
// contains filtered or unexported fields
}
func NewMenusUsecase ¶
func NewMenusUsecase(repo MenusRepo, logger log.Logger) *MenusUsecase
func (*MenusUsecase) Delete ¶
func (uc *MenusUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除
func (*MenusUsecase) DeleteList ¶
DeleteList 根据ID批量删除
func (*MenusUsecase) FindOneByID ¶
FindOneByID 根据ID查询信息
func (*MenusUsecase) ListAll ¶
func (uc *MenusUsecase) ListAll(ctx context.Context, opts MenusDOListOption) (*MenusDOList, error)
ListAll 批量查询
type RoleApiRepo ¶
type RoleApiUsecase ¶
type RoleApiUsecase struct {
// contains filtered or unexported fields
}
func NewRoleApiUsecase ¶
func NewRoleApiUsecase(repo RoleApiRepo, cabinRepo CasbinRuleRepo, logger log.Logger) *RoleApiUsecase
NewRoleApiUsecase new a UserDO usecase.
func (*RoleApiUsecase) FindApiIdsByRoleId ¶
func (*RoleApiUsecase) SaveApisForRole ¶
func (uc *RoleApiUsecase) SaveApisForRole(ctx context.Context, role *RoleDO) error
func (*RoleApiUsecase) UpdateApisForRole ¶
func (uc *RoleApiUsecase) UpdateApisForRole(ctx context.Context, role *RoleDO) error
type RoleDOList ¶
type RoleDOListOption ¶
type RoleDOListOption struct {
metaV1.ListOptions `json:"page"`
RoleDO `json:"item"`
}
type RoleMenusDO ¶
type RoleMenusRepo ¶
type RoleMenusRepo interface {
CreateInBatches(ctx context.Context, userRoles []*RoleMenusDO) error
UpdateInBatches(ctx context.Context, userRoles []*RoleMenusDO) error
DeleteByRoleId(ctx context.Context, roleId uint64) error
FindMenusIdsByRoleId(ctx context.Context, roleId uint64) ([]uint64, error)
}
type RoleMenusUsecase ¶
type RoleMenusUsecase struct {
// contains filtered or unexported fields
}
func NewRoleMenusUsecase ¶
func NewRoleMenusUsecase(repo RoleMenusRepo, logger log.Logger) *RoleMenusUsecase
NewRoleMenusUsecase new a UserDO usecase.
func (*RoleMenusUsecase) FindMenusIdsByRoleId ¶
func (*RoleMenusUsecase) SaveMenusForRole ¶
func (uc *RoleMenusUsecase) SaveMenusForRole(ctx context.Context, role *RoleDO) error
func (*RoleMenusUsecase) UpdateRoleForUser ¶
func (uc *RoleMenusUsecase) UpdateRoleForUser(ctx context.Context, role *RoleDO) error
type RoleRepo ¶
type RoleRepo interface {
Save(context.Context, *RoleDO) (*RoleDO, error)
Update(context.Context, *RoleDO) (*RoleDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*po.RolePO, error)
FindByKey(c context.Context, key string) (*po.RolePO, error)
ListAll(c context.Context, opts RoleDOListOption) (*po.RolePOList, error)
FindByUserId(c context.Context, userId uint64) ([]*RoleDO, error)
}
type RoleUsecase ¶
type RoleUsecase struct {
// contains filtered or unexported fields
}
func NewRoleUsecase ¶
func NewRoleUsecase(repo RoleRepo, cabinRepo CasbinRuleRepo, roleMenus *RoleMenusUsecase, ra *RoleApiUsecase, logger log.Logger) *RoleUsecase
func (*RoleUsecase) Delete ¶
func (uc *RoleUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除
func (*RoleUsecase) DeleteList ¶
func (uc *RoleUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除
func (*RoleUsecase) FindByUserId ¶
func (*RoleUsecase) FindOneByID ¶
FindOneByID 根据ID查询信息
func (*RoleUsecase) ListAll ¶
func (uc *RoleUsecase) ListAll(ctx context.Context, opts RoleDOListOption) (*RoleDOList, error)
ListAll 批量查询
type ShortLinkDO ¶
type ShortLinkDO struct {
metaV1.ObjectMeta
Url string
Description string
Identifier string
}
type ShortLinkDOList ¶
type ShortLinkDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*ShortLinkDO `json:"items"`
}
type ShortLinkDOListOption ¶
type ShortLinkDOListOption struct {
metaV1.ListOptions `json:"page"`
ShortLinkDO `json:"item"`
}
type ShortLinkRepo ¶
type ShortLinkRepo interface {
Save(context.Context, *ShortLinkDO) (*ShortLinkDO, error)
Update(context.Context, *ShortLinkDO) (*ShortLinkDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*ShortLinkDO, error)
ListAll(c context.Context, opts ShortLinkDOListOption) (*ShortLinkDOList, error)
FindAllWitchCache(context.Context) ([]*ShortLinkDO, error)
}
type ShortLinkUsecase ¶
type ShortLinkUsecase struct {
// contains filtered or unexported fields
}
func NewShortLinkUsecase ¶
func NewShortLinkUsecase(repo ShortLinkRepo, logger log.Logger) *ShortLinkUsecase
func (*ShortLinkUsecase) Create ¶
func (uc *ShortLinkUsecase) Create(ctx context.Context, obj *ShortLinkDO) (*ShortLinkDO, error)
func (*ShortLinkUsecase) Delete ¶
func (uc *ShortLinkUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除
func (*ShortLinkUsecase) DeleteList ¶
func (uc *ShortLinkUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除
func (*ShortLinkUsecase) FindAllWitchCache ¶
func (uc *ShortLinkUsecase) FindAllWitchCache(ctx context.Context) ([]*ShortLinkDO, error)
func (*ShortLinkUsecase) FindOneByID ¶
func (uc *ShortLinkUsecase) FindOneByID(ctx context.Context, id uint64) (*ShortLinkDO, error)
FindOneByID 根据ID查询信息
func (*ShortLinkUsecase) ListAll ¶
func (uc *ShortLinkUsecase) ListAll(ctx context.Context, opts ShortLinkDOListOption) (*ShortLinkDOList, error)
ListAll 批量查询
func (*ShortLinkUsecase) Update ¶
func (uc *ShortLinkUsecase) Update(ctx context.Context, obj *ShortLinkDO) (*ShortLinkDO, error)
Update 更新
type SiteConfigDO ¶
type SiteConfigDOList ¶
type SiteConfigDOList struct {
metaV1.ListMeta `json:",inline"`
Items []*SiteConfigDO `json:"items"`
}
type SiteConfigDOListOption ¶
type SiteConfigDOListOption struct {
metaV1.ListOptions `json:"page"`
SiteConfigDO `json:"item"`
Types string
}
type SiteConfigRepo ¶
type SiteConfigRepo interface {
Save(ctx context.Context, data *SiteConfigDO) (*SiteConfigDO, error)
Update(context.Context, *SiteConfigDO) (*SiteConfigDO, error)
UpdateInBatches(context.Context, []*SiteConfigDO) error
GetValueByKey(key string) (any, bool)
ListAll(c context.Context, opts SiteConfigDOListOption) ([]*SiteConfigDO, error)
InitLocalSiteConfigCache(ctx context.Context)
}
type SiteConfigUsecase ¶
type SiteConfigUsecase struct {
// contains filtered or unexported fields
}
func NewSiteConfigUsecase ¶
func NewSiteConfigUsecase(repo SiteConfigRepo, logger log.Logger) *SiteConfigUsecase
NewSiteConfigUsecase new a UserDO usecase.
func (*SiteConfigUsecase) FindValueByKey ¶
func (uc *SiteConfigUsecase) FindValueByKey(ctx context.Context, key string) string
func (*SiteConfigUsecase) ListAll ¶
func (uc *SiteConfigUsecase) ListAll(ctx context.Context, opts SiteConfigDOListOption) ([]*SiteConfigDO, error)
func (*SiteConfigUsecase) Save ¶
func (uc *SiteConfigUsecase) Save(ctx context.Context, data *SiteConfigDO) (*SiteConfigDO, error)
func (*SiteConfigUsecase) Update ¶
func (uc *SiteConfigUsecase) Update(ctx context.Context, data *SiteConfigDO) (*SiteConfigDO, error)
func (*SiteConfigUsecase) UpdateInBatches ¶
func (uc *SiteConfigUsecase) UpdateInBatches(ctx context.Context, data []*SiteConfigDO) error
type SiteMapUsecase ¶
type SiteMapUsecase struct {
// contains filtered or unexported fields
}
func NewSiteMapUsecase ¶
func NewSiteMapUsecase(logger log.Logger, site *SiteConfigUsecase, au *ArticleUsecase, ) *SiteMapUsecase
func (*SiteMapUsecase) GeneratorMap ¶
func (uc *SiteMapUsecase) GeneratorMap(ctx context.Context, path string) error
GeneratorMap 生成地图 TODO: 后期考虑文件的问题
type TagsDO ¶
type TagsDO struct {
metaV1.ObjectMeta
Name string
Identifier string
Description string
}
type TagsDOList ¶
type TagsDOListOption ¶
type TagsDOListOption struct {
metaV1.ListOptions `json:"page"`
TagsDO `json:"item"`
}
type TagsRepo ¶
type TagsRepo interface {
Save(context.Context, *TagsDO) (*TagsDO, error)
Update(context.Context, *TagsDO) (*TagsDO, error)
//Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*TagsDO, error)
FindOneByName(context.Context, string) (*TagsDO, error)
CountByIdentifier(ctx context.Context, str string) (int64, error)
ListAll(c context.Context, opts TagsDOListOption) (*TagsDOList, error)
FindAllByArticleID(ctx context.Context, articleId uint64) ([]*TagsDO, error)
FindOneByIdentifier(ctx context.Context, name string) (*TagsDO, error)
}
type TagsUsecase ¶
type TagsUsecase struct {
// contains filtered or unexported fields
}
func NewTagsUsecase ¶
func NewTagsUsecase(repo TagsRepo, logger log.Logger) *TagsUsecase
func (*TagsUsecase) DeleteList ¶
func (uc *TagsUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除用户
func (*TagsUsecase) FindAllByArticleID ¶
func (*TagsUsecase) FindOneByID ¶
FindOneByID 根据ID查询用户信息
func (*TagsUsecase) FindOneByIdentifier ¶
func (*TagsUsecase) FindOneByName ¶
func (*TagsUsecase) ListAll ¶
func (uc *TagsUsecase) ListAll(ctx context.Context, opts TagsDOListOption) (*TagsDOList, error)
ListAll 批量查询
type UserDO ¶
type UserDO struct {
metaV1.ObjectMeta
Username string
Nickname string
Avatar string
Password string
Salt string
Email string
Phone string
AdminFlag bool
Roles []*RoleDO
}
UserDO is a UserDO model.
type UserDOList ¶
type UserDOListOption ¶
type UserDOListOption struct {
metaV1.ListOptions `json:"page"`
UserDO `json:"item"`
}
type UserInfoDO ¶
type UserRepo ¶
type UserRepo interface {
Save(context.Context, *UserDO) (*UserDO, error)
Update(context.Context, *UserDO) (*UserDO, error)
Delete(context.Context, uint64) error
DeleteList(c context.Context, uids []uint64) error
FindByID(context.Context, uint64) (*UserDO, error)
FindByUsername(c context.Context, username string) (*UserDO, error)
ListAll(c context.Context, opts UserDOListOption) (*UserDOList, error)
ChangePassword(c context.Context, user *UserDO) error
}
UserRepo is a Greater repo.
type UserRoleDO ¶
type UserRoleRepo ¶
type UserRoleUsecase ¶
type UserRoleUsecase struct {
// contains filtered or unexported fields
}
func NewUserRoleUsecase ¶
func NewUserRoleUsecase(repo UserRoleRepo, cabinRepo CasbinRuleRepo, logger log.Logger) *UserRoleUsecase
NewUserRoleUsecase new a UserDO usecase.
func (*UserRoleUsecase) SaveRoleForUser ¶
func (uc *UserRoleUsecase) SaveRoleForUser(ctx context.Context, user *UserDO) error
func (*UserRoleUsecase) UpdateRoleForUser ¶
func (uc *UserRoleUsecase) UpdateRoleForUser(ctx context.Context, user *UserDO) error
type UserUsecase ¶
type UserUsecase struct {
// contains filtered or unexported fields
}
UserUsecase is a UserDO usecase.
func NewUserUsecase ¶
func NewUserUsecase(repo UserRepo, role *RoleUsecase, userRole *UserRoleUsecase, logger log.Logger) *UserUsecase
NewUserUsecase new a UserDO usecase.
func (*UserUsecase) ChangePassword ¶
func (uc *UserUsecase) ChangePassword(ctx context.Context, user *UserDO) error
func (*UserUsecase) CreateUser ¶
CreateUser creates a UserDO, and returns the new UserDO.
func (*UserUsecase) Delete ¶
func (uc *UserUsecase) Delete(ctx context.Context, id uint64) error
Delete 根据ID删除用户
func (*UserUsecase) DeleteList ¶
func (uc *UserUsecase) DeleteList(ctx context.Context, ids []uint64) error
DeleteList 根据ID批量删除用户
func (*UserUsecase) FindOneByID ¶
FindOneByID 根据ID查询用户信息
func (*UserUsecase) FindOneByUsername ¶
FindOneByUsername 根据用户名查询用户信息
func (*UserUsecase) ListAll ¶
func (uc *UserUsecase) ListAll(ctx context.Context, opts UserDOListOption) (*UserDOList, error)
ListAll 批量查询
func (*UserUsecase) VerifyPassword ¶
func (uc *UserUsecase) VerifyPassword(ctx context.Context, u *UserDO, authConf *conf.Auth) (*UserInfoDO, error)
Source Files
¶
- api.go
- apis_group.go
- article.go
- article_content.go
- article_resource.go
- article_tags.go
- article_visitor.go
- biz.go
- casbin_rule.go
- category.go
- comment.go
- comment_agent.go
- comment_content.go
- comment_index.go
- file_lib.go
- file_lib_config.go
- file_lib_type.go
- link.go
- menus.go
- menus_admin.go
- menus_agent.go
- role.go
- role_api.go
- role_menus_admin.go
- short_link.go
- site_config.go
- site_map_generator.go
- tags.go
- user.go
- user_role.go