feat: 代码规范性修改

This commit is contained in:
zhengkunwang223
2023-03-28 18:00:06 +08:00
committed by zhengkunwang223
parent bf9a37623a
commit 8be00dad7f
28 changed files with 278 additions and 145 deletions

View File

@@ -11,6 +11,20 @@ import (
type AppInstallResourceRpo struct {
}
type IAppInstallResourceRpo interface {
WithAppInstallId(appInstallId uint) DBOption
WithLinkId(linkId uint) DBOption
WithResourceId(resourceId uint) DBOption
GetBy(opts ...DBOption) ([]model.AppInstallResource, error)
GetFirst(opts ...DBOption) (model.AppInstallResource, error)
Create(ctx context.Context, resource *model.AppInstallResource) error
DeleteBy(ctx context.Context, opts ...DBOption) error
}
func NewIAppInstallResourceRpo() IAppInstallResourceRpo {
return &AppInstallResourceRpo{}
}
func (a AppInstallResourceRpo) WithAppInstallId(appInstallId uint) DBOption {
return func(db *gorm.DB) *gorm.DB {
return db.Where("app_install_id = ?", appInstallId)