MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / DeleteCheck

Method DeleteCheck

agent/app/service/app_install.go:663–689  ·  view source on GitHub ↗
(installID uint)

Source from the content-addressed store, hash-verified

661}
662
663func (a *AppInstallService) DeleteCheck(installID uint) ([]dto.AppResource, error) {
664 var res []dto.AppResource
665 appInstall, err := appInstallRepo.GetFirst(repo.WithByID(installID))
666 if err != nil {
667 return nil, err
668 }
669 websites, _ := websiteRepo.GetBy(websiteRepo.WithAppInstallId(appInstall.ID))
670 for _, website := range websites {
671 res = append(res, dto.AppResource{
672 Type: "website",
673 Name: website.PrimaryDomain,
674 })
675 }
676 resources, _ := appInstallResourceRepo.GetBy(appInstallResourceRepo.WithLinkId(appInstall.ID), repo.WithByFrom(constant.AppResourceLocal))
677 for _, resource := range resources {
678 linkInstall, _ := appInstallRepo.GetFirst(repo.WithByID(resource.AppInstallId))
679 if linkInstall.ID > 0 {
680 res = append(res, dto.AppResource{
681 Type: "app",
682 Name: linkInstall.Name,
683 })
684 } else {
685 _ = appInstallResourceRepo.DeleteBy(context.Background(), appInstallResourceRepo.WithAppInstallId(resource.AppInstallId))
686 }
687 }
688 return res, nil
689}
690
691func (a *AppInstallService) GetDefaultConfigByKey(key, name string) (string, error) {
692 baseInfo, err := appInstallRepo.LoadBaseInfo(key, name)

Callers

nothing calls this directly

Calls 6

GetFirstMethod · 0.65
WithByIDMethod · 0.65
GetByMethod · 0.65
WithAppInstallIdMethod · 0.65
WithLinkIdMethod · 0.65
DeleteByMethod · 0.65

Tested by

no test coverage detected