|
|
|
@ -19,6 +19,7 @@ type IAppInstallRepo interface {
|
|
|
|
|
WithAppIdsIn(appIds []uint) DBOption
|
|
|
|
|
WithStatus(status string) DBOption
|
|
|
|
|
WithServiceName(serviceName string) DBOption
|
|
|
|
|
WithContainerName(containerName string) DBOption
|
|
|
|
|
WithPort(port int) DBOption
|
|
|
|
|
WithIdNotInWebsite() DBOption
|
|
|
|
|
ListBy(opts ...DBOption) ([]model.AppInstall, error)
|
|
|
|
@ -73,6 +74,12 @@ func (a *AppInstallRepo) WithServiceName(serviceName string) DBOption {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *AppInstallRepo) WithContainerName(containerName string) DBOption {
|
|
|
|
|
return func(db *gorm.DB) *gorm.DB {
|
|
|
|
|
return db.Where("container_name = ?", containerName)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *AppInstallRepo) WithPort(port int) DBOption {
|
|
|
|
|
return func(db *gorm.DB) *gorm.DB {
|
|
|
|
|
return db.Where("https_port = ? or http_port = ?", port, port)
|
|
|
|
|