2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

refactor: 应用支持依赖注入

This commit is contained in:
耗子
2024-12-16 02:01:31 +08:00
parent 1fdc86cc0a
commit a64660d0cb
57 changed files with 663 additions and 861 deletions

View File

@@ -8,9 +8,9 @@ import (
"gorm.io/gorm"
"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/apps"
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/pkg/api"
"github.com/TheTNB/panel/pkg/apploader"
)
type cacheRepo struct {
@@ -58,8 +58,7 @@ func (r *cacheRepo) UpdateApps() error {
// 去除本地不存在的应用
*remote = slices.Clip(slices.DeleteFunc(*remote, func(app *api.App) bool {
_, err = apploader.Get(app.Slug)
return err != nil
return !slices.Contains(apps.Slugs(), app.Slug)
}))
encoded, err := json.Marshal(remote)