feat: 代码规范性修改
This commit is contained in:
committed by
zhengkunwang223
parent
bf9a37623a
commit
8be00dad7f
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user