db

package
v0.0.0-...-6fd7e0b Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const POST_VIEW_COUNT = "post_viewCount_"

Variables

View Source
var (
	// ErrApiNotFound is api not found.
	ErrResourceNotFound = errors.NotFound("101404A", "测试异常效果")
)

ProviderSet is cdata providers.

Functions

func AutoMigrateTable

func AutoMigrateTable(dbIns *gorm.DB)

AutoMigrateTable 初始化table

func NewApiGroupRepo

func NewApiGroupRepo(data *Data, logger log.Logger) biz.ApiGroupRepo

NewApiGroupRepo .

func NewApiRepo

func NewApiRepo(data *Data, logger log.Logger) biz.ApiRepo

NewApiRepo .

func NewArticleContentRepo

func NewArticleContentRepo(data *Data, logger log.Logger) biz.ArticleContentRepo

NewArticleContentRepo .

func NewArticleRepo

func NewArticleRepo(data *Data, logger log.Logger) biz.ArticleRepo

NewArticleRepo .

func NewArticleResourceRepo

func NewArticleResourceRepo(data *Data, logger log.Logger) biz.ArticleResourceRepo

func NewArticleTagsRepo

func NewArticleTagsRepo(data *Data, logger log.Logger) biz.ArticleTagsRepo

func NewArticleVisitorRepo

func NewArticleVisitorRepo(data *Data, logger log.Logger) biz.ArticleVisitorRepo

func NewCasbinRuleRepo

func NewCasbinRuleRepo(cdata *CasbinData, logger log.Logger) biz.CasbinRuleRepo

func NewCategoryRepo

func NewCategoryRepo(data *Data, logger log.Logger) biz.CategoryRepo

NewCategoryRepo .

func NewCommentAgentRepo

func NewCommentAgentRepo(data *Data, logger log.Logger) biz.CommentAgentRepo

NewCommentAgentRepo .

func NewCommentContentRepo

func NewCommentContentRepo(data *Data, logger log.Logger) biz.CommentContentRepo

NewCommentIndexRepo .

func NewCommentIndexRepo

func NewCommentIndexRepo(data *Data, logger log.Logger) biz.CommentIndexRepo

NewCommentIndexRepo .

func NewFileLibConfigRepo

func NewFileLibConfigRepo(data *Data, logger log.Logger) biz.FileLibConfigRepo

NewFileLibConfigRepo .

func NewFileLibRepo

func NewFileLibRepo(data *Data, logger log.Logger) biz.FileLibRepo

NewFileLibRepo .

func NewFileLibTypeRepo

func NewFileLibTypeRepo(data *Data, logger log.Logger) biz.FileLibTypeRepo

NewFileLibTypeRepo .

func NewLinkRepo

func NewLinkRepo(data *Data, logger log.Logger) biz.LinkRepo

func NewMenusAdminRepo

func NewMenusAdminRepo(data *Data, logger log.Logger) biz.MenusAdminRepo

NewMenusAdminRepo .

func NewMenusAgentRepo

func NewMenusAgentRepo(data *Data, logger log.Logger) biz.MenusAgentRepo

func NewMenusRepo

func NewMenusRepo(data *Data, logger log.Logger) biz.MenusRepo

func NewRoleApiRepo

func NewRoleApiRepo(data *Data, logger log.Logger) biz.RoleApiRepo

func NewRoleMenusRepo

func NewRoleMenusRepo(data *Data, logger log.Logger) biz.RoleMenusRepo

func NewRoleRepo

func NewRoleRepo(data *Data, logger log.Logger) biz.RoleRepo

NewRoleRepo .

func NewShortLinkRepo

func NewShortLinkRepo(data *Data, logger log.Logger) biz.ShortLinkRepo

func NewSiteConfigRepo

func NewSiteConfigRepo(data *Data, logger log.Logger) biz.SiteConfigRepo

NewSiteConfigRepo .

func NewTagsRepo

func NewTagsRepo(data *Data, logger log.Logger) biz.TagsRepo

NewTagsRepo .

func NewUserRepo

func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo

NewUserRepo .

func NewUserRoleRepo

func NewUserRoleRepo(data *Data, logger log.Logger) biz.UserRoleRepo

Types

type CasbinData

type CasbinData struct {
	Enf *casbin.SyncedEnforcer
	// contains filtered or unexported fields
}

func NewCasbinData

func NewCasbinData(data *Data, conf *conf.Auth, logger log.Logger) (*CasbinData, error)

NewCasbinData .

type CommentAgentRepo

type CommentAgentRepo struct {
	// contains filtered or unexported fields
}

func (*CommentAgentRepo) FindByID

func (r *CommentAgentRepo) FindByID(cxt context.Context, id uint64) (*biz.CommentAgentDO, error)

func (*CommentAgentRepo) Save

func (*CommentAgentRepo) Update

func (*CommentAgentRepo) UpdateAddCountById

func (r *CommentAgentRepo) UpdateAddCountById(ctx context.Context, id uint64, isRoot bool) error

func (*CommentAgentRepo) UpdateMinusCountById

func (r *CommentAgentRepo) UpdateMinusCountById(ctx context.Context, id uint64, isRoot bool) error

type CommentContentRepo

type CommentContentRepo struct {
	// contains filtered or unexported fields
}

func (*CommentContentRepo) CountByState

func (r *CommentContentRepo) CountByState(ctx context.Context, state int) (int64, error)

func (*CommentContentRepo) DeleteList

func (r *CommentContentRepo) DeleteList(ctx context.Context, ids []uint64) error

func (*CommentContentRepo) FindAllByParentID

func (r *CommentContentRepo) FindAllByParentID(cxt context.Context, id uint64, size int) ([]*biz.CommentContentDO, error)

func (*CommentContentRepo) FindByID

func (*CommentContentRepo) FindParentByID

func (r *CommentContentRepo) FindParentByID(cxt context.Context, id uint64) (*biz.CommentContentDO, error)

func (*CommentContentRepo) ListAll

func (*CommentContentRepo) Save

func (*CommentContentRepo) UpdaeCommentById

func (r *CommentContentRepo) UpdaeCommentById(cxt context.Context, id uint64, comment string) error

func (*CommentContentRepo) UpdaeEmailStateById

func (r *CommentContentRepo) UpdaeEmailStateById(cxt context.Context, id uint64, satae int32) error

func (*CommentContentRepo) UpdaeStateByIDs

func (r *CommentContentRepo) UpdaeStateByIDs(cxt context.Context, ids []uint64, state int) error

func (*CommentContentRepo) Update

type CommentIndexRepo

type CommentIndexRepo struct {
	// contains filtered or unexported fields
}

func (*CommentIndexRepo) DeleteList

func (r *CommentIndexRepo) DeleteList(ctx context.Context, ids []uint64) error

func (*CommentIndexRepo) FindAllByParentID

func (r *CommentIndexRepo) FindAllByParentID(cxt context.Context, id uint64) ([]*biz.CommentIndexDO, error)

func (*CommentIndexRepo) FindByID

func (r *CommentIndexRepo) FindByID(cxt context.Context, id uint64) (*biz.CommentIndexDO, error)

func (*CommentIndexRepo) Save

func (*CommentIndexRepo) UpdaeStateByIDs

func (r *CommentIndexRepo) UpdaeStateByIDs(cxt context.Context, ids []uint64, state int) error

func (*CommentIndexRepo) Update

func (*CommentIndexRepo) UpdateAddCountById

func (r *CommentIndexRepo) UpdateAddCountById(ctx context.Context, id uint64, isRoot bool) error

func (*CommentIndexRepo) UpdateMinusCountById

func (r *CommentIndexRepo) UpdateMinusCountById(ctx context.Context, id uint64, isRoot bool) error

func (*CommentIndexRepo) UpdateObjIdByAgentIds

func (r *CommentIndexRepo) UpdateObjIdByAgentIds(ctx context.Context) error

type Data

type Data struct {
	// TODO wrapped database client
	Db       *gorm.DB
	RedisCli redis.Cmdable
	// contains filtered or unexported fields
}

Data .

func NewData

func NewData(conf *conf.Data, logger log.Logger) (*Data, func(), error)

NewData .

Jump to

Keyboard shortcuts

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