From 04bdbe73bca4764ea1548a81ad2dabe434a930e7 Mon Sep 17 00:00:00 2001
From: Liujian <824010343@qq.com>
Date: Wed, 24 Jul 2024 10:34:11 +0800
Subject: [PATCH 01/19] =?UTF-8?q?1.=20=E5=88=A0=E9=99=A4=E7=BB=84=E7=BB=87?=
=?UTF-8?q?=E6=A6=82=E5=BF=B5=202.=20=E7=8E=AF=E5=A2=83=EF=BC=88=E5=88=86?=
=?UTF-8?q?=E5=8C=BA=EF=BC=89=E5=8F=96=E6=B6=88=E7=BB=91=E5=AE=9A=E6=9C=8D?=
=?UTF-8?q?=E5=8A=A1=E3=80=81=E5=9B=A2=E9=98=9F=E3=80=81=E8=AE=A2=E9=98=85?=
=?UTF-8?q?=E5=85=B3=E7=B3=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
controller/api/iml.go | 2 +-
controller/organization/iml.go | 44 ----
controller/organization/organization.go | 24 ---
controller/project/iml.go | 2 +-
controller/subscribe/iml.go | 7 +-
controller/subscribe/subscribe.go | 5 +-
controller/upstream/iml.go | 21 +-
controller/upstream/upstream.go | 3 +-
module/api/api.go | 2 +-
module/api/iml.go | 40 +---
module/catalogue/dto/output.go | 20 +-
module/catalogue/iml.go | 186 ++++++-----------
module/my-team/iml.go | 64 +++---
module/organization/dto/input.go | 18 --
module/organization/dto/output.go | 58 ------
module/organization/iml.go | 125 ------------
module/organization/organization.go | 24 ---
module/partition/impl.go | 78 ++++----
module/project-authorization/iml.go | 41 ++--
module/project/dto/input.go | 7 +-
module/project/dto/output.go | 87 ++++----
module/project/iml.go | 256 ++++++++----------------
module/project/project.go | 2 +-
module/project_diff/iml.go | 27 +--
module/publish/iml.go | 28 +--
module/release/iml.go | 24 ++-
module/service/iml.go | 56 +++---
module/subscribe/dto/input.go | 16 +-
module/subscribe/dto/output.go | 26 +--
module/subscribe/iml.go | 244 +++++++++++-----------
module/subscribe/subscribe.go | 2 +-
module/team/dto/input.go | 9 +-
module/team/iml.go | 9 +-
module/upstream/iml.go | 18 +-
plugins/core/core.go | 32 ++-
plugins/core/organization.go | 22 --
plugins/core/subscribe.go | 2 +-
plugins/core/upstream.go | 2 +-
service/organization/iml.go | 250 -----------------------
service/organization/model.go | 35 ----
service/organization/service.go | 27 ---
service/project/iml.go | 115 +----------
service/project/model.go | 59 +++---
service/project/service.go | 11 -
service/service/iml.go | 25 ++-
service/service/model.go | 67 +++----
service/subscribe/iml.go | 42 ++--
service/subscribe/model.go | 105 ++++------
service/subscribe/service.go | 2 +-
service/team/iml.go | 19 +-
service/team/model.go | 34 ++--
stores/dynamic-module/model.go | 7 +-
stores/organization/model.go | 43 ----
stores/organization/store.go | 30 ---
stores/project/model.go | 40 ++--
stores/project/store.go | 11 -
stores/service/model.go | 33 ++-
stores/subscribe/model.go | 33 ++-
stores/team/model.go | 22 +-
59 files changed, 778 insertions(+), 1865 deletions(-)
delete mode 100644 controller/organization/iml.go
delete mode 100644 controller/organization/organization.go
delete mode 100644 module/organization/dto/input.go
delete mode 100644 module/organization/dto/output.go
delete mode 100644 module/organization/iml.go
delete mode 100644 module/organization/organization.go
delete mode 100644 plugins/core/organization.go
delete mode 100644 service/organization/iml.go
delete mode 100644 service/organization/model.go
delete mode 100644 service/organization/service.go
delete mode 100644 stores/organization/model.go
delete mode 100644 stores/organization/store.go
diff --git a/controller/api/iml.go b/controller/api/iml.go
index e6ae143..403e3f4 100644
--- a/controller/api/iml.go
+++ b/controller/api/iml.go
@@ -13,7 +13,7 @@ type imlAPIController struct {
}
func (i *imlAPIController) SimpleList(ctx *gin.Context, partitionId string, input *api_dto.ListInput) ([]*api_dto.ApiSimpleItem, error) {
- return i.module.SimpleList(ctx, partitionId, input)
+ return i.module.SimpleList(ctx, input)
}
func (i *imlAPIController) Detail(ctx *gin.Context, pid string, aid string) (*api_dto.ApiDetail, error) {
diff --git a/controller/organization/iml.go b/controller/organization/iml.go
deleted file mode 100644
index e63d274..0000000
--- a/controller/organization/iml.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package organization
-
-import (
- "github.com/eolinker/apipark/module/organization"
- organization_dto "github.com/eolinker/apipark/module/organization/dto"
- "github.com/gin-gonic/gin"
-)
-
-var (
- _ IOrganizationController = (*imlOrganizationController)(nil)
-)
-
-type imlOrganizationController struct {
- module organization.IOrganizationModule `autowired:""`
-}
-
-func (c *imlOrganizationController) Simple(ctx *gin.Context) ([]*organization_dto.Simple, error) {
- return c.module.Simple(ctx)
-
-}
-
-func (c *imlOrganizationController) Create(ctx *gin.Context, input *organization_dto.CreateOrganization) (*organization_dto.Detail, error) {
- return c.module.Create(ctx, input)
-}
-
-func (c *imlOrganizationController) Edit(ctx *gin.Context, id string, input *organization_dto.EditOrganization) (*organization_dto.Detail, error) {
- return c.module.Edit(ctx, id, input)
-}
-
-func (c *imlOrganizationController) Get(ctx *gin.Context, id string) (*organization_dto.Detail, error) {
- return c.module.Get(ctx, id)
-}
-
-func (c *imlOrganizationController) Search(ctx *gin.Context, keyword string) ([]*organization_dto.Item, error) {
- return c.module.Search(ctx, keyword)
-}
-
-func (c *imlOrganizationController) Delete(ctx *gin.Context, id string) (string, error) {
- return c.module.Delete(ctx, id)
-}
-
-func (c *imlOrganizationController) Partitions(ctx *gin.Context, id string) ([]*organization_dto.Partition, error) {
- return c.module.Partitions(ctx, id)
-}
diff --git a/controller/organization/organization.go b/controller/organization/organization.go
deleted file mode 100644
index 4af2a81..0000000
--- a/controller/organization/organization.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package organization
-
-import (
- organization_dto "github.com/eolinker/apipark/module/organization/dto"
- "github.com/eolinker/go-common/autowire"
- "github.com/gin-gonic/gin"
- "reflect"
-)
-
-type IOrganizationController interface {
- Create(ctx *gin.Context, input *organization_dto.CreateOrganization) (*organization_dto.Detail, error)
- Edit(ctx *gin.Context, id string, input *organization_dto.EditOrganization) (*organization_dto.Detail, error)
- Get(ctx *gin.Context, id string) (*organization_dto.Detail, error)
- Search(ctx *gin.Context, keyword string) ([]*organization_dto.Item, error)
- Delete(ctx *gin.Context, id string) (string, error)
- Partitions(ctx *gin.Context, id string) ([]*organization_dto.Partition, error)
- Simple(ctx *gin.Context) ([]*organization_dto.Simple, error)
-}
-
-func init() {
- autowire.Auto[IOrganizationController](func() reflect.Value {
- return reflect.ValueOf(new(imlOrganizationController))
- })
-}
diff --git a/controller/project/iml.go b/controller/project/iml.go
index 9c56152..a617a77 100644
--- a/controller/project/iml.go
+++ b/controller/project/iml.go
@@ -21,7 +21,7 @@ func (i *imlProjectController) SearchMyProjects(ctx *gin.Context, teamId string,
}
func (i *imlProjectController) SimpleProjects(ctx *gin.Context, keyword string, partition string) ([]*project_dto.SimpleProjectItem, error) {
- return i.module.SimpleProjects(ctx, keyword, partition)
+ return i.module.SimpleProjects(ctx, keyword)
}
func (i *imlProjectController) MySimpleProjects(ctx *gin.Context, keyword string) ([]*project_dto.SimpleProjectItem, error) {
diff --git a/controller/subscribe/iml.go b/controller/subscribe/iml.go
index 2d3324b..ff9da18 100644
--- a/controller/subscribe/iml.go
+++ b/controller/subscribe/iml.go
@@ -2,6 +2,7 @@ package subscribe
import (
"fmt"
+
"github.com/gin-gonic/gin"
"github.com/eolinker/apipark/module/subscribe"
@@ -16,9 +17,9 @@ type imlSubscribeController struct {
module subscribe.ISubscribeModule `autowired:""`
}
-func (i *imlSubscribeController) PartitionServices(ctx *gin.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error) {
- return i.module.PartitionServices(ctx, app)
-}
+//func (i *imlSubscribeController) PartitionServices(ctx *gin.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error) {
+// return i.module.PartitionServices(ctx, app)
+//}
func (i *imlSubscribeController) SearchSubscriptions(ctx *gin.Context, partitionId string, projectId string, keyword string) ([]*subscribe_dto.SubscriptionItem, error) {
return i.module.SearchSubscriptions(ctx, partitionId, projectId, keyword)
diff --git a/controller/subscribe/subscribe.go b/controller/subscribe/subscribe.go
index 1b159ef..fab292f 100644
--- a/controller/subscribe/subscribe.go
+++ b/controller/subscribe/subscribe.go
@@ -1,9 +1,10 @@
package subscribe
import (
- "github.com/gin-gonic/gin"
"reflect"
+ "github.com/gin-gonic/gin"
+
subscribe_dto "github.com/eolinker/apipark/module/subscribe/dto"
"github.com/eolinker/go-common/autowire"
@@ -24,7 +25,7 @@ type ISubscribeController interface {
DeleteSubscription(ctx *gin.Context, project string, uuid string) error
// RevokeApply 取消申请
RevokeApply(ctx *gin.Context, project string, uuid string) error
- PartitionServices(ctx *gin.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error)
+ //PartitionServices(ctx *gin.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error)
}
type ISubscribeApprovalController interface {
diff --git a/controller/upstream/iml.go b/controller/upstream/iml.go
index 3f960d6..96416aa 100644
--- a/controller/upstream/iml.go
+++ b/controller/upstream/iml.go
@@ -2,7 +2,6 @@ package upstream
import (
"github.com/eolinker/apipark/module/partition"
- partition_dto "github.com/eolinker/apipark/module/partition/dto"
"github.com/eolinker/apipark/module/project"
"github.com/eolinker/apipark/module/upstream"
upstream_dto "github.com/eolinker/apipark/module/upstream/dto"
@@ -19,24 +18,8 @@ type imlUpstreamController struct {
partitionModule partition.IPartitionModule `autowired:""`
}
-func (i *imlUpstreamController) Get(ctx *gin.Context, pid string) (upstream_dto.UpstreamConfig, []*partition_dto.Simple, error) {
- info, err := i.upstreamModule.Get(ctx, pid)
- if err != nil {
- return nil, nil, err
- }
- projectInfo, err := i.projectModule.GetProject(ctx, pid)
- if err != nil {
- return nil, nil, err
- }
- ids := make([]string, 0)
- for _, p := range projectInfo.Partition {
- ids = append(ids, p.Id)
- }
- items, err := i.partitionModule.SimpleByIds(ctx, ids)
- if err != nil {
- return nil, nil, err
- }
- return info, items, nil
+func (i *imlUpstreamController) Get(ctx *gin.Context, pid string) (upstream_dto.UpstreamConfig, error) {
+ return i.upstreamModule.Get(ctx, pid)
}
func (i *imlUpstreamController) Save(ctx *gin.Context, pid string, upstream *upstream_dto.UpstreamConfig) (upstream_dto.UpstreamConfig, error) {
diff --git a/controller/upstream/upstream.go b/controller/upstream/upstream.go
index 89e14a9..122582d 100644
--- a/controller/upstream/upstream.go
+++ b/controller/upstream/upstream.go
@@ -1,7 +1,6 @@
package upstream
import (
- partition_dto "github.com/eolinker/apipark/module/partition/dto"
"reflect"
"github.com/eolinker/go-common/autowire"
@@ -11,7 +10,7 @@ import (
)
type IUpstreamController interface {
- Get(ctx *gin.Context, pid string) (upstream_dto.UpstreamConfig, []*partition_dto.Simple, error)
+ Get(ctx *gin.Context, pid string) (upstream_dto.UpstreamConfig, error)
Save(ctx *gin.Context, pid string, upstream *upstream_dto.UpstreamConfig) (upstream_dto.UpstreamConfig, error)
}
diff --git a/module/api/api.go b/module/api/api.go
index 754c3c9..524d471 100644
--- a/module/api/api.go
+++ b/module/api/api.go
@@ -18,7 +18,7 @@ type IApiModule interface {
Search(ctx context.Context, keyword string, pid string) ([]*api_dto.ApiItem, error)
// SimpleSearch 获取API简要列表
SimpleSearch(ctx context.Context, keyword string, pid string) ([]*api_dto.ApiSimpleItem, error)
- SimpleList(ctx context.Context, partitionId string, input *api_dto.ListInput) ([]*api_dto.ApiSimpleItem, error)
+ SimpleList(ctx context.Context, input *api_dto.ListInput) ([]*api_dto.ApiSimpleItem, error)
// Create 创建API
Create(ctx context.Context, pid string, dto *api_dto.CreateApi) (*api_dto.ApiSimpleDetail, error)
// Edit 编辑API
diff --git a/module/api/iml.go b/module/api/iml.go
index bd7eb36..d56df96 100644
--- a/module/api/iml.go
+++ b/module/api/iml.go
@@ -11,7 +11,6 @@ import (
"gorm.io/gorm"
- "github.com/eolinker/apipark/service/organization"
"github.com/eolinker/apipark/service/team"
"github.com/google/uuid"
@@ -36,26 +35,15 @@ var (
)
type imlApiModule struct {
- organizationService organization.IOrganizationService `autowired:""`
- teamService team.ITeamService `autowired:""`
- projectService project.IProjectService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- apiService api.IAPIService `autowired:""`
- upstreamService upstream.IUpstreamService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ teamService team.ITeamService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ upstreamService upstream.IUpstreamService `autowired:""`
+ transaction store.ITransaction `autowired:""`
}
-func (i *imlApiModule) SimpleList(ctx context.Context, partitionId string, input *api_dto.ListInput) ([]*api_dto.ApiSimpleItem, error) {
+func (i *imlApiModule) SimpleList(ctx context.Context, input *api_dto.ListInput) ([]*api_dto.ApiSimpleItem, error) {
projectIds := input.Projects
- if partitionId != "" {
- pp, err := i.projectPartitionService.ListByPartition(ctx, partitionId)
- if err != nil {
- return nil, err
- }
- projectIds = utils.SliceToSlice(pp, func(p *project.Partition) string {
- return p.Project
- })
- }
w := make(map[string]interface{})
if len(projectIds) > 0 {
w["project"] = projectIds
@@ -455,23 +443,11 @@ func (i *imlApiModule) Prefix(ctx context.Context, pid string) (string, error) {
if err != nil {
return "", err
}
- tInfo, err := i.teamService.Get(ctx, pInfo.Team)
- if err != nil {
- return "", err
- }
- oInfo, err := i.organizationService.Get(ctx, tInfo.Organization)
- if err != nil {
- return "", err
- }
- if oInfo.Prefix != "" {
- if oInfo.Prefix[0] != '/' {
- oInfo.Prefix = fmt.Sprintf("/%s", strings.TrimSuffix(oInfo.Prefix, "/"))
- }
- }
+
if pInfo.Prefix != "" {
if pInfo.Prefix[0] != '/' {
pInfo.Prefix = fmt.Sprintf("/%s", strings.TrimSuffix(pInfo.Prefix, "/"))
}
}
- return strings.TrimSuffix(fmt.Sprintf("%s%s", oInfo.Prefix, pInfo.Prefix), "/"), nil
+ return strings.TrimSuffix(pInfo.Prefix, "/"), nil
}
diff --git a/module/catalogue/dto/output.go b/module/catalogue/dto/output.go
index 83fdd87..c2c1767 100644
--- a/module/catalogue/dto/output.go
+++ b/module/catalogue/dto/output.go
@@ -9,15 +9,15 @@ type Item struct {
}
type ServiceItem struct {
- Id string `json:"id"`
- Name string `json:"name"`
- Tags []auto.Label `json:"tags" aolabel:"tag"`
- Catalogue auto.Label `json:"catalogue" aolabel:"catalogue"`
- Partition []auto.Label `json:"partition" aolabel:"partition"`
- Description string `json:"description"`
- Logo string `json:"logo"`
- ApiNum int64 `json:"api_num"`
- SubscriberNum int64 `json:"subscriber_num"`
+ Id string `json:"id"`
+ Name string `json:"name"`
+ Tags []auto.Label `json:"tags" aolabel:"tag"`
+ Catalogue auto.Label `json:"catalogue" aolabel:"catalogue"`
+ //Partition []auto.Label `json:"partition" aolabel:"partition"`
+ Description string `json:"description"`
+ Logo string `json:"logo"`
+ ApiNum int64 `json:"api_num"`
+ SubscriberNum int64 `json:"subscriber_num"`
}
type ServiceDetail struct {
@@ -31,7 +31,7 @@ type ServiceDetail struct {
}
type ServiceBasic struct {
- Organization auto.Label `json:"organization" aolabel:"organization"`
+ //Organization auto.Label `json:"organization" aolabel:"organization"`
Project auto.Label `json:"project" aolabel:"project"`
Team auto.Label `json:"team" aolabel:"team"`
ApiNum int `json:"api_num"`
diff --git a/module/catalogue/iml.go b/module/catalogue/iml.go
index 8413369..af1933e 100644
--- a/module/catalogue/iml.go
+++ b/module/catalogue/iml.go
@@ -42,21 +42,20 @@ var (
)
type imlCatalogueModule struct {
- catalogueService catalogue.ICatalogueService `autowired:""`
- projectService project.IProjectService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- apiService api.IAPIService `autowired:""`
- serviceService service.IServiceService `autowired:""`
- serviceApiService service.IApiService `autowired:""`
- serviceTagService service.ITagService `autowired:""`
- servicePartitionService service.IPartitionsService `autowired:""`
- serviceDocService service.IDocService `autowired:""`
- tagService tag.ITagService `autowired:""`
- releaseService release.IReleaseService `autowired:""`
- subscribeService subscribe.ISubscribeService `autowired:""`
- subscribeApplyService subscribe.ISubscribeApplyService `autowired:""`
- partitionService partition.IPartitionService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ catalogueService catalogue.ICatalogueService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ serviceService service.IServiceService `autowired:""`
+ serviceApiService service.IApiService `autowired:""`
+ serviceTagService service.ITagService `autowired:""`
+ servicePartitionService service.IPartitionsService `autowired:""`
+ serviceDocService service.IDocService `autowired:""`
+ tagService tag.ITagService `autowired:""`
+ releaseService release.IReleaseService `autowired:""`
+ subscribeService subscribe.ISubscribeService `autowired:""`
+ subscribeApplyService subscribe.ISubscribeApplyService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ transaction store.ITransaction `autowired:""`
root *Root
}
@@ -70,31 +69,10 @@ func (i *imlCatalogueModule) Subscribe(ctx context.Context, subscribeInfo *catal
if err != nil {
return fmt.Errorf("get service failed: %w", err)
}
- // 获取服务可用分区
- servicePartitions, err := i.servicePartitionService.PartitionsByService(ctx, subscribeInfo.Service)
- if err != nil {
- return fmt.Errorf("get service partitions failed: %w", err)
- }
- partitions, has := servicePartitions[subscribeInfo.Service]
- if !has || len(partitions) == 0 {
- // 没有可用分区,不给申请
- return fmt.Errorf("service has no available partitions")
- }
- partitionMap := utils.SliceToMapO(partitions, func(t string) (string, struct{}) {
- return t, struct{}{}
- })
userId := utils.UserId(ctx)
return i.transaction.Transaction(ctx, func(ctx context.Context) error {
- availablePartitions := make([]string, 0, len(subscribeInfo.Partitions))
- for _, p := range subscribeInfo.Partitions {
- if _, has := partitionMap[p]; has {
- availablePartitions = append(availablePartitions, p)
- }
- }
- if len(availablePartitions) == 0 {
- return fmt.Errorf("service has no available partitions")
- }
+
projects := make([]string, 0, len(subscribeInfo.Applications))
for _, pid := range subscribeInfo.Applications {
@@ -114,18 +92,15 @@ func (i *imlCatalogueModule) Subscribe(ctx context.Context, subscribeInfo *catal
applyID := uuid.New().String()
// 创建一条审核申请
err = i.subscribeApplyService.Create(ctx, &subscribe.CreateApply{
- Uuid: applyID,
- Service: subscribeInfo.Service,
- Project: s.Project,
- Team: s.Team,
- ApplyPartitions: availablePartitions,
- Application: pid,
- ApplyTeam: pInfo.Team,
- ApplyOrganization: pInfo.Organization,
- Reason: subscribeInfo.Reason,
- Organization: s.Organization,
- Status: subscribe.ApplyStatusReview,
- Applier: userId,
+ Uuid: applyID,
+ Service: subscribeInfo.Service,
+ Project: s.Project,
+ Team: s.Team,
+ Application: pid,
+ ApplyTeam: pInfo.Team,
+ Reason: subscribeInfo.Reason,
+ Status: subscribe.ApplyStatusReview,
+ Applier: userId,
})
if err != nil {
return err
@@ -136,12 +111,28 @@ func (i *imlCatalogueModule) Subscribe(ctx context.Context, subscribeInfo *catal
if !errors.Is(err, gorm.ErrRecordNotFound) {
return err
}
- for _, p := range availablePartitions {
+ err = i.subscribeService.Create(ctx, &subscribe.CreateSubscribe{
+ Uuid: uuid.New().String(),
+ Service: subscribeInfo.Service,
+ Project: s.Project,
+ Application: pid,
+ ApplyStatus: subscribe.ApplyStatusReview,
+ From: subscribe.FromSubscribe,
+ })
+ if err != nil {
+ return err
+ }
+
+ } else {
+ subscriberMap := utils.SliceToMap(subscriber, func(t *subscribe.Subscribe) string {
+ return t.Application
+ })
+ v, has := subscriberMap[pid]
+ if !has {
err = i.subscribeService.Create(ctx, &subscribe.CreateSubscribe{
Uuid: uuid.New().String(),
Service: subscribeInfo.Service,
Project: s.Project,
- Partition: p,
Application: pid,
ApplyStatus: subscribe.ApplyStatusReview,
From: subscribe.FromSubscribe,
@@ -149,37 +140,13 @@ func (i *imlCatalogueModule) Subscribe(ctx context.Context, subscribeInfo *catal
if err != nil {
return err
}
+ } else if v.ApplyStatus != subscribe.ApplyStatusSubscribe {
+ status := subscribe.ApplyStatusReview
+ err = i.subscribeService.Save(ctx, v.Id, &subscribe.UpdateSubscribe{
+ ApplyStatus: &status,
+ })
}
- if err != nil {
- return err
- }
- } else {
- subscriberMap := utils.SliceToMap(subscriber, func(t *subscribe.Subscribe) string {
- return t.Partition
- })
- for _, p := range availablePartitions {
- v, has := subscriberMap[p]
- if !has {
- err = i.subscribeService.Create(ctx, &subscribe.CreateSubscribe{
- Uuid: uuid.New().String(),
- Service: subscribeInfo.Service,
- Project: s.Project,
- Partition: p,
- Application: pid,
- ApplyStatus: subscribe.ApplyStatusReview,
- From: subscribe.FromSubscribe,
- })
- if err != nil {
- return err
- }
- } else if v.ApplyStatus != subscribe.ApplyStatusSubscribe {
- status := subscribe.ApplyStatusReview
- err = i.subscribeService.Save(ctx, v.Id, &subscribe.UpdateSubscribe{
- ApplyStatus: &status,
- })
- }
- }
}
projects = append(projects, pid)
@@ -207,27 +174,8 @@ func (i *imlCatalogueModule) ServiceDetail(ctx context.Context, sid string) (*ca
} else {
docStr = doc.Doc
}
- servicePartitions, err := i.servicePartitionService.List(ctx, sid)
- if err != nil {
- return nil, fmt.Errorf("get service partitions failed: %w", err)
- }
- servicePartitionIds := utils.SliceToSlice(servicePartitions, func(t *service.Partition) string {
- return t.Pid
- })
- projectPartitions, err := i.projectPartitionService.ListByProject(ctx, s.Project)
- if err != nil {
- return nil, err
- }
- projectPartitionIds := utils.SliceToSlice(projectPartitions, func(t *project.Partition) string {
- return t.Partition
- })
-
- partitionIds := utils.Intersection(servicePartitionIds, projectPartitionIds)
- if len(partitionIds) == 0 {
- return nil, fmt.Errorf("no partition")
- }
- globalPartitions, err := i.partitionService.List(ctx, partitionIds...)
+ globalPartitions, err := i.partitionService.List(ctx)
if err != nil {
return nil, err
}
@@ -247,10 +195,9 @@ func (i *imlCatalogueModule) ServiceDetail(ctx context.Context, sid string) (*ca
Description: s.Description,
Document: docStr,
Basic: &catalogue_dto.ServiceBasic{
- Organization: auto.UUID(s.Organization),
- Project: auto.UUID(s.Project),
- Team: auto.UUID(s.Team),
- ApiNum: 0,
+ Project: auto.UUID(s.Project),
+ Team: auto.UUID(s.Team),
+ ApiNum: 0,
},
Partition: partitions,
}, nil
@@ -330,7 +277,6 @@ func (i *imlCatalogueModule) ServiceDetail(ctx context.Context, sid string) (*ca
Description: s.Description,
Document: docStr,
Basic: &catalogue_dto.ServiceBasic{
- Organization: auto.UUID(s.Organization),
Project: auto.UUID(s.Project),
Team: auto.UUID(s.Team),
ApiNum: len(apis),
@@ -342,13 +288,7 @@ func (i *imlCatalogueModule) ServiceDetail(ctx context.Context, sid string) (*ca
}
func (i *imlCatalogueModule) Services(ctx context.Context, keyword string) ([]*catalogue_dto.ServiceItem, error) {
- projectPartitions, err := i.projectPartitionService.ListByProject(ctx)
- if err != nil {
- return nil, err
- }
- projectPartitionMap := utils.SliceToMapArrayO(projectPartitions, func(t *project.Partition) (string, string) {
- return t.Project, t.Partition
- })
+
serviceTags, err := i.serviceTagService.List(ctx, nil, nil)
if err != nil {
return nil, err
@@ -356,10 +296,6 @@ func (i *imlCatalogueModule) Services(ctx context.Context, keyword string) ([]*c
serviceTagMap := utils.SliceToMapArrayO(serviceTags, func(t *service.Tag) (string, string) {
return t.Sid, t.Tid
})
- servicePartitionMap, err := i.servicePartitionService.PartitionsByService(ctx)
- if err != nil {
- return nil, err
- }
items, err := i.serviceService.Search(ctx, keyword, nil)
if err != nil {
@@ -391,16 +327,16 @@ func (i *imlCatalogueModule) Services(ctx context.Context, keyword string) ([]*c
if !ok || apiNum < 1 {
continue
}
- ps := utils.Intersection(servicePartitionMap[v.Id], projectPartitionMap[v.Project])
- if len(ps) < 1 {
- continue
- }
+ //ps := utils.Intersection(servicePartitionMap[v.Id], projectPartitionMap[v.Project])
+ //if len(ps) < 1 {
+ // continue
+ //}
result = append(result, &catalogue_dto.ServiceItem{
- Id: v.Id,
- Name: v.Name,
- Tags: auto.List(serviceTagMap[v.Id]),
- Catalogue: auto.UUID(v.Catalogue),
- Partition: auto.List(ps),
+ Id: v.Id,
+ Name: v.Name,
+ Tags: auto.List(serviceTagMap[v.Id]),
+ Catalogue: auto.UUID(v.Catalogue),
+ //Partition: auto.List(ps),
ApiNum: apiNum,
SubscriberNum: subscribeCount[v.Id],
Description: v.Description,
diff --git a/module/my-team/iml.go b/module/my-team/iml.go
index 7f3da14..b2fe2aa 100644
--- a/module/my-team/iml.go
+++ b/module/my-team/iml.go
@@ -4,12 +4,11 @@ import (
"context"
"errors"
"fmt"
+
"gorm.io/gorm"
"github.com/eolinker/apipark/service/partition"
- "github.com/eolinker/apipark/service/organization"
-
"github.com/eolinker/apipark/service/project"
department_member "github.com/eolinker/ap-account/service/department-member"
@@ -39,7 +38,6 @@ type imlTeamModule struct {
userService user.IUserService `autowired:""`
departmentMemberService department_member.IMemberService `autowired:""`
projectService project.IProjectService `autowired:""`
- organizationService organization.IOrganizationService `autowired:""`
partitionService partition.IPartitionService `autowired:""`
transaction store.ITransaction `autowired:""`
}
@@ -49,10 +47,10 @@ func (m *imlTeamModule) GetTeam(ctx context.Context, id string) (*team_dto.Team,
if err != nil {
return nil, err
}
- availablePartitions, err := m.organizationService.Partitions(ctx, tv.Organization)
- if err != nil {
- return nil, err
- }
+ //availablePartitions, err := m.organizationService.Partitions(ctx, tv.Organization)
+ //if err != nil {
+ // return nil, err
+ //}
globalPartitions, err := m.partitionService.List(ctx)
if err != nil {
return nil, err
@@ -60,20 +58,20 @@ func (m *imlTeamModule) GetTeam(ctx context.Context, id string) (*team_dto.Team,
globalPartitionMap := utils.SliceToMapO(globalPartitions, func(p *partition.Partition) (string, struct{}) {
return p.UUID, struct{}{}
})
- for _, p := range availablePartitions {
- delete(globalPartitionMap, p)
- }
+ //for _, p := range availablePartitions {
+ // delete(globalPartitionMap, p)
+ //}
return &team_dto.Team{
- Id: tv.Id,
- Name: tv.Name,
- Description: tv.Description,
- Master: auto.UUID(tv.Master),
- CreateTime: auto.TimeLabel(tv.CreateTime),
- UpdateTime: auto.TimeLabel(tv.UpdateTime),
- Organization: auto.UUID(tv.Organization),
- Creator: auto.UUID(tv.Creator),
- Updater: auto.UUID(tv.Updater),
- AvailablePartitions: auto.List(availablePartitions),
+ Id: tv.Id,
+ Name: tv.Name,
+ Description: tv.Description,
+ Master: auto.UUID(tv.Master),
+ CreateTime: auto.TimeLabel(tv.CreateTime),
+ UpdateTime: auto.TimeLabel(tv.UpdateTime),
+ Organization: auto.UUID(tv.Organization),
+ Creator: auto.UUID(tv.Creator),
+ Updater: auto.UUID(tv.Updater),
+ //AvailablePartitions: auto.List(availablePartitions),
DisablePartitions: auto.List(utils.MapToSlice(globalPartitionMap, func(k string, v struct{}) string {
return k
})),
@@ -152,10 +150,10 @@ func (m *imlTeamModule) SimpleTeams(ctx context.Context, keyword string) ([]*tea
if err != nil {
return nil, err
}
- partitionMap, err := m.organizationService.PartitionsByOrganization(ctx)
- if err != nil {
- return nil, err
- }
+ //partitionMap, err := m.organizationService.PartitionsByOrganization(ctx)
+ //if err != nil {
+ // return nil, err
+ //}
globalPartitions, err := m.partitionService.List(ctx)
if err != nil {
return nil, err
@@ -177,16 +175,16 @@ func (m *imlTeamModule) SimpleTeams(ctx context.Context, keyword string) ([]*tea
globalPartitionMap := utils.SliceToMapO(globalPartitions, func(p *partition.Partition) (string, struct{}) {
return p.UUID, struct{}{}
})
- availablePartitions := partitionMap[s.Organization]
- for _, p := range availablePartitions {
- delete(globalPartitionMap, p)
- }
+ //availablePartitions := partitionMap[s.Organization]
+ //for _, p := range availablePartitions {
+ // delete(globalPartitionMap, p)
+ //}
return &team_dto.SimpleTeam{
- Id: s.Id,
- Name: s.Name,
- Description: s.Description,
- Organization: auto.UUID(s.Organization),
- AvailablePartitions: auto.List(availablePartitions),
+ Id: s.Id,
+ Name: s.Name,
+ Description: s.Description,
+ Organization: auto.UUID(s.Organization),
+ //AvailablePartitions: auto.List(availablePartitions),
DisablePartitions: auto.List(utils.MapToSlice(globalPartitionMap, func(k string, v struct{}) string {
return k
})),
diff --git a/module/organization/dto/input.go b/module/organization/dto/input.go
deleted file mode 100644
index c8472fa..0000000
--- a/module/organization/dto/input.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package organization_dto
-
-type CreateOrganization struct {
- Id string `json:"id,omitempty"` // Id is the UUID of the organization
- Name string `json:"name,omitempty"` // Name is the name of the organization
- Description string `json:"description,omitempty"` // Description is the description of the organization
- Master string `json:"master,omitempty"` // Master is the UUID of the organization's master partition
- Partitions []string `json:"partitions,omitempty"` // Partition is the list of the organization's partition UUID
- Prefix string `json:"prefix,omitempty"` // Prefix is the prefix of the organization's UUID
-}
-
-type EditOrganization struct {
- Name *string `json:"name,omitempty"` // Name is the name of the organization
- Description *string `json:"description,omitempty"` // Description is the description of the organization
- Master *string `json:"master,omitempty"` // Master is the UUID of the organization's master partition
- Partitions *[]string `json:"partitions,omitempty"` // Partition is the
- Prefix *string `json:"prefix,omitempty"` // Prefix is the prefix of the organization's UUID
-}
diff --git a/module/organization/dto/output.go b/module/organization/dto/output.go
deleted file mode 100644
index 1185145..0000000
--- a/module/organization/dto/output.go
+++ /dev/null
@@ -1,58 +0,0 @@
-package organization_dto
-
-import (
- "github.com/eolinker/apipark/service/organization"
- "github.com/eolinker/go-common/auto"
-)
-
-type Item struct {
- Id string `json:"id,omitempty"` // Id is the UUID of the organization
- Name string `json:"name,omitempty"` // Name is the name of the organization
- Description string `json:"description,omitempty"` // Description is the description of the organization
- Master auto.Label `json:"master,omitempty" aolabel:"user"` // Master is the UUID of the organization's master partition
- Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"` // Partition is the list of the organization's partition UUID
- Prefix string `json:"prefix,omitempty"` // Prefix is the prefix of the organization's UUID
- CreateTime auto.TimeLabel `json:"create_time,omitempty"` // CreateTime is the time when the organization was created
- UpdateTime auto.TimeLabel `json:"update_time,omitempty"` // UpdateTime is the time when the organization was updated
- Updater auto.Label `json:"updater,omitempty" aolabel:"user"` //
- Creator auto.Label `json:"creator,omitempty" aolabel:"user"`
- CanDelete bool `json:"can_delete"`
-}
-
-type Detail struct {
- Id string `json:"id"` //
- Name string `json:"name"` //
- Description string `json:"description"` //
- Master auto.Label `json:"master" aolabel:"user"` //
- Prefix string `json:"prefix"` //
- Updater auto.Label `json:"updater" aolabel:"user"` //
- Creator auto.Label `json:"creator" aolabel:"user"` //
- CreateTime auto.TimeLabel `json:"create_time"` //
- UpdateTime auto.TimeLabel `json:"update_time"` //
- Partitions []auto.Label `json:"partitions" aolabel:"partition"` //
-}
-
-func NewDetail(m *organization.Organization) *Detail {
- return &Detail{
- Id: m.UUID,
- Name: m.Name,
- Description: m.Description,
- Master: auto.UUID(m.Master),
- Prefix: m.Prefix,
- Updater: auto.UUID(m.Updater),
- Creator: auto.UUID(m.Creator),
- CreateTime: auto.TimeLabel(m.CreateTime),
- UpdateTime: auto.TimeLabel(m.UpdateTime),
- Partitions: auto.List(m.Partitions),
- }
-}
-
-type Partition struct {
- Id string `json:"id,omitempty"` //
- Name string `json:"name,omitempty"` //
-}
-
-type Simple struct {
- Id string `json:"id,omitempty"` //
- Name string `json:"name,omitempty"` //
-}
diff --git a/module/organization/iml.go b/module/organization/iml.go
deleted file mode 100644
index f06b135..0000000
--- a/module/organization/iml.go
+++ /dev/null
@@ -1,125 +0,0 @@
-package organization
-
-import (
- "context"
- "strings"
-
- "github.com/eolinker/apipark/service/team"
-
- organization_dto "github.com/eolinker/apipark/module/organization/dto"
- "github.com/eolinker/apipark/service/organization"
- "github.com/eolinker/apipark/service/partition"
- "github.com/eolinker/go-common/auto"
- "github.com/eolinker/go-common/utils"
- "github.com/google/uuid"
-)
-
-var (
- _ IOrganizationModule = (*implOrganizationModule)(nil)
-)
-
-type implOrganizationModule struct {
- organizationService organization.IOrganizationService `autowired:""`
- partitionService partition.IPartitionService `autowired:""`
- teamService team.ITeamService `autowired:""`
-}
-
-func (m *implOrganizationModule) Simple(ctx context.Context) ([]*organization_dto.Simple, error) {
- list, err := m.organizationService.All(ctx)
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(list, func(i *organization.Organization) *organization_dto.Simple {
- return &organization_dto.Simple{
- Id: i.UUID,
- Name: i.Name,
- }
- }), nil
-}
-
-func (m *implOrganizationModule) Create(ctx context.Context, input *organization_dto.CreateOrganization) (*organization_dto.Detail, error) {
- id := input.Id
- if id == "" {
- id = uuid.NewString()
- }
- input.Prefix = strings.Trim(strings.Trim(input.Prefix, " "), "/")
- o, err := m.organizationService.Create(ctx, id, input.Name, input.Description, input.Prefix, input.Master, input.Partitions)
- if err != nil {
- return nil, err
- }
- detail := organization_dto.NewDetail(o)
- return detail, nil
-}
-
-func (m *implOrganizationModule) Edit(ctx context.Context, id string, input *organization_dto.EditOrganization) (*organization_dto.Detail, error) {
- nv, err := m.organizationService.Edit(ctx, id, input.Name, input.Description, input.Master, input.Partitions)
- if err != nil {
- return nil, err
- }
- detail := organization_dto.NewDetail(nv)
-
- return detail, nil
-}
-
-func (m *implOrganizationModule) Get(ctx context.Context, id string) (*organization_dto.Detail, error) {
- v, err := m.organizationService.Get(ctx, id)
- if err != nil {
- return nil, err
- }
- detail := organization_dto.NewDetail(v)
-
- return detail, nil
-}
-
-func (m *implOrganizationModule) Search(ctx context.Context, keyword string) ([]*organization_dto.Item, error) {
- list, err := m.organizationService.Search(ctx, keyword)
- if err != nil {
- return nil, err
- }
- countMap, err := m.teamService.CountByGroup(ctx, "", nil, "organization")
- if err != nil {
- return nil, err
- }
- itemList := utils.SliceToSlice(list, func(o *organization.Organization) *organization_dto.Item {
- return &organization_dto.Item{
- Id: o.UUID,
- Name: o.Name,
- Description: o.Description,
- Master: auto.UUID(o.Master),
- Partition: auto.List(o.Partitions),
- Prefix: o.Prefix,
- CreateTime: auto.TimeLabel(o.CreateTime),
- UpdateTime: auto.TimeLabel(o.UpdateTime),
- Updater: auto.UUID(o.Updater),
- Creator: auto.UUID(o.Creator),
- CanDelete: countMap[o.UUID] == 0,
- }
- })
- return itemList, nil
-}
-
-func (m *implOrganizationModule) Delete(ctx context.Context, id string) (string, error) {
- err := m.organizationService.Delete(ctx, id)
- if err != nil {
- return "", err
- }
- return id, nil
-}
-
-func (m *implOrganizationModule) Partitions(ctx context.Context, id string) ([]*organization_dto.Partition, error) {
- partitions, err := m.organizationService.Partitions(ctx, id)
- if err != nil {
- return nil, err
- }
- list, err := m.partitionService.List(ctx, partitions...)
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(list, func(p *partition.Partition) *organization_dto.Partition {
- return &organization_dto.Partition{
- Id: p.UUID,
- Name: p.Name,
- }
- }), nil
-
-}
diff --git a/module/organization/organization.go b/module/organization/organization.go
deleted file mode 100644
index 3219652..0000000
--- a/module/organization/organization.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package organization
-
-import (
- "context"
- organization_dto "github.com/eolinker/apipark/module/organization/dto"
- "github.com/eolinker/go-common/autowire"
- "reflect"
-)
-
-type IOrganizationModule interface {
- Create(ctx context.Context, input *organization_dto.CreateOrganization) (*organization_dto.Detail, error)
- Edit(ctx context.Context, id string, input *organization_dto.EditOrganization) (*organization_dto.Detail, error)
- Get(ctx context.Context, id string) (*organization_dto.Detail, error)
- Search(ctx context.Context, keyword string) ([]*organization_dto.Item, error)
- Delete(ctx context.Context, id string) (string, error)
- Simple(ctx context.Context) ([]*organization_dto.Simple, error)
- Partitions(ctx context.Context, id string) ([]*organization_dto.Partition, error)
-}
-
-func init() {
- autowire.Auto[IOrganizationModule](func() reflect.Value {
- return reflect.ValueOf(new(implOrganizationModule))
- })
-}
diff --git a/module/partition/impl.go b/module/partition/impl.go
index 725025c..f312695 100644
--- a/module/partition/impl.go
+++ b/module/partition/impl.go
@@ -4,19 +4,19 @@ import (
"context"
"errors"
"fmt"
+ "strings"
+
"github.com/eolinker/apipark/gateway/admin"
- "github.com/eolinker/apipark/service/organization"
"github.com/eolinker/eosc/log"
- "strings"
-
+
"github.com/eolinker/go-common/store"
-
+
"github.com/eolinker/apipark/gateway"
-
+
"gorm.io/gorm"
-
+
"github.com/google/uuid"
-
+
"github.com/eolinker/ap-account/service/account"
paritiondto "github.com/eolinker/apipark/module/partition/dto"
"github.com/eolinker/apipark/service/cluster"
@@ -30,10 +30,10 @@ var (
)
type imlPartition struct {
- partitionService partition.IPartitionService `autowired:""`
- organizationService organization.IOrganizationService `autowired:""`
- clusterService cluster.IClusterService `autowired:""`
- userNameService account.IAccountService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ //organizationService organization.IOrganizationService `autowired:""`
+ clusterService cluster.IClusterService `autowired:""`
+ userNameService account.IAccountService `autowired:""`
//monitorService monitor.IMonitorService `autowired:""`
transaction store.ITransaction `autowired:""`
}
@@ -53,7 +53,7 @@ func (m *imlPartition) CheckCluster(ctx context.Context, address ...string) ([]*
}
})
nodeStatus(ctx, nodesOut)
-
+
return nodesOut, nil
}
@@ -62,7 +62,7 @@ func (m *imlPartition) ResetCluster(ctx context.Context, partitionId string, add
if err != nil {
return nil, err
}
-
+
nodes, err := m.clusterService.UpdateAddress(ctx, info.Cluster, address)
if err != nil {
return nil, err
@@ -80,7 +80,7 @@ func (m *imlPartition) ResetCluster(ctx context.Context, partitionId string, add
Gateways: i.Server,
}
})
-
+
nodeStatus(ctx, nodesOut)
return nodesOut, nil
}
@@ -116,7 +116,7 @@ func (m *imlPartition) ClusterNodes(ctx context.Context, partitionId string) ([]
}
})
nodeStatus(ctx, nodesOut)
-
+
return nodesOut, nil
}
@@ -166,7 +166,7 @@ func (m *imlPartition) Search(ctx context.Context, keyword string) ([]*paritiond
return nil, err
}
items := utils.SliceToSlice(partitions, func(i *partition.Partition) *paritiondto.Item {
-
+
return &paritiondto.Item{
Creator: auto.UUID(i.Creator),
Updater: auto.UUID(i.Updater),
@@ -187,7 +187,7 @@ func (m *imlPartition) Search(ctx context.Context, keyword string) ([]*paritiond
item.ClusterNum = counts[item.Id]
}
}
-
+
return items, nil
}
@@ -196,23 +196,23 @@ func (m *imlPartition) Get(ctx context.Context, id string) (*paritiondto.Detail,
if err != nil {
return nil, err
}
- oDetails, err := m.organizationService.Search(ctx, "")
- if err != nil {
- return nil, err
- }
- canDelete := true
- for _, o := range oDetails {
- for _, p := range o.Partitions {
- if p == id {
- canDelete = false
- break
- }
- }
- if !canDelete {
- break
- }
- }
-
+ //oDetails, err := m.organizationService.Search(ctx, "")
+ //if err != nil {
+ // return nil, err
+ //}
+ //canDelete := true
+ //for _, o := range oDetails {
+ // for _, p := range o.Partitions {
+ // if p == id {
+ // canDelete = false
+ // break
+ // }
+ // }
+ // if !canDelete {
+ // break
+ // }
+ //}
+
pd := &paritiondto.Detail{
Creator: auto.UUID(pm.Creator),
Updater: auto.UUID(pm.Updater),
@@ -222,7 +222,7 @@ func (m *imlPartition) Get(ctx context.Context, id string) (*paritiondto.Detail,
Prefix: pm.Prefix,
CreateTime: auto.TimeLabel(pm.CreateTime),
UpdateTime: auto.TimeLabel(pm.UpdateTime),
- CanDelete: canDelete,
+ //CanDelete: canDelete,
}
return pd, nil
}
@@ -255,7 +255,7 @@ func (m *imlPartition) Delete(ctx context.Context, id string) error {
}
return m.partitionService.Delete(ctx, id)
})
-
+
}
func (m *imlPartition) Simple(ctx context.Context) ([]*paritiondto.Simple, error) {
@@ -286,19 +286,19 @@ func (m *imlPartition) SimpleByIds(ctx context.Context, ids []string) ([]*pariti
}
})
return pd, nil
-
+
}
func (m *imlPartition) SimpleWithCluster(ctx context.Context) ([]*paritiondto.SimpleWithCluster, error) {
pm, err := m.partitionService.Search(ctx, "", nil)
if err != nil {
return nil, err
}
-
+
clusterList, err := m.clusterService.List(ctx)
if err != nil {
return nil, err
}
-
+
clusterMap := utils.SliceToMapArrayO(clusterList, func(i *cluster.Cluster) (string, *paritiondto.Cluster) {
return i.Partition, &paritiondto.Cluster{
Id: i.Uuid,
diff --git a/module/project-authorization/iml.go b/module/project-authorization/iml.go
index 85009ea..155b16a 100644
--- a/module/project-authorization/iml.go
+++ b/module/project-authorization/iml.go
@@ -5,9 +5,12 @@ import (
"encoding/json"
"errors"
"fmt"
- "github.com/eolinker/eosc/log"
"time"
+ "github.com/eolinker/apipark/service/partition"
+
+ "github.com/eolinker/eosc/log"
+
authDriver "github.com/eolinker/apipark/module/project-authorization/auth-driver"
"github.com/eolinker/go-common/utils"
@@ -33,7 +36,7 @@ var _ IProjectAuthorizationModule = (*imlProjectAuthorizationModule)(nil)
type imlProjectAuthorizationModule struct {
projectService project.IProjectService `autowired:""`
projectAuthorizationService projectAuthorization.IProjectAuthorizationService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
clusterService cluster.IClusterService `autowired:""`
transaction store.ITransaction `autowired:""`
}
@@ -80,20 +83,17 @@ func (i *imlProjectAuthorizationModule) getApplications(ctx context.Context, pro
}
func (i *imlProjectAuthorizationModule) initGateway(ctx context.Context, partitionId string, clientDriver gateway.IClientDriver) error {
- projectPartitions, err := i.projectPartitionService.ListByPartition(ctx, partitionId)
+ projects, err := i.projectService.List(ctx)
if err != nil {
return err
}
- projectIds := utils.SliceToSlice(projectPartitions, func(p *project.Partition) string {
- return p.Project
- })
- projects, err := i.projectService.List(ctx, projectIds...)
- if err != nil {
- return err
+ projectIds := make([]string, 0, len(projects))
+ projectMap := make(map[string]*project.Project)
+ for _, p := range projects {
+ projectIds = append(projectIds, p.Id)
+ projectMap[p.Id] = p
}
- projectMap := utils.SliceToMap(projects, func(p *project.Project) string {
- return p.Id
- })
+
applications, err := i.getApplications(ctx, projectIds, projectMap)
if err != nil {
return err
@@ -102,10 +102,14 @@ func (i *imlProjectAuthorizationModule) initGateway(ctx context.Context, partiti
}
func (i *imlProjectAuthorizationModule) online(ctx context.Context, projectInfo *project.Project) error {
- partitionIds, err := i.projectPartitionService.GetByProject(ctx, projectInfo.Id)
+
+ partitions, err := i.partitionService.List(ctx)
if err != nil {
return err
}
+ partitionIds := utils.SliceToSlice(partitions, func(p *partition.Partition) string {
+ return p.UUID
+ })
clusters, err := i.clusterService.List(ctx, partitionIds...)
if err != nil {
return err
@@ -259,15 +263,18 @@ func (i *imlProjectAuthorizationModule) DeleteAuthorization(ctx context.Context,
if err != nil {
return err
}
+ partitions, err := i.partitionService.List(ctx)
+ if err != nil {
+ return err
+ }
+ partitionIds := utils.SliceToSlice(partitions, func(p *partition.Partition) string {
+ return p.UUID
+ })
return i.transaction.Transaction(ctx, func(ctx context.Context) error {
err = i.projectAuthorizationService.Delete(ctx, aid)
if err != nil {
return err
}
- partitionIds, err := i.projectPartitionService.GetByProject(ctx, pid)
- if err != nil {
- return err
- }
clusters, err := i.clusterService.List(ctx, partitionIds...)
if err != nil {
return err
diff --git a/module/project/dto/input.go b/module/project/dto/input.go
index 2195016..d4445b9 100644
--- a/module/project/dto/input.go
+++ b/module/project/dto/input.go
@@ -12,10 +12,9 @@ type CreateProject struct {
}
type EditProject struct {
- Name *string `json:"name"`
- Description *string `json:"description"`
- Master *string `json:"master" aocheck:"user"`
- Partition []string `json:"partition" aocheck:"partition"`
+ Name *string `json:"name"`
+ Description *string `json:"description"`
+ Master *string `json:"master" aocheck:"user"`
}
type CreateApp struct {
diff --git a/module/project/dto/output.go b/module/project/dto/output.go
index a55e8c5..6fb22fd 100644
--- a/module/project/dto/output.go
+++ b/module/project/dto/output.go
@@ -6,19 +6,19 @@ import (
)
type ProjectItem struct {
- Id string `json:"id"`
- Name string `json:"name"`
- Organization auto.Label `json:"organization" aolabel:"organization"`
- Team auto.Label `json:"team" aolabel:"team"`
- ApiNum int64 `json:"api_num"`
- ServiceNum int64 `json:"service_num"`
+ Id string `json:"id"`
+ Name string `json:"name"`
+ //Organization auto.Label `json:"organization" aolabel:"organization"`
+ Team auto.Label `json:"team" aolabel:"team"`
+ ApiNum int64 `json:"api_num"`
+ ServiceNum int64 `json:"service_num"`
//SubscribeNum int64 `json:"subscribe_num"`
- Description string `json:"description"`
- Master auto.Label `json:"master" aolabel:"user"`
- Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
- CreateTime auto.TimeLabel `json:"create_time"`
- UpdateTime auto.TimeLabel `json:"update_time"`
- CanDelete bool `json:"can_delete"`
+ Description string `json:"description"`
+ Master auto.Label `json:"master" aolabel:"user"`
+ //Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
+ CreateTime auto.TimeLabel `json:"create_time"`
+ UpdateTime auto.TimeLabel `json:"update_time"`
+ CanDelete bool `json:"can_delete"`
}
type AppItem struct {
@@ -34,12 +34,12 @@ type AppItem struct {
}
type SimpleProjectItem struct {
- Id string `json:"id"`
- Name string `json:"name"`
- Organization auto.Label `json:"organization" aolabel:"organization"`
- Team auto.Label `json:"team" aolabel:"team"`
- Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
- Description string `json:"description"`
+ Id string `json:"id"`
+ Name string `json:"name"`
+ //Organization auto.Label `json:"organization" aolabel:"organization"`
+ Team auto.Label `json:"team" aolabel:"team"`
+ //Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
+ Description string `json:"description"`
}
type SimpleAppItem struct {
@@ -50,19 +50,19 @@ type SimpleAppItem struct {
}
type Project struct {
- Id string `json:"id"`
- Name string `json:"name"`
- Prefix string `json:"prefix,omitempty"`
- Description string `json:"description"`
- Organization auto.Label `json:"organization" aolabel:"organization"`
- Team auto.Label `json:"team" aolabel:"team"`
- Master auto.Label `json:"master" aolabel:"user"`
- Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
- OrganizationPrefix string `json:"organization_prefix,omitempty"`
- CreateTime auto.TimeLabel `json:"create_time"`
- UpdateTime auto.TimeLabel `json:"update_time"`
- AsServer bool `json:"as_server"`
- AsApp bool `json:"as_app"`
+ Id string `json:"id"`
+ Name string `json:"name"`
+ Prefix string `json:"prefix,omitempty"`
+ Description string `json:"description"`
+ //Organization auto.Label `json:"organization" aolabel:"organization"`
+ Team auto.Label `json:"team" aolabel:"team"`
+ Master auto.Label `json:"master" aolabel:"user"`
+ //Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
+ //OrganizationPrefix string `json:"organization_prefix,omitempty"`
+ CreateTime auto.TimeLabel `json:"create_time"`
+ UpdateTime auto.TimeLabel `json:"update_time"`
+ AsServer bool `json:"as_server"`
+ AsApp bool `json:"as_app"`
}
type App struct {
@@ -75,21 +75,18 @@ type App struct {
AsApp bool `json:"as_app"`
}
-func ToProject(model *project.Project, organization string, organizationPrefix string, partitions []string) *Project {
+func ToProject(model *project.Project) *Project {
return &Project{
- Id: model.Id,
- Name: model.Name,
- Prefix: model.Prefix,
- Description: model.Description,
- Organization: auto.UUID(organization),
- Team: auto.UUID(model.Team),
- Master: auto.UUID(model.Master),
- Partition: auto.List(partitions),
- OrganizationPrefix: organizationPrefix,
- CreateTime: auto.TimeLabel(model.CreateTime),
- UpdateTime: auto.TimeLabel(model.UpdateTime),
- AsServer: model.AsServer,
- AsApp: model.AsApp,
+ Id: model.Id,
+ Name: model.Name,
+ Prefix: model.Prefix,
+ Description: model.Description,
+ Team: auto.UUID(model.Team),
+ Master: auto.UUID(model.Master),
+ CreateTime: auto.TimeLabel(model.CreateTime),
+ UpdateTime: auto.TimeLabel(model.UpdateTime),
+ AsServer: model.AsServer,
+ AsApp: model.AsApp,
}
}
diff --git a/module/project/iml.go b/module/project/iml.go
index 965b608..e9903c5 100644
--- a/module/project/iml.go
+++ b/module/project/iml.go
@@ -4,11 +4,14 @@ import (
"context"
"errors"
"fmt"
- "github.com/eolinker/apipark/service/subscribe"
- "gorm.io/gorm"
"sort"
"strings"
+ "github.com/eolinker/apipark/service/partition"
+
+ "github.com/eolinker/apipark/service/subscribe"
+ "gorm.io/gorm"
+
"github.com/eolinker/ap-account/service/member"
"github.com/eolinker/apipark/service/api"
@@ -21,8 +24,6 @@ import (
"github.com/eolinker/go-common/auto"
- "github.com/eolinker/apipark/service/organization"
-
team_member "github.com/eolinker/apipark/service/team-member"
project_member "github.com/eolinker/apipark/service/project-member"
@@ -45,15 +46,14 @@ var (
)
type imlProjectModule struct {
- projectService project.IProjectService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- projectMemberService project_member.IMemberService `autowired:""`
- teamService team.ITeamService `autowired:""`
- teamMemberService team_member.ITeamMemberService `autowired:""`
- organizationService organization.IOrganizationService `autowired:""`
- serviceService service.IServiceService `autowired:""`
- apiService api.IAPIService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ projectMemberService project_member.IMemberService `autowired:""`
+ teamService team.ITeamService `autowired:""`
+ teamMemberService team_member.ITeamMemberService `autowired:""`
+ serviceService service.IServiceService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ transaction store.ITransaction `autowired:""`
}
func (i *imlProjectModule) searchMyProjects(ctx context.Context, teamId string, keyword string) ([]*project.Project, error) {
@@ -96,13 +96,7 @@ func (i *imlProjectModule) SearchMyProjects(ctx context.Context, teamId string,
if err != nil {
return nil, err
}
- partitions, err := i.projectPartitionService.ListByProject(ctx, projectIDs...)
- if err != nil {
- return nil, err
- }
- partitionMap := utils.SliceToMapArrayO(partitions, func(p *project.Partition) (string, string) {
- return p.Project, p.Partition
- })
+
items := make([]*project_dto.ProjectItem, 0, len(projects))
for _, model := range projects {
if teamId != "" && model.Team != teamId {
@@ -111,18 +105,16 @@ func (i *imlProjectModule) SearchMyProjects(ctx context.Context, teamId string,
apiCount := apiCountMap[model.Id]
serviceCount := serviceCountMap[model.Id]
items = append(items, &project_dto.ProjectItem{
- Id: model.Id,
- Name: model.Name,
- Description: model.Description,
- Master: auto.UUID(model.Master),
- CreateTime: auto.TimeLabel(model.CreateTime),
- UpdateTime: auto.TimeLabel(model.UpdateTime),
- Organization: auto.UUID(model.Organization),
- Partition: auto.List(partitionMap[model.Id]),
- Team: auto.UUID(model.Team),
- ApiNum: apiCount,
- ServiceNum: serviceCount,
- CanDelete: apiCount == 0 && serviceCount == 0,
+ Id: model.Id,
+ Name: model.Name,
+ Description: model.Description,
+ Master: auto.UUID(model.Master),
+ CreateTime: auto.TimeLabel(model.CreateTime),
+ UpdateTime: auto.TimeLabel(model.UpdateTime),
+ Team: auto.UUID(model.Team),
+ ApiNum: apiCount,
+ ServiceNum: serviceCount,
+ CanDelete: apiCount == 0 && serviceCount == 0,
})
}
return items, nil
@@ -141,49 +133,36 @@ func (i *imlProjectModule) SimpleAPPS(ctx context.Context, keyword string) ([]*p
Name: p.Name,
Description: p.Description,
- Organization: auto.UUID(p.Organization),
- Team: auto.UUID(p.Team),
+ Team: auto.UUID(p.Team),
}
}), nil
}
-func (i *imlProjectModule) SimpleProjects(ctx context.Context, keyword string, partition string) ([]*project_dto.SimpleProjectItem, error) {
+func (i *imlProjectModule) SimpleProjects(ctx context.Context, keyword string) ([]*project_dto.SimpleProjectItem, error) {
w := make(map[string]interface{})
w["as_server"] = true
- if partition != "" {
- pp, err := i.projectPartitionService.ListByPartition(ctx, partition)
- if err != nil {
- return nil, err
- }
- w["uuid"] = utils.SliceToSlice(pp, func(p *project.Partition) string {
- return p.Project
- })
- }
+ //if partition != "" {
+ // pp, err := i.projectPartitionService.ListByPartition(ctx, partition)
+ // if err != nil {
+ // return nil, err
+ // }
+ // w["uuid"] = utils.SliceToSlice(pp, func(p *project.Partition) string {
+ // return p.Project
+ // })
+ //}
projects, err := i.projectService.Search(ctx, keyword, w)
if err != nil {
return nil, err
}
- projectIDs := utils.SliceToSlice(projects, func(p *project.Project) string {
- return p.Id
- })
- partitions, err := i.projectPartitionService.ListByProject(ctx, projectIDs...)
- if err != nil {
- return nil, err
- }
- partitionMap := utils.SliceToMapArrayO(partitions, func(p *project.Partition) (string, string) {
- return p.Project, p.Partition
- })
items := make([]*project_dto.SimpleProjectItem, 0, len(projects))
for _, p := range projects {
items = append(items, &project_dto.SimpleProjectItem{
- Id: p.Id,
- Name: p.Name,
- Description: p.Description,
- Organization: auto.UUID(p.Organization),
- Team: auto.UUID(p.Team),
- Partition: auto.List(partitionMap[p.Id]),
+ Id: p.Id,
+ Name: p.Name,
+ Description: p.Description,
+ Team: auto.UUID(p.Team),
})
}
return items, nil
@@ -195,27 +174,15 @@ func (i *imlProjectModule) MySimpleProjects(ctx context.Context, keyword string)
if err != nil {
return nil, err
}
- projectIDs := utils.SliceToSlice(projects, func(p *project.Project) string {
- return p.Id
- })
- partitions, err := i.projectPartitionService.ListByProject(ctx, projectIDs...)
- if err != nil {
- return nil, err
- }
- partitionMap := utils.SliceToMapArrayO(partitions, func(p *project.Partition) (string, string) {
- return p.Project, p.Partition
- })
items := make([]*project_dto.SimpleProjectItem, 0, len(projects))
for _, p := range projects {
items = append(items, &project_dto.SimpleProjectItem{
- Id: p.Id,
- Name: p.Name,
- Description: p.Description,
- Organization: auto.UUID(p.Organization),
- Team: auto.UUID(p.Team),
- Partition: auto.List(partitionMap[p.Id]),
+ Id: p.Id,
+ Name: p.Name,
+ Description: p.Description,
+ Team: auto.UUID(p.Team),
})
}
return items, nil
@@ -226,19 +193,8 @@ func (i *imlProjectModule) GetProject(ctx context.Context, id string) (*project_
if err != nil {
return nil, err
}
- teamInfo, err := i.teamService.Get(ctx, projectInfo.Team)
- if err != nil {
- return nil, err
- }
- organizationInfo, err := i.organizationService.Get(ctx, teamInfo.Organization)
- if err != nil {
- return nil, err
- }
- partitions, err := i.projectPartitionService.GetByProject(ctx, id)
- if err != nil {
- return nil, err
- }
- return project_dto.ToProject(projectInfo, teamInfo.Organization, organizationInfo.Prefix, partitions), nil
+
+ return project_dto.ToProject(projectInfo), nil
}
func (i *imlProjectModule) Search(ctx context.Context, teamID string, keyword string) ([]*project_dto.ProjectItem, error) {
@@ -269,51 +225,39 @@ func (i *imlProjectModule) Search(ctx context.Context, teamID string, keyword st
if err != nil {
return nil, err
}
- partitions, err := i.projectPartitionService.ListByProject(ctx, projectIds...)
- if err != nil {
- return nil, err
- }
- partitionMap := utils.SliceToMapArrayO(partitions, func(p *project.Partition) (string, string) {
- return p.Project, p.Partition
- })
+
items := make([]*project_dto.ProjectItem, 0, len(list))
for _, model := range list {
apiCount := apiCountMap[model.Id]
serviceCount := serviceCountMap[model.Id]
items = append(items, &project_dto.ProjectItem{
- Id: model.Id,
- Name: model.Name,
- Description: model.Description,
- Master: auto.UUID(model.Master),
- CreateTime: auto.TimeLabel(model.CreateTime),
- UpdateTime: auto.TimeLabel(model.UpdateTime),
- Organization: auto.UUID(model.Organization),
- Partition: auto.List(partitionMap[model.Id]),
- Team: auto.UUID(model.Team),
- ApiNum: apiCount,
- ServiceNum: serviceCount,
- CanDelete: apiCount == 0 && serviceCount == 0,
+ Id: model.Id,
+ Name: model.Name,
+ Description: model.Description,
+ Master: auto.UUID(model.Master),
+ CreateTime: auto.TimeLabel(model.CreateTime),
+ UpdateTime: auto.TimeLabel(model.UpdateTime),
+ Team: auto.UUID(model.Team),
+ ApiNum: apiCount,
+ ServiceNum: serviceCount,
+ CanDelete: apiCount == 0 && serviceCount == 0,
})
}
return items, nil
}
func (i *imlProjectModule) CreateProject(ctx context.Context, teamID string, input *project_dto.CreateProject) (*project_dto.Project, error) {
- teamInfo, err := i.teamService.Get(ctx, teamID)
- if err != nil {
- return nil, err
- }
+
if input.Id == "" {
input.Id = uuid.New().String()
}
mo := &project.CreateProject{
- Id: input.Id,
- Name: input.Name,
- Description: input.Description,
- Master: input.Master,
- Team: teamID,
- Prefix: input.Prefix,
- Organization: teamInfo.Organization,
+ Id: input.Id,
+ Name: input.Name,
+ Description: input.Description,
+ Master: input.Master,
+ Team: teamID,
+ Prefix: input.Prefix,
}
if input.AsApp == nil {
// 默认值为false
@@ -328,18 +272,8 @@ func (i *imlProjectModule) CreateProject(ctx context.Context, teamID string, inp
mo.AsServer = *input.AsServer
}
input.Prefix = strings.Trim(strings.Trim(input.Prefix, " "), "/")
- err = i.transaction.Transaction(ctx, func(ctx context.Context) error {
- if mo.AsServer {
- // 判断是否有不可用的分区
- err = i.validPartitions(ctx, teamInfo.Organization, input.Partition)
- if err != nil {
- return err
- }
- err = i.projectPartitionService.Save(ctx, input.Id, input.Partition)
- if err != nil {
- return err
- }
- }
+ err := i.transaction.Transaction(ctx, func(ctx context.Context) error {
+
// 判断用户是否在团队内
members, err := i.teamMemberService.Members(ctx, []string{teamID}, []string{input.Master})
if err != nil {
@@ -362,40 +296,13 @@ func (i *imlProjectModule) CreateProject(ctx context.Context, teamID string, inp
return i.GetProject(ctx, input.Id)
}
-func (i *imlProjectModule) validPartitions(ctx context.Context, orgID string, partitions []string) error {
- orgPartitions, err := i.organizationService.Partitions(ctx, orgID)
+func (i *imlProjectModule) EditProject(ctx context.Context, id string, input *project_dto.EditProject) (*project_dto.Project, error) {
+ _, err := i.projectService.Get(ctx, id)
if err != nil {
- return err
- }
- partitionMap := utils.SliceToMapO(orgPartitions, func(s string) (string, struct{}) {
- return s, struct{}{}
- })
- for _, partition := range partitions {
- if _, ok := partitionMap[partition]; !ok {
- return fmt.Errorf("partition not found: %s", partition)
- }
+ return nil, err
}
- return nil
-}
-
-func (i *imlProjectModule) EditProject(ctx context.Context, id string, input *project_dto.EditProject) (*project_dto.Project, error) {
+ err = i.transaction.Transaction(ctx, func(ctx context.Context) error {
- err := i.transaction.Transaction(ctx, func(ctx context.Context) error {
- pInfo, err := i.projectService.Get(ctx, id)
- if err != nil {
- return err
- }
- if len(input.Partition) > 0 {
- // 判断是否有不可用的分区
- err = i.validPartitions(ctx, pInfo.Organization, input.Partition)
- if err != nil {
- return err
- }
- err = i.projectPartitionService.Save(ctx, pInfo.Id, input.Partition)
- if err != nil {
- return err
- }
- }
if input.Master != nil {
projectInfo, err := i.projectService.Get(ctx, id)
if err != nil {
@@ -450,10 +357,6 @@ func (i *imlProjectModule) DeleteProject(ctx context.Context, id string) error {
if err != nil {
return err
}
- err = i.projectPartitionService.Delete(ctx, id)
- if err != nil {
- return err
- }
return i.projectService.Delete(ctx, id)
})
@@ -643,22 +546,21 @@ type imlAppModule struct {
}
func (i *imlAppModule) CreateApp(ctx context.Context, teamID string, input *project_dto.CreateApp) (*project_dto.App, error) {
- teamInfo, err := i.teamService.Get(ctx, teamID)
- if err != nil {
- return nil, err
- }
+ //teamInfo, err := i.teamService.Get(ctx, teamID)
+ //if err != nil {
+ // return nil, err
+ //}
if input.Id == "" {
input.Id = uuid.New().String()
}
userId := utils.UserId(ctx)
mo := &project.CreateProject{
- Id: input.Id,
- Name: input.Name,
- Description: input.Description,
- Master: userId,
- Team: teamID,
- Organization: teamInfo.Organization,
- AsApp: true,
+ Id: input.Id,
+ Name: input.Name,
+ Description: input.Description,
+ Master: userId,
+ Team: teamID,
+ AsApp: true,
}
// 判断用户是否在团队内
members, err := i.teamMemberService.Members(ctx, []string{teamID}, []string{userId})
diff --git a/module/project/project.go b/module/project/project.go
index 23712d8..9850848 100644
--- a/module/project/project.go
+++ b/module/project/project.go
@@ -23,7 +23,7 @@ type IProjectModule interface {
// DeleteProject 删除项目
DeleteProject(ctx context.Context, id string) error
// SimpleProjects 获取简易项目列表
- SimpleProjects(ctx context.Context, keyword string, partition string) ([]*project_dto.SimpleProjectItem, error)
+ SimpleProjects(ctx context.Context, keyword string) ([]*project_dto.SimpleProjectItem, error)
// MySimpleProjects 获取我的简易项目列表
MySimpleProjects(ctx context.Context, keyword string) ([]*project_dto.SimpleProjectItem, error)
diff --git a/module/project_diff/iml.go b/module/project_diff/iml.go
index 885c43a..816be78 100644
--- a/module/project_diff/iml.go
+++ b/module/project_diff/iml.go
@@ -10,7 +10,6 @@ import (
"github.com/eolinker/apipark/service/api"
"github.com/eolinker/apipark/service/cluster"
"github.com/eolinker/apipark/service/partition"
- "github.com/eolinker/apipark/service/project"
"github.com/eolinker/apipark/service/project_diff"
"github.com/eolinker/apipark/service/release"
"github.com/eolinker/apipark/service/universally/commit"
@@ -20,19 +19,18 @@ import (
)
type imlProjectDiff struct {
- apiService api.IAPIService `autowired:""`
- upstreamService upstream.IUpstreamService `autowired:""`
- releaseService release.IReleaseService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- partitionService partition.IPartitionService `autowired:""`
- clusterService cluster.IClusterService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ upstreamService upstream.IUpstreamService `autowired:""`
+ releaseService release.IReleaseService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ clusterService cluster.IClusterService `autowired:""`
}
func (m *imlProjectDiff) Diff(ctx context.Context, projectId string, baseRelease, targetRelease string) (*project_diff.Diff, error) {
if targetRelease == "" {
return nil, fmt.Errorf("target release is required")
}
- partitions, err := m.projectPartitionService.GetByProject(ctx, projectId)
+ partitions, err := m.partitionService.List(ctx)
if err != nil {
return nil, err
}
@@ -58,8 +56,10 @@ func (m *imlProjectDiff) Diff(ctx context.Context, projectId string, baseRelease
return nil, err
}
target.id = projectId
-
- diff := m.diff(partitions, base, target)
+ partitionIds := utils.SliceToSlice(partitions, func(i *partition.Partition) string {
+ return i.UUID
+ })
+ diff := m.diff(partitionIds, base, target)
return diff, nil
}
@@ -120,11 +120,14 @@ func (m *imlProjectDiff) DiffForLatest(ctx context.Context, projectId string, ba
apiDocs: documents,
upstreamCommits: upstreamCommits,
}
- partitions, err := m.projectPartitionService.GetByProject(ctx, projectId)
+ partitions, err := m.partitionService.List(ctx)
if err != nil {
return nil, false, err
}
- return m.diff(partitions, base, target), true, nil
+ partitionIds := utils.SliceToSlice(partitions, func(i *partition.Partition) string {
+ return i.UUID
+ })
+ return m.diff(partitionIds, base, target), true, nil
}
func (m *imlProjectDiff) getReleaseInfo(ctx context.Context, releaseId string) (*projectInfo, error) {
commits, err := m.releaseService.GetCommits(ctx, releaseId)
diff --git a/module/publish/iml.go b/module/publish/iml.go
index fa31b32..86a232b 100644
--- a/module/publish/iml.go
+++ b/module/publish/iml.go
@@ -39,25 +39,24 @@ var (
)
type imlPublishModule struct {
- projectDiffModule projectDiff.IProjectDiffModule `autowired:""`
- publishService publish.IPublishService `autowired:""`
- apiService api.IAPIService `autowired:""`
- upstreamService upstream.IUpstreamService `autowired:""`
- releaseService release.IReleaseService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- clusterService cluster.IClusterService `autowired:""`
- partitionService partition.IPartitionService `autowired:""`
- projectService project.IProjectService `autowired:""`
+ projectDiffModule projectDiff.IProjectDiffModule `autowired:""`
+ publishService publish.IPublishService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ upstreamService upstream.IUpstreamService `autowired:""`
+ releaseService release.IReleaseService `autowired:""`
+ clusterService cluster.IClusterService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ projectService project.IProjectService `autowired:""`
}
func (m *imlPublishModule) initGateway(ctx context.Context, partitionId string, clientDriver gateway.IClientDriver) error {
- projectPartitions, err := m.projectPartitionService.ListByPartition(ctx, partitionId)
+ projects, err := m.projectService.List(ctx)
if err != nil {
return err
}
- projectIds := utils.SliceToSlice(projectPartitions, func(p *project.Partition) string {
- return p.Project
+ projectIds := utils.SliceToSlice(projects, func(p *project.Project) string {
+ return p.Id
})
for _, projectId := range projectIds {
releaseInfo, err := m.getProjectRelease(ctx, projectId, partitionId)
@@ -530,10 +529,13 @@ func (m *imlPublishModule) Publish(ctx context.Context, project string, id strin
if flow.Status != publish.StatusAccept {
return errors.New("只有通过状态才能发布")
}
- partitionIds, err := m.projectPartitionService.GetByProject(ctx, project)
+ partitions, err := m.partitionService.List(ctx)
if err != nil {
return err
}
+ partitionIds := utils.SliceToSlice(partitions, func(p *partition.Partition) string {
+ return p.UUID
+ })
projectReleaseMap, err := m.getReleaseInfo(ctx, project, flow.Release, flow.Release, partitionIds)
if err != nil {
return err
diff --git a/module/release/iml.go b/module/release/iml.go
index 3555e10..7f56a6a 100644
--- a/module/release/iml.go
+++ b/module/release/iml.go
@@ -5,6 +5,8 @@ import (
"errors"
"fmt"
+ "github.com/eolinker/apipark/service/partition"
+
projectDiff "github.com/eolinker/apipark/module/project_diff"
"github.com/eolinker/apipark/module/release/dto"
"github.com/eolinker/apipark/service/api"
@@ -28,14 +30,14 @@ var (
)
type imlReleaseModule struct {
- projectDiffModule projectDiff.IProjectDiffModule `autowired:""`
- releaseService release.IReleaseService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- apiService api.IAPIService `autowired:""`
- upstreamService upstream.IUpstreamService `autowired:""`
- publishService publish.IPublishService `autowired:""`
- transaction store.ITransaction `autowired:""`
- projectService project.IProjectService `autowired:""`
+ projectDiffModule projectDiff.IProjectDiffModule `autowired:""`
+ releaseService release.IReleaseService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ upstreamService upstream.IUpstreamService `autowired:""`
+ publishService publish.IPublishService `autowired:""`
+ transaction store.ITransaction `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
}
func (m *imlReleaseModule) Create(ctx context.Context, projectId string, input *dto.CreateInput) (string, error) {
@@ -47,7 +49,7 @@ func (m *imlReleaseModule) Create(ctx context.Context, projectId string, input *
}
return "", err
}
- partitions, err := m.projectPartitionService.ListByProject(ctx, projectId)
+ partitions, err := m.partitionService.List(ctx)
if err != nil {
return "", fmt.Errorf("partitions not set:%w", err)
}
@@ -107,8 +109,8 @@ func (m *imlReleaseModule) Create(ctx context.Context, projectId string, input *
return c.Key, c.UUID
})
})
- if !m.releaseService.Completeness(utils.SliceToSlice(partitions, func(s *project.Partition) string {
- return s.Partition
+ if !m.releaseService.Completeness(utils.SliceToSlice(partitions, func(s *partition.Partition) string {
+ return s.UUID
}), apiUUIDS, apiProxy, apiDocs, upstreams) {
return "", errors.New("completeness check failed")
}
diff --git a/module/service/iml.go b/module/service/iml.go
index 773acc0..19f2607 100644
--- a/module/service/iml.go
+++ b/module/service/iml.go
@@ -4,10 +4,11 @@ import (
"context"
"errors"
"fmt"
+ "strings"
+
"github.com/eolinker/apipark/service/partition"
"github.com/eolinker/apipark/service/subscribe"
"github.com/eolinker/eosc/log"
- "strings"
"github.com/eolinker/apipark/gateway"
@@ -39,18 +40,17 @@ var (
)
type imlServiceModule struct {
- projectService project.IProjectService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- serviceService service.IServiceService `autowired:""`
- serviceTagService service.ITagService `autowired:""`
- servicePartitionService service.IPartitionsService `autowired:""`
- serviceDocService service.IDocService `autowired:""`
- tagService tag.ITagService `autowired:""`
- serviceApiService service.IApiService `autowired:""`
- apiService api.IAPIService `autowired:""`
- subscribeService subscribe.ISubscribeService `autowired:""`
- partitionService partition.IPartitionService `autowired:""`
- clusterService cluster.IClusterService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ serviceService service.IServiceService `autowired:""`
+ serviceTagService service.ITagService `autowired:""`
+ servicePartitionService service.IPartitionsService `autowired:""`
+ serviceDocService service.IDocService `autowired:""`
+ tagService tag.ITagService `autowired:""`
+ serviceApiService service.IApiService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ subscribeService subscribe.ISubscribeService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ clusterService cluster.IClusterService `autowired:""`
transaction store.ITransaction `autowired:""`
}
@@ -82,12 +82,9 @@ func (i *imlServiceModule) getServiceApis(ctx context.Context, projectIds []stri
}
func (i *imlServiceModule) initGateway(ctx context.Context, partitionId string, clientDriver gateway.IClientDriver) error {
- projectPartitions, err := i.projectPartitionService.ListByPartition(ctx, partitionId)
- if err != nil {
- return err
- }
- projectIds := utils.SliceToSlice(projectPartitions, func(p *project.Partition) string {
- return p.Project
+ projects, err := i.projectService.List(ctx)
+ projectIds := utils.SliceToSlice(projects, func(p *project.Project) string {
+ return p.Id
})
releases, err := i.getServiceApis(ctx, projectIds)
if err != nil {
@@ -413,17 +410,16 @@ func (i *imlServiceModule) Create(ctx context.Context, pid string, input *servic
err = i.transaction.Transaction(ctx, func(ctx context.Context) error {
t := strings.Join(input.Tags, ",")
err = i.serviceService.Create(ctx, &service.CreateService{
- Uuid: input.ID,
- Name: input.Name,
- Description: input.Description,
- Logo: input.Logo,
- ServiceType: input.ServiceType,
- Project: pid,
- Team: pInfo.Team,
- Organization: pInfo.Organization,
- Catalogue: catalogue,
- Status: service.StatusOff,
- Tag: t,
+ Uuid: input.ID,
+ Name: input.Name,
+ Description: input.Description,
+ Logo: input.Logo,
+ ServiceType: input.ServiceType,
+ Project: pid,
+ Team: pInfo.Team,
+ Catalogue: catalogue,
+ Status: service.StatusOff,
+ Tag: t,
})
if err != nil {
return err
diff --git a/module/subscribe/dto/input.go b/module/subscribe/dto/input.go
index ba67cab..8f9faa5 100644
--- a/module/subscribe/dto/input.go
+++ b/module/subscribe/dto/input.go
@@ -1,15 +1,15 @@
package subscribe_dto
type AddSubscriber struct {
- Uuid string `json:"uuid"`
- Service string `json:"service" aocheck:"service"`
- Project string `json:"subscriber" aocheck:"project"`
- Applier string `json:"applier" aocheck:"user"`
- Partition []string `json:"partition" aocheck:"partition"`
+ Uuid string `json:"uuid"`
+ Service string `json:"service" aocheck:"service"`
+ Project string `json:"subscriber" aocheck:"project"`
+ Applier string `json:"applier" aocheck:"user"`
+ //Partition []string `json:"partition" aocheck:"partition"`
}
type Approve struct {
- Partition []string `json:"partition" aocheck:"partition"`
- Opinion string `json:"opinion"`
- Operate string `json:"operate"`
+ //Partition []string `json:"partition" aocheck:"partition"`
+ Opinion string `json:"opinion"`
+ Operate string `json:"operate"`
}
diff --git a/module/subscribe/dto/output.go b/module/subscribe/dto/output.go
index b749d01..70ec6fe 100644
--- a/module/subscribe/dto/output.go
+++ b/module/subscribe/dto/output.go
@@ -3,10 +3,10 @@ package subscribe_dto
import "github.com/eolinker/go-common/auto"
type Subscriber struct {
- Id string `json:"id"`
- Project auto.Label `json:"project" aolabel:"project"`
- Service auto.Label `json:"service" aolabel:"service"`
- Partition []auto.Label `json:"partition" aolabel:"partition"`
+ Id string `json:"id"`
+ Project auto.Label `json:"project" aolabel:"project"`
+ Service auto.Label `json:"service" aolabel:"service"`
+ //Partition []auto.Label `json:"partition" aolabel:"partition"`
Subscriber auto.Label `json:"subscriber" aolabel:"project"`
Team auto.Label `json:"team" aolabel:"team"`
@@ -17,9 +17,9 @@ type Subscriber struct {
}
type SubscriptionItem struct {
- Id string `json:"id"`
- Service auto.Label `json:"service" aolabel:"service"`
- Partition auto.Label `json:"partition" aolabel:"partition"`
+ Id string `json:"id"`
+ Service auto.Label `json:"service" aolabel:"service"`
+ //Partition auto.Label `json:"partition" aolabel:"partition"`
ApplyStatus int `json:"apply_status"`
Project auto.Label `json:"project" aolabel:"project"`
Team auto.Label `json:"team" aolabel:"team"`
@@ -39,7 +39,6 @@ type Approval struct {
Applier auto.Label `json:"applier" aolabel:"user"`
Approver auto.Label `json:"approver" aolabel:"user"`
ApprovalTime auto.TimeLabel `json:"approval_time"`
- Partition []auto.Label `json:"partition" aolabel:"partition"`
Reason string `json:"reason"`
Opinion string `json:"opinion"`
Status int `json:"status"`
@@ -59,8 +58,9 @@ type ApprovalItem struct {
Status int `json:"status"`
}
-type PartitionServiceItem struct {
- Id string `json:"id"`
- Name string `json:"name"`
- ServiceNum int64 `json:"service_num"`
-}
+//
+//type PartitionServiceItem struct {
+// Id string `json:"id"`
+// Name string `json:"name"`
+// ServiceNum int64 `json:"service_num"`
+//}
diff --git a/module/subscribe/iml.go b/module/subscribe/iml.go
index 1af02cf..1958f6c 100644
--- a/module/subscribe/iml.go
+++ b/module/subscribe/iml.go
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
+
"github.com/eolinker/apipark/service/partition"
"github.com/eolinker/eosc/log"
"gorm.io/gorm"
@@ -34,55 +35,54 @@ var (
)
type imlSubscribeModule struct {
- partitionService partition.IPartitionService `autowired:""`
- projectService project.IProjectService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- subscribeService subscribe.ISubscribeService `autowired:""`
- subscribeApplyService subscribe.ISubscribeApplyService `autowired:""`
- serviceService service.IServiceService `autowired:""`
- clusterService cluster.IClusterService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ subscribeService subscribe.ISubscribeService `autowired:""`
+ subscribeApplyService subscribe.ISubscribeApplyService `autowired:""`
+ serviceService service.IServiceService `autowired:""`
+ clusterService cluster.IClusterService `autowired:""`
+ transaction store.ITransaction `autowired:""`
}
-func (i *imlSubscribeModule) PartitionServices(ctx context.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error) {
- pInfo, err := i.projectService.Get(ctx, app)
- if err != nil {
- return nil, fmt.Errorf("get application error: %w", err)
- }
- if !pInfo.AsApp {
- return nil, fmt.Errorf("project %s is not an application", app)
- }
- partitions, err := i.partitionService.List(ctx)
- if err != nil {
- return nil, err
- }
- subscriptions, err := i.subscribeService.SubscriptionsByApplication(ctx, app)
- if err != nil {
- return nil, err
- }
- subscriptionCount := make(map[string]int64)
- for _, s := range subscriptions {
- if s.ApplyStatus != subscribe.ApplyStatusSubscribe && s.ApplyStatus != subscribe.ApplyStatusReview {
- continue
- }
- if _, ok := subscriptionCount[s.Partition]; !ok {
- subscriptionCount[s.Partition] = 0
- }
- subscriptionCount[s.Partition]++
- }
- items := make([]*subscribe_dto.PartitionServiceItem, 0)
- for _, p := range partitions {
- items = append(items, &subscribe_dto.PartitionServiceItem{
- Id: p.UUID,
- Name: p.Name,
- ServiceNum: subscriptionCount[p.UUID],
- })
- }
- return items, nil
-}
-
-func (i *imlSubscribeModule) getSubscribers(ctx context.Context, partitionId string, projectIds []string) ([]*gateway.SubscribeRelease, error) {
- subscribers, err := i.subscribeService.SubscribersByProject(ctx, partitionId, projectIds...)
+//func (i *imlSubscribeModule) PartitionServices(ctx context.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error) {
+// pInfo, err := i.projectService.Get(ctx, app)
+// if err != nil {
+// return nil, fmt.Errorf("get application error: %w", err)
+// }
+// if !pInfo.AsApp {
+// return nil, fmt.Errorf("project %s is not an application", app)
+// }
+// partitions, err := i.partitionService.List(ctx)
+// if err != nil {
+// return nil, err
+// }
+// subscriptions, err := i.subscribeService.SubscriptionsByApplication(ctx, app)
+// if err != nil {
+// return nil, err
+// }
+// subscriptionCount := make(map[string]int64)
+// for _, s := range subscriptions {
+// if s.ApplyStatus != subscribe.ApplyStatusSubscribe && s.ApplyStatus != subscribe.ApplyStatusReview {
+// continue
+// }
+// if _, ok := subscriptionCount[s.Partition]; !ok {
+// subscriptionCount[s.Partition] = 0
+// }
+// subscriptionCount[s.Partition]++
+// }
+// items := make([]*subscribe_dto.PartitionServiceItem, 0)
+// for _, p := range partitions {
+// items = append(items, &subscribe_dto.PartitionServiceItem{
+// Id: p.UUID,
+// Name: p.Name,
+// ServiceNum: subscriptionCount[p.UUID],
+// })
+// }
+// return items, nil
+//}
+
+func (i *imlSubscribeModule) getSubscribers(ctx context.Context, projectIds []string) ([]*gateway.SubscribeRelease, error) {
+ subscribers, err := i.subscribeService.SubscribersByProject(ctx, projectIds...)
if err != nil {
return nil, err
}
@@ -95,15 +95,16 @@ func (i *imlSubscribeModule) getSubscribers(ctx context.Context, partitionId str
}), nil
}
-func (i *imlSubscribeModule) initGateway(ctx context.Context, partitionId string, clientDriver gateway.IClientDriver) error {
- projectPartitions, err := i.projectPartitionService.ListByPartition(ctx, partitionId)
+func (i *imlSubscribeModule) initGateway(ctx context.Context, clientDriver gateway.IClientDriver) error {
+
+ projects, err := i.projectService.List(ctx)
if err != nil {
return err
}
- projectIds := utils.SliceToSlice(projectPartitions, func(p *project.Partition) string {
- return p.Project
+ projectIds := utils.SliceToSlice(projects, func(p *project.Project) string {
+ return p.Id
})
- releases, err := i.getSubscribers(ctx, partitionId, projectIds)
+ releases, err := i.getSubscribers(ctx, projectIds)
if err != nil {
return err
}
@@ -140,7 +141,6 @@ func (i *imlSubscribeModule) SearchSubscriptions(ctx context.Context, partitionI
return &subscribe_dto.SubscriptionItem{
Id: s.Id,
Service: auto.UUID(s.Service),
- Partition: auto.UUID(s.Partition),
ApplyStatus: s.ApplyStatus,
Project: auto.UUID(s.Project),
Team: auto.UUID(pInfo.Team),
@@ -172,6 +172,13 @@ func (i *imlSubscribeModule) RevokeSubscription(ctx context.Context, pid string,
if subscription.ApplyStatus != subscribe.ApplyStatusSubscribe {
return fmt.Errorf("subscription can not be revoked")
}
+ partitions, err := i.partitionService.List(ctx)
+ if err != nil {
+ return err
+ }
+ partitionIds := utils.SliceToSlice(partitions, func(i *partition.Partition) string {
+ return i.UUID
+ })
applyStatus := subscribe.ApplyStatusUnsubscribe
return i.transaction.Transaction(ctx, func(ctx context.Context) error {
err = i.subscribeService.Save(ctx, uuid, &subscribe.UpdateSubscribe{
@@ -180,13 +187,14 @@ func (i *imlSubscribeModule) RevokeSubscription(ctx context.Context, pid string,
if err != nil {
return err
}
-
- err = i.offlineForCluster(ctx, subscription.Partition, &gateway.SubscribeRelease{
- Service: subscription.Service,
- Application: subscription.Application,
- })
- if err != nil {
- log.Warnf("revoke Subscription for partition:%s %s", subscription.Partition, err)
+ for _, p := range partitionIds {
+ err = i.offlineForCluster(ctx, p, &gateway.SubscribeRelease{
+ Service: subscription.Service,
+ Application: subscription.Application,
+ })
+ if err != nil {
+ return err
+ }
}
return nil
@@ -232,9 +240,11 @@ func (i *imlSubscribeModule) AddSubscriber(ctx context.Context, project string,
if err != nil {
return err
}
- if len(input.Partition) == 0 {
- return fmt.Errorf("partition is empty")
+ partitions, err := i.partitionService.List(ctx)
+ if err != nil {
+ return err
}
+
if input.Uuid == "" {
input.Uuid = uuid.New().String()
}
@@ -243,25 +253,24 @@ func (i *imlSubscribeModule) AddSubscriber(ctx context.Context, project string,
Application: input.Project,
Expired: "0",
}
+
return i.transaction.Transaction(ctx, func(ctx context.Context) error {
- for _, partitionId := range input.Partition {
- err = i.subscribeService.Create(ctx, &subscribe.CreateSubscribe{
- Uuid: input.Uuid,
- Service: input.Service,
- Project: project,
- Partition: partitionId,
- Application: input.Project,
- ApplyStatus: subscribe.ApplyStatusSubscribe,
- From: subscribe.FromUser,
- })
- if err != nil {
- return err
- }
- err := i.onlineSubscriber(ctx, partitionId, sub)
+ err = i.subscribeService.Create(ctx, &subscribe.CreateSubscribe{
+ Uuid: input.Uuid,
+ Service: input.Service,
+ Project: project,
+ Application: input.Project,
+ ApplyStatus: subscribe.ApplyStatusSubscribe,
+ From: subscribe.FromUser,
+ })
+ if err != nil {
+ return err
+ }
+ for _, p := range partitions {
+ err = i.onlineSubscriber(ctx, p.UUID, sub)
if err != nil {
- return fmt.Errorf("add subscriber for partition[%s] %v", partitionId, err)
+ return fmt.Errorf("add subscriber for partition[%s] %v", p.UUID, err)
}
-
}
return nil
@@ -291,6 +300,19 @@ func (i *imlSubscribeModule) DeleteSubscriber(ctx context.Context, project strin
if err != nil {
return err
}
+ partitions, err := i.partitionService.List(ctx)
+ if err != nil {
+ return err
+ }
+ for _, p := range partitions {
+ err = i.offlineForCluster(ctx, p.UUID, &gateway.SubscribeRelease{
+ Service: serviceId,
+ Application: applicationId,
+ })
+ if err != nil {
+ return fmt.Errorf("offline subscribe for partition[%s] %s", p.UUID, err)
+ }
+ }
return i.transaction.Transaction(ctx, func(ctx context.Context) error {
list, err := i.subscribeService.ListByApplication(ctx, serviceId, applicationId)
@@ -306,9 +328,11 @@ func (i *imlSubscribeModule) DeleteSubscriber(ctx context.Context, project strin
if err != nil {
return err
}
- err := i.offlineForCluster(ctx, s.Partition, releaseInfo)
+ }
+ for _, p := range partitions {
+ err := i.offlineForCluster(ctx, p.UUID, releaseInfo)
if err != nil {
- return fmt.Errorf("offline subscribe for partition[%s] %s", s.Partition, err)
+ return fmt.Errorf("offline subscribe for partition[%s] %s", p.UUID, err)
}
}
return nil
@@ -343,30 +367,19 @@ func (i *imlSubscribeModule) SearchSubscribers(ctx context.Context, projectId st
if err != nil {
return nil, err
}
- subscriberMap := utils.SliceToMapArrayO(list, func(s *subscribe.Subscribe) (string, string) {
- return fmt.Sprintf("%s-%s", s.Service, s.Application), s.Partition
- })
if keyword == "" {
items := make([]*subscribe_dto.Subscriber, 0, len(list))
for _, subscriber := range list {
- key := fmt.Sprintf("%s-%s", subscriber.Service, subscriber.Application)
- partitionIds, ok := subscriberMap[key]
- if !ok {
- continue
- }
-
items = append(items, &subscribe_dto.Subscriber{
Id: subscriber.Application,
Project: auto.UUID(subscriber.Project),
Service: auto.UUID(subscriber.Service),
- Partition: auto.List(partitionIds),
Subscriber: auto.UUID(subscriber.Application),
Team: auto.UUID(pInfo.Team),
ApplyTime: auto.TimeLabel(subscriber.CreateAt),
From: subscriber.From,
})
- delete(subscriberMap, key)
}
return items, nil
}
@@ -381,23 +394,17 @@ func (i *imlSubscribeModule) SearchSubscribers(ctx context.Context, projectId st
})
items := make([]*subscribe_dto.Subscriber, 0, len(list))
for _, subscriber := range list {
- key := fmt.Sprintf("%s-%s", subscriber.Service, subscriber.Application)
- partitionIds, ok := subscriberMap[key]
- if !ok {
- continue
- }
+
if _, ok := serviceMap[subscriber.Service]; ok {
items = append(items, &subscribe_dto.Subscriber{
Id: subscriber.Id,
Project: auto.UUID(subscriber.Project),
Service: auto.UUID(subscriber.Service),
- Partition: auto.List(partitionIds),
Subscriber: auto.UUID(subscriber.Application),
Team: auto.UUID(pInfo.Team),
ApplyTime: auto.TimeLabel(subscriber.CreateAt),
From: subscriber.From,
})
- delete(subscriberMap, key)
}
}
return items, nil
@@ -406,12 +413,12 @@ func (i *imlSubscribeModule) SearchSubscribers(ctx context.Context, projectId st
var _ ISubscribeApprovalModule = (*imlSubscribeApprovalModule)(nil)
type imlSubscribeApprovalModule struct {
- subscribeService subscribe.ISubscribeService `autowired:""`
- subscribeApplyService subscribe.ISubscribeApplyService `autowired:""`
- projectService project.IProjectService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- clusterService cluster.IClusterService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ subscribeService subscribe.ISubscribeService `autowired:""`
+ subscribeApplyService subscribe.ISubscribeApplyService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ clusterService cluster.IClusterService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ transaction store.ITransaction `autowired:""`
}
func (i *imlSubscribeApprovalModule) Pass(ctx context.Context, pid string, id string, approveInfo *subscribe_dto.Approve) error {
@@ -419,27 +426,20 @@ func (i *imlSubscribeApprovalModule) Pass(ctx context.Context, pid string, id st
if err != nil {
return err
}
- partitions, err := i.projectPartitionService.GetByProject(ctx, pid)
+ partitions, err := i.partitionService.List(ctx)
if err != nil {
return err
}
- partitionMap := utils.SliceToMapO(partitions, func(s string) (string, struct{}) {
- return s, struct{}{}
+ partitionIds := utils.SliceToSlice(partitions, func(i *partition.Partition) string {
+ return i.UUID
})
- for _, pt := range approveInfo.Partition {
- if _, ok := partitionMap[pt]; !ok {
- return fmt.Errorf("partition %s not exists", pt)
- }
- }
-
return i.transaction.Transaction(ctx, func(ctx context.Context) error {
userID := utils.UserId(ctx)
status := subscribe.ApplyStatusSubscribe
err = i.subscribeApplyService.Save(ctx, id, &subscribe.EditApply{
- ApplyPartitions: approveInfo.Partition,
- Opinion: &approveInfo.Opinion,
- Status: &status,
- Approver: &userID,
+ Opinion: &approveInfo.Opinion,
+ Status: &status,
+ Approver: &userID,
})
if err != nil {
return err
@@ -448,7 +448,7 @@ func (i *imlSubscribeApprovalModule) Pass(ctx context.Context, pid string, id st
if err != nil {
return err
}
- cs, err := i.clusterService.List(ctx, approveInfo.Partition...)
+ cs, err := i.clusterService.List(ctx, partitionIds...)
if err != nil {
return err
}
@@ -488,10 +488,9 @@ func (i *imlSubscribeApprovalModule) Reject(ctx context.Context, pid string, id
userID := utils.UserId(ctx)
status := subscribe.ApplyStatusRefuse
err = i.subscribeApplyService.Save(ctx, id, &subscribe.EditApply{
- ApplyPartitions: approveInfo.Partition,
- Opinion: &approveInfo.Opinion,
- Status: &status,
- Approver: &userID,
+ Opinion: &approveInfo.Opinion,
+ Status: &status,
+ Approver: &userID,
})
if err != nil {
return err
@@ -551,7 +550,6 @@ func (i *imlSubscribeApprovalModule) GetApprovalDetail(ctx context.Context, pid
Applier: auto.UUID(item.Applier),
Approver: auto.UUID(item.Approver),
ApprovalTime: auto.TimeLabel(item.ApproveAt),
- Partition: auto.List(item.ApplyPartitions),
Reason: item.Reason,
Opinion: item.Opinion,
Status: item.Status,
diff --git a/module/subscribe/subscribe.go b/module/subscribe/subscribe.go
index 9fd2722..110e75e 100644
--- a/module/subscribe/subscribe.go
+++ b/module/subscribe/subscribe.go
@@ -24,7 +24,7 @@ type ISubscribeModule interface {
DeleteSubscription(ctx context.Context, pid string, uuid string) error
// RevokeApply 取消申请
RevokeApply(ctx context.Context, app string, uuid string) error
- PartitionServices(ctx context.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error)
+ //PartitionServices(ctx context.Context, app string) ([]*subscribe_dto.PartitionServiceItem, error)
}
type ISubscribeApprovalModule interface {
diff --git a/module/team/dto/input.go b/module/team/dto/input.go
index e9149e2..64ae4d7 100644
--- a/module/team/dto/input.go
+++ b/module/team/dto/input.go
@@ -1,11 +1,10 @@
package team_dto
type CreateTeam struct {
- Id string `json:"id"`
- Name string `json:"name" binding:"required"`
- Description string `json:"description"`
- OrganizationId string `json:"organization" aocheck:"organization"`
- Master string `json:"master" aocheck:"user"`
+ Id string `json:"id"`
+ Name string `json:"name" binding:"required"`
+ Description string `json:"description"`
+ Master string `json:"master" aocheck:"user"`
}
type EditTeam struct {
Name *string `json:"name"`
diff --git a/module/team/iml.go b/module/team/iml.go
index d81ce9e..11ec075 100644
--- a/module/team/iml.go
+++ b/module/team/iml.go
@@ -67,11 +67,10 @@ func (m *imlTeamModule) Create(ctx context.Context, input *team_dto.CreateTeam)
err := m.transaction.Transaction(ctx, func(ctx context.Context) error {
err := m.service.Create(ctx, &team.CreateTeam{
- Id: input.Id,
- Name: input.Name,
- Description: input.Description,
- Master: input.Master,
- Organization: input.OrganizationId,
+ Id: input.Id,
+ Name: input.Name,
+ Description: input.Description,
+ Master: input.Master,
})
if err != nil {
return err
diff --git a/module/upstream/iml.go b/module/upstream/iml.go
index 97b8efb..2e6f573 100644
--- a/module/upstream/iml.go
+++ b/module/upstream/iml.go
@@ -5,6 +5,8 @@ import (
"errors"
"fmt"
+ "github.com/eolinker/apipark/service/partition"
+
"github.com/eolinker/go-common/utils"
"gorm.io/gorm"
@@ -26,10 +28,10 @@ var (
)
type imlUpstreamModule struct {
- projectService project.IProjectService `autowired:""`
- projectPartitionService project.IProjectPartitionsService `autowired:""`
- upstreamService upstream.IUpstreamService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ upstreamService upstream.IUpstreamService `autowired:""`
+ transaction store.ITransaction `autowired:""`
}
func (i *imlUpstreamModule) Get(ctx context.Context, pid string) (upstream_dto.UpstreamConfig, error) {
@@ -64,18 +66,18 @@ func (i *imlUpstreamModule) Save(ctx context.Context, pid string, upstreamConfig
if err != nil {
return nil, err
}
- projectPartitions, err := i.projectPartitionService.ListByProject(ctx, pid)
+ partitions, err := i.partitionService.List(ctx)
if err != nil {
return nil, err
}
- projectPartitionMap := utils.SliceToMap(projectPartitions, func(p *project.Partition) string {
- return p.Partition
+ partitionMap := utils.SliceToMapO(partitions, func(p *partition.Partition) (string, struct{}) {
+ return p.UUID, struct{}{}
})
err = i.transaction.Transaction(ctx, func(ctx context.Context) error {
partitionIds := make([]string, 0, len(upstreamConfig))
for id, cfg := range upstreamConfig {
- if _, ok := projectPartitionMap[id]; !ok {
+ if _, ok := partitionMap[id]; !ok {
continue
}
err = i.upstreamService.SaveCommit(ctx, pid, id, upstream_dto.ConvertUpstream(cfg))
diff --git a/plugins/core/core.go b/plugins/core/core.go
index e73661c..2d4fc8e 100644
--- a/plugins/core/core.go
+++ b/plugins/core/core.go
@@ -1,34 +1,34 @@
package core
import (
+ "net/http"
+
"github.com/eolinker/apipark/controller/common"
plugin_partition "github.com/eolinker/apipark/controller/plugin-partition"
- "net/http"
-
+
"github.com/eolinker/apipark/controller/topology"
-
+
dynamic_module "github.com/eolinker/apipark/controller/dynamic-module"
-
+
"github.com/eolinker/apipark/controller/release"
-
+
project_authorization "github.com/eolinker/apipark/controller/project-authorization"
-
+
"github.com/eolinker/apipark/controller/subscribe"
-
+
"github.com/eolinker/apipark/controller/api"
-
+
"github.com/eolinker/apipark/controller/upstream"
-
+
"github.com/eolinker/apipark/controller/service"
-
+
"github.com/eolinker/apipark/controller/catalogue"
-
+
"github.com/eolinker/apipark/controller/project"
-
+
"github.com/eolinker/apipark/controller/my_team"
-
+
"github.com/eolinker/apipark/controller/certificate"
- organization2 "github.com/eolinker/apipark/controller/organization"
"github.com/eolinker/apipark/controller/partition"
"github.com/eolinker/apipark/controller/team_manager"
"github.com/eolinker/go-common/autowire"
@@ -47,7 +47,7 @@ func (d *Driver) Access() map[string][]string {
}
func (d *Driver) Create() (pm3.IPlugin, error) {
-
+
p := new(plugin)
autowire.Autowired(p)
return p, nil
@@ -56,7 +56,6 @@ func (d *Driver) Create() (pm3.IPlugin, error) {
type plugin struct {
partitionController partition.IPartitionController `autowired:""`
certificateController certificate.ICertificateController `autowired:""`
- organizationController organization2.IOrganizationController `autowired:""`
teamManagerController team_manager.ITeamManagerController `autowired:""`
myTeamController my_team.ITeamController `autowired:""`
appController project.IAppController `autowired:""`
@@ -81,7 +80,6 @@ func (p *plugin) OnComplete() {
p.apis = append(p.apis, p.partitionApi()...)
p.apis = append(p.apis, p.certificateApi()...)
p.apis = append(p.apis, p.clusterApi()...)
- p.apis = append(p.apis, p.organizationApi()...)
p.apis = append(p.apis, p.TeamManagerApi()...)
p.apis = append(p.apis, p.MyTeamApi()...)
p.apis = append(p.apis, p.ProjectApi()...)
diff --git a/plugins/core/organization.go b/plugins/core/organization.go
deleted file mode 100644
index eb7646f..0000000
--- a/plugins/core/organization.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package core
-
-import (
- "net/http"
-
- "github.com/eolinker/go-common/pm3"
-)
-
-func (p *plugin) organizationApi() []pm3.Api {
- return []pm3.Api{
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/manager/organizations", []string{"context", "query:keyword"}, []string{"organizations"}, p.organizationController.Search),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/manager/organization", []string{"context", "query:id"}, []string{"organization"}, p.organizationController.Get),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/manager/organization/:id", []string{"context", "path:id"}, []string{"organization"}, p.organizationController.Get),
- pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/manager/organization", []string{"context", "body"}, []string{"organization"}, p.organizationController.Create),
- pm3.CreateApiWidthDoc(http.MethodPut, "/api/v1/manager/organization", []string{"context", "query:id", "body"}, []string{"organization"}, p.organizationController.Edit),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/manager/organization", []string{"context", "query:id"}, []string{"id"}, p.organizationController.Delete),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/manager/organization/:id", []string{"context", "path:id"}, []string{"id"}, p.organizationController.Delete),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/organization/partitions", []string{"context", "query:organization"}, []string{"partitions"}, p.organizationController.Partitions),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/organizations", []string{"context"}, []string{"organizations"}, p.organizationController.Simple),
- }
-
-}
diff --git a/plugins/core/subscribe.go b/plugins/core/subscribe.go
index 1824313..68868fb 100644
--- a/plugins/core/subscribe.go
+++ b/plugins/core/subscribe.go
@@ -17,7 +17,7 @@ func (p *plugin) subscribeApis() []pm3.Api {
pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/application/subscription/cancel", []string{"context", "query:application", "query:subscription"}, nil, p.subscribeController.RevokeSubscription),
pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/application/subscription/cancel_apply", []string{"context", "query:application", "query:subscription"}, nil, p.subscribeController.RevokeApply),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/application/partitions", []string{"context", "query:application"}, []string{"partitions"}, p.subscribeController.PartitionServices),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/application/partitions", []string{"context", "query:application"}, []string{"partitions"}, p.subscribeController.PartitionServices),
// 审批相关
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/approval/subscribes", []string{"context", "query:project", "query:status"}, []string{"approvals"}, p.subscribeApprovalController.GetApprovalList),
diff --git a/plugins/core/upstream.go b/plugins/core/upstream.go
index 859bfe0..c72138e 100644
--- a/plugins/core/upstream.go
+++ b/plugins/core/upstream.go
@@ -8,7 +8,7 @@ import (
func (p *plugin) upstreamApis() []pm3.Api {
return []pm3.Api{
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/upstream", []string{"context", "query:project"}, []string{"upstream", "partitions"}, p.upstreamController.Get),
+ pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/upstream", []string{"context", "query:project"}, []string{"upstream"}, p.upstreamController.Get),
pm3.CreateApiWidthDoc(http.MethodPut, "/api/v1/project/upstream", []string{"context", "query:project", "body"}, []string{"upstream"}, p.upstreamController.Save),
}
}
diff --git a/service/organization/iml.go b/service/organization/iml.go
deleted file mode 100644
index 2ce8393..0000000
--- a/service/organization/iml.go
+++ /dev/null
@@ -1,250 +0,0 @@
-package organization
-
-import (
- "context"
- "errors"
- "time"
-
- "github.com/eolinker/apipark/stores/organization"
- "github.com/eolinker/go-common/auto"
- "github.com/eolinker/go-common/utils"
- "github.com/google/uuid"
- "gorm.io/gorm"
-)
-
-var (
- _ IOrganizationService = (*imlOrganizationService)(nil)
-)
-
-type imlOrganizationService struct {
- organizationStore organization.IOrganizationStore `autowired:""`
- partitionStore organization.IOrganizationPartitionStore `autowired:""`
-}
-
-func (s *imlOrganizationService) PartitionsByOrganization(ctx context.Context, orgId ...string) (map[string][]string, error) {
- w := make(map[string]interface{})
- if len(orgId) > 0 {
- w["oid"] = orgId
- }
- partitions, err := s.partitionStore.List(ctx, w)
- if err != nil {
- return nil, err
- }
- return utils.SliceToMapArrayO(partitions, func(p *organization.Partition) (string, string) {
- return p.Oid, p.Pid
- }), nil
-}
-
-func (s *imlOrganizationService) All(ctx context.Context) ([]*Organization, error) {
- list, err := s.organizationStore.List(ctx, map[string]interface{}{})
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(list, func(e *organization.Organization) *Organization {
- return fromEntity(e, nil)
- }), nil
-}
-
-func (s *imlOrganizationService) OnComplete() {
- auto.RegisterService("organization", s)
-}
-
-func (s *imlOrganizationService) GetLabels(ctx context.Context, ids ...string) map[string]string {
- if len(ids) == 0 {
- return nil
- }
- list, err := s.organizationStore.ListQuery(ctx, "`uuid` in (?)", []interface{}{ids}, "id")
- if err != nil {
- return nil
- }
- return utils.SliceToMapO(list, func(i *organization.Organization) (string, string) {
- return i.UUID, i.Name
- })
-}
-
-func (s *imlOrganizationService) Create(ctx context.Context, id, name, description, prefix, master string, partitions []string) (*Organization, error) {
- if id == "" {
- id = uuid.NewString()
- }
- oe, err := s.organizationStore.FirstQuery(ctx, "`uuid`=?", []interface{}{id}, "id")
- if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
- return nil, err
- }
- if oe != nil {
- return nil, errors.New("organization already exists")
- }
- now := time.Now()
- userId := utils.UserId(ctx)
- ne := &organization.Organization{
- Id: 0,
- UUID: id,
- Name: name,
- CreateAt: now,
- UpdateAt: now,
- Description: description,
- Master: master,
- Prefix: prefix,
- Updater: userId,
- Creator: userId,
- }
- pel := make([]*organization.Partition, 0, len(partitions))
- for _, p := range partitions {
- pel = append(pel, &organization.Partition{
- Id: 0,
- Oid: id,
- Pid: p,
- CreateTime: ne.CreateAt,
- })
- }
- err = s.partitionStore.Transaction(ctx, func(ctx context.Context) error {
- err := s.organizationStore.Insert(ctx, ne)
- if err != nil {
- return err
- }
-
- err = s.organizationStore.SetLabels(ctx, ne.Id, ne.Name, ne.Prefix, ne.Master, ne.Description)
- if err != nil {
- return err
- }
- return s.partitionStore.Insert(ctx, pel...)
- })
- if err != nil {
- return nil, err
- }
- return fromEntity(ne, utils.SliceToSlice(pel, func(p *organization.Partition) string { return p.Pid })), nil
-}
-
-func (s *imlOrganizationService) Edit(ctx context.Context, id string, name, description, master *string, partitions *[]string) (*Organization, error) {
- if id == "" {
- return nil, errors.New("id is empty")
- }
- operator := utils.UserId(ctx)
- ve, err := s.organizationStore.FirstQuery(ctx, "`uuid`=?", []interface{}{id}, "id")
- if err != nil {
- return nil, err
- }
- if ve == nil {
- return nil, errors.New("organization not exists")
- }
- if name != nil {
- ve.Name = *name
- }
- if description != nil {
- ve.Description = *description
- }
- if master != nil {
- ve.Master = *master
- }
- ve.UpdateAt = time.Now()
- ve.Updater = operator
- pel := make([]*organization.Partition, 0, len(*partitions))
- err = s.organizationStore.Transaction(ctx, func(ctx context.Context) error {
- update, err := s.organizationStore.Update(ctx, ve)
- if err != nil {
- return err
- }
- if update == 0 {
- return errors.New("organization not exists")
- }
- err = s.organizationStore.SetLabels(ctx, ve.Id, ve.Name, ve.Prefix, ve.Master, ve.Description)
- // todo: update labels 需要增加更多参与查询的内容
- if err != nil {
- return err
- }
- if partitions != nil {
- _, err := s.partitionStore.DeleteWhere(ctx, map[string]interface{}{
- "`oid`": id,
- })
- if err != nil {
- return err
- }
- for _, p := range *partitions {
- pel = append(pel, &organization.Partition{
- Id: 0,
- Oid: id,
- Pid: p,
- CreateTime: ve.UpdateAt,
- })
- }
- err = s.partitionStore.Insert(ctx, pel...)
- } else {
- pelO, err := s.partitionStore.List(ctx, map[string]interface{}{
- "`oid`": id,
- })
- if err != nil {
- return err
- }
- pel = pelO
- }
- return nil
- })
- if err != nil {
- return nil, err
- }
- return fromEntity(ve, utils.SliceToSlice(pel, func(p *organization.Partition) string { return p.Pid })), nil
-}
-
-func (s *imlOrganizationService) Get(ctx context.Context, id string) (*Organization, error) {
- ev, err := s.organizationStore.FirstQuery(ctx, "`uuid`=?", []interface{}{id}, "id")
- if err != nil {
- return nil, err
- }
- pel, err := s.partitionStore.List(ctx, map[string]interface{}{"`oid`": id})
- if err != nil {
- return nil, err
- }
- return fromEntity(ev, utils.SliceToSlice(pel, func(p *organization.Partition) string { return p.Pid })), nil
-
-}
-
-func (s *imlOrganizationService) Search(ctx context.Context, keyword string) ([]*Organization, error) {
- ev, err := s.organizationStore.Search(ctx, keyword, nil)
- if err != nil {
- return nil, err
- }
- pelAll, err := s.partitionStore.List(ctx, nil)
- if err != nil {
- return nil, err
- }
- pelMap := utils.SliceToMapArray(pelAll, func(i *organization.Partition) string {
- return i.Oid
- })
-
- return utils.SliceToSlice(ev, func(i *organization.Organization) *Organization {
- return fromEntity(i, utils.SliceToSlice(pelMap[i.UUID], func(p *organization.Partition) string { return p.Pid }))
- }), nil
-}
-
-func (s *imlOrganizationService) Delete(ctx context.Context, id string) error {
- _, err := s.organizationStore.FirstQuery(ctx, "`uuid`=?", []interface{}{id}, "id")
- if err != nil {
- return err
- }
- return s.organizationStore.Transaction(ctx, func(ctx context.Context) error {
- deleteCount, err := s.organizationStore.DeleteWhere(ctx, map[string]interface{}{
- "`uuid`": id,
- })
- if err != nil {
- return err
- }
- if deleteCount != 1 {
- return errors.New("delete organization failed")
- }
- _, err = s.partitionStore.DeleteWhere(ctx, map[string]interface{}{
- "`oid`": id,
- })
- return err
- })
-
-}
-
-func (s *imlOrganizationService) Partitions(ctx context.Context, id string) ([]string, error) {
- ps, err := s.partitionStore.List(ctx, map[string]interface{}{"`oid`": id})
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(ps, func(i *organization.Partition) string {
- return i.Pid
- }), nil
-
-}
diff --git a/service/organization/model.go b/service/organization/model.go
deleted file mode 100644
index bd746aa..0000000
--- a/service/organization/model.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package organization
-
-import (
- "time"
-
- "github.com/eolinker/apipark/stores/organization"
-)
-
-type Organization struct {
- UUID string
- Name string
- Description string
- Master string
- Prefix string
- Creator string
- Partitions []string
- CreateTime time.Time
- Updater string
- UpdateTime time.Time
-}
-
-func fromEntity(ov *organization.Organization, pl []string) *Organization {
- return &Organization{
- UUID: ov.UUID,
- Name: ov.Name,
- Description: ov.Description,
- Master: ov.Master,
- Creator: ov.Creator,
- Updater: ov.Updater,
- CreateTime: ov.CreateAt,
- UpdateTime: ov.UpdateAt,
- Partitions: pl,
- Prefix: ov.Prefix,
- }
-}
diff --git a/service/organization/service.go b/service/organization/service.go
deleted file mode 100644
index f41292e..0000000
--- a/service/organization/service.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package organization
-
-import (
- "context"
- "reflect"
-
- "github.com/eolinker/go-common/auto"
- "github.com/eolinker/go-common/autowire"
-)
-
-type IOrganizationService interface {
- Create(ctx context.Context, id, name, description, prefix, master string, partitions []string) (*Organization, error)
- Edit(ctx context.Context, id string, name, description, master *string, partitions *[]string) (*Organization, error)
- Get(ctx context.Context, id string) (*Organization, error)
- Search(ctx context.Context, keyword string) ([]*Organization, error)
- Delete(ctx context.Context, id string) error
- Partitions(ctx context.Context, id string) ([]string, error)
- PartitionsByOrganization(ctx context.Context, orgId ...string) (map[string][]string, error)
- All(ctx context.Context) ([]*Organization, error)
- auto.CompleteService
-}
-
-func init() {
- autowire.Auto[IOrganizationService](func() reflect.Value {
- return reflect.ValueOf(new(imlOrganizationService))
- })
-}
diff --git a/service/project/iml.go b/service/project/iml.go
index da9c8b7..8815506 100644
--- a/service/project/iml.go
+++ b/service/project/iml.go
@@ -70,16 +70,6 @@ func (i *imlProjectService) CountByTeam(ctx context.Context, keyword string) (ma
return i.projectStore.CountByGroup(ctx, keyword, map[string]interface{}{"as_server": true}, "team")
}
-//func (i *imlProjectService) ListByProject(ctx context.Context, projectId string) ([]*Project, error) {
-// list, err := i.projectStore.List(ctx, map[string]interface{}{
-// "project": projectId,
-// }, "update_at desc")
-// if err != nil {
-// return nil, err
-// }
-// return utils.SliceToSlice(list, FromEntity), nil
-//}
-
func (i *imlProjectService) GetLabels(ctx context.Context, ids ...string) map[string]string {
if len(ids) == 0 {
return nil
@@ -113,18 +103,17 @@ func uniquestHandler(i *CreateProject) []map[string]interface{} {
func createEntityHandler(i *CreateProject) *project.Project {
now := time.Now()
return &project.Project{
- Id: 0,
- UUID: i.Id,
- Name: i.Name,
- CreateAt: now,
- UpdateAt: now,
- Description: i.Description,
- Prefix: i.Prefix,
- Team: i.Team,
- Organization: i.Organization,
- Master: i.Master,
- AsServer: i.AsServer,
- AsApp: i.AsApp,
+ Id: 0,
+ UUID: i.Id,
+ Name: i.Name,
+ CreateAt: now,
+ UpdateAt: now,
+ Description: i.Description,
+ Prefix: i.Prefix,
+ Team: i.Team,
+ Master: i.Master,
+ AsServer: i.AsServer,
+ AsApp: i.AsApp,
}
}
func updateHandler(e *project.Project, i *EditProject) {
@@ -138,85 +127,3 @@ func updateHandler(e *project.Project, i *EditProject) {
e.Master = *i.Master
}
}
-
-var _ IProjectPartitionsService = (*imlProjectPartitionService)(nil)
-
-type imlProjectPartitionService struct {
- store project.IProjectPartitionStore `autowired:""`
-}
-
-func (i *imlProjectPartitionService) ListByPartition(ctx context.Context, partitionIds ...string) ([]*Partition, error) {
- w := make(map[string]interface{})
- if len(partitionIds) > 0 {
- w["partition"] = partitionIds
- }
- list, err := i.store.List(ctx, w)
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(list, func(t *project.Partition) *Partition {
- return &Partition{
- Project: t.Project,
- Partition: t.Partition,
- }
- }), nil
-}
-
-func (i *imlProjectPartitionService) Delete(ctx context.Context, projectID string) error {
- _, err := i.store.DeleteWhere(ctx, map[string]interface{}{
- "project": projectID,
- })
- return err
-}
-
-func (i *imlProjectPartitionService) ListByProject(ctx context.Context, projectIDs ...string) ([]*Partition, error) {
- w := make(map[string]interface{})
- if len(projectIDs) > 0 {
- w["project"] = projectIDs
- }
- list, err := i.store.List(ctx, w)
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(list, func(t *project.Partition) *Partition {
- return &Partition{
- Project: t.Project,
- Partition: t.Partition,
- }
- }), nil
-}
-
-func (i *imlProjectPartitionService) Save(ctx context.Context, projectID string, partitions []string) error {
- if len(partitions) == 0 {
- return fmt.Errorf("partitions is empty")
- }
- return i.store.Transaction(ctx, func(ctx context.Context) error {
- _, err := i.store.DeleteWhere(ctx, map[string]interface{}{
- "project": projectID,
- })
- if err != nil {
- return err
- }
- now := time.Now()
- return i.store.Insert(ctx, utils.SliceToSlice(partitions, func(t string) *project.Partition {
- return &project.Partition{
- Project: projectID,
- Partition: t,
- CreateTime: now,
- }
- })...)
- })
-
-}
-
-func (i *imlProjectPartitionService) GetByProject(ctx context.Context, projectID string) ([]string, error) {
- list, err := i.store.List(ctx, map[string]interface{}{
- "project": projectID,
- })
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(list, func(t *project.Partition) string {
- return t.Partition
- }), nil
-}
diff --git a/service/project/model.go b/service/project/model.go
index 729d36a..c23d773 100644
--- a/service/project/model.go
+++ b/service/project/model.go
@@ -7,45 +7,42 @@ import (
)
type Project struct {
- Id string
- Name string
- Description string
- Team string
- Organization string
- Master string
- Prefix string
- AsServer bool
- AsApp bool
- CreateTime time.Time
- UpdateTime time.Time
+ Id string
+ Name string
+ Description string
+ Team string
+ Master string
+ Prefix string
+ AsServer bool
+ AsApp bool
+ CreateTime time.Time
+ UpdateTime time.Time
}
func FromEntity(e *project.Project) *Project {
return &Project{
- Id: e.UUID,
- Name: e.Name,
- Description: e.Description,
- Team: e.Team,
- Organization: e.Organization,
- Master: e.Master,
- Prefix: e.Prefix,
- AsServer: e.AsServer,
- AsApp: e.AsApp,
- CreateTime: e.CreateAt,
- UpdateTime: e.UpdateAt,
+ Id: e.UUID,
+ Name: e.Name,
+ Description: e.Description,
+ Team: e.Team,
+ Master: e.Master,
+ Prefix: e.Prefix,
+ AsServer: e.AsServer,
+ AsApp: e.AsApp,
+ CreateTime: e.CreateAt,
+ UpdateTime: e.UpdateAt,
}
}
type CreateProject struct {
- Id string
- Name string
- Description string
- Master string
- Team string
- Organization string
- Prefix string
- AsServer bool
- AsApp bool
+ Id string
+ Name string
+ Description string
+ Master string
+ Team string
+ Prefix string
+ AsServer bool
+ AsApp bool
}
type EditProject struct {
diff --git a/service/project/service.go b/service/project/service.go
index eb0f2d0..0044c6a 100644
--- a/service/project/service.go
+++ b/service/project/service.go
@@ -19,19 +19,8 @@ type IProjectService interface {
AppList(ctx context.Context, appIds ...string) ([]*Project, error)
}
-type IProjectPartitionsService interface {
- ListByProject(ctx context.Context, projectIDs ...string) ([]*Partition, error)
- ListByPartition(ctx context.Context, partition ...string) ([]*Partition, error)
- Save(ctx context.Context, projectID string, partitions []string) error
- Delete(ctx context.Context, projectID string) error
- GetByProject(ctx context.Context, projectID string) ([]string, error)
-}
-
func init() {
autowire.Auto[IProjectService](func() reflect.Value {
return reflect.ValueOf(new(imlProjectService))
})
- autowire.Auto[IProjectPartitionsService](func() reflect.Value {
- return reflect.ValueOf(new(imlProjectPartitionService))
- })
}
diff --git a/service/service/iml.go b/service/service/iml.go
index 6f251bb..1ff5f05 100644
--- a/service/service/iml.go
+++ b/service/service/iml.go
@@ -110,19 +110,18 @@ func uniquestHandler(i *CreateService) []map[string]interface{} {
func createEntityHandler(i *CreateService) *service.Service {
now := time.Now()
return &service.Service{
- UUID: i.Uuid,
- Name: i.Name,
- Description: i.Description,
- Logo: i.Logo,
- ServiceType: i.ServiceType,
- Project: i.Project,
- Team: i.Team,
- Organization: i.Organization,
- Catalogue: i.Catalogue,
- Status: i.Status,
- Tag: i.Tag,
- CreateAt: now,
- UpdateAt: now,
+ UUID: i.Uuid,
+ Name: i.Name,
+ Description: i.Description,
+ Logo: i.Logo,
+ ServiceType: i.ServiceType,
+ Project: i.Project,
+ Team: i.Team,
+ Catalogue: i.Catalogue,
+ Status: i.Status,
+ Tag: i.Tag,
+ CreateAt: now,
+ UpdateAt: now,
}
}
func updateHandler(e *service.Service, i *EditService) {
diff --git a/service/service/model.go b/service/service/model.go
index 00976ab..ab44562 100644
--- a/service/service/model.go
+++ b/service/service/model.go
@@ -12,49 +12,46 @@ const (
)
type Service struct {
- Id string
- Name string
- Description string
- Logo string
- ServiceType string
- Project string
- Team string
- Organization string
- Catalogue string
- Status string
- CreateTime time.Time
- UpdateTime time.Time
+ Id string
+ Name string
+ Description string
+ Logo string
+ ServiceType string
+ Project string
+ Team string
+ Catalogue string
+ Status string
+ CreateTime time.Time
+ UpdateTime time.Time
}
func FromEntity(e *service.Service) *Service {
return &Service{
- Id: e.UUID,
- Name: e.Name,
- Description: e.Description,
- Logo: e.Logo,
- ServiceType: e.ServiceType,
- Project: e.Project,
- Team: e.Team,
- Organization: e.Organization,
- Catalogue: e.Catalogue,
- Status: e.Status,
- CreateTime: e.CreateAt,
- UpdateTime: e.UpdateAt,
+ Id: e.UUID,
+ Name: e.Name,
+ Description: e.Description,
+ Logo: e.Logo,
+ ServiceType: e.ServiceType,
+ Project: e.Project,
+ Team: e.Team,
+ Catalogue: e.Catalogue,
+ Status: e.Status,
+ CreateTime: e.CreateAt,
+ UpdateTime: e.UpdateAt,
}
}
type CreateService struct {
- Uuid string
- Name string
- Description string
- Logo string
- ServiceType string
- Project string
- Team string
- Organization string
- Catalogue string
- Status string
- Tag string
+ Uuid string
+ Name string
+ Description string
+ Logo string
+ ServiceType string
+ Project string
+ Team string
+ Catalogue string
+ Status string
+ Tag string
}
type EditService struct {
diff --git a/service/subscribe/iml.go b/service/subscribe/iml.go
index 750a50e..899d88f 100644
--- a/service/subscribe/iml.go
+++ b/service/subscribe/iml.go
@@ -73,14 +73,12 @@ func (i *imlSubscribeService) DeleteByApplication(ctx context.Context, service s
return err
}
-func (i *imlSubscribeService) SubscribersByProject(ctx context.Context, partitionId string, projectIds ...string) ([]*Subscribe, error) {
+func (i *imlSubscribeService) SubscribersByProject(ctx context.Context, projectIds ...string) ([]*Subscribe, error) {
w := make(map[string]interface{})
if len(projectIds) > 0 {
w["project"] = projectIds
}
- if partitionId != "" {
- w["partition"] = partitionId
- }
+
w["apply_status"] = ApplyStatusSubscribe
list, err := i.store.List(ctx, w, "create_at desc")
if err != nil {
@@ -175,13 +173,9 @@ func (i *imlSubscribeService) createEntityHandler(t *CreateSubscribe) *subscribe
Project: t.Project,
Application: t.Application,
Service: t.Service,
- Partition: t.Partition,
- //Applier: t.Applier,
- //Approver: t.Approver,
From: t.From,
CreateAt: time.Now(),
ApplyStatus: t.ApplyStatus,
- //ApplyID: t.ApplyID,
}
}
@@ -255,22 +249,19 @@ func (i *imlSubscribeApplyService) uniquestHandler(t *CreateApply) []map[string]
func (i *imlSubscribeApplyService) createEntityHandler(t *CreateApply) *subscribe.Apply {
now := time.Now()
return &subscribe.Apply{
- Uuid: t.Uuid,
- Service: t.Service,
- Project: t.Project,
- Team: t.Team,
- Organization: t.Organization,
- Application: t.Application,
- ApplyTeam: t.ApplyTeam,
- ApplyOrganization: t.ApplyOrganization,
- ApplyPartitions: t.ApplyPartitions,
- Applier: t.Applier,
- ApplyAt: now,
- Approver: "",
- ApproveAt: now,
- Status: t.Status,
- Opinion: "",
- Reason: t.Reason,
+ Uuid: t.Uuid,
+ Service: t.Service,
+ Project: t.Project,
+ Team: t.Team,
+ Application: t.Application,
+ ApplyTeam: t.ApplyTeam,
+ Applier: t.Applier,
+ ApplyAt: now,
+ Approver: "",
+ ApproveAt: now,
+ Status: t.Status,
+ Opinion: "",
+ Reason: t.Reason,
}
}
@@ -288,8 +279,5 @@ func (i *imlSubscribeApplyService) updateHandler(e *subscribe.Apply, t *EditAppl
e.Approver = *t.Approver
e.ApplyAt = time.Now()
}
- if t.ApplyPartitions != nil {
- e.ApplyPartitions = t.ApplyPartitions
- }
}
diff --git a/service/subscribe/model.go b/service/subscribe/model.go
index cf4af7e..a51c0d4 100644
--- a/service/subscribe/model.go
+++ b/service/subscribe/model.go
@@ -9,9 +9,8 @@ import (
type Subscribe struct {
Id string
// 被订阅服务相关
- Project string
- Service string
- Partition string
+ Project string
+ Service string
// 订阅方相关
Application string
@@ -23,22 +22,17 @@ type Subscribe struct {
}
type CreateSubscribe struct {
- Uuid string
- Service string
- Project string
- Partition string
+ Uuid string
+ Service string
+ Project string
Application string
- //Applier string
- //Approver string
ApplyStatus int
From int
}
type UpdateSubscribe struct {
ApplyStatus *int
- //Approver *string
- //Applier *string
}
func FromEntity(e *subscribe.Subscribe) *Subscribe {
@@ -46,74 +40,61 @@ func FromEntity(e *subscribe.Subscribe) *Subscribe {
Id: e.UUID,
Project: e.Project,
Service: e.Service,
- Partition: e.Partition,
ApplyStatus: e.ApplyStatus,
Application: e.Application,
From: e.From,
CreateAt: e.CreateAt,
- //Applier: e.Applier,
- //Approver: e.Approver,
}
}
type CreateApply struct {
- Uuid string
- Service string
- Project string
- Team string
- Organization string
- ApplyPartitions []string
- Application string
- ApplyTeam string
- ApplyOrganization string
- Reason string
- Status int
- Applier string
+ Uuid string
+ Service string
+ Project string
+ Team string
+ Application string
+ ApplyTeam string
+ Reason string
+ Status int
+ Applier string
}
type EditApply struct {
- ApplyPartitions []string
- Opinion *string
- Status *int
- Approver *string
+ Opinion *string
+ Status *int
+ Approver *string
}
type Apply struct {
- Id string
- Service string
- Project string
- Team string
- Application string
- ApplyTeam string
- ApplyOrganization string
- ApplyPartitions []string
- Partitions []string
- Applier string
- ApplyAt time.Time
- Approver string
- ApproveAt time.Time
- Status int
- Opinion string
- Reason string
+ Id string
+ Service string
+ Project string
+ Team string
+ Application string
+ ApplyTeam string
+ Applier string
+ ApplyAt time.Time
+ Approver string
+ ApproveAt time.Time
+ Status int
+ Opinion string
+ Reason string
}
func FromApplyEntity(e *subscribe.Apply) *Apply {
return &Apply{
- Id: e.Uuid,
- Service: e.Service,
- Project: e.Project,
- Team: e.Team,
- Application: e.Application,
- ApplyTeam: e.ApplyTeam,
- ApplyOrganization: e.ApplyOrganization,
- ApplyPartitions: e.ApplyPartitions,
- Partitions: e.Partitions,
- Applier: e.Applier,
- ApplyAt: e.ApplyAt,
- Approver: e.Approver,
- ApproveAt: e.ApproveAt,
- Status: e.Status,
- Opinion: e.Opinion,
- Reason: e.Reason,
+ Id: e.Uuid,
+ Service: e.Service,
+ Project: e.Project,
+ Team: e.Team,
+ Application: e.Application,
+ ApplyTeam: e.ApplyTeam,
+ Applier: e.Applier,
+ ApplyAt: e.ApplyAt,
+ Approver: e.Approver,
+ ApproveAt: e.ApproveAt,
+ Status: e.Status,
+ Opinion: e.Opinion,
+ Reason: e.Reason,
}
}
diff --git a/service/subscribe/service.go b/service/subscribe/service.go
index 0c3141a..47d004e 100644
--- a/service/subscribe/service.go
+++ b/service/subscribe/service.go
@@ -20,7 +20,7 @@ type ISubscribeService interface {
MySubscribeServices(ctx context.Context, application string, projectIds []string, serviceIDs []string, partitionIds ...string) ([]*Subscribe, error)
UpdateSubscribeStatus(ctx context.Context, application string, service string, status int) error
ListBySubscribeStatus(ctx context.Context, projectId string, status int) ([]*Subscribe, error)
- SubscribersByProject(ctx context.Context, partition string, projectIds ...string) ([]*Subscribe, error)
+ SubscribersByProject(ctx context.Context, projectIds ...string) ([]*Subscribe, error)
Subscribers(ctx context.Context, project string, status int) ([]*Subscribe, error)
SubscriptionsByApplication(ctx context.Context, applicationIds ...string) ([]*Subscribe, error)
}
diff --git a/service/team/iml.go b/service/team/iml.go
index 840efbc..ad9e9a7 100644
--- a/service/team/iml.go
+++ b/service/team/iml.go
@@ -55,14 +55,13 @@ func uniquestHandler(i *CreateTeam) []map[string]interface{} {
}
func createEntityHandler(i *CreateTeam) *team.Team {
return &team.Team{
- Id: 0,
- UUID: i.Id,
- Name: i.Name,
- Description: i.Description,
- Master: i.Master,
- Organization: i.Organization,
- CreateAt: time.Now(),
- UpdateAt: time.Now(),
+ Id: 0,
+ UUID: i.Id,
+ Name: i.Name,
+ Description: i.Description,
+ Master: i.Master,
+ CreateAt: time.Now(),
+ UpdateAt: time.Now(),
}
}
func updateHandler(e *team.Team, i *EditTeam) {
@@ -75,8 +74,6 @@ func updateHandler(e *team.Team, i *EditTeam) {
if i.Master != nil {
e.Master = *i.Master
}
- if i.Organization != nil {
- e.Organization = *i.Organization
- }
+
e.UpdateAt = time.Now()
}
diff --git a/service/team/model.go b/service/team/model.go
index 34da7e9..51ee360 100644
--- a/service/team/model.go
+++ b/service/team/model.go
@@ -16,33 +16,29 @@ type Team struct {
UpdateTime time.Time `json:"update_time"`
Creator string `json:"creator"`
Updater string `json:"updater"`
- //ProjectNum int64 `json:"project_num"`
}
func FromEntity(e *team.Team) *Team {
return &Team{
- Id: e.UUID,
- Name: e.Name,
- Description: e.Description,
- Master: e.Master,
- Organization: e.Organization,
- CreateTime: e.CreateAt,
- UpdateTime: e.UpdateAt,
- Creator: e.Creator,
- Updater: e.Updater,
+ Id: e.UUID,
+ Name: e.Name,
+ Description: e.Description,
+ Master: e.Master,
+ CreateTime: e.CreateAt,
+ UpdateTime: e.UpdateAt,
+ Creator: e.Creator,
+ Updater: e.Updater,
}
}
type CreateTeam struct {
- Id string `json:"id" `
- Name string `json:"name" `
- Description string `json:"description"`
- Master string `json:"master" `
- Organization string `json:"organization"`
+ Id string `json:"id" `
+ Name string `json:"name" `
+ Description string `json:"description"`
+ Master string `json:"master" `
}
type EditTeam struct {
- Name *string `json:"name" `
- Description *string `json:"description"`
- Master *string `json:"master" `
- Organization *string `json:"organization"`
+ Name *string `json:"name" `
+ Description *string `json:"description"`
+ Master *string `json:"master" `
}
diff --git a/stores/dynamic-module/model.go b/stores/dynamic-module/model.go
index 054c3c1..385a181 100644
--- a/stores/dynamic-module/model.go
+++ b/stores/dynamic-module/model.go
@@ -3,10 +3,9 @@ package dynamic_module
import "time"
type DynamicModule struct {
- Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
- UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
- Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
- //Partition string `gorm:"column:partition;type:VARCHAR(255);NOT NULL;comment:分区"`
+ Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
+ UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
+ Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
Driver string `gorm:"column:driver;type:VARCHAR(255);NOT NULL;comment:驱动"`
Description string `gorm:"column:description;type:VARCHAR(255);comment:描述"`
Version string `gorm:"column:version;type:VARCHAR(32);NOT NULL;comment:版本"`
diff --git a/stores/organization/model.go b/stores/organization/model.go
deleted file mode 100644
index 3348101..0000000
--- a/stores/organization/model.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package organization
-
-import (
- "time"
-)
-
-// 组织
-
-type Organization struct {
- Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
- UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
- Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
- CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
- UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间" json:"update_at"`
- Creator string `gorm:"type:varchar(36);not null;column:creator;comment:创建人id" aovalue:"creator"`
- Updater string `gorm:"type:varchar(36);not null;column:updater;comment:修改人id" aovalue:"updater"`
- Description string `gorm:"size:255;not null;column:description;comment:description"`
- Master string `gorm:"size:36;not null;column:master;comment:负责人id"` // 负责人id
- Prefix string `gorm:"size:255;not null;column:prefix;comment:分区前缀"`
-}
-
-func (o *Organization) TableName() string {
- return "organization"
-}
-
-func (o *Organization) IdValue() int64 {
- return o.Id
-}
-
-type Partition struct {
- Id int64 `gorm:"type:BIGINT(20);size:20;not null;auto_increment;primary_key;column:id;comment:主键ID;"`
- Oid string `gorm:"size:36;not null;column:oid;comment:组织id;uniqueIndex:oid_pid;"`
- Pid string `gorm:"size:36;not null;column:pid;comment:分区id;uniqueIndex:oid_pid;"`
- CreateTime time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
-}
-
-func (p *Partition) TableName() string {
- return "organization_partition"
-}
-
-func (p *Partition) IdValue() int64 {
- return p.Id
-}
diff --git a/stores/organization/store.go b/stores/organization/store.go
deleted file mode 100644
index 29659c9..0000000
--- a/stores/organization/store.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package organization
-
-import (
- "github.com/eolinker/go-common/autowire"
- "github.com/eolinker/go-common/store"
- "reflect"
-)
-
-type IOrganizationStore interface {
- store.ISearchStore[Organization]
-}
-type IOrganizationPartitionStore interface {
- store.IBaseStore[Partition]
-}
-
-type imlOrganizationStore struct {
- store.SearchStore[Organization]
-}
-type imlOrganizationPartitionStore struct {
- store.Store[Partition]
-}
-
-func init() {
- autowire.Auto[IOrganizationStore](func() reflect.Value {
- return reflect.ValueOf(new(imlOrganizationStore))
- })
- autowire.Auto[IOrganizationPartitionStore](func() reflect.Value {
- return reflect.ValueOf(new(imlOrganizationPartitionStore))
- })
-}
diff --git a/stores/project/model.go b/stores/project/model.go
index 1c6c425..9617952 100644
--- a/stores/project/model.go
+++ b/stores/project/model.go
@@ -3,20 +3,19 @@ package project
import "time"
type Project struct {
- Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
- UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
- Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
- CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
- UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间"`
+ Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
+ UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
+ Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
- Description string `gorm:"size:255;not null;column:description;comment:description"`
- Prefix string `gorm:"size:255;not null;column:prefix;comment:前缀"`
- Team string `gorm:"size:36;not null;column:team;comment:团队id;index:team"` // 团队id
- Organization string `gorm:"size:36;not null;column:organization;comment:组织id;index:organization"` // 组织
- Master string `gorm:"size:36;not null;column:master;comment:负责人id"` // 负责人id
- IsDelete int `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除"`
- AsServer bool `gorm:"type:tinyint(1);not null;column:as_server;comment:是否为服务端项目"`
- AsApp bool `gorm:"type:tinyint(1);not null;column:as_app;comment:是否为应用项目"`
+ Description string `gorm:"size:255;not null;column:description;comment:description"`
+ Prefix string `gorm:"size:255;not null;column:prefix;comment:前缀"`
+ Team string `gorm:"size:36;not null;column:team;comment:团队id;index:team"` // 团队id
+ Master string `gorm:"size:36;not null;column:master;comment:负责人id"` // 负责人id
+ CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
+ UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间"`
+ IsDelete int `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除"`
+ AsServer bool `gorm:"type:tinyint(1);not null;column:as_server;comment:是否为服务端项目"`
+ AsApp bool `gorm:"type:tinyint(1);not null;column:as_app;comment:是否为应用项目"`
}
func (p *Project) IdValue() int64 {
@@ -65,18 +64,3 @@ func (a *Authorization) IdValue() int64 {
func (a *Authorization) TableName() string {
return "project_authorization"
}
-
-type Partition struct {
- Id int64 `gorm:"type:BIGINT(20);size:20;not null;auto_increment;primary_key;column:id;comment:主键ID;"`
- Project string `gorm:"size:36;not null;column:project;comment:系统id;uniqueIndex:oid_pid;"`
- Partition string `gorm:"size:36;not null;column:partition;comment:分区id;uniqueIndex:oid_pid;"`
- CreateTime time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
-}
-
-func (p *Partition) TableName() string {
- return "project_partition"
-}
-
-func (p *Partition) IdValue() int64 {
- return p.Id
-}
diff --git a/stores/project/store.go b/stores/project/store.go
index da13c55..642dc88 100644
--- a/stores/project/store.go
+++ b/stores/project/store.go
@@ -31,14 +31,6 @@ type imlAuthorizationStore struct {
store.SearchStore[Authorization]
}
-type IProjectPartitionStore interface {
- store.IBaseStore[Partition]
-}
-
-type imlProjectPartitionStore struct {
- store.Store[Partition]
-}
-
func init() {
autowire.Auto[IProjectStore](func() reflect.Value {
return reflect.ValueOf(new(imlProjectStore))
@@ -52,7 +44,4 @@ func init() {
autowire.Auto[IAuthorizationStore](func() reflect.Value {
return reflect.ValueOf(new(imlAuthorizationStore))
})
- autowire.Auto[IProjectPartitionStore](func() reflect.Value {
- return reflect.ValueOf(new(imlProjectPartitionStore))
- })
}
diff --git a/stores/service/model.go b/stores/service/model.go
index 6e0d572..5ad4350 100644
--- a/stores/service/model.go
+++ b/stores/service/model.go
@@ -3,23 +3,22 @@ package service
import "time"
type Service struct {
- Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
- UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
- Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
- Description string `gorm:"type:varchar(255);not null;column:description;comment:描述"`
- Logo string `gorm:"type:text;column:logo;comment:logo"`
- ServiceType string `gorm:"type:varchar(36);not null;column:service_type;comment:服务类型"`
- Project string `gorm:"type:varchar(36);not null;column:project;comment:项目"`
- Team string `gorm:"type:varchar(36);not null;column:team;comment:团队"`
- Organization string `gorm:"type:varchar(36);not null;column:organization;comment:组织"`
- Catalogue string `gorm:"type:varchar(36);not null;column:catalogue;comment:目录"`
- Status string `gorm:"type:varchar(36);not null;column:status;comment:状态"`
- Tag string `gorm:"type:varchar(255);not null;column:tag;comment:标签"`
- CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
- UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间" json:"update_at"`
- Creator string `gorm:"type:varchar(36);not null;column:creator;comment:创建者" aovalue:"creator"`
- Updater string `gorm:"type:varchar(36);not null;column:updater;comment:修改者" aovalue:"updater"`
- IsDelete int `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除 0:未删除 1:已删除"`
+ Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
+ UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
+ Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
+ Description string `gorm:"type:varchar(255);not null;column:description;comment:描述"`
+ Logo string `gorm:"type:text;column:logo;comment:logo"`
+ ServiceType string `gorm:"type:varchar(36);not null;column:service_type;comment:服务类型"`
+ Project string `gorm:"type:varchar(36);not null;column:project;comment:项目"`
+ Team string `gorm:"type:varchar(36);not null;column:team;comment:团队"`
+ Catalogue string `gorm:"type:varchar(36);not null;column:catalogue;comment:目录"`
+ Status string `gorm:"type:varchar(36);not null;column:status;comment:状态"`
+ Tag string `gorm:"type:varchar(255);not null;column:tag;comment:标签"`
+ CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
+ UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间" json:"update_at"`
+ Creator string `gorm:"type:varchar(36);not null;column:creator;comment:创建者" aovalue:"creator"`
+ Updater string `gorm:"type:varchar(36);not null;column:updater;comment:修改者" aovalue:"updater"`
+ IsDelete int `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除 0:未删除 1:已删除"`
}
func (o *Service) TableName() string {
diff --git a/stores/subscribe/model.go b/stores/subscribe/model.go
index d018207..ea094fc 100644
--- a/stores/subscribe/model.go
+++ b/stores/subscribe/model.go
@@ -8,7 +8,6 @@ type Subscribe struct {
Project string `gorm:"size:36;not null;column:project;comment:项目id;index:project;"` // 项目id
Service string `gorm:"size:36;not null;column:service;comment:服务id;uniqueIndex:unique_subscribe"`
Application string `gorm:"size:36;not null;column:application;comment:应用id,项目id,系统id;uniqueIndex:unique_subscribe"`
- Partition string `gorm:"size:36;not null;column:partition;uniqueIndex:unique_subscribe;comment:分区id"`
ApplyStatus int `gorm:"type:tinyint(1);not null;column:apply_status;comment:申请状态;index:status;"`
From int `gorm:"type:tinyint(1);not null;column:from;comment:来源;index:status;"`
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
@@ -24,24 +23,20 @@ func (s *Subscribe) TableName() string {
}
type Apply struct {
- Id int64 `gorm:"column:id;type:BIGINT(20);NOT NULL;comment:id;primary_key;comment:主键ID;"`
- Uuid string `gorm:"size:36;not null;column:uuid;comment:uuid;uniqueIndex:uuid;"` // uuid
- Service string `gorm:"size:36;not null;column:service;comment:服务id;index:server;"` // 服务id
- Project string `gorm:"size:36;not null;column:project;comment:项目id;index:project;"` // 项目id
- Team string `gorm:"size:36;not null;column:team;comment:团队id;index:team;"` // 团队id
- Organization string `gorm:"size:36;not null;column:organization;comment:组织id;index:organization;"` // 组织id
- Application string `gorm:"size:36;not null;column:application;comment:应用id,项目id,系统id;index:application;"` // 订阅应用id
- ApplyTeam string `gorm:"size:36;not null;column:apply_team;comment:申请团队id;index:apply_team;"` // 申请团队id
- ApplyOrganization string `gorm:"size:36;not null;column:apply_organization;comment:申请组织id;index:apply_organization;"` // 申请组织id
- ApplyPartitions []string `gorm:"type:text;not null;column:apply_partitions;comment:申请分区id;serializer:json"` // 申请分区id列表
- Partitions []string `gorm:"type:text;not null;column:partitions;comment:分区id;serializer:json"` // 通过分区id列表
- Applier string `gorm:"size:36;not null;column:applier;comment:申请人;index:applier;" aovalue:"creator"`
- ApplyAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:apply_at;comment:申请时间"`
- Approver string `gorm:"size:36;not null;column:approver;comment:审批人;index:approver;"`
- ApproveAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:approve_at;comment:审批时间"`
- Status int `gorm:"type:tinyint(1);not null;column:status;comment:审批状态;index:status;"`
- Opinion string `gorm:"type:text;not null;column:opinion;comment:审批意见;"`
- Reason string `gorm:"type:text;not null;column:reason;comment:申请原因;"`
+ Id int64 `gorm:"column:id;type:BIGINT(20);NOT NULL;comment:id;primary_key;comment:主键ID;"`
+ Uuid string `gorm:"size:36;not null;column:uuid;comment:uuid;uniqueIndex:uuid;"` // uuid
+ Service string `gorm:"size:36;not null;column:service;comment:服务id;index:server;"` // 服务id
+ Project string `gorm:"size:36;not null;column:project;comment:项目id;index:project;"` // 项目id
+ Team string `gorm:"size:36;not null;column:team;comment:团队id;index:team;"` // 团队id
+ Application string `gorm:"size:36;not null;column:application;comment:应用id,项目id,系统id;index:application;"` // 订阅应用id
+ ApplyTeam string `gorm:"size:36;not null;column:apply_team;comment:申请团队id;index:apply_team;"` // 申请团队id
+ Applier string `gorm:"size:36;not null;column:applier;comment:申请人;index:applier;" aovalue:"creator"`
+ ApplyAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:apply_at;comment:申请时间"`
+ Approver string `gorm:"size:36;not null;column:approver;comment:审批人;index:approver;"`
+ ApproveAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:approve_at;comment:审批时间"`
+ Status int `gorm:"type:tinyint(1);not null;column:status;comment:审批状态;index:status;"`
+ Opinion string `gorm:"type:text;not null;column:opinion;comment:审批意见;"`
+ Reason string `gorm:"type:text;not null;column:reason;comment:申请原因;"`
}
func (a *Apply) IdValue() int64 {
diff --git a/stores/team/model.go b/stores/team/model.go
index 05d0493..41e2d35 100644
--- a/stores/team/model.go
+++ b/stores/team/model.go
@@ -5,18 +5,16 @@ import (
)
type Team struct {
- Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
- UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
- Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
- CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
- UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间" json:"update_at"`
-
- Description string `gorm:"size:255;not null;column:description;comment:description"`
- Master string `gorm:"size:36;not null;column:master;comment:负责人id"` // 负责人id
- Organization string `gorm:"size:36;not null;column:organization;comment:组织id"` // 组织id
- Creator string `gorm:"size:36;not null;column:creator;comment:创建人id" aovalue:"creator"` // 创建人id
- Updater string `gorm:"size:36;not null;column:updater;comment:修改人id" aovalue:"updater"` // 修改人id
- IsDelete bool `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除"`
+ Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
+ UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
+ Name string `gorm:"type:varchar(100);not null;column:name;comment:name"`
+ Description string `gorm:"size:255;not null;column:description;comment:description"`
+ Master string `gorm:"size:36;not null;column:master;comment:负责人id"` // 负责人id
+ Creator string `gorm:"size:36;not null;column:creator;comment:创建人id" aovalue:"creator"` // 创建人id
+ Updater string `gorm:"size:36;not null;column:updater;comment:修改人id" aovalue:"updater"` // 修改人id
+ CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
+ UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间" json:"update_at"`
+ IsDelete bool `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除"`
}
func (t *Team) IdValue() int64 {
From 8e6abe511de212c6bc8fffc7a5ca0ef6d2e858c5 Mon Sep 17 00:00:00 2001
From: Liujian <824010343@qq.com>
Date: Wed, 24 Jul 2024 10:57:35 +0800
Subject: [PATCH 02/19] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E6=88=90=E5=91=98=E6=A8=A1=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
controller/project/iml.go | 60 ++--
controller/project/project.go | 40 +--
module/permit/project/iml.go | 24 +-
module/project/dto/input.go | 10 +-
module/project/dto/output.go | 18 +-
module/project/iml.go | 478 ++++++++++++++++----------------
module/project/project.go | 32 +--
plugins/core/core.go | 14 +-
plugins/core/project.go | 26 +-
service/project-role/iml.go | 74 -----
service/project-role/model.go | 12 -
service/project-role/service.go | 22 --
service/project/iml.go | 12 +-
service/project/model.go | 36 +--
stores/project/model.go | 29 +-
stores/project/store.go | 18 +-
16 files changed, 394 insertions(+), 511 deletions(-)
delete mode 100644 service/project-role/iml.go
delete mode 100644 service/project-role/model.go
delete mode 100644 service/project-role/service.go
diff --git a/controller/project/iml.go b/controller/project/iml.go
index a617a77..53c159e 100644
--- a/controller/project/iml.go
+++ b/controller/project/iml.go
@@ -7,9 +7,9 @@ import (
)
var (
- _ IProjectController = (*imlProjectController)(nil)
- _ IProjectMemberController = (*imlProjectMemberController)(nil)
- _ IAppController = (*imlAppController)(nil)
+ _ IProjectController = (*imlProjectController)(nil)
+ //_ IProjectMemberController = (*imlProjectMemberController)(nil)
+ _ IAppController = (*imlAppController)(nil)
)
type imlProjectController struct {
@@ -48,33 +48,33 @@ func (i *imlProjectController) DeleteProject(ctx *gin.Context, id string) error
return i.module.DeleteProject(ctx, id)
}
-type imlProjectMemberController struct {
- module project.IProjectMemberModule `autowired:""`
-}
-
-func (i *imlProjectMemberController) SimpleMembersToAdd(ctx *gin.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error) {
- return i.module.SimpleMembersToAdd(ctx, pid, keyword)
-}
-
-func (i *imlProjectMemberController) SimpleMembers(ctx *gin.Context, pid string) ([]*project_dto.SimpleMemberItem, error) {
- return i.module.SimpleMembers(ctx, pid)
-}
-
-func (i *imlProjectMemberController) Members(ctx *gin.Context, id string, keyword string) ([]*project_dto.MemberItem, error) {
- return i.module.Members(ctx, id, keyword)
-}
-
-func (i *imlProjectMemberController) AddMember(ctx *gin.Context, pid string, users *project_dto.Users) error {
- return i.module.AddMember(ctx, pid, users.Users)
-}
-
-func (i *imlProjectMemberController) RemoveMember(ctx *gin.Context, pid string, uid string) error {
- return i.module.RemoveMember(ctx, pid, []string{uid})
-}
-
-func (i *imlProjectMemberController) EditProjectMember(ctx *gin.Context, pid string, uid string, edit *project_dto.EditProjectMember) error {
- return i.module.EditProjectMember(ctx, pid, uid, edit.Roles)
-}
+//type imlProjectMemberController struct {
+// module project.IProjectMemberModule `autowired:""`
+//}
+//
+//func (i *imlProjectMemberController) SimpleMembersToAdd(ctx *gin.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error) {
+// return i.module.SimpleMembersToAdd(ctx, pid, keyword)
+//}
+//
+//func (i *imlProjectMemberController) SimpleMembers(ctx *gin.Context, pid string) ([]*project_dto.SimpleMemberItem, error) {
+// return i.module.SimpleMembers(ctx, pid)
+//}
+//
+//func (i *imlProjectMemberController) Members(ctx *gin.Context, id string, keyword string) ([]*project_dto.MemberItem, error) {
+// return i.module.Members(ctx, id, keyword)
+//}
+//
+//func (i *imlProjectMemberController) AddMember(ctx *gin.Context, pid string, users *project_dto.Users) error {
+// return i.module.AddMember(ctx, pid, users.Users)
+//}
+//
+//func (i *imlProjectMemberController) RemoveMember(ctx *gin.Context, pid string, uid string) error {
+// return i.module.RemoveMember(ctx, pid, []string{uid})
+//}
+//
+//func (i *imlProjectMemberController) EditProjectMember(ctx *gin.Context, pid string, uid string, edit *project_dto.EditProjectMember) error {
+// return i.module.EditProjectMember(ctx, pid, uid, edit.Roles)
+//}
type imlAppController struct {
module project.IAppModule `autowired:""`
diff --git a/controller/project/project.go b/controller/project/project.go
index 2d4beeb..127e8a0 100644
--- a/controller/project/project.go
+++ b/controller/project/project.go
@@ -2,10 +2,10 @@ package project
import (
"reflect"
-
+
project_dto "github.com/eolinker/apipark/module/project/dto"
"github.com/gin-gonic/gin"
-
+
"github.com/eolinker/go-common/autowire"
)
@@ -27,24 +27,24 @@ type IProjectController interface {
MySimpleProjects(ctx *gin.Context, keyword string) ([]*project_dto.SimpleProjectItem, error)
}
-type IProjectMemberController interface {
- // Members 获取项目成员列表
- Members(ctx *gin.Context, pid string, keyword string) ([]*project_dto.MemberItem, error)
- // AddMember 添加项目成员
- AddMember(ctx *gin.Context, pid string, users *project_dto.Users) error
- // RemoveMember 移除项目成员
- RemoveMember(ctx *gin.Context, pid string, uid string) error
- // EditProjectMember 修改成员信息
- EditProjectMember(ctx *gin.Context, pid string, uid string, edit *project_dto.EditProjectMember) error
- // SimpleMembers 简易系统成员列表
- SimpleMembers(ctx *gin.Context, pid string) ([]*project_dto.SimpleMemberItem, error)
- SimpleMembersToAdd(ctx *gin.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error)
-}
+//type IProjectMemberController interface {
+// // Members 获取项目成员列表
+// Members(ctx *gin.Context, pid string, keyword string) ([]*project_dto.MemberItem, error)
+// // AddMember 添加项目成员
+// AddMember(ctx *gin.Context, pid string, users *project_dto.Users) error
+// // RemoveMember 移除项目成员
+// RemoveMember(ctx *gin.Context, pid string, uid string) error
+// // EditProjectMember 修改成员信息
+// EditProjectMember(ctx *gin.Context, pid string, uid string, edit *project_dto.EditProjectMember) error
+// // SimpleMembers 简易系统成员列表
+// SimpleMembers(ctx *gin.Context, pid string) ([]*project_dto.SimpleMemberItem, error)
+// SimpleMembersToAdd(ctx *gin.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error)
+//}
type IAppController interface {
// CreateApp 创建应用
CreateApp(ctx *gin.Context, teamID string, project *project_dto.CreateApp) (*project_dto.App, error)
-
+
UpdateApp(ctx *gin.Context, appId string, project *project_dto.UpdateApp) (*project_dto.App, error)
SearchMyApps(ctx *gin.Context, teamId string, keyword string) ([]*project_dto.AppItem, error)
// SimpleApps 获取简易项目列表
@@ -58,10 +58,10 @@ func init() {
autowire.Auto[IProjectController](func() reflect.Value {
return reflect.ValueOf(new(imlProjectController))
})
- autowire.Auto[IProjectMemberController](func() reflect.Value {
- return reflect.ValueOf(new(imlProjectMemberController))
- })
-
+ //autowire.Auto[IProjectMemberController](func() reflect.Value {
+ // return reflect.ValueOf(new(imlProjectMemberController))
+ //})
+
autowire.Auto[IAppController](func() reflect.Value {
return reflect.ValueOf(new(imlAppController))
})
diff --git a/module/permit/project/iml.go b/module/permit/project/iml.go
index b74f093..525e47c 100644
--- a/module/permit/project/iml.go
+++ b/module/permit/project/iml.go
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
+
"github.com/eolinker/ap-account/service/member"
"github.com/eolinker/ap-account/service/role"
"github.com/eolinker/ap-account/service/user"
@@ -13,7 +14,6 @@ import (
permit_type "github.com/eolinker/apipark/service/permit-type"
"github.com/eolinker/apipark/service/project"
project_member "github.com/eolinker/apipark/service/project-member"
- project_role "github.com/eolinker/apipark/service/project-role"
"github.com/eolinker/apipark/service/team"
team_member "github.com/eolinker/apipark/service/team-member"
"github.com/eolinker/eosc/log"
@@ -56,7 +56,7 @@ type imlProjectPermitModule struct {
userGroupService user_group.IUserGroupService `autowired:""`
userService user.IUserService `autowired:""`
roleService role.IRoleService `autowired:""`
- projectRoleService project_role.IProjectRoleService `autowired:""`
+ //projectRoleService project_role.IProjectRoleService `autowired:""`
}
func (m *imlProjectPermitModule) Permissions(ctx *gin.Context, projectId string) ([]string, error) {
@@ -149,10 +149,10 @@ func (m *imlProjectPermitModule) getIdentity(ctx context.Context, p *project.Pro
targets := make([]string, 0)
targets = append(targets, permit_type.AnyOne.Key)
- if p.Master == uid {
- targets = append(targets, permit_type.ProjectMaster.Key)
- targets = append(targets, permit_type.ProjectMember.Key)
- }
+ //if p.Master == uid {
+ // targets = append(targets, permit_type.ProjectMaster.Key)
+ // targets = append(targets, permit_type.ProjectMember.Key)
+ //}
if len(members) != 0 {
// 用户属于该项目的成员,则是用户的全局用户组身份生效
targets = append(targets, permit_type.ProjectMember.Key)
@@ -165,12 +165,12 @@ func (m *imlProjectPermitModule) getIdentity(ctx context.Context, p *project.Pro
targets = append(targets, permit_type.UserGroup.KeyOf(mb.Come))
}
}
- roles, err := m.projectRoleService.Roles(ctx, p.Id, uid)
- if err == nil && roles != nil {
- targets = append(targets, utils.SliceToSlice(roles, func(s *project_role.ProjectRole) string {
- return permit_type.Role.KeyOf(s.Rid)
- })...)
- }
+ //roles, err := m.projectRoleService.Roles(ctx, p.Id, uid)
+ //if err == nil && roles != nil {
+ // targets = append(targets, utils.SliceToSlice(roles, func(s *project_role.ProjectRole) string {
+ // return permit_type.Role.KeyOf(s.Rid)
+ // })...)
+ //}
teamIdentity, err := m.identityTeamService.IdentifyTeam(ctx, p.Team, uid)
if err != nil {
diff --git a/module/project/dto/input.go b/module/project/dto/input.go
index d4445b9..67738a7 100644
--- a/module/project/dto/input.go
+++ b/module/project/dto/input.go
@@ -1,10 +1,10 @@
package project_dto
type CreateProject struct {
- Id string `json:"id"`
- Name string `json:"name"`
- Prefix string `json:"prefix"`
- Master string `json:"master"`
+ Id string `json:"id"`
+ Name string `json:"name"`
+ Prefix string `json:"prefix"`
+ //Master string `json:"master"`
Partition []string `json:"partition" aocheck:"partition"`
Description string `json:"description"`
AsApp *bool `json:"as_app"`
@@ -14,7 +14,7 @@ type CreateProject struct {
type EditProject struct {
Name *string `json:"name"`
Description *string `json:"description"`
- Master *string `json:"master" aocheck:"user"`
+ //Master *string `json:"master" aocheck:"user"`
}
type CreateApp struct {
diff --git a/module/project/dto/output.go b/module/project/dto/output.go
index 6fb22fd..f7312f1 100644
--- a/module/project/dto/output.go
+++ b/module/project/dto/output.go
@@ -13,8 +13,8 @@ type ProjectItem struct {
ApiNum int64 `json:"api_num"`
ServiceNum int64 `json:"service_num"`
//SubscribeNum int64 `json:"subscribe_num"`
- Description string `json:"description"`
- Master auto.Label `json:"master" aolabel:"user"`
+ Description string `json:"description"`
+ //Master auto.Label `json:"master" aolabel:"user"`
//Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
CreateTime auto.TimeLabel `json:"create_time"`
UpdateTime auto.TimeLabel `json:"update_time"`
@@ -55,8 +55,8 @@ type Project struct {
Prefix string `json:"prefix,omitempty"`
Description string `json:"description"`
//Organization auto.Label `json:"organization" aolabel:"organization"`
- Team auto.Label `json:"team" aolabel:"team"`
- Master auto.Label `json:"master" aolabel:"user"`
+ Team auto.Label `json:"team" aolabel:"team"`
+ //Master auto.Label `json:"master" aolabel:"user"`
//Partition []auto.Label `json:"partition,omitempty" aolabel:"partition"`
//OrganizationPrefix string `json:"organization_prefix,omitempty"`
CreateTime auto.TimeLabel `json:"create_time"`
@@ -82,11 +82,11 @@ func ToProject(model *project.Project) *Project {
Prefix: model.Prefix,
Description: model.Description,
Team: auto.UUID(model.Team),
- Master: auto.UUID(model.Master),
- CreateTime: auto.TimeLabel(model.CreateTime),
- UpdateTime: auto.TimeLabel(model.UpdateTime),
- AsServer: model.AsServer,
- AsApp: model.AsApp,
+ //Master: auto.UUID(model.Master),
+ CreateTime: auto.TimeLabel(model.CreateTime),
+ UpdateTime: auto.TimeLabel(model.UpdateTime),
+ AsServer: model.AsServer,
+ AsApp: model.AsApp,
}
}
diff --git a/module/project/iml.go b/module/project/iml.go
index e9903c5..c02e9f0 100644
--- a/module/project/iml.go
+++ b/module/project/iml.go
@@ -12,16 +12,10 @@ import (
"github.com/eolinker/apipark/service/subscribe"
"gorm.io/gorm"
- "github.com/eolinker/ap-account/service/member"
-
"github.com/eolinker/apipark/service/api"
"github.com/eolinker/apipark/service/service"
- project_role "github.com/eolinker/apipark/service/project-role"
-
- "github.com/eolinker/ap-account/service/user"
-
"github.com/eolinker/go-common/auto"
team_member "github.com/eolinker/apipark/service/team-member"
@@ -108,13 +102,13 @@ func (i *imlProjectModule) SearchMyProjects(ctx context.Context, teamId string,
Id: model.Id,
Name: model.Name,
Description: model.Description,
- Master: auto.UUID(model.Master),
- CreateTime: auto.TimeLabel(model.CreateTime),
- UpdateTime: auto.TimeLabel(model.UpdateTime),
- Team: auto.UUID(model.Team),
- ApiNum: apiCount,
- ServiceNum: serviceCount,
- CanDelete: apiCount == 0 && serviceCount == 0,
+ //Master: auto.UUID(model.Master),
+ CreateTime: auto.TimeLabel(model.CreateTime),
+ UpdateTime: auto.TimeLabel(model.UpdateTime),
+ Team: auto.UUID(model.Team),
+ ApiNum: apiCount,
+ ServiceNum: serviceCount,
+ CanDelete: apiCount == 0 && serviceCount == 0,
})
}
return items, nil
@@ -234,13 +228,13 @@ func (i *imlProjectModule) Search(ctx context.Context, teamID string, keyword st
Id: model.Id,
Name: model.Name,
Description: model.Description,
- Master: auto.UUID(model.Master),
- CreateTime: auto.TimeLabel(model.CreateTime),
- UpdateTime: auto.TimeLabel(model.UpdateTime),
- Team: auto.UUID(model.Team),
- ApiNum: apiCount,
- ServiceNum: serviceCount,
- CanDelete: apiCount == 0 && serviceCount == 0,
+ //Master: auto.UUID(model.Master),
+ CreateTime: auto.TimeLabel(model.CreateTime),
+ UpdateTime: auto.TimeLabel(model.UpdateTime),
+ Team: auto.UUID(model.Team),
+ ApiNum: apiCount,
+ ServiceNum: serviceCount,
+ CanDelete: apiCount == 0 && serviceCount == 0,
})
}
return items, nil
@@ -255,9 +249,9 @@ func (i *imlProjectModule) CreateProject(ctx context.Context, teamID string, inp
Id: input.Id,
Name: input.Name,
Description: input.Description,
- Master: input.Master,
- Team: teamID,
- Prefix: input.Prefix,
+ //Master: input.Master,
+ Team: teamID,
+ Prefix: input.Prefix,
}
if input.AsApp == nil {
// 默认值为false
@@ -274,21 +268,18 @@ func (i *imlProjectModule) CreateProject(ctx context.Context, teamID string, inp
input.Prefix = strings.Trim(strings.Trim(input.Prefix, " "), "/")
err := i.transaction.Transaction(ctx, func(ctx context.Context) error {
- // 判断用户是否在团队内
- members, err := i.teamMemberService.Members(ctx, []string{teamID}, []string{input.Master})
- if err != nil {
- return err
- }
- if len(members) == 0 {
- return fmt.Errorf("master is not in team")
- }
+ //// 判断用户是否在团队内
+ //members, err := i.teamMemberService.Members(ctx, []string{teamID}, []string{input.Master})
+ //if err != nil {
+ // return err
+ //}
+ //if len(members) == 0 {
+ // return fmt.Errorf("master is not in team")
+ //}
- err = i.projectService.Create(ctx, mo)
- if err != nil {
- return err
- }
+ return i.projectService.Create(ctx, mo)
- return i.projectMemberService.AddMemberTo(ctx, input.Id, input.Master)
+ //return i.projectMemberService.AddMemberTo(ctx, input.Id, input.Master)
})
if err != nil {
return nil, err
@@ -303,36 +294,36 @@ func (i *imlProjectModule) EditProject(ctx context.Context, id string, input *pr
}
err = i.transaction.Transaction(ctx, func(ctx context.Context) error {
- if input.Master != nil {
- projectInfo, err := i.projectService.Get(ctx, id)
- if err != nil {
- return err
- }
-
- // 判断用户是否在团队内
- members, err := i.teamMemberService.Members(ctx, []string{projectInfo.Team}, []string{*input.Master})
- if err != nil {
- return err
- }
- if len(members) == 0 {
- return fmt.Errorf("master is not in team")
- }
- // 负责人是否在项目内,若不在,则新增
- projectMembers, err := i.projectMemberService.Members(ctx, []string{id}, []string{*input.Master})
- if err != nil {
- return err
- }
- if len(projectMembers) == 0 {
- err = i.projectMemberService.AddMemberTo(ctx, id, *input.Master)
- if err != nil {
- return err
- }
- }
- }
+ //if input.Master != nil {
+ //projectInfo, err := i.projectService.Get(ctx, id)
+ //if err != nil {
+ // return err
+ //}
+
+ //// 判断用户是否在团队内
+ //members, err := i.teamMemberService.Members(ctx, []string{projectInfo.Team}, []string{*input.Master})
+ //if err != nil {
+ // return err
+ //}
+ //if len(members) == 0 {
+ // return fmt.Errorf("master is not in team")
+ //}
+ //// 负责人是否在项目内,若不在,则新增
+ //projectMembers, err := i.projectMemberService.Members(ctx, []string{id}, []string{*input.Master})
+ //if err != nil {
+ // return err
+ //}
+ //if len(projectMembers) == 0 {
+ // err = i.projectMemberService.AddMemberTo(ctx, id, *input.Master)
+ // if err != nil {
+ // return err
+ // }
+ //}
+ //}
return i.projectService.Save(ctx, id, &project.EditProject{
Name: input.Name,
Description: input.Description,
- Master: input.Master,
+ //Master: input.Master,
})
})
@@ -363,176 +354,177 @@ func (i *imlProjectModule) DeleteProject(ctx context.Context, id string) error {
return err
}
-var _ IProjectMemberModule = (*imlProjectMemberModule)(nil)
-
-type imlProjectMemberModule struct {
- projectService project.IProjectService `autowired:""`
- projectMemberService project_member.IMemberService `autowired:""`
- projectRoleService project_role.IProjectRoleService `autowired:""`
- userService user.IUserService `autowired:""`
- transaction store.ITransaction `autowired:""`
- teamMemberService team_member.ITeamMemberService `autowired:""`
-}
-
-func (i *imlProjectMemberModule) SimpleMembersToAdd(ctx context.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error) {
-
- pro, err := i.projectService.Get(ctx, pid)
- if err != nil {
- return nil, err
- }
-
- users, err := i.userService.Search(ctx, keyword, -1)
- if err != nil {
- return nil, err
- }
- userIds := utils.SliceToSlice(users, func(s *user.User) string {
- return s.UID
- })
-
- members, err := i.teamMemberService.Members(ctx, []string{pro.Team}, userIds)
- if err != nil {
- return nil, err
- }
- userMaps := utils.SliceToMap(users, func(s *user.User) string {
- return s.UID
- })
-
- return utils.SliceToSlice(members, func(s *member.Member) *project_dto.TeamMemberToAdd {
- uf := userMaps[s.UID]
- return &project_dto.TeamMemberToAdd{
- Id: uf.UID,
- Name: uf.Username,
- Email: uf.Email,
- //Department: uf.,
- }
- }, func(m *member.Member) bool {
- _, has := userMaps[m.UID]
- return has
- }), nil
-
-}
-
-func (i *imlProjectMemberModule) SimpleMembers(ctx context.Context, pid string) ([]*project_dto.SimpleMemberItem, error) {
- members, err := i.projectMemberService.Members(ctx, []string{pid}, nil)
- if err != nil {
- return nil, err
- }
- userIds := utils.SliceToSlice(members, func(s *member.Member) string {
- return s.UID
- })
- users, err := i.userService.Get(ctx, userIds...)
- if err != nil {
- return nil, err
- }
- out := utils.SliceToSlice(users, func(s *user.User) *project_dto.SimpleMemberItem {
- return &project_dto.SimpleMemberItem{
- Id: s.UID,
- Name: s.Username,
- }
- })
- return out, nil
-}
-
-func (i *imlProjectMemberModule) Members(ctx context.Context, id string, keyword string) ([]*project_dto.MemberItem, error) {
- pInfo, err := i.projectService.Get(ctx, id)
- if err != nil {
- return nil, err
- }
- users, err := i.userService.Search(ctx, keyword, -1)
- if err != nil {
- return nil, err
- }
- userMap := make(map[string]*user.User)
- userIds := make([]string, 0, len(users))
- for _, u := range users {
- userIds = append(userIds, u.UID)
- userMap[u.UID] = u
- }
- members, err := i.projectMemberService.Members(ctx, []string{id}, userIds)
- if err != nil {
- return nil, err
- }
- roleMap, err := i.projectRoleService.RoleMap(ctx, id)
- if err != nil {
- return nil, err
- }
-
- out := utils.SliceToSlice(members, func(info *project_member.Member) *project_dto.MemberItem {
- roleIDs := make([]string, 0, len(roleMap[info.UID]))
- for _, r := range roleMap[info.UID] {
- roleIDs = append(roleIDs, r.Rid)
- }
- item := &project_dto.MemberItem{
- User: auto.UUID(info.UID),
- Email: "",
- Roles: auto.List(roleIDs),
- }
-
- u, ok := userMap[info.UID]
- if ok {
- item.Email = u.Email
- }
- if pInfo.Master == info.UID {
- item.CanDelete = false
- } else {
- item.CanDelete = true
- }
- return item
-
- })
- return out, nil
-}
-
-func (i *imlProjectMemberModule) AddMember(ctx context.Context, pid string, userIDs []string) error {
- _, err := i.projectService.Get(ctx, pid)
- if err != nil {
- return err
- }
- return i.projectMemberService.AddMemberTo(ctx, pid, userIDs...)
-}
-
-func (i *imlProjectMemberModule) RemoveMember(ctx context.Context, pid string, userIDs []string) error {
- // 删除的成员是否有项目负责人
- info, err := i.projectService.Get(ctx, pid)
- if err != nil {
- return err
- }
- uids := make([]string, 0, len(userIDs))
- for _, id := range userIDs {
- if id != info.Master {
- uids = append(uids, id)
- }
- }
- if len(uids) == 0 {
- return nil
- }
- return i.projectMemberService.RemoveMemberFrom(ctx, pid, userIDs...)
-}
-
-func (i *imlProjectMemberModule) EditProjectMember(ctx context.Context, pid string, uid string, roles []string) error {
- return i.transaction.Transaction(ctx, func(ctx context.Context) error {
- _, err := i.projectService.Get(ctx, pid)
- if err != nil {
- return err
- }
- _, err = i.userService.Get(ctx, uid)
- if err != nil {
- return err
- }
-
- err = i.projectRoleService.DeleteRole(ctx, pid, uid)
- if err != nil {
- return err
- }
- for _, rid := range roles {
- err = i.projectRoleService.AddRole(ctx, pid, uid, rid)
- if err != nil {
- return err
- }
- }
- return nil
- })
-}
+//var _ IProjectMemberModule = (*imlProjectMemberModule)(nil)
+//
+//type imlProjectMemberModule struct {
+// projectService project.IProjectService `autowired:""`
+// projectMemberService project_member.IMemberService `autowired:""`
+// //projectRoleService project_role.IProjectRoleService `autowired:""`
+// userService user.IUserService `autowired:""`
+// transaction store.ITransaction `autowired:""`
+// teamMemberService team_member.ITeamMemberService `autowired:""`
+//}
+//
+//func (i *imlProjectMemberModule) SimpleMembersToAdd(ctx context.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error) {
+//
+// pro, err := i.projectService.Get(ctx, pid)
+// if err != nil {
+// return nil, err
+// }
+//
+// users, err := i.userService.Search(ctx, keyword, -1)
+// if err != nil {
+// return nil, err
+// }
+// userIds := utils.SliceToSlice(users, func(s *user.User) string {
+// return s.UID
+// })
+//
+// members, err := i.teamMemberService.Members(ctx, []string{pro.Team}, userIds)
+// if err != nil {
+// return nil, err
+// }
+// userMaps := utils.SliceToMap(users, func(s *user.User) string {
+// return s.UID
+// })
+//
+// return utils.SliceToSlice(members, func(s *member.Member) *project_dto.TeamMemberToAdd {
+// uf := userMaps[s.UID]
+// return &project_dto.TeamMemberToAdd{
+// Id: uf.UID,
+// Name: uf.Username,
+// Email: uf.Email,
+// //Department: uf.,
+// }
+// }, func(m *member.Member) bool {
+// _, has := userMaps[m.UID]
+// return has
+// }), nil
+//
+//}
+//
+//func (i *imlProjectMemberModule) SimpleMembers(ctx context.Context, pid string) ([]*project_dto.SimpleMemberItem, error) {
+// members, err := i.projectMemberService.Members(ctx, []string{pid}, nil)
+// if err != nil {
+// return nil, err
+// }
+// userIds := utils.SliceToSlice(members, func(s *member.Member) string {
+// return s.UID
+// })
+// users, err := i.userService.Get(ctx, userIds...)
+// if err != nil {
+// return nil, err
+// }
+// out := utils.SliceToSlice(users, func(s *user.User) *project_dto.SimpleMemberItem {
+// return &project_dto.SimpleMemberItem{
+// Id: s.UID,
+// Name: s.Username,
+// }
+// })
+// return out, nil
+//}
+
+//
+//func (i *imlProjectMemberModule) Members(ctx context.Context, id string, keyword string) ([]*project_dto.MemberItem, error) {
+// pInfo, err := i.projectService.Get(ctx, id)
+// if err != nil {
+// return nil, err
+// }
+// users, err := i.userService.Search(ctx, keyword, -1)
+// if err != nil {
+// return nil, err
+// }
+// userMap := make(map[string]*user.User)
+// userIds := make([]string, 0, len(users))
+// for _, u := range users {
+// userIds = append(userIds, u.UID)
+// userMap[u.UID] = u
+// }
+// members, err := i.projectMemberService.Members(ctx, []string{id}, userIds)
+// if err != nil {
+// return nil, err
+// }
+// roleMap, err := i.projectRoleService.RoleMap(ctx, id)
+// if err != nil {
+// return nil, err
+// }
+//
+// out := utils.SliceToSlice(members, func(info *project_member.Member) *project_dto.MemberItem {
+// roleIDs := make([]string, 0, len(roleMap[info.UID]))
+// for _, r := range roleMap[info.UID] {
+// roleIDs = append(roleIDs, r.Rid)
+// }
+// item := &project_dto.MemberItem{
+// User: auto.UUID(info.UID),
+// Email: "",
+// Roles: auto.List(roleIDs),
+// }
+//
+// u, ok := userMap[info.UID]
+// if ok {
+// item.Email = u.Email
+// }
+// if pInfo.Master == info.UID {
+// item.CanDelete = false
+// } else {
+// item.CanDelete = true
+// }
+// return item
+//
+// })
+// return out, nil
+//}
+//
+//func (i *imlProjectMemberModule) AddMember(ctx context.Context, pid string, userIDs []string) error {
+// _, err := i.projectService.Get(ctx, pid)
+// if err != nil {
+// return err
+// }
+// return i.projectMemberService.AddMemberTo(ctx, pid, userIDs...)
+//}
+//
+//func (i *imlProjectMemberModule) RemoveMember(ctx context.Context, pid string, userIDs []string) error {
+// // 删除的成员是否有项目负责人
+// info, err := i.projectService.Get(ctx, pid)
+// if err != nil {
+// return err
+// }
+// uids := make([]string, 0, len(userIDs))
+// for _, id := range userIDs {
+// if id != info.Master {
+// uids = append(uids, id)
+// }
+// }
+// if len(uids) == 0 {
+// return nil
+// }
+// return i.projectMemberService.RemoveMemberFrom(ctx, pid, userIDs...)
+//}
+//
+//func (i *imlProjectMemberModule) EditProjectMember(ctx context.Context, pid string, uid string, roles []string) error {
+// return i.transaction.Transaction(ctx, func(ctx context.Context) error {
+// _, err := i.projectService.Get(ctx, pid)
+// if err != nil {
+// return err
+// }
+// _, err = i.userService.Get(ctx, uid)
+// if err != nil {
+// return err
+// }
+//
+// err = i.projectRoleService.DeleteRole(ctx, pid, uid)
+// if err != nil {
+// return err
+// }
+// for _, rid := range roles {
+// err = i.projectRoleService.AddRole(ctx, pid, uid, rid)
+// if err != nil {
+// return err
+// }
+// }
+// return nil
+// })
+//}
var _ IAppModule = &imlAppModule{}
@@ -558,9 +550,9 @@ func (i *imlAppModule) CreateApp(ctx context.Context, teamID string, input *proj
Id: input.Id,
Name: input.Name,
Description: input.Description,
- Master: userId,
- Team: teamID,
- AsApp: true,
+ //Master: userId,
+ Team: teamID,
+ AsApp: true,
}
// 判断用户是否在团队内
members, err := i.teamMemberService.Members(ctx, []string{teamID}, []string{userId})
@@ -587,7 +579,7 @@ func (i *imlAppModule) CreateApp(ctx context.Context, teamID string, input *proj
}
func (i *imlAppModule) UpdateApp(ctx context.Context, appId string, input *project_dto.UpdateApp) (*project_dto.App, error) {
- userId := utils.UserId(ctx)
+ //userId := utils.UserId(ctx)
info, err := i.projectService.Get(ctx, appId)
if err != nil {
return nil, err
@@ -595,9 +587,9 @@ func (i *imlAppModule) UpdateApp(ctx context.Context, appId string, input *proje
if !info.AsApp {
return nil, fmt.Errorf("not app")
}
- if info.Master != userId {
- return nil, fmt.Errorf("user is not app master, can not update")
- }
+ //if info.Master != userId {
+ // return nil, fmt.Errorf("user is not app master, can not update")
+ //}
err = i.projectService.Save(ctx, appId, &project.EditProject{
Name: input.Name,
@@ -761,8 +753,8 @@ func (i *imlAppModule) DeleteApp(ctx context.Context, appId string) error {
if !info.AsApp {
return errors.New("not app, can not delete")
}
- if info.Master != utils.UserId(ctx) {
- return errors.New("not master, can not delete")
- }
+ //if info.Master != utils.UserId(ctx) {
+ // return errors.New("not master, can not delete")
+ //}
return i.projectService.Delete(ctx, appId)
}
diff --git a/module/project/project.go b/module/project/project.go
index 9850848..a8b457b 100644
--- a/module/project/project.go
+++ b/module/project/project.go
@@ -40,28 +40,28 @@ type IAppModule interface {
DeleteApp(ctx context.Context, appId string) error
}
-type IProjectMemberModule interface {
- // Members 获取项目成员列表
- Members(ctx context.Context, id string, keyword string) ([]*project_dto.MemberItem, error)
- // AddMember 添加项目成员
- AddMember(ctx context.Context, id string, userIDs []string) error
- // RemoveMember 移除项目成员
- RemoveMember(ctx context.Context, id string, userIDs []string) error
- // EditProjectMember 修改成员信息
- EditProjectMember(ctx context.Context, pid string, uid string, roles []string) error
- // SimpleMembers 简易成员列表
- SimpleMembers(ctx context.Context, pid string) ([]*project_dto.SimpleMemberItem, error)
- SimpleMembersToAdd(ctx context.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error)
-}
+//type IProjectMemberModule interface {
+// // Members 获取项目成员列表
+// Members(ctx context.Context, id string, keyword string) ([]*project_dto.MemberItem, error)
+// // AddMember 添加项目成员
+// AddMember(ctx context.Context, id string, userIDs []string) error
+// // RemoveMember 移除项目成员
+// RemoveMember(ctx context.Context, id string, userIDs []string) error
+// // EditProjectMember 修改成员信息
+// EditProjectMember(ctx context.Context, pid string, uid string, roles []string) error
+// // SimpleMembers 简易成员列表
+// SimpleMembers(ctx context.Context, pid string) ([]*project_dto.SimpleMemberItem, error)
+// SimpleMembersToAdd(ctx context.Context, pid string, keyword string) ([]*project_dto.TeamMemberToAdd, error)
+//}
func init() {
autowire.Auto[IProjectModule](func() reflect.Value {
m := new(imlProjectModule)
return reflect.ValueOf(m)
})
- autowire.Auto[IProjectMemberModule](func() reflect.Value {
- return reflect.ValueOf(new(imlProjectMemberModule))
- })
+ //autowire.Auto[IProjectMemberModule](func() reflect.Value {
+ // return reflect.ValueOf(new(imlProjectMemberModule))
+ //})
autowire.Auto[IAppModule](func() reflect.Value {
return reflect.ValueOf(new(imlAppModule))
diff --git a/plugins/core/core.go b/plugins/core/core.go
index 2d4fc8e..7b73a68 100644
--- a/plugins/core/core.go
+++ b/plugins/core/core.go
@@ -54,13 +54,13 @@ func (d *Driver) Create() (pm3.IPlugin, error) {
}
type plugin struct {
- partitionController partition.IPartitionController `autowired:""`
- certificateController certificate.ICertificateController `autowired:""`
- teamManagerController team_manager.ITeamManagerController `autowired:""`
- myTeamController my_team.ITeamController `autowired:""`
- appController project.IAppController `autowired:""`
- projectController project.IProjectController `autowired:""`
- projectMemberController project.IProjectMemberController `autowired:""`
+ partitionController partition.IPartitionController `autowired:""`
+ certificateController certificate.ICertificateController `autowired:""`
+ teamManagerController team_manager.ITeamManagerController `autowired:""`
+ myTeamController my_team.ITeamController `autowired:""`
+ appController project.IAppController `autowired:""`
+ projectController project.IProjectController `autowired:""`
+ //projectMemberController project.IProjectMemberController `autowired:""`
serviceController service.IServiceController `autowired:""`
catalogueController catalogue.ICatalogueController `autowired:""`
upstreamController upstream.IUpstreamController `autowired:""`
diff --git a/plugins/core/project.go b/plugins/core/project.go
index 80814ff..9592887 100644
--- a/plugins/core/project.go
+++ b/plugins/core/project.go
@@ -2,7 +2,7 @@ package core
import (
"net/http"
-
+
"github.com/eolinker/go-common/pm3"
)
@@ -13,20 +13,20 @@ func (p *plugin) ProjectApi() []pm3.Api {
pm3.CreateApiWidthDoc(http.MethodPut, "/api/v1/project/info", []string{"context", "query:project", "body"}, []string{"project"}, p.projectController.EditProject),
pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/project/info", []string{"context", "query:project"}, nil, p.projectController.DeleteProject),
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/my_projects", []string{"context", "query:team", "query:keyword"}, []string{"projects"}, p.projectController.SearchMyProjects),
-
+
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/projects/mine", []string{"context", "query:keyword"}, []string{"projects"}, p.projectController.MySimpleProjects),
-
+
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/projects", []string{"context", "query:keyword", "query:partition"}, []string{"projects"}, p.projectController.SimpleProjects),
-
- // 项目成员相关
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/members", []string{"context", "query:project", "query:keyword"}, []string{"members"}, p.projectMemberController.Members),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/project/members", []string{"context", "query:project"}, []string{"members"}, p.projectMemberController.SimpleMembers),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/members/toadd", []string{"context", "query:project", "query:keyword"}, []string{"members"}, p.projectMemberController.SimpleMembersToAdd),
-
- pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/project/member", []string{"context", "query:project", "body"}, nil, p.projectMemberController.AddMember),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/project/member", []string{"context", "query:project", "query:user"}, nil, p.projectMemberController.RemoveMember),
- pm3.CreateApiWidthDoc(http.MethodPut, "/api/v1/project/member", []string{"context", "query:project", "query:user", "body"}, nil, p.projectMemberController.EditProjectMember),
-
+
+ //// 项目成员相关
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/members", []string{"context", "query:project", "query:keyword"}, []string{"members"}, p.projectMemberController.Members),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/simple/project/members", []string{"context", "query:project"}, []string{"members"}, p.projectMemberController.SimpleMembers),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/members/toadd", []string{"context", "query:project", "query:keyword"}, []string{"members"}, p.projectMemberController.SimpleMembersToAdd),
+ //
+ //pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/project/member", []string{"context", "query:project", "body"}, nil, p.projectMemberController.AddMember),
+ //pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/project/member", []string{"context", "query:project", "query:user"}, nil, p.projectMemberController.RemoveMember),
+ //pm3.CreateApiWidthDoc(http.MethodPut, "/api/v1/project/member", []string{"context", "query:project", "query:user", "body"}, nil, p.projectMemberController.EditProjectMember),
+
// 应用相关
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/app/info", []string{"context", "query:app"}, []string{"project"}, p.appController.GetApp),
pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/app", []string{"context", "query:app"}, nil, p.appController.DeleteApp),
diff --git a/service/project-role/iml.go b/service/project-role/iml.go
deleted file mode 100644
index 293e78f..0000000
--- a/service/project-role/iml.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package project_role
-
-import (
- "context"
- "github.com/eolinker/go-common/utils"
- "time"
-
- "github.com/eolinker/apipark/stores/project"
-)
-
-var (
- _ IProjectRoleService = (*imlProjectRoleService)(nil)
-)
-
-type imlProjectRoleService struct {
- projectRoleStore project.IMemberRoleStore `autowired:""`
-}
-
-func (i *imlProjectRoleService) AddRole(ctx context.Context, pid string, uid string, rid string) error {
- return i.projectRoleStore.Insert(ctx, &project.MemberRole{
- Pid: pid,
- Uid: uid,
- Rid: rid,
- CreateTime: time.Now(),
- })
-}
-
-func (i *imlProjectRoleService) DeleteRole(ctx context.Context, pid string, uid string) error {
- _, err := i.projectRoleStore.DeleteWhere(ctx, map[string]interface{}{
- "pid": pid,
- "uid": uid,
- })
- return err
-}
-
-func (i *imlProjectRoleService) Count(ctx context.Context, condition map[string]interface{}) (int64, error) {
- return i.projectRoleStore.CountWhere(ctx, condition)
-}
-
-func (i *imlProjectRoleService) Roles(ctx context.Context, pid string, uid ...string) ([]*ProjectRole, error) {
- condition := map[string]interface{}{
- "pid": pid,
- }
- if len(uid) > 0 {
- condition["uid"] = uid
- }
- roles, err := i.projectRoleStore.List(ctx, condition)
- if err != nil {
- return nil, err
- }
- return utils.SliceToSlice(roles, func(role *project.MemberRole) *ProjectRole {
- return &ProjectRole{
- Pid: role.Pid,
- Uid: role.Uid,
- Rid: role.Rid,
- CreateTime: role.CreateTime,
- }
- }), nil
-}
-
-func (i *imlProjectRoleService) RoleMap(ctx context.Context, pid string, uid ...string) (map[string][]*ProjectRole, error) {
- roles, err := i.Roles(ctx, pid, uid...)
- if err != nil {
- return nil, err
- }
- return utils.SliceToMapArray(roles, func(t *ProjectRole) string {
- return t.Uid
- }), nil
-
-}
-
-func (i *imlProjectRoleService) OnComplete() {
-
-}
diff --git a/service/project-role/model.go b/service/project-role/model.go
deleted file mode 100644
index dfb2f10..0000000
--- a/service/project-role/model.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package project_role
-
-import (
- "time"
-)
-
-type ProjectRole struct {
- Pid string
- Uid string
- Rid string
- CreateTime time.Time
-}
diff --git a/service/project-role/service.go b/service/project-role/service.go
deleted file mode 100644
index c740516..0000000
--- a/service/project-role/service.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package project_role
-
-import (
- "context"
- "reflect"
-
- "github.com/eolinker/go-common/autowire"
-)
-
-type IProjectRoleService interface {
- RoleMap(ctx context.Context, pid string, uid ...string) (map[string][]*ProjectRole, error)
- Roles(ctx context.Context, pid string, uid ...string) ([]*ProjectRole, error)
- AddRole(ctx context.Context, pid string, uid string, rid string) error
- DeleteRole(ctx context.Context, pid string, uid string) error
- Count(ctx context.Context, condition map[string]interface{}) (int64, error)
-}
-
-func init() {
- autowire.Auto[IProjectRoleService](func() reflect.Value {
- return reflect.ValueOf(new(imlProjectRoleService))
- })
-}
diff --git a/service/project/iml.go b/service/project/iml.go
index 8815506..abb98be 100644
--- a/service/project/iml.go
+++ b/service/project/iml.go
@@ -111,9 +111,9 @@ func createEntityHandler(i *CreateProject) *project.Project {
Description: i.Description,
Prefix: i.Prefix,
Team: i.Team,
- Master: i.Master,
- AsServer: i.AsServer,
- AsApp: i.AsApp,
+ //Master: i.Master,
+ AsServer: i.AsServer,
+ AsApp: i.AsApp,
}
}
func updateHandler(e *project.Project, i *EditProject) {
@@ -123,7 +123,7 @@ func updateHandler(e *project.Project, i *EditProject) {
if i.Description != nil {
e.Description = *i.Description
}
- if i.Master != nil {
- e.Master = *i.Master
- }
+ //if i.Master != nil {
+ // e.Master = *i.Master
+ //}
}
diff --git a/service/project/model.go b/service/project/model.go
index c23d773..cf3b729 100644
--- a/service/project/model.go
+++ b/service/project/model.go
@@ -11,12 +11,12 @@ type Project struct {
Name string
Description string
Team string
- Master string
- Prefix string
- AsServer bool
- AsApp bool
- CreateTime time.Time
- UpdateTime time.Time
+ //Master string
+ Prefix string
+ AsServer bool
+ AsApp bool
+ CreateTime time.Time
+ UpdateTime time.Time
}
func FromEntity(e *project.Project) *Project {
@@ -25,12 +25,12 @@ func FromEntity(e *project.Project) *Project {
Name: e.Name,
Description: e.Description,
Team: e.Team,
- Master: e.Master,
- Prefix: e.Prefix,
- AsServer: e.AsServer,
- AsApp: e.AsApp,
- CreateTime: e.CreateAt,
- UpdateTime: e.UpdateAt,
+ //Master: e.Master,
+ Prefix: e.Prefix,
+ AsServer: e.AsServer,
+ AsApp: e.AsApp,
+ CreateTime: e.CreateAt,
+ UpdateTime: e.UpdateAt,
}
}
@@ -38,17 +38,17 @@ type CreateProject struct {
Id string
Name string
Description string
- Master string
- Team string
- Prefix string
- AsServer bool
- AsApp bool
+ //Master string
+ Team string
+ Prefix string
+ AsServer bool
+ AsApp bool
}
type EditProject struct {
Name *string
Description *string
- Master *string
+ //Master *string
}
type Partition struct {
diff --git a/stores/project/model.go b/stores/project/model.go
index 9617952..0b4117f 100644
--- a/stores/project/model.go
+++ b/stores/project/model.go
@@ -10,7 +10,6 @@ type Project struct {
Description string `gorm:"size:255;not null;column:description;comment:description"`
Prefix string `gorm:"size:255;not null;column:prefix;comment:前缀"`
Team string `gorm:"size:36;not null;column:team;comment:团队id;index:team"` // 团队id
- Master string `gorm:"size:36;not null;column:master;comment:负责人id"` // 负责人id
CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;column:update_at;comment:修改时间"`
IsDelete int `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除"`
@@ -25,20 +24,20 @@ func (p *Project) TableName() string {
return "project"
}
-type MemberRole struct {
- Id int64 `gorm:"type:BIGINT(20);size:20;not null;auto_increment;primary_key;column:id;comment:主键ID;"`
- Pid string `gorm:"size:36;not null;column:pid;index:pid;comment:项目id;uniqueIndex:pid_uid_rid;"`
- Uid string `gorm:"size:36;not null;column:uid;index:uid;comment:用户id;uniqueIndex:pid_uid_rid;"`
- Rid string `gorm:"size:36;not null;column:rid;index:rid;comment:角色id;uniqueIndex:pid_uid_rid;"`
- CreateTime time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
-}
-
-func (m *MemberRole) IdValue() int64 {
- return m.Id
-}
-func (m *MemberRole) TableName() string {
- return "project_role"
-}
+//type MemberRole struct {
+// Id int64 `gorm:"type:BIGINT(20);size:20;not null;auto_increment;primary_key;column:id;comment:主键ID;"`
+// Pid string `gorm:"size:36;not null;column:pid;index:pid;comment:项目id;uniqueIndex:pid_uid_rid;"`
+// Uid string `gorm:"size:36;not null;column:uid;index:uid;comment:用户id;uniqueIndex:pid_uid_rid;"`
+// Rid string `gorm:"size:36;not null;column:rid;index:rid;comment:角色id;uniqueIndex:pid_uid_rid;"`
+// CreateTime time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
+//}
+//
+//func (m *MemberRole) IdValue() int64 {
+// return m.Id
+//}
+//func (m *MemberRole) TableName() string {
+// return "project_role"
+//}
type Authorization struct {
Id int64 `gorm:"type:BIGINT(20);size:20;not null;auto_increment;primary_key;column:id;comment:主键ID;"`
diff --git a/stores/project/store.go b/stores/project/store.go
index 642dc88..9643e15 100644
--- a/stores/project/store.go
+++ b/stores/project/store.go
@@ -16,12 +16,12 @@ type imlProjectStore struct {
type IMemberStore member.IMemberStore
-type IMemberRoleStore interface {
- store.IBaseStore[MemberRole]
-}
-type imlMemberRoleStore struct {
- store.Store[MemberRole]
-}
+//type IMemberRoleStore interface {
+// store.IBaseStore[MemberRole]
+//}
+//type imlMemberRoleStore struct {
+// store.Store[MemberRole]
+//}
type IAuthorizationStore interface {
store.ISearchStore[Authorization]
@@ -38,9 +38,9 @@ func init() {
autowire.Auto[IMemberStore](func() reflect.Value {
return reflect.ValueOf(member.NewMemberStore("project"))
})
- autowire.Auto[IMemberRoleStore](func() reflect.Value {
- return reflect.ValueOf(new(imlMemberRoleStore))
- })
+ //autowire.Auto[IMemberRoleStore](func() reflect.Value {
+ // return reflect.ValueOf(new(imlMemberRoleStore))
+ //})
autowire.Auto[IAuthorizationStore](func() reflect.Value {
return reflect.ValueOf(new(imlAuthorizationStore))
})
From 4ab2d8ca18137cd1e394d73ba87be48c16aa71be Mon Sep 17 00:00:00 2001
From: Liujian <824010343@qq.com>
Date: Mon, 29 Jul 2024 17:56:56 +0800
Subject: [PATCH 03/19] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
controller/permit_project/iml.go | 38 ----
controller/permit_project/project.go | 22 --
controller/permit_system/iml.go | 80 -------
controller/permit_system/permit.go | 28 ---
controller/permit_team/iml.go | 35 ---
controller/permit_team/team.go | 22 --
controller/project/project.go | 3 -
go.mod | 5 +
go.sum | 4 -
module/permit/project/iml.go | 8 +-
module/permit/team/iml.go | 8 +-
module/project/iml.go | 52 +++--
plugins/core/core.go | 3 +
plugins/permit/plugin.go | 15 +-
plugins/permit/project.go | 11 +-
plugins/permit/system.go | 23 +-
plugins/permit/team.go | 11 +-
resources/access/access.go | 1 +
resources/access/access.yaml | 313 +++++++++++++++++++--------
resources/access/access_test.go | 29 +++
resources/access/role.go | 24 ++
resources/access/role.yaml | 114 ++++++++++
service/project-member/model.go | 5 -
service/project-member/service.go | 17 --
stores/project/model.go | 15 --
25 files changed, 457 insertions(+), 429 deletions(-)
delete mode 100644 controller/permit_project/iml.go
delete mode 100644 controller/permit_project/project.go
delete mode 100644 controller/permit_system/iml.go
delete mode 100644 controller/permit_system/permit.go
delete mode 100644 controller/permit_team/iml.go
delete mode 100644 controller/permit_team/team.go
create mode 100644 resources/access/access_test.go
create mode 100644 resources/access/role.go
create mode 100644 resources/access/role.yaml
delete mode 100644 service/project-member/model.go
delete mode 100644 service/project-member/service.go
diff --git a/controller/permit_project/iml.go b/controller/permit_project/iml.go
deleted file mode 100644
index fc60fde..0000000
--- a/controller/permit_project/iml.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package permit_project
-
-import (
- permit_dto "github.com/eolinker/apipark/module/permit/dto"
- "github.com/eolinker/apipark/module/permit/project"
- "github.com/gin-gonic/gin"
-)
-
-var (
- _ IProjectPermitController = (*imlProjectPermitController)(nil)
-)
-
-type imlProjectPermitController struct {
- projectPermitModule project.IProjectPermitModule `autowired:""`
-}
-
-func (c *imlProjectPermitController) Permissions(ctx *gin.Context, project string) ([]string, error) {
- return c.projectPermitModule.Permissions(ctx, project)
-}
-
-func (c *imlProjectPermitController) Grant(ctx *gin.Context, project string, input *permit_dto.SetGrant) error {
- return c.projectPermitModule.Grant(ctx, project, input.Access, input.Key)
-}
-
-func (c *imlProjectPermitController) Remove(ctx *gin.Context, project string, access string, key string) error {
- return c.projectPermitModule.Remove(ctx, project, access, key)
-
-}
-
-func (c *imlProjectPermitController) List(ctx *gin.Context, project string) ([]*permit_dto.Permission, error) {
-
- return c.projectPermitModule.ProjectAccess(ctx, project)
-
-}
-
-func (c *imlProjectPermitController) Options(ctx *gin.Context, project string, keyword string) ([]*permit_dto.Option, error) {
- return c.projectPermitModule.Options(ctx, project, keyword)
-}
diff --git a/controller/permit_project/project.go b/controller/permit_project/project.go
deleted file mode 100644
index ef1f899..0000000
--- a/controller/permit_project/project.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package permit_project
-
-import (
- permit_dto "github.com/eolinker/apipark/module/permit/dto"
- "github.com/eolinker/go-common/autowire"
- "github.com/gin-gonic/gin"
- "reflect"
-)
-
-type IProjectPermitController interface {
- Grant(ctx *gin.Context, project string, input *permit_dto.SetGrant) error
- Remove(ctx *gin.Context, project string, access string, key string) error
- List(ctx *gin.Context, project string) ([]*permit_dto.Permission, error)
- Options(ctx *gin.Context, project string, keyword string) ([]*permit_dto.Option, error)
- Permissions(ctx *gin.Context, project string) ([]string, error)
-}
-
-func init() {
- autowire.Auto[IProjectPermitController](func() reflect.Value {
- return reflect.ValueOf(new(imlProjectPermitController))
- })
-}
diff --git a/controller/permit_system/iml.go b/controller/permit_system/iml.go
deleted file mode 100644
index 75a08d7..0000000
--- a/controller/permit_system/iml.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package permit_system
-
-import (
- permit_identity "github.com/eolinker/apipark/middleware/permit/identity"
- "github.com/eolinker/apipark/module/permit/dto"
- "github.com/eolinker/apipark/module/permit/system"
- "github.com/eolinker/go-common/autowire"
- "github.com/gin-gonic/gin"
-)
-
-var (
- _ ISystemPermitController = (*imlSystemPermitController)(nil)
- _ autowire.Complete = (*imlSystemPermitController)(nil)
-)
-
-type imlSystemPermitController struct {
- systemPermitModule system.ISystemPermitModule `autowired:""`
-
- identitySystem permit_identity.IdentitySystemService `autowired:""`
-}
-
-func (c *imlSystemPermitController) Permissions(ctx *gin.Context) ([]string, error) {
- return c.systemPermitModule.Permissions(ctx)
-}
-
-func (c *imlSystemPermitController) RemoveTemplateForTeam(ctx *gin.Context, access string, key string) error {
- return c.systemPermitModule.RemoveTeamTemplateAccess(ctx, access, key)
-}
-
-func (c *imlSystemPermitController) RemoveTemplateForSystem(ctx *gin.Context, access string, key string) error {
- return c.systemPermitModule.RemoveProjectTemplateAccess(ctx, access, key)
-}
-
-func (c *imlSystemPermitController) GrantTemplateForTeam(ctx *gin.Context, input *permit_dto.SetGrant) error {
- return c.systemPermitModule.GrantTemplateForTeam(ctx, input.Access, input.Key)
-}
-
-func (c *imlSystemPermitController) GrantTemplateForProject(ctx *gin.Context, input *permit_dto.SetGrant) error {
- return c.systemPermitModule.GrantTemplateForProject(ctx, input.Access, input.Key)
-}
-
-func (c *imlSystemPermitController) OptionsForTeamTemplate(ctx *gin.Context, keyword string) ([]*permit_dto.Option, error) {
- return c.systemPermitModule.OptionsForTeamTemplate(ctx, keyword)
-}
-
-func (c *imlSystemPermitController) OptionsForProjectTemplate(ctx *gin.Context, keyword string) ([]*permit_dto.Option, error) {
- return c.systemPermitModule.OptionsForProjectTemplate(ctx, keyword)
-}
-
-func (c *imlSystemPermitController) OnComplete() {
-
-}
-
-func (c *imlSystemPermitController) Grant(ctx *gin.Context, input *permit_dto.SetGrant) error {
- return c.systemPermitModule.GrantSystem(ctx, input.Access, input.Key)
-}
-
-func (c *imlSystemPermitController) Remove(ctx *gin.Context, access string, key string) error {
- return c.systemPermitModule.RemoveSystemAccess(ctx, access, key)
-}
-
-func (c *imlSystemPermitController) List(ctx *gin.Context) ([]*permit_dto.Permission, []*permit_dto.Permission, []*permit_dto.Permission, error) {
- systemAccess, err := c.systemPermitModule.SystemAccess(ctx)
- if err != nil {
- return nil, nil, nil, err
- }
- teamAccess, err := c.systemPermitModule.TeamAccess(ctx)
- if err != nil {
- return nil, nil, nil, err
- }
- projectAccess, err := c.systemPermitModule.ProjectAccess(ctx)
- if err != nil {
- return nil, nil, nil, err
- }
- return systemAccess, teamAccess, projectAccess, err
-}
-
-func (c *imlSystemPermitController) Options(ctx *gin.Context, keyword string) ([]*permit_dto.Option, error) {
- return c.systemPermitModule.OptionsForSystem(ctx, keyword)
-}
diff --git a/controller/permit_system/permit.go b/controller/permit_system/permit.go
deleted file mode 100644
index 7bfcf4a..0000000
--- a/controller/permit_system/permit.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package permit_system
-
-import (
- permit_dto "github.com/eolinker/apipark/module/permit/dto"
- "github.com/eolinker/go-common/autowire"
- "github.com/gin-gonic/gin"
- "reflect"
-)
-
-type ISystemPermitController interface {
- Grant(ctx *gin.Context, input *permit_dto.SetGrant) error
- GrantTemplateForTeam(ctx *gin.Context, input *permit_dto.SetGrant) error
- GrantTemplateForProject(ctx *gin.Context, input *permit_dto.SetGrant) error
- Remove(ctx *gin.Context, access string, key string) error
- RemoveTemplateForTeam(ctx *gin.Context, access string, key string) error
- RemoveTemplateForSystem(ctx *gin.Context, access string, key string) error
- List(ctx *gin.Context) ([]*permit_dto.Permission, []*permit_dto.Permission, []*permit_dto.Permission, error)
- Options(ctx *gin.Context, keyword string) ([]*permit_dto.Option, error)
- OptionsForTeamTemplate(ctx *gin.Context, keyword string) ([]*permit_dto.Option, error)
- OptionsForProjectTemplate(ctx *gin.Context, keyword string) ([]*permit_dto.Option, error)
- Permissions(ctx *gin.Context) ([]string, error)
-}
-
-func init() {
- autowire.Auto[ISystemPermitController](func() reflect.Value {
- return reflect.ValueOf(new(imlSystemPermitController))
- })
-}
diff --git a/controller/permit_team/iml.go b/controller/permit_team/iml.go
deleted file mode 100644
index 7196ac5..0000000
--- a/controller/permit_team/iml.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package permit_team
-
-import (
- permit_dto "github.com/eolinker/apipark/module/permit/dto"
- "github.com/eolinker/apipark/module/permit/team"
- "github.com/gin-gonic/gin"
-)
-
-var (
- _ ITeamPermitController = (*imlTeamPermitController)(nil)
-)
-
-type imlTeamPermitController struct {
- teamPermitModule team.ITeamPermitModule `autowired:""`
-}
-
-func (c *imlTeamPermitController) Permissions(ctx *gin.Context, team string) ([]string, error) {
- return c.teamPermitModule.Permissions(ctx, team)
-}
-
-func (c *imlTeamPermitController) Grant(ctx *gin.Context, team string, input *permit_dto.SetGrant) error {
- return c.teamPermitModule.Grant(ctx, team, input.Access, input.Key)
-}
-
-func (c *imlTeamPermitController) Remove(ctx *gin.Context, team string, access string, key string) error {
- return c.teamPermitModule.Remove(ctx, team, access, key)
-}
-
-func (c *imlTeamPermitController) List(ctx *gin.Context, team string) ([]*permit_dto.Permission, error) {
- return c.teamPermitModule.TeamAccess(ctx, team)
-}
-
-func (c *imlTeamPermitController) Options(ctx *gin.Context, team string, keyword string) ([]*permit_dto.Option, error) {
- return c.teamPermitModule.Options(ctx, team, keyword)
-}
diff --git a/controller/permit_team/team.go b/controller/permit_team/team.go
deleted file mode 100644
index 085b710..0000000
--- a/controller/permit_team/team.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package permit_team
-
-import (
- permit_dto "github.com/eolinker/apipark/module/permit/dto"
- "github.com/eolinker/go-common/autowire"
- "github.com/gin-gonic/gin"
- "reflect"
-)
-
-type ITeamPermitController interface {
- Grant(ctx *gin.Context, team string, input *permit_dto.SetGrant) error
- Remove(ctx *gin.Context, team string, access string, key string) error
- List(ctx *gin.Context, team string) ([]*permit_dto.Permission, error)
- Options(ctx *gin.Context, team string, keyword string) ([]*permit_dto.Option, error)
- Permissions(ctx *gin.Context, team string) ([]string, error)
-}
-
-func init() {
- autowire.Auto[ITeamPermitController](func() reflect.Value {
- return reflect.ValueOf(new(imlTeamPermitController))
- })
-}
diff --git a/controller/project/project.go b/controller/project/project.go
index 127e8a0..a3de0cc 100644
--- a/controller/project/project.go
+++ b/controller/project/project.go
@@ -58,9 +58,6 @@ func init() {
autowire.Auto[IProjectController](func() reflect.Value {
return reflect.ValueOf(new(imlProjectController))
})
- //autowire.Auto[IProjectMemberController](func() reflect.Value {
- // return reflect.ValueOf(new(imlProjectMemberController))
- //})
autowire.Auto[IAppController](func() reflect.Value {
return reflect.ValueOf(new(imlAppController))
diff --git a/go.mod b/go.mod
index 44b2f0e..2612bad 100644
--- a/go.mod
+++ b/go.mod
@@ -65,3 +65,8 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gorm.io/driver/mysql v1.5.2 // indirect
)
+
+replace (
+ github.com/eolinker/ap-account => ../ap-account
+ github.com/eolinker/go-common => ../go-common
+)
diff --git a/go.sum b/go.sum
index 08f9336..55db0a8 100644
--- a/go.sum
+++ b/go.sum
@@ -23,12 +23,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
-github.com/eolinker/ap-account v1.0.2 h1:wSPBrOu0FoL27lAkYVOdIXak6YUVq2nCP6dw+StQDz8=
-github.com/eolinker/ap-account v1.0.2/go.mod h1:DmBBodZRFmQLeppKY63PCnNGL/IGjT6FIOWCpAK0vSg=
github.com/eolinker/eosc v0.17.3 h1:sr2yT+v/AsqEdciRaaZZj0zL9pTufR5RvDW6+65hraQ=
github.com/eolinker/eosc v0.17.3/go.mod h1:xgq816hpanlMXFtZw7Ztdctb1eEk9UPHchY4NfFO6Cw=
-github.com/eolinker/go-common v1.0.0 h1:gqR0d6juRrJVc6OKpl7DFB5Xml5uGx6q9eCetrPqEq8=
-github.com/eolinker/go-common v1.0.0/go.mod h1:Kb/jENMN1mApnodvRgV4YwO9FJby1Jkt2EUjrBjvSX4=
github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I=
github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
diff --git a/module/permit/project/iml.go b/module/permit/project/iml.go
index 525e47c..51b9428 100644
--- a/module/permit/project/iml.go
+++ b/module/permit/project/iml.go
@@ -309,10 +309,10 @@ func (m *imlProjectPermitModule) ProjectAccess(ctx *gin.Context, projectId strin
result := utils.SliceToSlice(accesses, func(s access.Access) *permit_dto.Permission {
r := &permit_dto.Permission{
- Access: s.Name,
- Name: s.CName,
- Description: s.Desc,
- Grant: nil,
+ Access: s.Name,
+ Name: s.CName,
+ //Description: s.Desc,
+ Grant: nil,
}
if gs, has := grants[r.Access]; has {
r.Grant = permit_type.TargetsOf(gs...)
diff --git a/module/permit/team/iml.go b/module/permit/team/iml.go
index 10c5f6c..494a312 100644
--- a/module/permit/team/iml.go
+++ b/module/permit/team/iml.go
@@ -247,10 +247,10 @@ func (m *imlTeamPermitModule) TeamAccess(ctx *gin.Context, teamId string) ([]*pe
result := utils.SliceToSlice(accesses, func(s access.Access) *permit_dto.Permission {
r := &permit_dto.Permission{
- Access: s.Name,
- Name: s.CName,
- Description: s.Desc,
- Grant: nil,
+ Access: s.Name,
+ Name: s.CName,
+ //Description: s.Desc,
+ Grant: nil,
}
if gs, has := grants[r.Access]; has {
r.Grant = permit_type.TargetsOf(gs...)
diff --git a/module/project/iml.go b/module/project/iml.go
index c02e9f0..6395ae8 100644
--- a/module/project/iml.go
+++ b/module/project/iml.go
@@ -20,8 +20,6 @@ import (
team_member "github.com/eolinker/apipark/service/team-member"
- project_member "github.com/eolinker/apipark/service/project-member"
-
"github.com/eolinker/go-common/store"
"github.com/google/uuid"
@@ -40,14 +38,14 @@ var (
)
type imlProjectModule struct {
- partitionService partition.IPartitionService `autowired:""`
- projectService project.IProjectService `autowired:""`
- projectMemberService project_member.IMemberService `autowired:""`
- teamService team.ITeamService `autowired:""`
- teamMemberService team_member.ITeamMemberService `autowired:""`
- serviceService service.IServiceService `autowired:""`
- apiService api.IAPIService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ partitionService partition.IPartitionService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ //projectMemberService project_member.IMemberService `autowired:""`
+ teamService team.ITeamService `autowired:""`
+ teamMemberService team_member.ITeamMemberService `autowired:""`
+ serviceService service.IServiceService `autowired:""`
+ apiService api.IAPIService `autowired:""`
+ transaction store.ITransaction `autowired:""`
}
func (i *imlProjectModule) searchMyProjects(ctx context.Context, teamId string, keyword string) ([]*project.Project, error) {
@@ -343,11 +341,11 @@ func (i *imlProjectModule) DeleteProject(ctx context.Context, id string) error {
if count > 0 {
return fmt.Errorf("project has apis, can not delete")
}
- // 删除项目成员
- err = i.projectMemberService.Delete(ctx, id)
- if err != nil {
- return err
- }
+ //// 删除项目成员
+ //err = i.projectMemberService.Delete(ctx, id)
+ //if err != nil {
+ // return err
+ //}
return i.projectService.Delete(ctx, id)
})
@@ -529,12 +527,12 @@ func (i *imlProjectModule) DeleteProject(ctx context.Context, id string) error {
var _ IAppModule = &imlAppModule{}
type imlAppModule struct {
- teamService team.ITeamService `autowired:""`
- projectService project.IProjectService `autowired:""`
- projectMemberService project_member.IMemberService `autowired:""`
- teamMemberService team_member.ITeamMemberService `autowired:""`
- subscribeService subscribe.ISubscribeService `autowired:""`
- transaction store.ITransaction `autowired:""`
+ teamService team.ITeamService `autowired:""`
+ projectService project.IProjectService `autowired:""`
+ //projectMemberService project_member.IMemberService `autowired:""`
+ teamMemberService team_member.ITeamMemberService `autowired:""`
+ subscribeService subscribe.ISubscribeService `autowired:""`
+ transaction store.ITransaction `autowired:""`
}
func (i *imlAppModule) CreateApp(ctx context.Context, teamID string, input *project_dto.CreateApp) (*project_dto.App, error) {
@@ -565,12 +563,12 @@ func (i *imlAppModule) CreateApp(ctx context.Context, teamID string, input *proj
err = i.transaction.Transaction(ctx, func(ctx context.Context) error {
- err = i.projectService.Create(ctx, mo)
- if err != nil {
- return err
- }
-
- return i.projectMemberService.AddMemberTo(ctx, input.Id, userId)
+ return i.projectService.Create(ctx, mo)
+ //if err != nil {
+ // return err
+ //}
+ //
+ //return i.projectMemberService.AddMemberTo(ctx, input.Id, userId)
})
if err != nil {
return nil, err
diff --git a/plugins/core/core.go b/plugins/core/core.go
index 7b73a68..330c8c8 100644
--- a/plugins/core/core.go
+++ b/plugins/core/core.go
@@ -3,6 +3,8 @@ package core
import (
"net/http"
+ "github.com/eolinker/ap-account/controller/role"
+
"github.com/eolinker/apipark/controller/common"
plugin_partition "github.com/eolinker/apipark/controller/plugin-partition"
@@ -68,6 +70,7 @@ type plugin struct {
subscribeController subscribe.ISubscribeController `autowired:""`
projectAuthorizationController project_authorization.IProjectAuthorizationController `autowired:""`
releaseController release.IReleaseController `autowired:""`
+ roleController role.IRoleController `autowired:""`
subscribeApprovalController subscribe.ISubscribeApprovalController `autowired:""`
dynamicModuleController dynamic_module.IDynamicModuleController `autowired:""`
topologyController topology.ITopologyController `autowired:""`
diff --git a/plugins/permit/plugin.go b/plugins/permit/plugin.go
index 1cac086..f9e9af1 100644
--- a/plugins/permit/plugin.go
+++ b/plugins/permit/plugin.go
@@ -1,9 +1,6 @@
package permit
import (
- "github.com/eolinker/apipark/controller/permit_project"
- "github.com/eolinker/apipark/controller/permit_system"
- "github.com/eolinker/apipark/controller/permit_team"
permit_middleware "github.com/eolinker/apipark/middleware/permit"
"github.com/eolinker/go-common/autowire"
"github.com/eolinker/go-common/pm3"
@@ -16,12 +13,12 @@ var (
)
type pluginPermit struct {
- systemPermitController permit_system.ISystemPermitController `autowired:""`
- teamPermitController permit_team.ITeamPermitController `autowired:""`
- projectPermitController permit_project.IProjectPermitController `autowired:""`
- apis []pm3.Api
- middlewares []pm3.IMiddleware
- permitChecker permit_middleware.IPermitMiddleware `autowired:""`
+ //systemPermitController permit_system.ISystemPermitController `autowired:""`
+ //teamPermitController permit_team.ITeamPermitController `autowired:""`
+ //projectPermitController permit_project.IProjectPermitController `autowired:""`
+ apis []pm3.Api
+ middlewares []pm3.IMiddleware
+ permitChecker permit_middleware.IPermitMiddleware `autowired:""`
}
func (p *pluginPermit) OnComplete() {
diff --git a/plugins/permit/project.go b/plugins/permit/project.go
index 190842d..d88828d 100644
--- a/plugins/permit/project.go
+++ b/plugins/permit/project.go
@@ -2,15 +2,14 @@ package permit
import (
"github.com/eolinker/go-common/pm3"
- "net/http"
)
func (p *pluginPermit) getSProjectPermitApis() []pm3.Api {
return []pm3.Api{
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/setting/permissions", []string{"context", "query:project"}, []string{"permissions"}, p.projectPermitController.List),
- pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/project/setting/permission", []string{"context", "query:project", "body"}, []string{}, p.projectPermitController.Grant),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/project/setting/permission", []string{"context", "query:project", "query:access", "query:key"}, []string{}, p.projectPermitController.Remove),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/setting/permission/options", []string{"context", "query:project", "query:keyword"}, []string{"options"}, p.projectPermitController.Options),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/profile/permission/project", []string{"context", "query:project"}, []string{"access"}, p.projectPermitController.Permissions),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/setting/permissions", []string{"context", "query:project"}, []string{"permissions"}, p.projectPermitController.List),
+ //pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/project/setting/permission", []string{"context", "query:project", "body"}, []string{}, p.projectPermitController.Grant),
+ //pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/project/setting/permission", []string{"context", "query:project", "query:access", "query:key"}, []string{}, p.projectPermitController.Remove),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/project/setting/permission/options", []string{"context", "query:project", "query:keyword"}, []string{"options"}, p.projectPermitController.Options),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/profile/permission/project", []string{"context", "query:project"}, []string{"access"}, p.projectPermitController.Permissions),
}
}
diff --git a/plugins/permit/system.go b/plugins/permit/system.go
index 0221441..5b6837e 100644
--- a/plugins/permit/system.go
+++ b/plugins/permit/system.go
@@ -2,21 +2,20 @@ package permit
import (
"github.com/eolinker/go-common/pm3"
- "net/http"
)
func (p *pluginPermit) getSystemApis() []pm3.Api {
return []pm3.Api{
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permissions", []string{"context"}, []string{"system", "team", "project"}, p.systemPermitController.List),
- pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/system/permission", []string{"context", "body"}, []string{}, p.systemPermitController.Grant),
- pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/system/permission/team", []string{"context", "body"}, []string{}, p.systemPermitController.GrantTemplateForTeam),
- pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/system/permission/project", []string{"context", "body"}, []string{}, p.systemPermitController.GrantTemplateForProject),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/system/permission", []string{"context", "query:access", "query:key"}, []string{}, p.systemPermitController.Remove),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/system/permission/team", []string{"context", "query:access", "query:key"}, []string{}, p.systemPermitController.Remove),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/system/permission/project", []string{"context", "query:access", "query:key"}, []string{}, p.systemPermitController.Remove),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permission/options", []string{"context", "query:keyword"}, []string{"options"}, p.systemPermitController.Options),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permission/options/team", []string{"context", "query:keyword"}, []string{"options"}, p.systemPermitController.OptionsForTeamTemplate),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permission/options/project", []string{"context", "query:keyword"}, []string{"options"}, p.systemPermitController.OptionsForProjectTemplate),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/profile/permission/system", []string{"context"}, []string{"access"}, p.systemPermitController.Permissions),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permissions", []string{"context"}, []string{"system", "team", "project"}, p.systemPermitController.List),
+ //pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/system/permission", []string{"context", "body"}, []string{}, p.systemPermitController.Grant),
+ //pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/system/permission/team", []string{"context", "body"}, []string{}, p.systemPermitController.GrantTemplateForTeam),
+ //pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/system/permission/project", []string{"context", "body"}, []string{}, p.systemPermitController.GrantTemplateForProject),
+ //pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/system/permission", []string{"context", "query:access", "query:key"}, []string{}, p.systemPermitController.Remove),
+ //pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/system/permission/team", []string{"context", "query:access", "query:key"}, []string{}, p.systemPermitController.Remove),
+ //pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/system/permission/project", []string{"context", "query:access", "query:key"}, []string{}, p.systemPermitController.Remove),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permission/options", []string{"context", "query:keyword"}, []string{"options"}, p.systemPermitController.Options),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permission/options/team", []string{"context", "query:keyword"}, []string{"options"}, p.systemPermitController.OptionsForTeamTemplate),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/permission/options/project", []string{"context", "query:keyword"}, []string{"options"}, p.systemPermitController.OptionsForProjectTemplate),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/profile/permission/system", []string{"context"}, []string{"access"}, p.systemPermitController.Permissions),
}
}
diff --git a/plugins/permit/team.go b/plugins/permit/team.go
index fc3e6a5..c2eca53 100644
--- a/plugins/permit/team.go
+++ b/plugins/permit/team.go
@@ -2,15 +2,14 @@ package permit
import (
"github.com/eolinker/go-common/pm3"
- "net/http"
)
func (p *pluginPermit) getSTeamPermitApis() []pm3.Api {
return []pm3.Api{
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/team/setting/permissions", []string{"context", "query:team"}, []string{"permissions"}, p.teamPermitController.List),
- pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/team/setting/permission", []string{"context", "query:team", "body"}, []string{}, p.teamPermitController.Grant),
- pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/team/setting/permission", []string{"context", "query:team", "query:access", "query:key"}, []string{}, p.teamPermitController.Remove),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/team/setting/permission/options", []string{"context", "query:team", "query:keyword"}, []string{"options"}, p.teamPermitController.Options),
- pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/profile/permission/team", []string{"context", "query:team"}, []string{"access"}, p.teamPermitController.Permissions),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/team/setting/permissions", []string{"context", "query:team"}, []string{"permissions"}, p.teamPermitController.List),
+ //pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/team/setting/permission", []string{"context", "query:team", "body"}, []string{}, p.teamPermitController.Grant),
+ //pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/team/setting/permission", []string{"context", "query:team", "query:access", "query:key"}, []string{}, p.teamPermitController.Remove),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/team/setting/permission/options", []string{"context", "query:team", "query:keyword"}, []string{"options"}, p.teamPermitController.Options),
+ //pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/profile/permission/team", []string{"context", "query:team"}, []string{"access"}, p.teamPermitController.Permissions),
}
}
diff --git a/resources/access/access.go b/resources/access/access.go
index 80e1828..4a56b8e 100644
--- a/resources/access/access.go
+++ b/resources/access/access.go
@@ -2,6 +2,7 @@ package access
import (
_ "embed"
+
"github.com/eolinker/go-common/access"
"gopkg.in/yaml.v3"
)
diff --git a/resources/access/access.yaml b/resources/access/access.yaml
index c7d2061..6fb4175 100644
--- a/resources/access/access.yaml
+++ b/resources/access/access.yaml
@@ -1,96 +1,225 @@
system:
- - name: user_manager
- cname: '成员管理'
- desc: '成员管理'
- - name: user_group
- cname: '用户组管理'
- desc: '用户组管理'
- - name: team_manager
- cname: '团队管理'
- desc: '团队管理'
- - name: organization_manager
+ - name: organization
cname: '组织管理'
- desc: '组织管理'
- - name: role_manager
- cname: '角色管理'
- desc: '角色管理'
- - name: system_permission_setting
- cname: '系统权限设置'
- desc: '系统权限设置'
+ value: 'organization'
+ children:
+ - name: member
+ cname: '成员'
+ value: 'member'
+ children:
+ - name: view
+ cname: '查看'
+ value: 'view'
+ - name: manager
+ cname: '管理'
+ value: 'manager'
+ apis:
+ - "GET:/api/v1/simple/member"
+ - "GET:/api/v1/simple/organization/member/:id"
+ - name: team
+ cname: '团队'
+ value: 'team'
+ children:
+ - name: view
+ cname: '查看'
+ value: 'view'
+ - name: manager
+ cname: '管理'
+ value: 'manager'
+ - name: role
+ cname: '角色'
+ value: 'role'
+ children:
+ - name: view system role
+ cname: '查看系统角色'
+ value: 'view_system_role'
+ - name: view team role
+ cname: '查看团队角色'
+ value: 'view_team_role'
+ - name: API Market
+ cname: 'API市场'
+ value: 'api_market'
+ children:
+ - name: service classification
+ cname: '服务分类'
+ value: 'service_classification'
+ children:
+ - name: view
+ cname: '查看'
+ value: 'view'
+ - name: manager
+ cname: '管理'
+ value: 'manager'
- name: devops
- cname: '运维管理'
- desc: '运维管理'
- - name: environs_setting
- cname: '环境管理'
- desc: '环境管理'
- - name: service_categories_setting
- cname: '服务类目管理'
- desc: '管理服务广场内的服务类目'
+ cname: 运维
+ value: 'devops'
+ children:
+ - name: cluster
+ cname: 集群
+ value: 'cluster'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: ssl certificate
+ cname: 证书
+ value: 'ssl_certificate'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: log configuration
+ cname: 日志
+ value: 'log_configuration'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: workspace
+ cname: 工作空间
+ value: 'workspace'
+ children:
+ - name: application
+ cname: 应用
+ value: 'application'
+ children:
+ - name: view all
+ cname: 查看所有应用
+ value: 'view_all'
+ - name: service
+ cname: 服务
+ value: 'service'
+ children:
+ - name: view all
+ cname: 查看所有服务
+ value: 'view_all'
+ - name: team
+ cname: 团队
+ value: 'team'
+ children:
+ - name: view all
+ cname: 查看所有团队
+ value: 'view_all'
+ - name: api market
+ cname: API市场
+ value: 'api_market'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
team:
- - name: project_manager
- cname: '项目管理'
- desc: '项目管理'
- - name: project_view
- cname: '项目查看'
- desc: '项目查看'
- - name: team_permission_setting
- cname: '团队权限管理'
- desc: '团队权限管理'
- - name: team_setting
- cname: '团队设置'
- desc: '团队设置'
- - name: member_setting
- cname: '成员管理'
- desc: '成员管理'
-project:
- - name: project_setting
- cname: '系统设置'
- desc: '管理系统设置'
- - name: member_setting
- cname: '成员管理'
- desc: '成员管理'
- - name: api_manager
- cname: 'API管理'
- desc: 'API管理'
- - name: api_view
- cname: 'API查看'
- desc: 'API查看'
- - name: upstream_manager
- cname: '上游管理'
- desc: '上游管理'
- - name: upstream_view
- cname: '上游查看'
- desc: '上游查看'
- - name: service_manager
- cname: '服务管理'
- desc: '服务管理'
- - name: service_view
- cname: '服务查看'
- desc: '服务查看'
- - name: subscribe_view
- cname: '订阅查看'
- desc: '查看订阅的第三方服务'
- - name: subscribe_apply
- cname: '申请订阅'
- desc: '申请订阅第三方服务'
- - name: subscribers_manager
- cname: '订阅方管理'
- desc: '管理订阅的第三方服务, 新增,删除订阅方'
- - name: subscribe_approval
- cname: '订阅审批'
- desc: '审批订阅申请'
- - name: authentication_view
- cname: '查看鉴权'
- desc: '查看鉴权配置'
- - name: authentication_manager
- cname: '鉴权管理'
- desc: '新增/编辑/删除鉴权信息'
- - name: publish_manager
- cname: '发布管理'
- desc: '申请\执行发布, 删除版本'
- - name: publish_approve
- cname: '发布审批'
- desc: '审批发布申请'
- - name: permission_manager
- cname: '权限管理'
- desc: '权限管理'
\ No newline at end of file
+ - name: service
+ cname: 服务
+ value: 'service'
+ children:
+ - name: api
+ cname: API
+ value: 'api'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: upstream
+ cname: 上游
+ value: 'upstream'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: release
+ cname: 发布
+ value: 'release'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: subscription management
+ cname: 订阅方管理
+ value: 'subscription'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: service
+ cname: 服务管理
+ value: 'service'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: application
+ cname: 应用
+ value: 'application'
+ children:
+ - name: subscription Service
+ cname: 订阅服务
+ value: 'subscription'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: authorization
+ cname: 访问授权
+ value: 'authorization'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: application
+ cname: 应用
+ value: 'application'
+ children:
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: team
+ cname: 团队
+ value: 'team'
+ children:
+ - name: member
+ cname: 成员
+ value: 'member'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
+ - name: team
+ cname: 团队管理
+ value: 'team'
+ children:
+ - name: view
+ cname: 查看
+ value: 'view'
+ - name: manager
+ cname: 管理
+ value: 'manager'
\ No newline at end of file
diff --git a/resources/access/access_test.go b/resources/access/access_test.go
new file mode 100644
index 0000000..1e24d46
--- /dev/null
+++ b/resources/access/access_test.go
@@ -0,0 +1,29 @@
+package access
+
+import (
+ "fmt"
+ "sort"
+ "testing"
+
+ "github.com/eolinker/go-common/access"
+)
+
+func TestPrintlnRoleAccess(t *testing.T) {
+ system, has := access.GetPermit("system")
+ if has {
+ keys := system.AccessKeys()
+ sort.Strings(keys)
+ for _, k := range keys {
+ fmt.Printf("- %s\n", k)
+ }
+
+ }
+ team, has := access.GetPermit("team")
+ if has {
+ keys := team.AccessKeys()
+ sort.Strings(keys)
+ for _, k := range keys {
+ fmt.Printf("- %s\n", k)
+ }
+ }
+}
diff --git a/resources/access/role.go b/resources/access/role.go
new file mode 100644
index 0000000..4b1ba46
--- /dev/null
+++ b/resources/access/role.go
@@ -0,0 +1,24 @@
+package access
+
+import (
+ _ "embed"
+
+ "github.com/eolinker/go-common/access"
+ "gopkg.in/yaml.v3"
+)
+
+type Role = access.Role
+
+var (
+ //go:embed role.yaml
+ roleData []byte
+)
+
+func init() {
+ ts := make(map[string][]Role)
+ err := yaml.Unmarshal(roleData, &ts)
+ if err != nil {
+ panic(err)
+ }
+ access.RoleAdd(ts)
+}
diff --git a/resources/access/role.yaml b/resources/access/role.yaml
new file mode 100644
index 0000000..e033bb4
--- /dev/null
+++ b/resources/access/role.yaml
@@ -0,0 +1,114 @@
+system:
+ - name: supper_admin
+ cname: 超级管理员
+ permits:
+ - system.api_market.service_classification.manager
+ - system.api_market.service_classification.view
+ - system.devops.cluster.manager
+ - system.devops.cluster.view
+ - system.devops.log_configuration.manager
+ - system.devops.log_configuration.view
+ - system.devops.ssl_certificate.manager
+ - system.devops.ssl_certificate.view
+ - system.organization.member.manager
+ - system.organization.member.view
+ - system.organization.role.view_system_role
+ - system.organization.role.view_team_role
+ - system.organization.team.manager
+ - system.organization.team.view
+ - system.workspace.api_market.view
+ - system.workspace.application.view_all
+ - system.workspace.service.view_all
+ - system.workspace.team.view_all
+ - name: team_admin
+ cname: 团队管理员
+ permits:
+ - system.organization.role.view_team_role
+ - system.organization.team.manager
+ - system.organization.team.view
+ - system.workspace.api_market.view
+ - system.workspace.application.view_all
+ - system.workspace.service.view_all
+ - system.workspace.team.view_all
+ - name: devops_admin
+ cname: 运维管理员
+ permits:
+ - system.api_market.service_classification.manager
+ - system.api_market.service_classification.view
+ - system.devops.cluster.manager
+ - system.devops.cluster.view
+ - system.devops.log_configuration.manager
+ - system.devops.log_configuration.view
+ - system.devops.ssl_certificate.manager
+ - system.devops.ssl_certificate.view
+ - system.workspace.api_market.view
+ - system.workspace.application.view_all
+ - system.workspace.service.view_all
+ - system.workspace.team.view_all
+ - name: member
+ cname: 普通成员
+ permits:
+ - system.workspace.api_market.view
+ default: true
+team:
+ - name: team_admin
+ cname: 团队管理员
+ permits:
+ - team.application.application.manager
+ - team.application.authorization.manager
+ - team.application.authorization.view
+ - team.application.subscription.manager
+ - team.application.subscription.view
+ - team.service.api.manager
+ - team.service.api.view
+ - team.service.release.manager
+ - team.service.release.view
+ - team.service.service.manager
+ - team.service.subscription.manager
+ - team.service.subscription.view
+ - team.service.upstream.manager
+ - team.service.upstream.view
+ - team.team.member.manager
+ - team.team.member.view
+ - team.team.team.manager
+ - team.team.team.view
+ - name: service_admin
+ cname: 服务管理员
+ permits:
+ - team.service.service.manager
+ - team.service.upstream.manager
+ - team.service.upstream.view
+ - team.service.api.manager
+ - team.service.api.view
+ - team.service.subscription.manager
+ - team.service.subscription.view
+ - team.service.release.manager
+ - team.service.release.view
+ - team.team.member.view
+ - name: service_developer
+ cname: 服务开发者
+ permits:
+ - team.service.upstream.manager
+ - team.service.upstream.view
+ - team.service.api.manager
+ - team.service.api.view
+ - team.service.release.manager
+ - team.service.release.view
+ - team.team.member.view
+ - name: application_admin
+ cname: 应用管理员
+ permits:
+ - team.application.application.manager
+ - team.application.authorization.manager
+ - team.application.authorization.view
+ - team.application.subscription.manager
+ - team.application.subscription.view
+ - team.team.member.view
+ - name: application_developer
+ cname: 应用开发者
+ permits:
+ - team.application.authorization.view
+ - team.application.subscription.manager
+ - team.application.subscription.view
+ - team.team.member.view
+ default: true
\ No newline at end of file
diff --git a/service/project-member/model.go b/service/project-member/model.go
deleted file mode 100644
index 7fe86bd..0000000
--- a/service/project-member/model.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package project_member
-
-import "github.com/eolinker/ap-account/service/member"
-
-type Member = member.Member
diff --git a/service/project-member/service.go b/service/project-member/service.go
deleted file mode 100644
index 47b29e0..0000000
--- a/service/project-member/service.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package project_member
-
-import (
- "reflect"
-
- "github.com/eolinker/ap-account/service/member"
- "github.com/eolinker/apipark/stores/project"
- "github.com/eolinker/go-common/autowire"
-)
-
-type IMemberService member.IMemberService
-
-func init() {
- autowire.Auto[IMemberService](func() reflect.Value {
- return reflect.ValueOf(new(member.Service[project.IMemberStore]))
- })
-}
diff --git a/stores/project/model.go b/stores/project/model.go
index 0b4117f..efc8b64 100644
--- a/stores/project/model.go
+++ b/stores/project/model.go
@@ -24,21 +24,6 @@ func (p *Project) TableName() string {
return "project"
}
-//type MemberRole struct {
-// Id int64 `gorm:"type:BIGINT(20);size:20;not null;auto_increment;primary_key;column:id;comment:主键ID;"`
-// Pid string `gorm:"size:36;not null;column:pid;index:pid;comment:项目id;uniqueIndex:pid_uid_rid;"`
-// Uid string `gorm:"size:36;not null;column:uid;index:uid;comment:用户id;uniqueIndex:pid_uid_rid;"`
-// Rid string `gorm:"size:36;not null;column:rid;index:rid;comment:角色id;uniqueIndex:pid_uid_rid;"`
-// CreateTime time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
-//}
-//
-//func (m *MemberRole) IdValue() int64 {
-// return m.Id
-//}
-//func (m *MemberRole) TableName() string {
-// return "project_role"
-//}
-
type Authorization struct {
Id int64 `gorm:"type:BIGINT(20);size:20;not null;auto_increment;primary_key;column:id;comment:主键ID;"`
UUID string `gorm:"size:36;not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
From 8294ad455923da7d03600852ca50118dc67ee194 Mon Sep 17 00:00:00 2001
From: Liujian <824010343@qq.com>
Date: Tue, 30 Jul 2024 23:28:57 +0800
Subject: [PATCH 04/19] =?UTF-8?q?=E9=9B=86=E7=BE=A4=E3=80=81=E8=AF=81?=
=?UTF-8?q?=E4=B9=A6=E6=8F=90=E5=8F=96=E5=87=BA=E4=B8=80=E7=BA=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
controller/certificate/iml.go | 2 +-
controller/cluster/cluster.go | 22 +
controller/cluster/iml.go | 73 ++
controller/dynamic-module/dynamic-module.go | 8 +-
controller/dynamic-module/iml.go | 34 +-
controller/my_team/iml.go | 4 +
controller/my_team/team.go | 1 +
controller/partition/iml.go | 69 --
controller/partition/partition.go | 31 -
controller/plugin-cluster/iml.go | 36 +
controller/plugin-cluster/plugin_partiton.go | 24 +
controller/plugin-partition/iml.go | 36 -
.../plugin-partition/plugin_partiton.go | 23 -
controller/service/iml.go | 62 +-
controller/service/service.go | 19 +-
controller/upstream/iml.go | 8 +-
frontend/README.md | 6 +
frontend/README.pro.md | 21 +
frontend/package.json | 12 +-
frontend/packages/businessEntry/.env | 10 +
frontend/packages/businessEntry/.eslintrc.cjs | 18 +
frontend/packages/businessEntry/.gitignore | 26 +
frontend/packages/businessEntry/README.md | 11 +
.../__tests__/businessEntry.test.js | 7 +
frontend/packages/businessEntry/index.html | 21 +
frontend/packages/businessEntry/package.json | 17 +
.../packages/businessEntry/postcss.config.js | 15 +
.../packages/businessEntry/public/favicon.ico | Bin 0 -> 32038 bytes
.../businessEntry/public/iconpark_apinto.js | 8 +
.../businessEntry/public/iconpark_eolink.js | 7 +
.../packages/businessEntry/public/vite.svg | 1 +
frontend/packages/businessEntry/src/App.tsx | 153 ++++
.../components/aoplatform/RenderRoutes.tsx | 533 ++++++++++++++
frontend/packages/businessEntry/src/main.tsx | 33 +
.../packages/businessEntry/src/vite-env.d.ts | 1 +
frontend/packages/businessEntry/start-vite.js | 22 +
.../packages/businessEntry/tailwind.config.js | 87 +++
frontend/packages/businessEntry/tsconfig.json | 39 ++
.../packages/businessEntry/tsconfig.node.json | 10 +
.../packages/businessEntry/vite.config.ts | 86 +++
frontend/packages/common/package.json | 1 -
frontend/packages/common/src/assets/logo.png | Bin 3417 -> 4240 bytes
.../src/components/aoplatform/BasicLayout.tsx | 4 +-
.../src/components/aoplatform/Navigation.tsx | 15 +-
.../PublishApprovalModalContent.tsx | 2 +-
.../SubscribeApprovalModalContent.tsx | 2 +-
.../components/aoplatform/TreeWithMore.tsx | 9 +-
.../IntelligentPluginList.tsx | 8 +-
.../IntelligentPluginPublish.tsx | 4 +-
.../apispace/code-snippet/generate-code.ts | 34 +-
.../apispace/code-snippet/index.tsx | 14 +-
.../common/src/const/approval/const.tsx | 18 +-
frontend/packages/common/src/const/const.ts | 2 +-
.../packages/common/src/const/permissions.ts | 5 +
frontend/packages/common/src/const/type.ts | 10 +
.../src/contexts/GlobalStateContext.tsx | 2 +-
.../packages/common/src/utils/dataTransfer.ts | 10 +-
.../packages/common/src/utils/permission.ts | 4 +-
frontend/packages/core/.env | 1 +
frontend/packages/core/package.json | 7 +-
.../components/aoplatform/RenderRoutes.tsx | 122 +---
.../core/src/const/organization/const.tsx | 4 +-
.../core/src/const/partitions/const.tsx | 38 +-
.../packages/core/src/const/system/const.tsx | 36 +-
.../packages/core/src/const/system/type.ts | 22 +-
.../packages/core/src/const/team/const.tsx | 2 +-
frontend/packages/core/src/pages/Login.tsx | 7 +-
.../core/src/pages/approval/ApprovalList.tsx | 2 +-
.../core/src/pages/approval/ApprovalPage.tsx | 2 +-
.../core/src/pages/auditLog/AuditLog.tsx | 6 +-
.../src/pages/logsettings/LogSettings.tsx | 2 +-
.../logsettings/LogSettingsInstruction.tsx | 10 +-
.../core/src/pages/member/MemberPage.tsx | 8 +-
.../pages/organization/OrganizationConfig.tsx | 4 +-
.../pages/organization/OrganizationList.tsx | 2 +-
.../src/pages/partitions/PartitionConfig.tsx | 25 +-
.../pages/partitions/PartitionInsideCert.tsx | 2 +-
.../PartitionInsideDashboardSetting.tsx | 4 +-
.../pages/partitions/PartitionInsidePage.tsx | 4 +-
.../src/pages/partitions/PartitionList.tsx | 12 +-
.../resourcesettings/ResourceSettings.tsx | 2 +-
.../ResourceSettingsInstruction.tsx | 10 +-
.../pages/serviceCategory/ServiceCategory.tsx | 2 +
.../ServiceHubCategoryConfig.tsx | 1 -
.../core/src/pages/system/SystemConfig.tsx | 4 +-
.../src/pages/system/SystemInsideMember.tsx | 1 -
.../src/pages/system/SystemInsidePage.tsx | 8 +-
.../pages/system/SystemInsideSubscriber.tsx | 6 +-
.../core/src/pages/system/SystemList.tsx | 4 +-
.../core/src/pages/system/SystemTopology.tsx | 3 +-
.../pages/system/api/SystemInsideApiList.tsx | 22 +-
.../approval/SystemInsideApprovalList.tsx | 3 +-
.../authority/SystemInsideAuthority.tsx | 3 +-
.../myService/MyServiceInsideConfig.tsx | 2 +-
.../system/myService/MyServiceInsideMenu.tsx | 2 +-
.../myService/SystemInsideMyService.tsx | 1 -
.../publish/SystemInsidePublishList.tsx | 5 +-
.../subSubscribe/SystemInsideSubService.tsx | 3 +-
.../upstream/SystemInsideUpstreamConfig.tsx | 2 +-
.../upstream/SystemInsideUpstreamList.tsx | 3 +-
.../pages/systemRunning/SystemRunning3.tsx | 550 ---------------
.../core/src/pages/team/TeamInsideMember.tsx | 10 -
.../core/src/pages/team/TeamInsidePage.tsx | 2 +-
.../packages/core/src/pages/team/TeamList.tsx | 4 +-
.../core/src/pages/webhook/Webhook.tsx | 5 +-
frontend/packages/core/tsconfig.json | 6 +-
frontend/packages/core/vite.config.ts | 13 +-
....timestamp-1720797741902-0827b2d7ab219.mjs | 90 ---
frontend/packages/dashboard/README.md | 11 +
.../dashboard/__tests__/dashboard.test.js | 7 +
frontend/packages/dashboard/package.json | 11 +
frontend/packages/dashboard/postcss.config.js | 15 +
.../src/component}/MonitorApiPage.tsx | 6 +-
.../src/component}/MonitorAppPage.tsx | 6 +-
.../src/component}/MonitorDetailPage.tsx | 6 +-
.../src/component}/MonitorLineGraph.tsx | 10 +-
.../src/component}/MonitorPieGraph.tsx | 2 +-
.../src/component}/MonitorSubPage.tsx | 6 +-
.../src/component}/MonitorTable.tsx | 6 +-
.../src/component}/MonitorTotalPage.tsx | 11 +-
.../src/const}/const.tsx | 0
.../dashboard => dashboard/src/const}/type.ts | 0
.../src/pages}/Dashboard.tsx | 0
.../src/pages}/DashboardApiList.tsx | 8 +-
.../src/pages}/DashboardApplicationList.tsx | 16 +-
.../src/pages}/DashboardDetail.tsx | 8 +-
.../src/pages}/DashboardInstruction.tsx | 10 +-
.../src/pages}/DashboardList.tsx | 0
.../src/pages}/DashboardProjectList.tsx | 14 +-
.../src/pages}/DashboardTabPage.tsx | 0
.../src/pages}/DashboardTotal.tsx | 8 +-
.../src/utils/dashboard.ts | 0
.../packages/dashboard/tailwind.config.js | 86 +++
frontend/packages/dashboard/tsconfig.json | 29 +
.../packages/dashboard/tsconfig.node.json | 10 +
.../market/src/const/serviceHub/const.tsx | 2 +-
.../pages/serviceHub/ApplyServiceModal.tsx | 2 +-
.../src/pages/serviceHub/ServiceHubGroup.tsx | 2 +-
frontend/packages/openApi/README.md | 11 +
.../openApi/__tests__/openApi.test.js | 7 +
frontend/packages/openApi/package.json | 15 +
frontend/packages/openApi/postcss.config.js | 15 +
.../src/pages}/OpenApiConfig.tsx | 0
.../src/pages}/OpenApiList.tsx | 8 +-
frontend/packages/openApi/tailwind.config.js | 86 +++
frontend/packages/openApi/tsconfig.json | 29 +
frontend/packages/openApi/tsconfig.node.json | 10 +
frontend/packages/systemRunning/README.md | 11 +
.../__tests__/systemRunning.test.js | 7 +
frontend/packages/systemRunning/package.json | 8 +
.../packages/systemRunning/postcss.config.js | 15 +
.../src/pages}/SystemRunning.tsx | 8 +-
.../src/pages}/SystemRunningInstruction.tsx | 0
.../packages/systemRunning/tailwind.config.js | 86 +++
frontend/packages/systemRunning/tsconfig.json | 28 +
.../packages/systemRunning/tsconfig.node.json | 10 +
gateway/handler.go | 22 +-
module/catalogue/dto/output.go | 19 +-
module/catalogue/iml.go | 21 +-
module/certificate/certificate.go | 4 +-
module/certificate/dto/dto.go | 2 +-
module/certificate/impl.go | 77 +-
module/cluster/cluster.go | 21 +
module/cluster/dto/input.go | 40 ++
module/{partition => cluster}/dto/output.go | 2 +-
module/cluster/impl.go | 300 ++++++++
module/{partition => cluster}/util.go | 8 +-
module/dynamic-module/dto/input.go | 4 +-
module/dynamic-module/dynamic_module.go | 10 +-
module/dynamic-module/iml.go | 324 ++++-----
module/my-team/dto/input.go | 5 +
module/my-team/dto/output.go | 114 ++-
module/my-team/iml.go | 208 +++---
module/my-team/team.go | 3 +
module/partition/dto/input.go | 40 --
module/partition/impl.go | 317 ---------
module/partition/partition.go | 29 -
module/permit/project/iml.go | 21 +-
.../dto/input.go | 0
.../dto/plugin.go | 2 +-
module/plugin-cluster/iml.go | 174 +++++
.../plugin-partition.go | 19 +-
module/plugin-partition/iml.go | 176 -----
module/project-authorization/iml.go | 26 +-
module/project/dto/output.go | 53 +-
module/project/iml.go | 322 ++-------
module/project_diff/iml.go | 88 ++-
module/project_diff/out.go | 4 +-
module/publish/dto/out.go | 8 +-
module/publish/iml.go | 48 +-
module/release/iml.go | 14 +-
module/service/iml.go | 658 +-----------------
module/service/service.go | 28 +-
module/subscribe/dto/input.go | 4 +-
module/subscribe/dto/output.go | 4 +-
module/subscribe/iml.go | 115 +--
module/team/dto/input.go | 3 +-
module/team/dto/output.go | 68 +-
module/team/iml.go | 56 +-
module/upstream/dto/output.go | 2 +-
module/upstream/iml.go | 60 +-
plugins/core/cluster.go | 6 +-
plugins/core/core.go | 21 +-
plugins/core/dynamic-module.go | 4 +-
plugins/core/my-team.go | 2 +
plugins/core/partition.go | 16 +-
plugins/core/plugin.go | 13 +-
plugins/core/service.go | 17 +-
resources/access/role.yaml | 166 ++---
resources/plugin/plugin-load.go | 11 +-
service/certificate/model.go | 2 +-
service/certificate/service.go | 18 +-
service/cluster/cluster.go | 68 +-
service/cluster/model.go | 2 -
service/dynamic-module/iml.go | 2 -
service/dynamic-module/model.go | 5 +-
service/partition/iml.go | 100 ---
service/partition/model.go | 33 -
service/partition/service.go | 20 -
.../iml.go | 19 +-
.../model.go | 5 +-
.../service.go | 11 +-
service/project_diff/diff.go | 6 +-
service/publish/iml.go | 22 +-
service/publish/model.go | 12 +-
service/release/iml.go | 12 +-
service/release/model.go | 5 +-
service/team/iml.go | 4 -
service/team/model.go | 22 +-
service/upstream/iml.go | 20 +-
service/upstream/model.go | 4 +-
stores/certificate/model.go | 2 +-
stores/cluster/model.go | 30 +-
stores/cluster/store.go | 11 +-
stores/dynamic-module/model.go | 1 -
stores/publish/model.go | 13 +-
stores/team/model.go | 20 +-
stores/upstream/model.go | 22 +-
238 files changed, 3666 insertions(+), 4079 deletions(-)
create mode 100644 controller/cluster/cluster.go
create mode 100644 controller/cluster/iml.go
delete mode 100644 controller/partition/iml.go
delete mode 100644 controller/partition/partition.go
create mode 100644 controller/plugin-cluster/iml.go
create mode 100644 controller/plugin-cluster/plugin_partiton.go
delete mode 100644 controller/plugin-partition/iml.go
delete mode 100644 controller/plugin-partition/plugin_partiton.go
create mode 100644 frontend/README.pro.md
create mode 100644 frontend/packages/businessEntry/.env
create mode 100644 frontend/packages/businessEntry/.eslintrc.cjs
create mode 100644 frontend/packages/businessEntry/.gitignore
create mode 100644 frontend/packages/businessEntry/README.md
create mode 100644 frontend/packages/businessEntry/__tests__/businessEntry.test.js
create mode 100644 frontend/packages/businessEntry/index.html
create mode 100644 frontend/packages/businessEntry/package.json
create mode 100644 frontend/packages/businessEntry/postcss.config.js
create mode 100644 frontend/packages/businessEntry/public/favicon.ico
create mode 100644 frontend/packages/businessEntry/public/iconpark_apinto.js
create mode 100644 frontend/packages/businessEntry/public/iconpark_eolink.js
create mode 100644 frontend/packages/businessEntry/public/vite.svg
create mode 100644 frontend/packages/businessEntry/src/App.tsx
create mode 100644 frontend/packages/businessEntry/src/components/aoplatform/RenderRoutes.tsx
create mode 100644 frontend/packages/businessEntry/src/main.tsx
create mode 100644 frontend/packages/businessEntry/src/vite-env.d.ts
create mode 100644 frontend/packages/businessEntry/start-vite.js
create mode 100644 frontend/packages/businessEntry/tailwind.config.js
create mode 100644 frontend/packages/businessEntry/tsconfig.json
create mode 100644 frontend/packages/businessEntry/tsconfig.node.json
create mode 100644 frontend/packages/businessEntry/vite.config.ts
create mode 100644 frontend/packages/core/.env
delete mode 100644 frontend/packages/core/src/pages/systemRunning/SystemRunning3.tsx
delete mode 100644 frontend/packages/core/vite.config.ts.timestamp-1720797741902-0827b2d7ab219.mjs
create mode 100644 frontend/packages/dashboard/README.md
create mode 100644 frontend/packages/dashboard/__tests__/dashboard.test.js
create mode 100644 frontend/packages/dashboard/package.json
create mode 100644 frontend/packages/dashboard/postcss.config.js
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorApiPage.tsx (98%)
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorAppPage.tsx (97%)
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorDetailPage.tsx (97%)
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorLineGraph.tsx (98%)
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorPieGraph.tsx (98%)
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorSubPage.tsx (97%)
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorTable.tsx (94%)
rename frontend/packages/{common/src/components/aoplatform/dashboard => dashboard/src/component}/MonitorTotalPage.tsx (97%)
rename frontend/packages/{common/src/const/dashboard => dashboard/src/const}/const.tsx (100%)
rename frontend/packages/{common/src/const/dashboard => dashboard/src/const}/type.ts (100%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/Dashboard.tsx (100%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardApiList.tsx (87%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardApplicationList.tsx (80%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardDetail.tsx (91%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardInstruction.tsx (80%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardList.tsx (100%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardProjectList.tsx (82%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardTabPage.tsx (100%)
rename frontend/packages/{core/src/pages/dashboard => dashboard/src/pages}/DashboardTotal.tsx (91%)
rename frontend/packages/{common => dashboard}/src/utils/dashboard.ts (100%)
create mode 100644 frontend/packages/dashboard/tailwind.config.js
create mode 100644 frontend/packages/dashboard/tsconfig.json
create mode 100644 frontend/packages/dashboard/tsconfig.node.json
create mode 100644 frontend/packages/openApi/README.md
create mode 100644 frontend/packages/openApi/__tests__/openApi.test.js
create mode 100644 frontend/packages/openApi/package.json
create mode 100644 frontend/packages/openApi/postcss.config.js
rename frontend/packages/{core/src/pages/openApi => openApi/src/pages}/OpenApiConfig.tsx (100%)
rename frontend/packages/{core/src/pages/openApi => openApi/src/pages}/OpenApiList.tsx (97%)
create mode 100644 frontend/packages/openApi/tailwind.config.js
create mode 100644 frontend/packages/openApi/tsconfig.json
create mode 100644 frontend/packages/openApi/tsconfig.node.json
create mode 100644 frontend/packages/systemRunning/README.md
create mode 100644 frontend/packages/systemRunning/__tests__/systemRunning.test.js
create mode 100644 frontend/packages/systemRunning/package.json
create mode 100644 frontend/packages/systemRunning/postcss.config.js
rename frontend/packages/{core/src/pages/systemRunning => systemRunning/src/pages}/SystemRunning.tsx (98%)
rename frontend/packages/{core/src/pages/systemRunning => systemRunning/src/pages}/SystemRunningInstruction.tsx (100%)
create mode 100644 frontend/packages/systemRunning/tailwind.config.js
create mode 100644 frontend/packages/systemRunning/tsconfig.json
create mode 100644 frontend/packages/systemRunning/tsconfig.node.json
create mode 100644 module/cluster/cluster.go
create mode 100644 module/cluster/dto/input.go
rename module/{partition => cluster}/dto/output.go (98%)
create mode 100644 module/cluster/impl.go
rename module/{partition => cluster}/util.go (69%)
delete mode 100644 module/partition/dto/input.go
delete mode 100644 module/partition/impl.go
delete mode 100644 module/partition/partition.go
rename module/{plugin-partition => plugin-cluster}/dto/input.go (100%)
rename module/{plugin-partition => plugin-cluster}/dto/plugin.go (94%)
create mode 100644 module/plugin-cluster/iml.go
rename module/{plugin-partition => plugin-cluster}/plugin-partition.go (56%)
delete mode 100644 module/plugin-partition/iml.go
delete mode 100644 service/partition/iml.go
delete mode 100644 service/partition/model.go
delete mode 100644 service/partition/service.go
rename service/{plugin-partition => plugin-cluster}/iml.go (90%)
rename service/{plugin-partition => plugin-cluster}/model.go (97%)
rename service/{plugin-partition => plugin-cluster}/service.go (63%)
diff --git a/controller/certificate/iml.go b/controller/certificate/iml.go
index 925d35d..2936e27 100644
--- a/controller/certificate/iml.go
+++ b/controller/certificate/iml.go
@@ -23,7 +23,7 @@ func (c *imlCertificate) Update(ctx *gin.Context, id string, edit *certificate_d
}
func (c *imlCertificate) ListForPartition(ctx *gin.Context, partitionId string) ([]*certificate_dto.Certificate, error) {
- return c.module.ListForPartition(ctx, partitionId)
+ return c.module.List(ctx, partitionId)
}
func (c *imlCertificate) Detail(ctx *gin.Context, id string) (*certificate_dto.Certificate, *certificate_dto.File, error) {
diff --git a/controller/cluster/cluster.go b/controller/cluster/cluster.go
new file mode 100644
index 0000000..4bdd43e
--- /dev/null
+++ b/controller/cluster/cluster.go
@@ -0,0 +1,22 @@
+package cluster
+
+import (
+ "reflect"
+
+ cluster_dto "github.com/eolinker/apipark/module/cluster/dto"
+
+ "github.com/eolinker/go-common/autowire"
+ "github.com/gin-gonic/gin"
+)
+
+type IClusterController interface {
+ Nodes(ctx *gin.Context, clusterId string) ([]*cluster_dto.Node, error)
+ ResetCluster(ctx *gin.Context, clusterId string, input *cluster_dto.ResetCluster) ([]*cluster_dto.Node, error)
+ Check(ctx *gin.Context, input *cluster_dto.CheckCluster) ([]*cluster_dto.Node, error)
+}
+
+func init() {
+ autowire.Auto[IClusterController](func() reflect.Value {
+ return reflect.ValueOf(new(imlCluster))
+ })
+}
diff --git a/controller/cluster/iml.go b/controller/cluster/iml.go
new file mode 100644
index 0000000..21dee15
--- /dev/null
+++ b/controller/cluster/iml.go
@@ -0,0 +1,73 @@
+package cluster
+
+import (
+ "github.com/eolinker/apipark/module/cluster"
+ cluster_dto "github.com/eolinker/apipark/module/cluster/dto"
+ "github.com/gin-gonic/gin"
+)
+
+var (
+ _ IClusterController = (*imlCluster)(nil)
+)
+
+type imlCluster struct {
+ module cluster.IClusterModule `autowired:""`
+}
+
+func (p *imlCluster) Nodes(ctx *gin.Context, clusterId string) ([]*cluster_dto.Node, error) {
+ if clusterId == "" {
+ clusterId = "default"
+ }
+ return p.module.ClusterNodes(ctx, clusterId)
+}
+
+func (p *imlCluster) ResetCluster(ctx *gin.Context, clusterId string, input *cluster_dto.ResetCluster) ([]*cluster_dto.Node, error) {
+ if clusterId == "" {
+ clusterId = "default"
+ }
+ return p.module.ResetCluster(ctx, clusterId, input.ManagerAddress)
+}
+
+func (p *imlCluster) Check(ctx *gin.Context, input *cluster_dto.CheckCluster) ([]*cluster_dto.Node, error) {
+ return p.module.CheckCluster(ctx, input.Address)
+}
+
+//
+//func (p *imlCluster) SimpleWithCluster(ctx *gin.Context) ([]*parition_dto.SimpleWithCluster, error) {
+// return p.module.SimpleWithCluster(ctx)
+//}
+//
+//func (p *imlCluster) Delete(ctx *gin.Context, id string) (string, error) {
+// err := p.module.Delete(ctx, id)
+// if err != nil {
+// return "", err
+// }
+// return id, nil
+//}
+//
+//func (p *imlCluster) Search(ctx *gin.Context, keyword string) ([]*parition_dto.Item, error) {
+// return p.module.Search(ctx, keyword)
+//}
+//
+//func (p *imlCluster) Simple(ctx *gin.Context) ([]*parition_dto.Simple, error) {
+// return p.module.Simple(ctx)
+//}
+//
+//func (p *imlCluster) Info(ctx *gin.Context, id string) (*parition_dto.Detail, error) {
+// if id == "" {
+// return nil, errors.New("id is empty")
+// }
+// return p.module.Get(ctx, id)
+//}
+//
+//func (p *imlCluster) Update(ctx *gin.Context, id string, input *parition_dto.Edit) (*parition_dto.Detail, error) {
+// return p.module.Update(ctx, id, input)
+//}
+//
+//func (p *imlCluster) Create(ctx *gin.Context, input *parition_dto.Create) (*parition_dto.Detail, string, auto.TimeLabel, error) {
+// detail, err := p.module.CreatePartition(ctx, input)
+// if err != nil {
+// return nil, "", auto.TimeLabel{}, err
+// }
+// return detail, detail.Id, detail.UpdateTime, nil
+//}
diff --git a/controller/dynamic-module/dynamic-module.go b/controller/dynamic-module/dynamic-module.go
index ab9ca50..2580922 100644
--- a/controller/dynamic-module/dynamic-module.go
+++ b/controller/dynamic-module/dynamic-module.go
@@ -16,10 +16,10 @@ type IDynamicModuleController interface {
List(ctx *gin.Context, module string, keyword string, cluster string, page string, pageSize string) ([]map[string]interface{}, *dynamic_module_dto.PluginInfo, int64, error)
Render(ctx *gin.Context, module string) (*dynamic_module_dto.PluginBasic, map[string]interface{}, error)
ModuleDrivers(ctx *gin.Context, group string) ([]*dynamic_module_dto.ModuleDriver, error)
- Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.PartitionInput) error
- Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.PartitionInput) error
- PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error)
- PartitionStatus(ctx *gin.Context, module string, id string) (*dynamic_module_dto.OnlineInfo, error)
+ Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error
+ Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error
+ //PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error)
+ //PartitionStatus(ctx *gin.Context, module string, id string) (*dynamic_module_dto.OnlineInfo, error)
}
func init() {
diff --git a/controller/dynamic-module/iml.go b/controller/dynamic-module/iml.go
index 5d16071..5e67f77 100644
--- a/controller/dynamic-module/iml.go
+++ b/controller/dynamic-module/iml.go
@@ -15,29 +15,29 @@ type imlDynamicModuleController struct {
module dynamic_module.IDynamicModuleModule `autowired:""`
}
-func (i *imlDynamicModuleController) Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.PartitionInput) error {
+func (i *imlDynamicModuleController) Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error {
return i.module.Online(ctx, module, id, partitionInput)
}
-func (i *imlDynamicModuleController) Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.PartitionInput) error {
+func (i *imlDynamicModuleController) Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error {
return i.module.Offline(ctx, module, id, partitionInput)
}
-func (i *imlDynamicModuleController) PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error) {
- p, err := strconv.Atoi(page)
- if err != nil {
- p = 1
- }
- ps, err := strconv.Atoi(pageSize)
- if err != nil {
- ps = 20
- }
- return i.module.PartitionStatuses(ctx, module, keyword, p, ps)
-}
-
-func (i *imlDynamicModuleController) PartitionStatus(ctx *gin.Context, module string, id string) (*dynamic_module_dto.OnlineInfo, error) {
- return i.module.PartitionStatus(ctx, module, id)
-}
+//func (i *imlDynamicModuleController) PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error) {
+// p, err := strconv.Atoi(page)
+// if err != nil {
+// p = 1
+// }
+// ps, err := strconv.Atoi(pageSize)
+// if err != nil {
+// ps = 20
+// }
+// return i.module.PartitionStatuses(ctx, module, keyword, p, ps)
+//}
+//
+//func (i *imlDynamicModuleController) PartitionStatus(ctx *gin.Context, module string, id string) (*dynamic_module_dto.OnlineInfo, error) {
+// return i.module.PartitionStatus(ctx, module, id)
+//}
func (i *imlDynamicModuleController) ModuleDrivers(ctx *gin.Context, group string) ([]*dynamic_module_dto.ModuleDriver, error) {
return i.module.ModuleDrivers(ctx, group)
diff --git a/controller/my_team/iml.go b/controller/my_team/iml.go
index c8888f9..7d554a8 100644
--- a/controller/my_team/iml.go
+++ b/controller/my_team/iml.go
@@ -14,6 +14,10 @@ type imlTeamController struct {
module my_team.ITeamModule `autowired:""`
}
+func (c *imlTeamController) UpdateMemberRole(ctx *gin.Context, id string, input *team_dto.UpdateMemberRole) error {
+ return c.module.UpdateMemberRole(ctx, id, input)
+}
+
func (c *imlTeamController) GetTeam(ctx *gin.Context, id string) (*team_dto.Team, error) {
return c.module.GetTeam(ctx, id)
}
diff --git a/controller/my_team/team.go b/controller/my_team/team.go
index 7d8407b..d701bec 100644
--- a/controller/my_team/team.go
+++ b/controller/my_team/team.go
@@ -18,6 +18,7 @@ type ITeamController interface {
RemoveMember(ctx *gin.Context, id string, uuid string) error
Members(ctx *gin.Context, id string, keyword string) ([]*team_dto.Member, error)
SimpleMembers(ctx *gin.Context, id string, keyword string) ([]*team_dto.SimpleMember, error)
+ UpdateMemberRole(ctx *gin.Context, id string, input *team_dto.UpdateMemberRole) error
}
func init() {
diff --git a/controller/partition/iml.go b/controller/partition/iml.go
deleted file mode 100644
index 03a8c65..0000000
--- a/controller/partition/iml.go
+++ /dev/null
@@ -1,69 +0,0 @@
-package partition
-
-import (
- "errors"
-
- "github.com/eolinker/apipark/module/partition"
- parition_dto "github.com/eolinker/apipark/module/partition/dto"
- "github.com/eolinker/go-common/auto"
- "github.com/gin-gonic/gin"
-)
-
-var (
- _ IPartitionController = (*imlPartition)(nil)
-)
-
-type imlPartition struct {
- partitionModule partition.IPartitionModule `autowired:""`
-}
-
-func (p *imlPartition) Nodes(ctx *gin.Context, partitionId string) ([]*parition_dto.Node, error) {
- return p.partitionModule.ClusterNodes(ctx, partitionId)
-}
-
-func (p *imlPartition) ResetCluster(ctx *gin.Context, partitionId string, input *parition_dto.ResetCluster) ([]*parition_dto.Node, error) {
- return p.partitionModule.ResetCluster(ctx, partitionId, input.ManagerAddress)
-}
-
-func (p *imlPartition) Check(ctx *gin.Context, input *parition_dto.CheckCluster) ([]*parition_dto.Node, error) {
- return p.partitionModule.CheckCluster(ctx, input.Address)
-}
-
-func (p *imlPartition) SimpleWithCluster(ctx *gin.Context) ([]*parition_dto.SimpleWithCluster, error) {
- return p.partitionModule.SimpleWithCluster(ctx)
-}
-
-func (p *imlPartition) Delete(ctx *gin.Context, id string) (string, error) {
- err := p.partitionModule.Delete(ctx, id)
- if err != nil {
- return "", err
- }
- return id, nil
-}
-
-func (p *imlPartition) Search(ctx *gin.Context, keyword string) ([]*parition_dto.Item, error) {
- return p.partitionModule.Search(ctx, keyword)
-}
-
-func (p *imlPartition) Simple(ctx *gin.Context) ([]*parition_dto.Simple, error) {
- return p.partitionModule.Simple(ctx)
-}
-
-func (p *imlPartition) Info(ctx *gin.Context, id string) (*parition_dto.Detail, error) {
- if id == "" {
- return nil, errors.New("id is empty")
- }
- return p.partitionModule.Get(ctx, id)
-}
-
-func (p *imlPartition) Update(ctx *gin.Context, id string, input *parition_dto.Edit) (*parition_dto.Detail, error) {
- return p.partitionModule.Update(ctx, id, input)
-}
-
-func (p *imlPartition) Create(ctx *gin.Context, input *parition_dto.Create) (*parition_dto.Detail, string, auto.TimeLabel, error) {
- detail, err := p.partitionModule.CreatePartition(ctx, input)
- if err != nil {
- return nil, "", auto.TimeLabel{}, err
- }
- return detail, detail.Id, detail.UpdateTime, nil
-}
diff --git a/controller/partition/partition.go b/controller/partition/partition.go
deleted file mode 100644
index 05402b6..0000000
--- a/controller/partition/partition.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package partition
-
-import (
- "reflect"
-
- parition_dto "github.com/eolinker/apipark/module/partition/dto"
-
- "github.com/eolinker/go-common/auto"
- "github.com/eolinker/go-common/autowire"
- "github.com/gin-gonic/gin"
-)
-
-type IPartitionController interface {
- Create(ctx *gin.Context, input *parition_dto.Create) (*parition_dto.Detail, string, auto.TimeLabel, error)
- Search(ctx *gin.Context, keyword string) ([]*parition_dto.Item, error)
- Simple(ctx *gin.Context) ([]*parition_dto.Simple, error)
- Info(ctx *gin.Context, id string) (*parition_dto.Detail, error)
- Update(ctx *gin.Context, id string, input *parition_dto.Edit) (*parition_dto.Detail, error)
- Delete(ctx *gin.Context, id string) (string, error)
- SimpleWithCluster(ctx *gin.Context) ([]*parition_dto.SimpleWithCluster, error)
-
- Nodes(ctx *gin.Context, partitionId string) ([]*parition_dto.Node, error)
- ResetCluster(ctx *gin.Context, partitionId string, input *parition_dto.ResetCluster) ([]*parition_dto.Node, error)
- Check(ctx *gin.Context, input *parition_dto.CheckCluster) ([]*parition_dto.Node, error)
-}
-
-func init() {
- autowire.Auto[IPartitionController](func() reflect.Value {
- return reflect.ValueOf(new(imlPartition))
- })
-}
diff --git a/controller/plugin-cluster/iml.go b/controller/plugin-cluster/iml.go
new file mode 100644
index 0000000..f3b0c6e
--- /dev/null
+++ b/controller/plugin-cluster/iml.go
@@ -0,0 +1,36 @@
+package plugin_cluster
+
+import (
+ "github.com/eolinker/apipark/model/plugin_model"
+ "github.com/eolinker/apipark/module/plugin-cluster"
+ "github.com/eolinker/apipark/module/plugin-cluster/dto"
+ "github.com/gin-gonic/gin"
+)
+
+var (
+ _ IPluginClusterController = (*imlPluginClusterController)(nil)
+)
+
+type imlPluginClusterController struct {
+ module plugin_cluster.IPluginClusterModule `autowired:""`
+}
+
+func (i *imlPluginClusterController) Info(ctx *gin.Context, name string) (*dto.Define, error) {
+ return i.module.GetDefine(ctx, name)
+}
+
+func (i *imlPluginClusterController) Option(ctx *gin.Context, project string) ([]*dto.PluginOption, error) {
+ return i.module.Options(ctx)
+}
+
+func (i *imlPluginClusterController) List(ctx *gin.Context, clusterId string) ([]*dto.Item, error) {
+ return i.module.List(ctx, clusterId)
+}
+
+func (i *imlPluginClusterController) Get(ctx *gin.Context, clusterId string, name string) (config *dto.PluginOutput, render plugin_model.Render, er error) {
+ return i.module.Get(ctx, clusterId, name)
+}
+
+func (i *imlPluginClusterController) Set(ctx *gin.Context, clusterId string, name string, config *dto.PluginSetting) error {
+ return i.module.Set(ctx, clusterId, name, config)
+}
diff --git a/controller/plugin-cluster/plugin_partiton.go b/controller/plugin-cluster/plugin_partiton.go
new file mode 100644
index 0000000..f212e82
--- /dev/null
+++ b/controller/plugin-cluster/plugin_partiton.go
@@ -0,0 +1,24 @@
+package plugin_cluster
+
+import (
+ "reflect"
+
+ "github.com/eolinker/apipark/model/plugin_model"
+ "github.com/eolinker/apipark/module/plugin-cluster/dto"
+ "github.com/eolinker/go-common/autowire"
+ "github.com/gin-gonic/gin"
+)
+
+type IPluginClusterController interface {
+ List(ctx *gin.Context, clusterId string) ([]*dto.Item, error)
+ Get(ctx *gin.Context, clusterId string, name string) (config *dto.PluginOutput, render plugin_model.Render, er error)
+ Set(ctx *gin.Context, clusterId string, name string, config *dto.PluginSetting) error
+ Option(ctx *gin.Context, project string) ([]*dto.PluginOption, error)
+ Info(ctx *gin.Context, name string) (*dto.Define, error)
+}
+
+func init() {
+ autowire.Auto[IPluginClusterController](func() reflect.Value {
+ return reflect.ValueOf(new(imlPluginClusterController))
+ })
+}
diff --git a/controller/plugin-partition/iml.go b/controller/plugin-partition/iml.go
deleted file mode 100644
index a949732..0000000
--- a/controller/plugin-partition/iml.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package plugin_partition
-
-import (
- "github.com/eolinker/apipark/model/plugin_model"
- plugin_partition "github.com/eolinker/apipark/module/plugin-partition"
- "github.com/eolinker/apipark/module/plugin-partition/dto"
- "github.com/gin-gonic/gin"
-)
-
-var (
- _ IPluginPartitionController = (*imlPluginPartitionController)(nil)
-)
-
-type imlPluginPartitionController struct {
- module plugin_partition.IPluginPartitionModule `autowired:""`
-}
-
-func (i *imlPluginPartitionController) Info(ctx *gin.Context, name string) (*dto.Define, error) {
- return i.module.GetDefine(ctx, name)
-}
-
-func (i *imlPluginPartitionController) Option(ctx *gin.Context, project string) ([]*dto.PluginOption, error) {
- return i.module.Options(ctx)
-}
-
-func (i *imlPluginPartitionController) List(ctx *gin.Context, partition string) ([]*dto.Item, error) {
- return i.module.List(ctx, partition)
-}
-
-func (i *imlPluginPartitionController) Get(ctx *gin.Context, partition string, name string) (config *dto.PluginOutput, render plugin_model.Render, er error) {
- return i.module.Get(ctx, partition, name)
-}
-
-func (i *imlPluginPartitionController) Set(ctx *gin.Context, partition string, name string, config *dto.PluginSetting) error {
- return i.module.Set(ctx, partition, name, config)
-}
diff --git a/controller/plugin-partition/plugin_partiton.go b/controller/plugin-partition/plugin_partiton.go
deleted file mode 100644
index 81698e4..0000000
--- a/controller/plugin-partition/plugin_partiton.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package plugin_partition
-
-import (
- "github.com/eolinker/apipark/model/plugin_model"
- "github.com/eolinker/apipark/module/plugin-partition/dto"
- "github.com/eolinker/go-common/autowire"
- "github.com/gin-gonic/gin"
- "reflect"
-)
-
-type IPluginPartitionController interface {
- List(ctx *gin.Context, partition string) ([]*dto.Item, error)
- Get(ctx *gin.Context, partition string, name string) (config *dto.PluginOutput, render plugin_model.Render, er error)
- Set(ctx *gin.Context, partition string, name string, config *dto.PluginSetting) error
- Option(ctx *gin.Context, project string) ([]*dto.PluginOption, error)
- Info(ctx *gin.Context, name string) (*dto.Define, error)
-}
-
-func init() {
- autowire.Auto[IPluginPartitionController](func() reflect.Value {
- return reflect.ValueOf(new(imlPluginPartitionController))
- })
-}
diff --git a/controller/service/iml.go b/controller/service/iml.go
index 9eefaa9..0bd3d9f 100644
--- a/controller/service/iml.go
+++ b/controller/service/iml.go
@@ -1,7 +1,6 @@
package service
import (
- "encoding/json"
"github.com/gin-gonic/gin"
"github.com/eolinker/apipark/module/service"
@@ -16,63 +15,10 @@ type imlServiceController struct {
module service.IServiceModule `autowired:""`
}
-func (i *imlServiceController) SimpleList(ctx *gin.Context, pid string) ([]*service_dto.SimpleItem, error) {
- return i.module.SimpleList(ctx, pid)
+func (i *imlServiceController) ServiceDoc(ctx *gin.Context, pid string) (*service_dto.ServiceDoc, error) {
+ return i.module.ServiceDoc(ctx, pid)
}
-func (i *imlServiceController) ServiceApis(ctx *gin.Context, pid string, sid string) ([]*service_dto.ServiceApi, error) {
- return i.module.ServiceApis(ctx, pid, sid)
-}
-
-func (i *imlServiceController) BindServiceApi(ctx *gin.Context, pid string, sid string, apis *service_dto.BindApis) error {
- return i.module.BindServiceApi(ctx, pid, sid, apis)
-}
-
-func (i *imlServiceController) UnbindServiceApi(ctx *gin.Context, pid string, sid string, api string) error {
- apis := make([]string, 0)
- err := json.Unmarshal([]byte(api), &apis)
- if err != nil {
- return err
- }
- return i.module.UnbindServiceApi(ctx, pid, sid, apis)
-}
-
-func (i *imlServiceController) SortApis(ctx *gin.Context, pid string, sid string, apis *service_dto.BindApis) error {
- return i.module.SortApis(ctx, pid, sid, apis)
-}
-
-func (i *imlServiceController) ServiceDoc(ctx *gin.Context, pid string, sid string) (*service_dto.ServiceDoc, error) {
- return i.module.ServiceDoc(ctx, pid, sid)
-}
-
-func (i *imlServiceController) SaveServiceDoc(ctx *gin.Context, pid string, sid string, input *service_dto.SaveServiceDoc) error {
- return i.module.SaveServiceDoc(ctx, pid, sid, input)
-}
-
-func (i *imlServiceController) Get(ctx *gin.Context, pid string, sid string) (*service_dto.Service, error) {
- return i.module.Get(ctx, pid, sid)
-}
-
-func (i *imlServiceController) Search(ctx *gin.Context, keyword string, pid string) ([]*service_dto.ServiceItem, error) {
- return i.module.Search(ctx, keyword, pid)
-}
-
-func (i *imlServiceController) Create(ctx *gin.Context, pid string, input *service_dto.CreateService) (*service_dto.Service, error) {
- return i.module.Create(ctx, pid, input)
-}
-
-func (i *imlServiceController) Edit(ctx *gin.Context, pid string, sid string, input *service_dto.EditService) (*service_dto.Service, error) {
- return i.module.Edit(ctx, pid, sid, input)
-}
-
-func (i *imlServiceController) Delete(ctx *gin.Context, pid string, sid string) error {
- return i.module.Delete(ctx, pid, sid)
-}
-
-func (i *imlServiceController) Enable(ctx *gin.Context, pid string, sid string) error {
- return i.module.Enable(ctx, pid, sid)
-}
-
-func (i *imlServiceController) Disable(ctx *gin.Context, pid string, sid string) error {
- return i.module.Disable(ctx, pid, sid)
+func (i *imlServiceController) SaveServiceDoc(ctx *gin.Context, pid string, input *service_dto.SaveServiceDoc) error {
+ return i.module.SaveServiceDoc(ctx, pid, input)
}
diff --git a/controller/service/service.go b/controller/service/service.go
index 770741f..23fc1e5 100644
--- a/controller/service/service.go
+++ b/controller/service/service.go
@@ -1,29 +1,18 @@
package service
import (
- "github.com/gin-gonic/gin"
"reflect"
+ "github.com/gin-gonic/gin"
+
service_dto "github.com/eolinker/apipark/module/service/dto"
"github.com/eolinker/go-common/autowire"
)
type IServiceController interface {
- Get(ctx *gin.Context, pid string, sid string) (*service_dto.Service, error)
- Search(ctx *gin.Context, keyword string, pid string) ([]*service_dto.ServiceItem, error)
- Create(ctx *gin.Context, pid string, input *service_dto.CreateService) (*service_dto.Service, error)
- Edit(ctx *gin.Context, pid string, sid string, input *service_dto.EditService) (*service_dto.Service, error)
- Delete(ctx *gin.Context, pid string, sid string) error
- Enable(ctx *gin.Context, pid string, sid string) error
- Disable(ctx *gin.Context, pid string, sid string) error
- ServiceDoc(ctx *gin.Context, pid string, sid string) (*service_dto.ServiceDoc, error)
- SaveServiceDoc(ctx *gin.Context, pid string, sid string, input *service_dto.SaveServiceDoc) error
- ServiceApis(ctx *gin.Context, pid string, sid string) ([]*service_dto.ServiceApi, error)
- BindServiceApi(ctx *gin.Context, pid string, sid string, apis *service_dto.BindApis) error
- UnbindServiceApi(ctx *gin.Context, pid string, sid string, api string) error
- SortApis(ctx *gin.Context, pid string, sid string, apis *service_dto.BindApis) error
- SimpleList(ctx *gin.Context, pid string) ([]*service_dto.SimpleItem, error)
+ ServiceDoc(ctx *gin.Context, pid string) (*service_dto.ServiceDoc, error)
+ SaveServiceDoc(ctx *gin.Context, pid string, input *service_dto.SaveServiceDoc) error
}
func init() {
diff --git a/controller/upstream/iml.go b/controller/upstream/iml.go
index 96416aa..936ebb4 100644
--- a/controller/upstream/iml.go
+++ b/controller/upstream/iml.go
@@ -1,7 +1,7 @@
package upstream
import (
- "github.com/eolinker/apipark/module/partition"
+ "github.com/eolinker/apipark/module/cluster"
"github.com/eolinker/apipark/module/project"
"github.com/eolinker/apipark/module/upstream"
upstream_dto "github.com/eolinker/apipark/module/upstream/dto"
@@ -13,9 +13,9 @@ var (
)
type imlUpstreamController struct {
- upstreamModule upstream.IUpstreamModule `autowired:""`
- projectModule project.IProjectModule `autowired:""`
- partitionModule partition.IPartitionModule `autowired:""`
+ upstreamModule upstream.IUpstreamModule `autowired:""`
+ projectModule project.IProjectModule `autowired:""`
+ partitionModule cluster.IClusterModule `autowired:""`
}
func (i *imlUpstreamController) Get(ctx *gin.Context, pid string) (upstream_dto.UpstreamConfig, error) {
diff --git a/frontend/README.md b/frontend/README.md
index 5fea0bb..921d7f2 100644
--- a/frontend/README.md
+++ b/frontend/README.md
@@ -1,3 +1,9 @@
+
# 部署
## 安装依赖
diff --git a/frontend/README.pro.md b/frontend/README.pro.md
new file mode 100644
index 0000000..e080d34
--- /dev/null
+++ b/frontend/README.pro.md
@@ -0,0 +1,21 @@
+# 部署
+
+## 代码同步
+ packages目录下,部分子项目为企业版独有,不要同步到开源版:
+ packages/businessEntry, packages/dashboard, packages/openApi, packages/systemRunning, README.pro.md
+
+## 安装依赖
+ 建议使用pnpm
+ `npm install -g pnpm`
+ 使用pnpm安装依赖
+ `pnpm install`
+
+## 编译
+### 开源版本
+ 仅编译管理后台(打包目录为dist):`pnpm run build`
+ 仅编译租户端(打包目录为tenant_dist):`pnpm run build:tenant`
+ 同时编译管理后台和租户端:`pnpm run build:all`
+### 企业版本
+ 仅编译管理后台(打包目录为dist):`pnpm run build:pro`
+ 仅编译租户端(租户端暂时不区分企业版和开源版,打包目录为tenant_dist):`pnpm run build:tenant`
+ 同时编译管理后台和租户端:`pnpm run build:pro:all`
\ No newline at end of file
diff --git a/frontend/package.json b/frontend/package.json
index 24e1e8a..d2c6462 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,4 +1,3 @@
-
{
"name": "frontend",
"version": "1.0.0",
@@ -9,12 +8,15 @@
"description": "",
"scripts": {
"test": "jest",
- "build:all": "set NODE_OPTIONS=--max-old-space-size=16384 && lerna run build --stream",
- "build": "set NODE_OPTIONS=--max-old-space-size=4096 && node -e \"console.log(v8.getHeapStatistics().heap_size_limit / 1024 / 1024)\"&& lerna run build --scope=core --stream --verbose ",
+ "build:all": "set NODE_OPTIONS=--max-old-space-size=16384 && lerna run build --scope=core --scope=market --stream",
+ "build:pro:all": "set NODE_OPTIONS=--max-old-space-size=16384 && lerna run build --scope=businessEntry --scope=market --stream",
+ "build": "set NODE_OPTIONS=--max-old-space-size=4096 && lerna run build --scope=core --stream --verbose ",
+ "build:pro": "set NODE_OPTIONS=--max-old-space-size=4096 && lerna run build --scope=business-entry --stream --verbose ",
"build:tenant": "set NODE_OPTIONS=--max-old-space-size=16384 && lerna run build --scope=market --stream",
"serve": "lerna run preview --parallel",
"serve:remotes": "lerna run serve --scope=remote --parallel",
"dev": "lerna run dev --scope=core --stream",
+ "dev:pro": "lerna run dev --scope=business-entry --stream",
"dev:tenant": "lerna run dev --scope=market --stream",
"stop": "kill-port --port 5000,5001"
},
@@ -34,13 +36,15 @@
"js-base64": "^3.7.5",
"moment": "^2.29.4",
"postcss": "^8.4.31",
+ "postcss-import": "^16.1.0",
"postcss-nesting": "^12.1.5",
"react": "^18.2.0",
"react-ace": "^10.1.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.20.0",
"tailwindcss": "^3.3.5",
- "uuid": "^9.0.1"
+ "uuid": "^9.0.1",
+ "vite-tsconfig-paths": "^4.3.2"
},
"devDependencies": {
"@ant-design/cssinjs": "^1.18.2",
diff --git a/frontend/packages/businessEntry/.env b/frontend/packages/businessEntry/.env
new file mode 100644
index 0000000..35f2ce9
--- /dev/null
+++ b/frontend/packages/businessEntry/.env
@@ -0,0 +1,10 @@
+###
+ # @Date: 2024-07-12 13:53:03
+ # @LastEditors: maggieyyy
+ # @LastEditTime: 2024-07-12 18:26:34
+ # @FilePath: \frontend\packages\core\.env.business
+###
+// .env.pro
+VITE_APP_MODE=pro
+VITE_APP_TITLE=My Production App
+VITE_API_BASE_URL=https://api.production.example.com
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/.eslintrc.cjs b/frontend/packages/businessEntry/.eslintrc.cjs
new file mode 100644
index 0000000..87e6dac
--- /dev/null
+++ b/frontend/packages/businessEntry/.eslintrc.cjs
@@ -0,0 +1,18 @@
+module.exports = {
+ root: true,
+ env: { browser: true, es2020: true },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:react-hooks/recommended',
+ ],
+ ignorePatterns: ['dist', '.eslintrc.cjs','public','code-snippet','ace-editor'],
+ parser: '@typescript-eslint/parser',
+ plugins: ['react-refresh'],
+ rules: {
+ 'react-refresh/only-export-components': [
+ 'warn',
+ { allowConstantExport: true },
+ ],
+ },
+}
diff --git a/frontend/packages/businessEntry/.gitignore b/frontend/packages/businessEntry/.gitignore
new file mode 100644
index 0000000..c564772
--- /dev/null
+++ b/frontend/packages/businessEntry/.gitignore
@@ -0,0 +1,26 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+public/tinymce
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
diff --git a/frontend/packages/businessEntry/README.md b/frontend/packages/businessEntry/README.md
new file mode 100644
index 0000000..38866cf
--- /dev/null
+++ b/frontend/packages/businessEntry/README.md
@@ -0,0 +1,11 @@
+# `businessEntry`
+
+> TODO: description
+
+## Usage
+
+```
+const businessEntry = require('businessEntry');
+
+// TODO: DEMONSTRATE API
+```
diff --git a/frontend/packages/businessEntry/__tests__/businessEntry.test.js b/frontend/packages/businessEntry/__tests__/businessEntry.test.js
new file mode 100644
index 0000000..46213a5
--- /dev/null
+++ b/frontend/packages/businessEntry/__tests__/businessEntry.test.js
@@ -0,0 +1,7 @@
+'use strict';
+
+const businessEntry = require('..');
+const assert = require('assert').strict;
+
+assert.strictEqual(businessEntry(), 'Hello from businessEntry');
+console.info('businessEntry tests passed');
diff --git a/frontend/packages/businessEntry/index.html b/frontend/packages/businessEntry/index.html
new file mode 100644
index 0000000..71bb310
--- /dev/null
+++ b/frontend/packages/businessEntry/index.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+ APIPark - 企业API数据开放平台
+
+
+
+
+
+
+
+
diff --git a/frontend/packages/businessEntry/package.json b/frontend/packages/businessEntry/package.json
new file mode 100644
index 0000000..9db872f
--- /dev/null
+++ b/frontend/packages/businessEntry/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "business-entry",
+ "private": true,
+ "version": "0.0.0",
+ "type": "module",
+ "scripts": {
+ "dev": " vite --port 5000 --strictPort",
+ "build": "vite build ",
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
+ "preview": "vite preview --port 5000 --strictPort",
+ "serve": "vite preview --port 5000 --strictPort"
+ },
+ "dependencies": {
+ },
+ "devDependencies": {
+ }
+}
diff --git a/frontend/packages/businessEntry/postcss.config.js b/frontend/packages/businessEntry/postcss.config.js
new file mode 100644
index 0000000..6921594
--- /dev/null
+++ b/frontend/packages/businessEntry/postcss.config.js
@@ -0,0 +1,15 @@
+/*
+ * @Date: 2023-11-27 17:31:54
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-06-05 10:42:18
+ * @FilePath: \frontend\packages\core\postcss.config.js
+ */
+export default {
+ plugins: {
+ 'postcss-import': {},
+ 'tailwindcss/nesting': {},
+ tailwindcss: {},
+ autoprefixer: {}
+ },
+ }
+
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/public/favicon.ico b/frontend/packages/businessEntry/public/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..2c1de84c3cae0948b4b90c0376d3440ef481a47e
GIT binary patch
literal 32038
zcmeHQca&6RvY&U({{7DW^UgbG-`ibw&1pd-#~I>~1q2D=ki(D$7;+LMM?obD2n&e%
zkOh_C0=l4xN)ixIf*BEzna=6nTkrR)dv7y@9(n>{&h|a0>7MQzzN)Xjs`{#aRivf;
zN80bwe*gP4yq8Ps`@6KXMrmnj<;vNAZ@~BO;JXSHoWCDPOKbmMX=&-{_TLZJOG~qA
zq@_KKYj7&=V1JLdG~70A?|<4a{Tu(ty>ghA$k#uL_2pTSNbH7DS$STGy}MhC&yI*#
zIQP24+VrtlBbSLe^c6AYtQUzH@iTaBsLKcmG{_QPt@aXGhTm~m1@2>wTrTE_C1T_(
zkXXN25}UbN%!4Py*mqb${a%nj3Le?qL4+r@h2A7X9(MC8JiK0kMnZNCQ17h}{Sk$m6vm&E@z_8yR6v)-_4
zy(G{G_Jy{M`j+;s>eCY2@vr!~i9T54VdqA_Ce|p}Y|=gqb{n?W7&upAeWpun3dVNs
zClS-UdW$G{zJ0F*+YXjMQ#_kCxqcV5%f4E8cD2^FeeE;)>NN>IS%Y4|vu&Gi=DsS%
zkcDClnkTXB+4}rw)(aBtIay-!*GcTH9TIzEtAt0*lVGd;bzBzQZS=ZT8h@
zBi<^ore);$wE_3GEwq&4bqT*G(AcZhb!bLXuS6F!7>{EWnAuaZ#HeiCenXE*Pw
z&ki)iv+Kb&*LfCvZ)^Jom0+V`X9J_AUwu%5Pu8~2G2gG+{u1O)`QC4)#ClATSnhlg
z*x>jPiArSfbkN;LeVIU`ZuXqRuPDfOPsJvnzlp>Sd>Owq;fHWktPQ*1FU=Dpn?BPF
ziFL=bM=liWyI*d&EV5t?=DUY8=g&KH4&Org4*#NJQ}H~}K!W3Di`+!sZ@3}9fIL};
zzY+8A+r?b=4>7mzgMZ_>@l>q!(0~^q>!3T%ch0%X_vYfM&{#ZGnv41Kjbp#@hDH0v
z*!d}Z*RELWHs9&b=~|<2RH+4MZzB1R)syh@bw#^z5@%aiJQB$4&6;Cud~84}&~v3p6Wy_-M&B7qi=
zdFnX&!PIe_^J-k@nDdI6>L2>M3{2WLO?q&!BavxKB>*3qI?hM^t~%~%_@$ilOkL~w
zPhmfB{OhD|o9v0k=SLkK=kT5T4|mSF7pTxk`5v4&=UN?|>;nor5Bet9XM(NUuh(&W
zHugaIkJT4X4eUqqZn9nryLS@5nI}$5pl)Y8|2gbIuJYYe*;#9U1MLshk?^WFlek;a
zPl;{bsrKBT0o#K86ZbLhTBCl?f26MXI%JFG^%wo-NnBy<`9l0P@Lbv!SI6m`gYQ`D
z`488T*q;4K+^Kk{SYDs_n{;=cO?k&!rfFUAipMGLPsJ(jo)=1OJvBU~cA$SLA2-GCy1t`QIuQ!(^Um96Tch{q&6
zF6P_uQpOC&AU5d64w19d7#ib;0};C%_Oh6p_ue!|nCRZtFP9`dV6p@mUuufDW@dM1
z{MdVQ59Y=;5pN02S)MSTVe<3c<;sjo3WSB%*Barnecn7KjMnyy(>42IlD1$j-7FD#$U6M`$haY
znl(wHgXV~_ahF)`DrPRGu;a9nN>D??nI
z8=*=u3Z>aPC|QwizTr$U5W6@pv}li*7vKjW;pA>hPYiZRSJ${ffT-w#Gtk
z80#P9Ein;HI7^}BPxYG#8c`peyb7J8w
z@b1LoZMmV$BTk3Bu^p3lEP5?60teq_tqP`k*9!6Un4in8BlJJ
zv*5Z#-k&)G^4{F}xd?1g{6Gwuc!F@}5fW;V?Zon(csk{#p(FF@h&R0N3mAcZEdFq?m;Jq8Oa%A4au`_=2XgvuIn_Q?)NJtOyA&k|(unPHt
zxpv+Fd^cQ~?*@6#njpr!wIY`j#{{Fu9|baCpW=BGN9Hxo=#0Gvb4ggQh%tLBLT;GX
zDBn=L^`4d3S0#wGGB0ubTQTRpA;xgb0dXchr>We;hC>If+#=Qm_(C_rTjFeqy|o?V
zhmF0du4HT+V`rQeSP|+Qd+dlAK3H4AudNp=SU@J@cP-)v=s@!b=3?7^F}LgybN2zU
z&ishHOCk1;kHE7-L#9ihK5`jNkUt|f1u<5i+F0hXDD%)alpDsl8FOTe9dhGs+)1oU
z;LY7SnD1pChP=mm)m%&i=$mv$-w@}bx)Qu6-lY;{9&!VHPuYoX-f_1^uFtiQ%LsKH
zg|WjwAm5q0bZxBW5W#!OJmp4n8yNeOjV15Cni3c|POOWU?%w#ZUx>WENdoCzRNtuF
zWFRM^`o@V-Q|9A#3cP1t=&=ms2wF+>gInjLZzpl)@oyy90XQ)F!(YquZ{Jp`8Y>cR>FFv%p*UPhy0Ac;{Y*lLvAc-+Fyy^U%aT=-4Uq)HfLWBk9nW4J5p7
zW1+rl(t{|$i8}sQ*Mk4g+GBV0jpoqf`i3&kd@{!V1ay75suJik5fbPr
zuQCt0;d*@xV}G!w_<9e&ierGjA&%jpx{~*&%HpllR-#+)uAME6C&czdH*OREb2(~X^Zr~x
z^8Qj;JhfX(a4cd)$4=f|U0>MX-QOTf#E}_ao&YZLki-rmmIWPejk{xI4yjUswcZ=mPl$KDGsDKkm5j!11S!qIFRB%+2BAZ
zB69jCv34I3YvW!ao=1Cze1uw6;39?ilG|}0cTHSpZ2h|unZ8s)LucSMO~TU_NqFU3
zVtjE_1idzH>+u~hm#p_*3e4*4w}D$l?KLoz#L}2E-wg?!+t>y)0t4%>3%a$2mzWpe
z0O}y8RjsY~Dz*?`l{ONd01V$(r<1Csj3v`!fEeo&--|VWBXD=bn*x7V5I0L4-UwhI
zhXa2K45!ID?7qM|F2?!5JC^8R4r#^P$l(Fk30!KRDR6GYr7F&i^fNDpyee}`b(xby
zexrP*geIf^!S}a*b~KswaxqV=*MZ3%OS~;#q@R2Meo}i5VE&2!1cp-k_7DR~9t;Ma
zZ^e5h!dw`i9Fk!B9K{n~gAG;O4dz~HcXQ!RUJ!X?U%gJidA}
z39vK7aAVhDuY*L_Z7wPKVhw<<8~-}!hTJRW8T7|7+wAq>V9rT9WgdMu
z6ib-|8$;gvMTrcUA(7m95}v$7qLUX(
zWEgPdSz~~~1`a#Z!IC$Ju1D`KyAFZaq;I}(f?)QQi-kIDzR-J
zi@9|#?7}9A4w)sP#-O!c4+%A5-2!N5Pned#bfZ5CZJulE6mP~gub6b3cIv#Vv^)4A
z$i3!gi6KIMKfDAO<`N#(V)%3uSAlNKdAvrZfZP+eKG4P8J9FO`>%Irpebz+ne`g&5
z*12H)27F`-wN$0<`tI=n@`*k{T#)RaPEm&v-Q2w
zPr0YgBPKvG4Zwe)hl&5${-x8)&6*
zaYkOASQNz^VywTG0@fDwb>^B6VB>JV!7q!Y`VRE7*N@IUXdeLDS?|JikD8rm7rW
zu^K)|VOVacePi=(tzlp-K!|;TnmTJ9^=f|LyR~-)X{W8PWn)DZH>W+C91IlkTc`_A
zOvQtBw6{X+qkYNQ+XC}((~q=G=YJFHwJln+VGM+St#sRRueCmI?Eo;gg>f|BYi`L+@qV
z^?vS}S37@o%@@QkDTax-Js0P!v_tNJAM-p^Tl`r$VjMnRT9jXVpG&A6{OFJv%QlNK
zaXI7w_8z+4pza@!o}Vi=!lLw1d@I%$(2e`CKR9?wtW)2i
zwheP$g!l)sE3D%PHnMdc>DPJ!Vl`Puli}F9o9KJRSySh6-2*d79GJgT|FYB91okkt
z;}g_@z^8${b8i#WeI3@j?(3-U9o$|VGYPrJ{zh?=YU>=_C-ADC^mY>a7j#}3Im|Cl
zN*I2AfO?PgtF42rZ$N#Axp%Pj_P&mIQD@Dg_Ehy9@qbzimLYktcfs-SQ*T4xu-n2;
z#x-6;KeAdK9X|(lp4f2Odir?uaVhg$^R)A>e@lJOdLZh2$~`f&z*>77cb3?G>@k5E
zzUL441B_L&FPGLMpg)uPx72y*sHs5g!mbGc{oL2kzXw)WZ5?a5NI&Z@ff>$wxR!XT
zwUp58#adT;&(n?pT9>X!WcCWX28rvP{;i|$RPJ4zaZLxKPCLiiP4({_J5Q`Paj)g7
zi@#@X>G*kfh`gWsL}Gx~}}OlK46eK<^3UyON2gmLeU+x)tkqJ~@cG%^cBumHK#~ojoDBucf|M
z+PUtXI2LrC`u416qmM(m=f3{229o#J>JnaoTw7_>Ul)s@qFuyVnDE4fm~-?MVGOSk
z=N(tg`&Fh|?x}Go0J@z)NzoouoeNf*0HN~6pjKuaGxMQO)>4VtsIl5+(Q$Gip
z*PNA`x3Tv&eqHxi^Xzwyp4YnWx#r!y4RzlAkbB5}a2jHdd5ABRk;DA%C-hxj9PhtN
zeIH;9)AjGQ_Lp$7Eqa(kGpdyY(c8Tze*
z=IZ>6<+!!}1>+gq-%#$+Psi>>jXCGMvo7w>RmD@YwM5o!!n#NPvofef5P0?Y9+Dvca{x5?(CDoljj)J5PIud8f|H`%884w(l#kPk|*X|fL3~cUj+nY0`&rh`
zU-|Fy;;q$M^H
zC9?fP^ak`Mx>K3{-tu@+C;p)Xrz{kI|BwArc(%qJ-Dr|ExQAcl(8uY38N|
ipW;A@11S!qIFRB%iUTPQq&Sci2hbiMb^IH1;Qs;bQdW}y
literal 0
HcmV?d00001
diff --git a/frontend/packages/businessEntry/public/iconpark_apinto.js b/frontend/packages/businessEntry/public/iconpark_apinto.js
new file mode 100644
index 0000000..d125a4a
--- /dev/null
+++ b/frontend/packages/businessEntry/public/iconpark_apinto.js
@@ -0,0 +1,8 @@
+/*
+ * @Date: 2024-05-06 09:47:27
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-05-06 09:47:47
+ * @FilePath: \frontend\packages\core\src\assets\iconpark_apinto.js
+ */
+(function(){window.__iconpark__=window.__iconpark__||{};var obj=JSON.parse("{\"680840\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"content\":\"\"},\"680856\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680857\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680858\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680859\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680860\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680861\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680862\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680863\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680864\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680865\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680866\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680867\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680868\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680869\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680870\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680871\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680872\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680873\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680874\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680875\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680876\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680877\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680878\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680879\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680880\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680881\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680882\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680883\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680884\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680885\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680886\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680887\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680888\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680889\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680890\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680891\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680892\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680893\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680894\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680895\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680896\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680897\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680898\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680899\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680900\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680901\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680902\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680903\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680904\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680905\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680906\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680907\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680908\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680909\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680910\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680911\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680912\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680913\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680914\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680915\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680916\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680917\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680918\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680919\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680920\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680921\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680922\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680923\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680924\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680925\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680926\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680927\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680928\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680929\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680930\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680931\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680932\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680933\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680934\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680935\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680936\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680937\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680938\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"680939\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"681014\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"681015\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"681016\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"681017\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"681018\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"681019\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"currentColor\",\"content\":\"\"},\"681787\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"content\":\"\"},\"694557\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"694558\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707431\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707736\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707739\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707741\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707742\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707743\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707744\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"707749\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"708142\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"708144\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"708145\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"708146\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"708147\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"708181\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"709715\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"808898\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"808900\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"808916\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"810363\":{\"viewBox\":\"0 0 20 20\",\"fill\":\"none\",\"content\":\"\"},\"810396\":{\"viewBox\":\"0 0 20 20\",\"fill\":\"none\",\"content\":\"\"},\"818250\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"818340\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"content\":\"\"}}");for(var _k in obj){window.__iconpark__[_k] = obj[_k]};var nm={"fuzhi1":680840,"bianji":680856,"tishi":680857,"xinkaibiaoqian":680858,"bianjiyoujian":680859,"suoyou":680860,"fuzhi":680861,"shijian":680862,"gundongxuanze":680863,"guanbi":680864,"zanting":680865,"chenggong":680866,"chakanyinyong":680867,"guidang":680868,"tihuan":680869,"zhankai":680870,"duankailianjie":680871,"Cookieguanli":680872,"riqi":680873,"zhongwen":680874,"yingwen":680875,"shuaxinjiankongzhuangtai":680876,"rili":680877,"genmulu":680878,"shangxianguanli":680879,"daimashili":680880,"yingyong":680881,"tianjia-2":680882,"qingchu":680883,"daoru":680884,"xiala":680885,"kuaisuceshi-2":680886,"saoyisao":680887,"shiyongjiaocheng":680888,"tianjiafujian":680889,"xiazai":680890,"jinzhidengji":680891,"fasongyoujian":680892,"bug":680893,"chaping":680894,"kuaisuceshi":680895,"yunshangchuan":680896,"yunxiazai":680897,"sousuo":680898,"peizhi":680899,"xinchuangkoudakai":680900,"shanchu-2":680901,"quanjusuoxiao":680902,"qiehuan":680903,"jianshao":680904,"chakanAPIlishi":680905,"lianjie":680906,"dunpaibaoxianrenzheng":680907,"shaixuan":680908,"zhihang":680909,"congmobanzhongchuangjianyongli":680910,"zhengligeshi":680911,"haoping":680912,"shouqi-2":680913,"gouwuche":680914,"lishi":680915,"tianjiaziji":680916,"tianjia":680917,"shouqi":680918,"gailan":680919,"paixu":680920,"gengduo":680921,"guanliyuanrenzheng":680922,"fenxiang":680923,"shanchu":680924,"yidong":680925,"chakan":680926,"shujuku":680927,"shangyoufuwu-":680928,"huanyuangeshi":680929,"jiangxu":680930,"shengxu":680931,"quanjufangda":680932,"xuanzhong":680933,"riqiqujian":680934,"ditu-1":680935,"qunzu":680936,"daochu":680937,"zhankai-":680938,"ditu-2":680939,"Eolink":681014,"APISpace":681015,"Apinto":681016,"json":681017,"webhook":681018,"linux":681019,"xinzengfenzu":681787,"circle-right-up":694557,"circle-right-down":694558,"APIjiekou-7mme3dcg":707431,"connection-box":707736,"system":707739,"form-one":707741,"yingyong-7mmhj11e":707742,"jiankongshexiangtou":707743,"file-cabinet":707744,"network-tree":707749,"search":708142,"find":708144,"circle-right-up-7mnlo5g9":708145,"circle-right-down-7mnlphn2":708146,"reduce-one":708147,"tool":708181,"shangxianguanli-new":709715,"hamburger-button":808898,"puzzle":808900,"keyline":808916,"daohang":810363,"lanjieqiguanli":810396,"shop":818250,"xiangmu":818340};for(var _i in nm){window.__iconpark__[_i] = obj[nm[_i]]}})();"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);(()=>{"use strict";var t={816:(t,e,i)=>{var s,r,o,n;i.d(e,{Vm:()=>z,dy:()=>P,Jb:()=>x,Ld:()=>$,sY:()=>T,YP:()=>A});const l=globalThis.trustedTypes,a=l?l.createPolicy("lit-html",{createHTML:t=>t}):void 0,h=`lit$${(Math.random()+"").slice(9)}$`,c="?"+h,d=`<${c}>`,u=document,p=(t="")=>u.createComment(t),v=t=>null===t||"object"!=typeof t&&"function"!=typeof t,f=Array.isArray,y=t=>{var e;return f(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,b=/>/g,S=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,w=/'/g,k=/"/g,E=/^(?:script|style|textarea)$/i,C=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),P=C(1),A=C(2),x=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,T=(t,e,i)=>{var s,r;const o=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let n=o._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new H(e.insertBefore(p(),t),t,void 0,i)}return n.I(t),n},R=u.createTreeWalker(u,129,null,!1),_=(t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"":"");return[void 0!==a?a.createHTML(l):l,s]};class N{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const n=t.length-1,a=this.parts,[d,u]=_(t,e);if(this.el=N.createElement(d,i),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=R.nextNode())&&a.length0){s.textContent=l?l.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this.H=Array(i.length-1).fill($),this.strings=i):this.H=$}get tagName(){return this.element.tagName}I(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=U(this,t,e,0),o=!v(t)||t!==this.H&&t!==x,o&&(this.H=t);else{const s=t;let n,l;for(t=r[0],n=0;n{i.r(e),i.d(e,{customElement:()=>s,eventOptions:()=>a,property:()=>o,query:()=>h,queryAll:()=>c,queryAssignedNodes:()=>v,queryAsync:()=>d,state:()=>n});const s=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e),r=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function o(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):r(t,e)}function n(t){return o({...t,state:!0,attribute:!1})}const l=({finisher:t,descriptor:e})=>(i,s)=>{var r;if(void 0===s){const s=null!==(r=i.originalKey)&&void 0!==r?r:i.key,o=null!=e?{kind:"method",placement:"prototype",key:s,descriptor:e(i.key)}:{...i,key:s};return null!=t&&(o.finisher=function(e){t(e,s)}),o}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,s,e(s)),null==t||t(r,s)}};function a(t){return l({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}function h(t,e){return l({descriptor:i=>{const s={get(){var e;return null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;s.get=function(){var i;return void 0===this[e]&&(this[e]=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t)),this[e]}}return s}})}function c(t){return l({descriptor:e=>({get(){var e;return null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t)},enumerable:!0,configurable:!0})})}function d(t){return l({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}const u=Element.prototype,p=u.msMatchesSelector||u.webkitMatchesSelector;function v(t="",e=!1,i=""){return l({descriptor:s=>({get(){var s,r;const o="slot"+(t?`[name=${t}]`:":not([name])");let n=null===(r=null===(s=this.renderRoot)||void 0===s?void 0:s.querySelector(o))||void 0===r?void 0:r.assignedNodes({flatten:e});return n&&i&&(n=n.filter((t=>t.nodeType===Node.ELEMENT_NODE&&(t.matches?t.matches(i):p.call(t,i))))),n},enumerable:!0,configurable:!0})})}},23:(t,e,i)=>{i.r(e),i.d(e,{unsafeSVG:()=>l});const s=t=>(...e)=>({_$litDirective$:t,values:e});var r=i(816);class o extends class{constructor(t){}T(t,e,i){this.Σdt=t,this.M=e,this.Σct=i}S(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){if(super(t),this.vt=r.Ld,2!==t.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===r.Ld)return this.Vt=void 0,this.vt=t;if(t===r.Jb)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.vt)return this.Vt;this.vt=t;const e=[t];return e.raw=e,this.Vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}o.directiveName="unsafeHTML",o.resultType=1,s(o);class n extends o{}n.directiveName="unsafeSVG",n.resultType=2;const l=s(n)},249:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>n,LitElement:()=>x,ReactiveElement:()=>b,UpdatingElement:()=>A,_Σ:()=>s.Vm,_Φ:()=>$,adoptStyles:()=>c,css:()=>h,defaultConverter:()=>y,getCompatibleStyle:()=>d,html:()=>s.dy,noChange:()=>s.Jb,notEqual:()=>m,nothing:()=>s.Ld,render:()=>s.sY,supportsAdoptingStyleSheets:()=>r,svg:()=>s.YP,unsafeCSS:()=>l});var s=i(816);const r=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol();class n{constructor(t,e){if(e!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return r&&void 0===this.t&&(this.t=new CSSStyleSheet,this.t.replaceSync(this.cssText)),this.t}toString(){return this.cssText}}const l=t=>new n(t+"",o),a=new Map,h=(t,...e)=>{const i=e.reduce(((e,i,s)=>e+(t=>{if(t instanceof n)return t.cssText;if("number"==typeof t)return t;throw Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[s+1]),t[0]);let s=a.get(i);return void 0===s&&a.set(i,s=new n(i,o)),s},c=(t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style");i.textContent=e.cssText,t.appendChild(i)}))},d=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t;var u,p,v,f;const y={toAttribute(t,e){switch(e){case Boolean:t=t?"":null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:m};class b extends HTMLElement{constructor(){super(),this.Πi=new Map,this.Πo=void 0,this.Πl=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.Πh=null,this.u()}static addInitializer(t){var e;null!==(e=this.v)&&void 0!==e||(this.v=[]),this.v.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this.Πp(i,e);void 0!==s&&(this.Πm.set(s,i),t.push(s))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this.Πm=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static Πp(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this.Πg=new Promise((t=>this.enableUpdating=t)),this.L=new Map,this.Π_(),this.requestUpdate(),null===(t=this.constructor.v)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this.ΠU)&&void 0!==e?e:this.ΠU=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this.ΠU)||void 0===e||e.splice(this.ΠU.indexOf(t)>>>0,1)}Π_(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this.Πi.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})),this.Πl&&(this.Πl(),this.Πo=this.Πl=void 0)}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})),this.Πo=new Promise((t=>this.Πl=t))}attributeChangedCallback(t,e,i){this.K(t,i)}Πj(t,e,i=g){var s,r;const o=this.constructor.Πp(t,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(r=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==r?r:y.toAttribute)(e,i.type);this.Πh=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this.Πh=null}}K(t,e){var i,s,r;const o=this.constructor,n=o.Πm.get(t);if(void 0!==n&&this.Πh!==n){const t=o.getPropertyOptions(n),l=t.converter,a=null!==(r=null!==(s=null===(i=l)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof l?l:null)&&void 0!==r?r:y.fromAttribute;this.Πh=n,this[n]=a(e,t.type),this.Πh=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this.L.has(t)||this.L.set(t,e),!0===i.reflect&&this.Πh!==t&&(void 0===this.Πk&&(this.Πk=new Map),this.Πk.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this.Πg=this.Πq())}async Πq(){this.isUpdatePending=!0;try{for(await this.Πg;this.Πo;)await this.Πo}catch(t){Promise.reject(t)}const t=this.performUpdate();return null!=t&&await t,!this.isUpdatePending}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this.Πi&&(this.Πi.forEach(((t,e)=>this[e]=t)),this.Πi=void 0);let e=!1;const i=this.L;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this.Π$()}catch(t){throw e=!1,this.Π$(),t}e&&this.E(i)}willUpdate(t){}E(t){var e;null===(e=this.ΠU)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}Π$(){this.L=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Πg}shouldUpdate(t){return!0}update(t){void 0!==this.Πk&&(this.Πk.forEach(((t,e)=>this.Πj(e,this[e],t))),this.Πk=void 0),this.Π$()}updated(t){}firstUpdated(t){}}var S,w,k,E,C,P;b.finalized=!0,b.shadowRootOptions={mode:"open"},null===(p=(u=globalThis).reactiveElementPlatformSupport)||void 0===p||p.call(u,{ReactiveElement:b}),(null!==(v=(f=globalThis).reactiveElementVersions)&&void 0!==v?v:f.reactiveElementVersions=[]).push("1.0.0-rc.1");const A=b;(null!==(S=(P=globalThis).litElementVersions)&&void 0!==S?S:P.litElementVersions=[]).push("3.0.0-rc.1");class x extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();super.update(t),this.Φt=(0,s.sY)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!1)}render(){return s.Jb}}x.finalized=!0,x._$litElement$=!0,null===(k=(w=globalThis).litElementHydrateSupport)||void 0===k||k.call(w,{LitElement:x}),null===(C=(E=globalThis).litElementPlatformSupport)||void 0===C||C.call(E,{LitElement:x});const $={K:(t,e,i)=>{t.K(e,i)},L:t=>t.L}},409:function(t,e,i){var s=this&&this.__decorate||function(t,e,i,s){var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};Object.defineProperty(e,"__esModule",{value:!0}),e.IconparkIconElement=void 0;const r=i(249),o=i(26),n=i(23),l={color:1,fill:1,stroke:1},a={STROKE:{trackAttr:"data-follow-stroke",rawAttr:"stroke"},FILL:{trackAttr:"data-follow-fill",rawAttr:"fill"}};class h extends r.LitElement{constructor(){super(...arguments),this.name="",this.identifyer="",this.size="1em"}get _width(){return this.width||this.size}get _height(){return this.height||this.size}get _stroke(){return this.stroke||this.color}get _fill(){return this.fill||this.color}get SVGConfig(){return(window.__iconpark__||{})[this.identifyer]||(window.__iconpark__||{})[this.name]||{viewBox:"0 0 0 0",content:""}}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.monkeyPatch("STROKE",!0),this.monkeyPatch("FILL",!0)}))}monkeyPatch(t,e){switch(t){case"STROKE":this.updateDOMByHand(this.strokeAppliedNodes,"STROKE",this._stroke,!!e);break;case"FILL":this.updateDOMByHand(this.fillAppliedNodes,"FILL",this._fill,!!e)}}updateDOMByHand(t,e,i,s){!i&&s||t&&t.forEach((t=>{i&&i===t.getAttribute(a[e].rawAttr)||t.setAttribute(a[e].rawAttr,i||t.getAttribute(a[e].trackAttr))}))}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"name"===t||"identifyer"===t?setTimeout((()=>{this.monkeyPatch("STROKE"),this.monkeyPatch("FILL")})):l[t]&&(this.monkeyPatch("STROKE"),this.monkeyPatch("FILL"))}render(){return r.svg``}}h.styles=r.css`:host {display: inline-flex; align-items: center; justify-content: center;} :host([spin]) svg {animation: iconpark-spin 1s infinite linear;} :host([spin][rtl]) svg {animation: iconpark-spin-rtl 1s infinite linear;} :host([rtl]) svg {transform: scaleX(-1);} @keyframes iconpark-spin {0% { -webkit-transform: rotate(0); transform: rotate(0);} 100% {-webkit-transform: rotate(360deg); transform: rotate(360deg);}} @keyframes iconpark-spin-rtl {0% {-webkit-transform: scaleX(-1) rotate(0); transform: scaleX(-1) rotate(0);} 100% {-webkit-transform: scaleX(-1) rotate(360deg); transform: scaleX(-1) rotate(360deg);}}`,s([o.property({reflect:!0})],h.prototype,"name",void 0),s([o.property({reflect:!0,attribute:"icon-id"})],h.prototype,"identifyer",void 0),s([o.property({reflect:!0})],h.prototype,"color",void 0),s([o.property({reflect:!0})],h.prototype,"stroke",void 0),s([o.property({reflect:!0})],h.prototype,"fill",void 0),s([o.property({reflect:!0})],h.prototype,"size",void 0),s([o.property({reflect:!0})],h.prototype,"width",void 0),s([o.property({reflect:!0})],h.prototype,"height",void 0),s([o.queryAll(`[${a.STROKE.trackAttr}]`)],h.prototype,"strokeAppliedNodes",void 0),s([o.queryAll(`[${a.FILL.trackAttr}]`)],h.prototype,"fillAppliedNodes",void 0),e.IconparkIconElement=h,customElements.get("iconpark-icon")||customElements.define("iconpark-icon",h)}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(409)})();
+
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/public/iconpark_eolink.js b/frontend/packages/businessEntry/public/iconpark_eolink.js
new file mode 100644
index 0000000..5c7f639
--- /dev/null
+++ b/frontend/packages/businessEntry/public/iconpark_eolink.js
@@ -0,0 +1,7 @@
+/*
+ * @Date: 2024-05-06 09:53:45
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-05-06 09:53:50
+ * @FilePath: \frontend\packages\core\src\assets\iconpark_eolink.js
+ */
+(function(){window.__iconpark__=window.__iconpark__||{};var obj=JSON.parse("{\"647367\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"684408\":{\"viewBox\":\"0 0 194 194\",\"content\":\"\"},\"684409\":{\"viewBox\":\"0 0 194 194\",\"content\":\"\"},\"684411\":{\"viewBox\":\"0 0 119.19 102.5\",\"content\":\"\"},\"684412\":{\"viewBox\":\"0 0 108.55 93.99\",\"fill\":\"currentColor\",\"content\":\"\"},\"684413\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"684414\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"686740\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686741\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686742\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686743\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686744\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686745\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686746\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686747\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686748\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686749\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686750\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686751\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686752\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686753\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686754\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"686993\":{\"viewBox\":\"0 0 38.22 22.18\",\"fill\":\"currentColor\",\"content\":\"\"},\"687741\":{\"viewBox\":\"0 0 194 194\",\"content\":\"\"},\"687742\":{\"viewBox\":\"0 0 194 194\",\"content\":\"\"},\"691262\":{\"viewBox\":\"0 0 194 194\",\"content\":\"\"},\"691537\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"691538\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"691806\":{\"viewBox\":\"0 0 194 194\",\"content\":\"\"},\"695738\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695739\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695740\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695741\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695742\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695743\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695746\":{\"viewBox\":\"0 0 1185 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"695747\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695748\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695750\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"695751\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"695752\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"695754\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"695755\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"695756\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"695758\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695759\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695760\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695761\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695762\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695763\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695764\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695801\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695802\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695803\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695804\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695805\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695806\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695807\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695810\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695811\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695812\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695817\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695818\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695819\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695820\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695821\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695822\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695828\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695829\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695830\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695831\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695833\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695834\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695835\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695836\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695837\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695838\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695839\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695840\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695841\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695842\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695844\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695845\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695846\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695865\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695867\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695868\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695869\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695870\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695876\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695877\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695878\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695883\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695884\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695886\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695887\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695888\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695889\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695890\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695891\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695892\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695893\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695896\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695899\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695900\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695901\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695902\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695903\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695904\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695905\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695906\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695907\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695908\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695909\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695913\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695914\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695915\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695916\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695933\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695934\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695935\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695936\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695938\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695940\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695941\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695942\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695944\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695945\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695946\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695947\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695948\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695950\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695951\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695953\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695954\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695955\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695956\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695957\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695958\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695959\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695960\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695961\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695962\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695963\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695964\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695966\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695967\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695968\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695969\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695971\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695972\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695973\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695975\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695978\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695979\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695980\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695981\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695982\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695984\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695985\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695986\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695987\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695988\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695990\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695993\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695995\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695997\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"695999\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696002\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696003\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696004\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696005\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696007\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696009\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696010\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696011\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696012\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696013\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696014\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696015\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696016\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696017\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696018\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696019\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696020\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696021\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696022\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696023\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696024\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696025\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696027\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696028\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696029\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696030\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696031\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696032\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696033\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696034\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696035\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696036\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696037\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696038\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696039\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696040\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696041\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696042\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696043\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696044\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696045\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696046\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696048\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696049\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696660\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"696661\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"744163\":{\"viewBox\":\"0 0 1024 1024\",\"fill\":\"currentColor\",\"content\":\"\"},\"744173\":{\"viewBox\":\"0 0 128 128\",\"fill\":\"none\",\"content\":\"\"},\"744175\":{\"viewBox\":\"0 0 128 128\",\"fill\":\"none\",\"content\":\"\"},\"750656\":{\"viewBox\":\"0 0 61 61\",\"fill\":\"none\",\"content\":\"\"},\"752737\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"756392\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757321\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757499\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757504\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757518\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757519\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757520\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757521\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757616\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"757650\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"767277\":{\"viewBox\":\"0 0 20 20\",\"fill\":\"none\",\"content\":\"\"},\"767278\":{\"viewBox\":\"0 0 20 20\",\"fill\":\"none\",\"content\":\"\"},\"775549\":{\"viewBox\":\"0 0 18 14\",\"fill\":\"none\",\"content\":\"\"},\"779333\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"content\":\"\"},\"779418\":{\"viewBox\":\"0 0 1024 1024\",\"content\":\"\"},\"779705\":{\"viewBox\":\"0 0 20 20\",\"fill\":\"none\",\"content\":\"\"},\"779706\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"content\":\"\"},\"787702\":{\"viewBox\":\"0 0 1024 1024\",\"content\":\"\"},\"788577\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"802334\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"804269\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"804612\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"804614\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"806103\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"813707\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"815901\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"820089\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"826687\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"854318\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"855246\":{\"viewBox\":\"0 0 16 16\",\"fill\":\"none\",\"content\":\"\"},\"855247\":{\"viewBox\":\"0 0 16 16\",\"fill\":\"none\",\"content\":\"\"},\"855248\":{\"viewBox\":\"0 0 16 16\",\"fill\":\"none\",\"content\":\"\"},\"855927\":{\"viewBox\":\"0 0 83 20\",\"fill\":\"none\",\"content\":\"\"},\"855928\":{\"viewBox\":\"0 0 68 24\",\"fill\":\"none\",\"content\":\"\"},\"855929\":{\"viewBox\":\"0 0 66 24\",\"fill\":\"none\",\"content\":\"\"},\"855938\":{\"viewBox\":\"0 0 198 72\",\"fill\":\"none\",\"content\":\"\"},\"857931\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"857985\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"861388\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"876705\":{\"viewBox\":\"0 0 16 16\",\"fill\":\"none\",\"content\":\"\"},\"884011\":{\"viewBox\":\"0 0 20 20\",\"fill\":\"none\",\"content\":\"\"},\"885387\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"897026\":{\"viewBox\":\"0 0 250 250\",\"fill\":\"none\",\"content\":\"\"},\"915485\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"929257\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"932197\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"949128\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"970590\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"973801\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"985435\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1002903\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"content\":\"\"},\"1021623\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1021686\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1035721\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1035737\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1037074\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1037815\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1037816\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1037817\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1039918\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1042170\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"1042171\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"}}");for(var _k in obj){window.__iconpark__[_k] = obj[_k]};var nm={"round-fill":647367,"apinto-pro-icon":684408,"apinto-icon":684409,"apinto-pro":684411,"apinto":684412,"check-circle":684413,"apispace":684414,"auto-generate-api":686740,"compare-api":686741,"multi-protocal":686742,"read-good":686743,"richdoc":686744,"mockapi":686745,"script-support":686746,"diy-test":686747,"send":686748,"stereo-perspective":686749,"automatic-robot":686750,"switch-env":686751,"flash":686752,"chart-pie":686753,"date-drive":686754,"apistudio":686993,"postcat-icon":687741,"postcat":687742,"apistudio-icon":691262,"update-rotation":691537,"page":691538,"apispace-icon":691806,"avatar":695738,"people":695739,"people-minus":695740,"people-plus":695741,"peoples":695742,"user-business":695743,"folder-close-fill":695746,"windows":695747,"github":695748,"qq":695750,"browser-chrome":695751,"linux":695752,"edge":695754,"wechat":695755,"browser":695756,"gitlab":695758,"apple":695759,"alipay":695760,"facebook":695761,"twitter":695762,"paypal":695763,"new-lark":695764,"delete":695801,"return":695802,"search":695803,"import":695804,"export":695805,"add":695806,"add-child":695807,"file-addition":695810,"add-circle":695811,"minus":695812,"close":695817,"close-small":695818,"check-small":695819,"check":695820,"code-terminal":695821,"code":695822,"preview-open":695828,"preview-close":695829,"folder-close":695830,"folder-open":695831,"upload":695833,"download":695834,"copy":695835,"upload-file":695836,"compare":695837,"edit":695838,"share":695839,"share-all":695840,"share-url-fill":695841,"share-url":695842,"back":695844,"back-fill":695845,"share-fill":695846,"sort":695865,"filter":695867,"reduce":695868,"done-all":695869,"full-selection":695870,"right-bar":695876,"left-bar":695877,"direction-adjustment":695878,"down-small":695883,"left-small":695884,"right-small":695886,"right-one":695887,"right":695888,"up":695889,"up-one":695890,"up-small":695891,"up-two":695892,"down-two":695893,"enter":695896,"down":695899,"left":695900,"down-one":695901,"left-two":695902,"right-two":695903,"left-one":695904,"more":695905,"expand-left":695906,"expand-right":695907,"column":695908,"center-alignment":695909,"list-add":695913,"sort-amount-down":695914,"sort-amount-up":695915,"list":695916,"remind":695933,"close-remind":695934,"api":695935,"rocket":695936,"monitor":695938,"robot":695940,"plan":695941,"application":695942,"chart-proportion":695944,"data":695945,"chart-line":695946,"pie-10":695947,"pie":695948,"chart-bubble":695950,"cube":695951,"application-menu":695953,"crown":695954,"crown-fill":695955,"market":695956,"file-word":695957,"file-excel":695958,"hashtag-key":695959,"file-hash":695960,"refresh":695961,"order":695962,"command":695963,"branch":695964,"page-template":695966,"smart-optimization":695967,"assembly-line":695968,"stopwatch":695969,"checklist":695971,"menu-fold":695972,"menu-unfold":695973,"alarm":695975,"protection":695978,"caution":695979,"openapi":695980,"webhook":695981,"holding-hands":695982,"support":695984,"agreement":695985,"community":695986,"roadmap":695987,"family-7knl2ae1":695988,"smiling-face":695990,"play-fill":695993,"play":695995,"pause":695997,"magic":695999,"whole-site-accelerator":696002,"link-cloud-faild":696003,"link-cloud-sucess":696004,"translate":696005,"funds":696007,"unhappy-face":696009,"message":696010,"connection-arrow":696011,"loading":696012,"fork":696013,"quote":696014,"headset":696015,"attention":696016,"theme":696017,"keyboard":696018,"briefcase":696019,"star":696020,"star-7knmka28":696021,"protect":696022,"finance":696023,"setting":696024,"link":696025,"undo":696027,"inbox-success":696028,"home":696029,"local":696030,"laptop":696031,"view-list":696032,"lock":696033,"unlock":696034,"lightning":696035,"file-text":696036,"cooperative-handshake":696037,"navigation":696038,"view-grid-detail":696039,"help":696040,"history":696041,"logout-7knnioon":696042,"chinese":696043,"calendar":696044,"play-cycle":696045,"world":696046,"plugins":696048,"link-cloud":696049,"book":696660,"table-report":696661,"qiyeweixin":744163,"Oauth":744173,"dingding":744175,"eolink":750656,"tool":752737,"category-management":756392,"folder-code-one":757321,"link-three-8ah7lifn":757499,"download-two-8ah85008":757504,"quanjusuoxiao1":757518,"quanjufangda21":757519,"quanjusuoxiao211":757520,"quanjufangda1":757521,"wenjianshezhi":757616,"key":757650,"zidingyijiaoben":767277,"tiqubianliang":767278,"mock":775549,"tongzhishezhi":779333,"csdn":779418,"ceshibaogao":779705,"biangengtongzhi":779706,"icon-api":787702,"youjian":788577,"pushpin":802334,"announcement":804269,"collapse-text-input":804612,"zhankai":804614,"replay-music":806103,"download-web":813707,"permissions":815901,"file-editing":820089,"wallet":826687,"file-focus":854318,"pingpu-9a913n0n":855246,"zuoyoufenping-9a913n1f":855247,"shangxiafenping-9a913n1i":855248,"Paypal11":855927,"zhifubaozhifu1":855928,"weixinzhifu11":855929,"weixinzhifu":855938,"update-rotation-9and40f5":857931,"terminal":857985,"switch":861388,"zhinengrucan":876705,"biaoqian-banbenleixinzeng":884011,"book-open":885387,"morentouxiang-2":897026,"xiajia":915485,"drag":929257,"new-up":932197,"rss":949128,"yewuchangjing":970590,"newlybuild":973801,"bianji":985435,"jiekoushouquan":1002903,"interfacefenzutubiao":1021623,"yidong":1021686,"link-one":1035721,"canshugouzaoqi":1035737,"bianliang":1037074,"tars":1037815,"if":1037816,"tars-2":1037817,"yingyongguanxi":1039918,"save-one":1042170,"save":1042171};for(var _i in nm){window.__iconpark__[_i] = obj[nm[_i]]}})();"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);(()=>{"use strict";var t={816:(t,e,i)=>{var s,r,o,n;i.d(e,{Vm:()=>z,dy:()=>P,Jb:()=>x,Ld:()=>$,sY:()=>T,YP:()=>A});const l=globalThis.trustedTypes,a=l?l.createPolicy("lit-html",{createHTML:t=>t}):void 0,h=`lit$${(Math.random()+"").slice(9)}$`,c="?"+h,d=`<${c}>`,u=document,p=(t="")=>u.createComment(t),v=t=>null===t||"object"!=typeof t&&"function"!=typeof t,f=Array.isArray,y=t=>{var e;return f(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,b=/>/g,S=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,w=/'/g,k=/"/g,E=/^(?:script|style|textarea)$/i,C=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),P=C(1),A=C(2),x=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,T=(t,e,i)=>{var s,r;const o=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let n=o._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new H(e.insertBefore(p(),t),t,void 0,i)}return n.I(t),n},R=u.createTreeWalker(u,129,null,!1),_=(t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"":"");return[void 0!==a?a.createHTML(l):l,s]};class N{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const n=t.length-1,a=this.parts,[d,u]=_(t,e);if(this.el=N.createElement(d,i),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=R.nextNode())&&a.length0){s.textContent=l?l.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this.H=Array(i.length-1).fill($),this.strings=i):this.H=$}get tagName(){return this.element.tagName}I(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=U(this,t,e,0),o=!v(t)||t!==this.H&&t!==x,o&&(this.H=t);else{const s=t;let n,l;for(t=r[0],n=0;n{i.r(e),i.d(e,{customElement:()=>s,eventOptions:()=>a,property:()=>o,query:()=>h,queryAll:()=>c,queryAssignedNodes:()=>v,queryAsync:()=>d,state:()=>n});const s=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e),r=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function o(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):r(t,e)}function n(t){return o({...t,state:!0,attribute:!1})}const l=({finisher:t,descriptor:e})=>(i,s)=>{var r;if(void 0===s){const s=null!==(r=i.originalKey)&&void 0!==r?r:i.key,o=null!=e?{kind:"method",placement:"prototype",key:s,descriptor:e(i.key)}:{...i,key:s};return null!=t&&(o.finisher=function(e){t(e,s)}),o}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,s,e(s)),null==t||t(r,s)}};function a(t){return l({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}function h(t,e){return l({descriptor:i=>{const s={get(){var e;return null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;s.get=function(){var i;return void 0===this[e]&&(this[e]=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t)),this[e]}}return s}})}function c(t){return l({descriptor:e=>({get(){var e;return null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t)},enumerable:!0,configurable:!0})})}function d(t){return l({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}const u=Element.prototype,p=u.msMatchesSelector||u.webkitMatchesSelector;function v(t="",e=!1,i=""){return l({descriptor:s=>({get(){var s,r;const o="slot"+(t?`[name=${t}]`:":not([name])");let n=null===(r=null===(s=this.renderRoot)||void 0===s?void 0:s.querySelector(o))||void 0===r?void 0:r.assignedNodes({flatten:e});return n&&i&&(n=n.filter((t=>t.nodeType===Node.ELEMENT_NODE&&(t.matches?t.matches(i):p.call(t,i))))),n},enumerable:!0,configurable:!0})})}},23:(t,e,i)=>{i.r(e),i.d(e,{unsafeSVG:()=>l});const s=t=>(...e)=>({_$litDirective$:t,values:e});var r=i(816);class o extends class{constructor(t){}T(t,e,i){this.Σdt=t,this.M=e,this.Σct=i}S(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){if(super(t),this.vt=r.Ld,2!==t.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===r.Ld)return this.Vt=void 0,this.vt=t;if(t===r.Jb)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.vt)return this.Vt;this.vt=t;const e=[t];return e.raw=e,this.Vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}o.directiveName="unsafeHTML",o.resultType=1,s(o);class n extends o{}n.directiveName="unsafeSVG",n.resultType=2;const l=s(n)},249:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>n,LitElement:()=>x,ReactiveElement:()=>b,UpdatingElement:()=>A,_Σ:()=>s.Vm,_Φ:()=>$,adoptStyles:()=>c,css:()=>h,defaultConverter:()=>y,getCompatibleStyle:()=>d,html:()=>s.dy,noChange:()=>s.Jb,notEqual:()=>m,nothing:()=>s.Ld,render:()=>s.sY,supportsAdoptingStyleSheets:()=>r,svg:()=>s.YP,unsafeCSS:()=>l});var s=i(816);const r=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol();class n{constructor(t,e){if(e!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return r&&void 0===this.t&&(this.t=new CSSStyleSheet,this.t.replaceSync(this.cssText)),this.t}toString(){return this.cssText}}const l=t=>new n(t+"",o),a=new Map,h=(t,...e)=>{const i=e.reduce(((e,i,s)=>e+(t=>{if(t instanceof n)return t.cssText;if("number"==typeof t)return t;throw Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[s+1]),t[0]);let s=a.get(i);return void 0===s&&a.set(i,s=new n(i,o)),s},c=(t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style");i.textContent=e.cssText,t.appendChild(i)}))},d=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t;var u,p,v,f;const y={toAttribute(t,e){switch(e){case Boolean:t=t?"":null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:m};class b extends HTMLElement{constructor(){super(),this.Πi=new Map,this.Πo=void 0,this.Πl=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.Πh=null,this.u()}static addInitializer(t){var e;null!==(e=this.v)&&void 0!==e||(this.v=[]),this.v.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this.Πp(i,e);void 0!==s&&(this.Πm.set(s,i),t.push(s))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this.Πm=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static Πp(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this.Πg=new Promise((t=>this.enableUpdating=t)),this.L=new Map,this.Π_(),this.requestUpdate(),null===(t=this.constructor.v)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this.ΠU)&&void 0!==e?e:this.ΠU=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this.ΠU)||void 0===e||e.splice(this.ΠU.indexOf(t)>>>0,1)}Π_(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this.Πi.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})),this.Πl&&(this.Πl(),this.Πo=this.Πl=void 0)}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})),this.Πo=new Promise((t=>this.Πl=t))}attributeChangedCallback(t,e,i){this.K(t,i)}Πj(t,e,i=g){var s,r;const o=this.constructor.Πp(t,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(r=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==r?r:y.toAttribute)(e,i.type);this.Πh=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this.Πh=null}}K(t,e){var i,s,r;const o=this.constructor,n=o.Πm.get(t);if(void 0!==n&&this.Πh!==n){const t=o.getPropertyOptions(n),l=t.converter,a=null!==(r=null!==(s=null===(i=l)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof l?l:null)&&void 0!==r?r:y.fromAttribute;this.Πh=n,this[n]=a(e,t.type),this.Πh=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this.L.has(t)||this.L.set(t,e),!0===i.reflect&&this.Πh!==t&&(void 0===this.Πk&&(this.Πk=new Map),this.Πk.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this.Πg=this.Πq())}async Πq(){this.isUpdatePending=!0;try{for(await this.Πg;this.Πo;)await this.Πo}catch(t){Promise.reject(t)}const t=this.performUpdate();return null!=t&&await t,!this.isUpdatePending}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this.Πi&&(this.Πi.forEach(((t,e)=>this[e]=t)),this.Πi=void 0);let e=!1;const i=this.L;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this.Π$()}catch(t){throw e=!1,this.Π$(),t}e&&this.E(i)}willUpdate(t){}E(t){var e;null===(e=this.ΠU)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}Π$(){this.L=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Πg}shouldUpdate(t){return!0}update(t){void 0!==this.Πk&&(this.Πk.forEach(((t,e)=>this.Πj(e,this[e],t))),this.Πk=void 0),this.Π$()}updated(t){}firstUpdated(t){}}var S,w,k,E,C,P;b.finalized=!0,b.shadowRootOptions={mode:"open"},null===(p=(u=globalThis).reactiveElementPlatformSupport)||void 0===p||p.call(u,{ReactiveElement:b}),(null!==(v=(f=globalThis).reactiveElementVersions)&&void 0!==v?v:f.reactiveElementVersions=[]).push("1.0.0-rc.1");const A=b;(null!==(S=(P=globalThis).litElementVersions)&&void 0!==S?S:P.litElementVersions=[]).push("3.0.0-rc.1");class x extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();super.update(t),this.Φt=(0,s.sY)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!1)}render(){return s.Jb}}x.finalized=!0,x._$litElement$=!0,null===(k=(w=globalThis).litElementHydrateSupport)||void 0===k||k.call(w,{LitElement:x}),null===(C=(E=globalThis).litElementPlatformSupport)||void 0===C||C.call(E,{LitElement:x});const $={K:(t,e,i)=>{t.K(e,i)},L:t=>t.L}},409:function(t,e,i){var s=this&&this.__decorate||function(t,e,i,s){var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};Object.defineProperty(e,"__esModule",{value:!0}),e.IconparkIconElement=void 0;const r=i(249),o=i(26),n=i(23),l={color:1,fill:1,stroke:1},a={STROKE:{trackAttr:"data-follow-stroke",rawAttr:"stroke"},FILL:{trackAttr:"data-follow-fill",rawAttr:"fill"}};class h extends r.LitElement{constructor(){super(...arguments),this.name="",this.identifyer="",this.size="1em"}get _width(){return this.width||this.size}get _height(){return this.height||this.size}get _stroke(){return this.stroke||this.color}get _fill(){return this.fill||this.color}get SVGConfig(){return(window.__iconpark__||{})[this.identifyer]||(window.__iconpark__||{})[this.name]||{viewBox:"0 0 0 0",content:""}}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.monkeyPatch("STROKE",!0),this.monkeyPatch("FILL",!0)}))}monkeyPatch(t,e){switch(t){case"STROKE":this.updateDOMByHand(this.strokeAppliedNodes,"STROKE",this._stroke,!!e);break;case"FILL":this.updateDOMByHand(this.fillAppliedNodes,"FILL",this._fill,!!e)}}updateDOMByHand(t,e,i,s){!i&&s||t&&t.forEach((t=>{i&&i===t.getAttribute(a[e].rawAttr)||t.setAttribute(a[e].rawAttr,i||t.getAttribute(a[e].trackAttr))}))}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"name"===t||"identifyer"===t?setTimeout((()=>{this.monkeyPatch("STROKE"),this.monkeyPatch("FILL")})):l[t]&&(this.monkeyPatch("STROKE"),this.monkeyPatch("FILL"))}render(){return r.svg``}}h.styles=r.css`:host {display: inline-flex; align-items: center; justify-content: center;} :host([spin]) svg {animation: iconpark-spin 1s infinite linear;} :host([spin][rtl]) svg {animation: iconpark-spin-rtl 1s infinite linear;} :host([rtl]) svg {transform: scaleX(-1);} @keyframes iconpark-spin {0% { -webkit-transform: rotate(0); transform: rotate(0);} 100% {-webkit-transform: rotate(360deg); transform: rotate(360deg);}} @keyframes iconpark-spin-rtl {0% {-webkit-transform: scaleX(-1) rotate(0); transform: scaleX(-1) rotate(0);} 100% {-webkit-transform: scaleX(-1) rotate(360deg); transform: scaleX(-1) rotate(360deg);}}`,s([o.property({reflect:!0})],h.prototype,"name",void 0),s([o.property({reflect:!0,attribute:"icon-id"})],h.prototype,"identifyer",void 0),s([o.property({reflect:!0})],h.prototype,"color",void 0),s([o.property({reflect:!0})],h.prototype,"stroke",void 0),s([o.property({reflect:!0})],h.prototype,"fill",void 0),s([o.property({reflect:!0})],h.prototype,"size",void 0),s([o.property({reflect:!0})],h.prototype,"width",void 0),s([o.property({reflect:!0})],h.prototype,"height",void 0),s([o.queryAll(`[${a.STROKE.trackAttr}]`)],h.prototype,"strokeAppliedNodes",void 0),s([o.queryAll(`[${a.FILL.trackAttr}]`)],h.prototype,"fillAppliedNodes",void 0),e.IconparkIconElement=h,customElements.get("iconpark-icon")||customElements.define("iconpark-icon",h)}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(409)})();
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/public/vite.svg b/frontend/packages/businessEntry/public/vite.svg
new file mode 100644
index 0000000..e7b8dfb
--- /dev/null
+++ b/frontend/packages/businessEntry/public/vite.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/src/App.tsx b/frontend/packages/businessEntry/src/App.tsx
new file mode 100644
index 0000000..225862b
--- /dev/null
+++ b/frontend/packages/businessEntry/src/App.tsx
@@ -0,0 +1,153 @@
+/*
+ * @Date: 2023-11-27 17:18:27
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-07-12 19:54:26
+ * @FilePath: \frontend\packages\businessEntry\src\App.tsx
+ */
+import '@core/App.css'
+import { ConfigProvider } from 'antd';
+import RenderRoutes from '@businessEntry/components/aoplatform/RenderRoutes';
+import {BreadcrumbProvider} from "@common/contexts/BreadcrumbContext.tsx";
+import { StyleProvider } from '@ant-design/cssinjs';
+import zhCN from 'antd/locale/zh_CN';
+import useInitializeMonaco from "@common/hooks/useInitializeMonaco";
+
+const antdComponentThemeToken = {
+ token: {
+ // Seed Token,影响范围大
+ colorPrimary: '#7371fc',
+ colorLink:'#7371fc',
+ colorBorder:'#ededed',
+ colorText:'#333',
+ borderRadius: 4,
+ // 派生变量,影响范围小
+ colorBgContainer: '#fff',
+ colorPrimaryBg:'#EBEEF2',
+ colorTextQuaternary:'#BBB',
+ colorTextTertiary:'#999'
+ },
+ components:{
+ // 派生变量,影响范围小
+ Input:{
+ activeShadow:'none'
+ },
+ Select:{
+ activeShadow:'none'
+ },
+ Checkbox:{
+ activeShadow:'none'
+ },
+ Cascader:{
+ activeShadow:'none',
+ optionSelectedBg:'#EBEEF2',
+ optionHoverBg:'#EBEEF2'
+ },
+ Layout: {
+ bodyBg: '#fff',
+ headerBg: '#fff',
+ headerColor: '#333',
+ headerHeight: 50,
+ headerPadding: '10 20px',
+ lightSiderBg: '#fff',
+ siderBg: '#fff',
+ },
+ Breadcrumb:{
+ itemColor:'#666',
+ linkColor:'#666',
+ lastItemColor:'#333',
+ },
+ Table:{
+ headerBorderRadius:0,
+ headerSplitColor:'#ededed',
+ borderColor:'#ededed',
+ cellPaddingBlockMD:'10px',
+ cellPaddingInlineMD:'12px',
+ cellPaddingBlockSM:'8px',
+ cellPaddingInlineSM:'12px',
+ headerFilterHoverBg:'#EBEEF2',
+ headerSortActiveBg:'#F7F8FA',
+ headerSortHoverBg:'#F7F8FA',
+ fixedHeaderSortActiveBg:'#F7F8FA',
+ headerBg:'#F7F8FA',
+ rowHoverBg:'#EBEEF2'
+
+ },
+ Segmented:{
+ itemColor:'#333',
+ itemSelectedColor:'#333',
+ trackBg:'#f7f8fa',
+ trackPadding:0,
+ // itemHoverColor:'#EBEEF2',
+ itemActiveBg:'#EBEEF2',
+ itemHoverBg:'#EBEEF2',
+ itemSelectedBg:'#EBEEF2',
+ },
+ Tree:{
+ // titleHeight:30,
+ // fontSize:12,
+ directoryNodeSelectedBg:'#EBEEF2',
+ directoryNodeSelectedColor:'#333',
+ nodeSelectedBg:'#EBEEF2',
+ nodeHoverBg:'#EBEEF2'
+ },
+ Collapse:{
+ headerBg:'#f7f8fa',
+ headerPadding:"12px",
+ contentPadding:"0 10px 12px 10px"
+ },
+ Button:{
+ // paddingInline:8,
+ dangerShadow:'none',
+ defaultShadow:'none',
+ primaryShadow:'none'
+ },
+ Tabs:{
+ cardBg:'#EBEEF2',
+ cardHeight:42,
+ horizontalItemGutter:8,
+ horizontalItemPaddingSM:'12px 8px 8px 8px',
+ horizontalItemPadding:'12px 8px 8px 8px',
+ },
+ Menu:{
+ // itemBg:'#F7F8FA',
+ // subMenuItemBg:'#F7F8FA',
+ // itemMarginBlock:0,
+ // activeBarBorderWidth:0,
+ // itemSelectedColor:'#333',
+ // itemSelectedBg:'#EBEEF2',
+ // itemHoverBg:'#EBEEF2'
+ },
+ List:{
+ itemPadding:'8px 0'
+ },
+ Form:{
+ itemMarginBottom:10,
+
+ },
+ Alert:{
+ defaultPadding:'12px 16px'
+ },
+ Tag:{
+ defaultBg:"#f7f8fa"
+ },
+ }
+}
+
+function App() {
+ useInitializeMonaco()
+
+ return (
+
+
+
+
+
+
+
+ );
+}
+
+export default App
diff --git a/frontend/packages/businessEntry/src/components/aoplatform/RenderRoutes.tsx b/frontend/packages/businessEntry/src/components/aoplatform/RenderRoutes.tsx
new file mode 100644
index 0000000..01c1d6b
--- /dev/null
+++ b/frontend/packages/businessEntry/src/components/aoplatform/RenderRoutes.tsx
@@ -0,0 +1,533 @@
+/*
+ * @Date: 2024-06-04 08:54:24
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-07-12 19:55:47
+ * @FilePath: \frontend\packages\businessEntry\src\components\aoplatform\RenderRoutes.tsx
+ */
+import { BrowserRouter as Router, Routes, Route, Navigate, Outlet } from 'react-router-dom';
+import Login from "@core/pages/Login.tsx"
+import BasicLayout from '@common/components/aoplatform/BasicLayout';
+import {createElement, ReactElement,ReactNode,Suspense} from 'react';
+import { v4 as uuidv4 } from 'uuid'
+import {App, Skeleton} from "antd";
+import ApprovalPage from "@core/pages/approval/ApprovalPage.tsx";
+import {SystemProvider} from "@core/contexts/SystemContext.tsx";
+import {useGlobalContext} from "@common/contexts/GlobalStateContext.tsx";
+import {FC,lazy} from 'react';
+import { TeamProvider } from '@core/contexts/TeamContext.tsx';
+import SystemOutlet from '@core/pages/system/SystemOutlet.tsx';
+import { DashboardProvider } from '@core/contexts/DashboardContext.tsx';
+import { PartitionProvider } from '@core/contexts/PartitionContext.tsx';
+import { TenantManagementProvider } from '@market/contexts/TenantManagementContext.tsx';
+
+type RouteConfig = {
+ path:string
+ component?:ReactElement
+ children?:(RouteConfig|false)[]
+ key:string
+ provider?:FC<{ children: ReactNode; }>
+ lazy?:unknown
+}
+const APP_MODE = import.meta.env.VITE_APP_MODE;
+export type RouterParams = {
+ orgId:string
+ teamId:string
+ systemId:string
+ apiId:string
+ serviceId:string
+ partitionId:string
+ clusterId:string;
+ memberGroupId:string
+ userGroupId:string
+ pluginName:string
+ moduleId:string
+ accessType:'project'|'team'|'system'
+ categoryId:string
+ tagId:string
+ dashboardType:string
+ dashboardDetailId:string
+ topologyId:string
+ appId:string
+}
+
+const PUBLIC_ROUTES:RouteConfig[] = [
+ {
+ path:'/',
+ component:,
+ key: uuidv4(),
+ },
+ {
+ path:'/login',
+ component:,
+ key: uuidv4()
+ },
+ {
+ path:'/',
+ component:,
+ key: uuidv4(),
+ children:[
+ {
+ path:'approval/*',
+ component:,
+ key:uuidv4()
+ },
+ {
+ path:'organization/*',
+ component:,
+ key: uuidv4(),
+ children:[
+ {
+ path:'list',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/organization/OrganizationList.tsx'))
+ }
+ ]
+ },
+ {
+ path:'team/*',
+ component:,
+ key: uuidv4(),
+ provider: TeamProvider,
+ children:[
+ {
+ path:'list',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/team/TeamList.tsx'))
+ },
+ {
+ path:'inside/:orgId/:teamId',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/team/TeamInsidePage.tsx')),
+ key: uuidv4(),
+ children:[
+ {
+ path:'member',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/team/TeamInsideMember.tsx')),
+ },
+ {
+ path:'access',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/team/TeamInsideAccess.tsx')),
+ },
+ {
+ path:'setting',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/team/TeamConfig.tsx')),
+ },
+ ]
+ }
+ ]
+ },
+ {
+ path:'system/*',
+ component:,
+ key: uuidv4(),
+ provider: SystemProvider,
+ children:[
+ {
+ path:'list',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemList.tsx')),
+ },
+ {
+ path:'list/:orgId/:teamId',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemList.tsx')),
+ },
+ {
+ path:':orgId/:teamId',
+ component:,
+ key: uuidv4(),
+ children:[
+ {
+ path:'inside/:systemId',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemInsidePage.tsx')),
+ children:[
+ {
+ path:'api',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/api/SystemInsideApiList.tsx')),
+ },
+ {
+ path:'upstream',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/upstream/SystemInsideUpstreamContent.tsx')),
+ },
+ {
+ path:'myService',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/myService/SystemInsideMyService.tsx')),
+ },
+ {
+ path:'subService',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/subSubscribe/SystemInsideSubService.tsx')),
+ children:[
+
+ ]
+ },
+ {
+ path:'subscriber',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemInsideSubscriber.tsx')),
+ children:[
+
+ ]
+ },
+ {
+ path:'approval',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/approval/SystemInsideApproval.tsx')),
+ children:[
+ {
+ path:'*',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/approval/SystemInsideApprovalList.tsx')),
+ }
+ ]
+ },
+ {
+ path:'topology',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemTopology.tsx')),
+ key: uuidv4(),
+ children:[
+ ]
+ },
+ {
+ path:'authority',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/authority/SystemInsideAuthority.tsx')),
+ children:[
+
+ ]
+ },
+ {
+ path:'publish',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/publish/SystemInsidePublish.tsx')),
+ children:[
+ {
+ path:'*',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/publish/SystemInsidePublishList.tsx')),
+ }
+ ]
+ },
+ {
+ path:'access',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemInsideAccess.tsx')),
+ },
+ {
+ path:'member',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemInsideMember.tsx')),
+ },
+ {
+ path:'setting',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/system/SystemConfig.tsx')),
+ children:[
+
+ ]
+ },
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ path:'partition/*',
+ component:,
+ key: uuidv4(),
+ children:[
+ {
+ path:'list',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/partitions/PartitionList.tsx')),
+ },
+ {
+ path:'inside/:partitionId',
+ key: uuidv4(),
+ provider:PartitionProvider,
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/partitions/PartitionInsidePage.tsx')),
+ children:[
+ {
+ path:'cluster',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/partitions/PartitionInsideCluster.tsx')),
+ },
+ {
+ path:'cert',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/partitions/PartitionInsideCert.tsx')),
+ },
+ APP_MODE === 'pro' &&{
+ path:'dashboard_setting',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/partitions/PartitionInsideDashboardSetting.tsx')),
+ },
+ {
+ path:'setting',
+ key: uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/partitions/PartitionConfig.tsx')),
+ },
+ {
+ path:'template/:moduleId',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '../../../../common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx')),
+ key:uuidv4()
+ }
+ ]
+ }
+ ]
+ },
+ {
+ path:'serviceHub',
+ component:,
+ key:uuidv4(),
+ children:[
+ {
+ path:'list',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/ServiceHubList.tsx')),
+ },
+ {
+ path:'detail/:serviceId',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/ServiceHubDetail.tsx')),
+ }]
+ },
+ {
+ path:'servicecategories',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/serviceCategory/ServiceCategory.tsx')),
+ key:uuidv4(),
+ },
+ {
+ path:'tenantManagement',
+ component:,
+ provider:TenantManagementProvider,
+ key:uuidv4(),
+ children:[
+ {
+ path:':teamId/inside/:appId',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/management/ManagementInsidePage.tsx')),
+ children:[
+ {
+ path:'service/:partitionId',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/management/ManagementInsideService.tsx')),
+ },
+ {
+ path:'authorization',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/management/ManagementInsideAuth.tsx')),
+ },
+ {
+ path:'setting',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/management/ManagementAppSetting.tsx')),
+ },
+ ]
+ },
+ {
+ path:'list',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/management/ServiceHubManagement.tsx')),
+ },
+ {
+ path:'list/:teamId',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@market/pages/serviceHub/management/ServiceHubManagement.tsx')),
+ },
+ ]
+ },
+ {
+ path:'member/*',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/member/MemberPage.tsx')),
+ children:[
+ {
+ path:'list',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/member/MemberList.tsx')),
+ },
+ {
+ path:'list/:memberGroupId',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/member/MemberList.tsx')),
+ }
+ ]
+ },
+ {
+ path:'user/*',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/user/UserPage.tsx')),
+ children:[
+ {
+ path:'list',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/user/UserList.tsx')),
+ },
+ {
+ path:'list/:userGroupId',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/user/UserList.tsx')),
+ }
+ ]
+ },
+ {
+ path:'role/*',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/role/RoleList.tsx')),
+ },
+ {
+ path:'access',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/access/AccessPage.tsx')),
+ children:[
+ {
+ path:':accessType',
+ key:uuidv4(),
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/access/AccessList.tsx')),
+ },
+ ]
+ },
+ APP_MODE === 'pro' &&{
+ path:'openapi',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@openApi/pages/OpenApiList.tsx')),
+ key:uuidv4(),
+ },
+ {
+ path:'logretrieval',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/logRetrieval/LogRetrieval.tsx')),
+ key:uuidv4(),
+ },
+ {
+ path:'auditlog',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/auditLog/AuditLog.tsx')),
+ key:uuidv4(),
+ },
+ {
+ path:'assets',
+ component:设计中
,
+ key:uuidv4()
+ },
+ APP_MODE === 'pro' &&{
+ path:'dashboard',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@dashboard/pages/Dashboard.tsx')),
+ key:uuidv4(),
+ children:[
+ {
+ path:':partitionId/:dashboardType',
+ component:,
+ key:uuidv4(),
+ provider:DashboardProvider,
+ children:[
+ {
+ path:'list',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@dashboard/pages/DashboardList.tsx')),
+ key:uuidv4()
+ },
+ {
+ path:'detail/:dashboardDetailId',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@dashboard/pages/DashboardDetail.tsx')),
+ key:uuidv4()
+ },
+ ]
+ },
+ ]
+ },
+ {
+ path:'systemrunning',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@systemRunning/pages/SystemRunning.tsx')),
+ key:uuidv4()
+ },
+ {
+ path:'template/:moduleId',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '../../../../common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx')),
+ key:uuidv4()
+ },
+ {
+ path:'logsettings/*',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/logsettings/LogSettings.tsx')),
+ key: uuidv4(),
+ children:[{
+ path:'template/:moduleId',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '../../../../common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx')),
+ key:uuidv4()
+ }]
+
+ },
+ APP_MODE ==='pro' && {
+ path:'resourcesettings/*',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '@core/pages/resourcesettings/ResourceSettings.tsx')),
+ key: uuidv4(),
+ children:[{
+ path:'template/:moduleId',
+ lazy:lazy(() => import(/* webpackChunkName: "[request]" */ '../../../../common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx')),
+ key:uuidv4()
+ }]
+
+ }
+ ]
+ },
+]
+
+const RenderRoutes = ()=> {
+ return (
+
+
+
+ {generateRoutes(PUBLIC_ROUTES)}
+
+
+
+ )
+}
+
+const generateRoutes = (routerConfig: RouteConfig[]) => {
+ return routerConfig?.map((route: RouteConfig) => {
+ let routeElement;
+ if (route.lazy) {
+ const LazyComponent = route.lazy as React.ExoticComponent;
+
+ routeElement = (
+ }>
+ {route.provider ? (
+ createElement(route.provider, {}, )
+ ) : (
+
+ )}
+
+ );
+ } else {
+ routeElement = route.provider ? (
+ createElement(route.provider, {}, route.component)
+ ) : (
+ route.component
+ );
+ }
+
+ return (
+
+ {route.children && generateRoutes(route.children as RouteConfig[])}
+
+ );
+ }
+ )
+}
+
+// 保护的路由组件
+function ProtectedRoute() {
+ const {state} = useGlobalContext()
+ return state.isAuthenticated? : ;
+ }
+
+export default RenderRoutes
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/src/main.tsx b/frontend/packages/businessEntry/src/main.tsx
new file mode 100644
index 0000000..dd6dede
--- /dev/null
+++ b/frontend/packages/businessEntry/src/main.tsx
@@ -0,0 +1,33 @@
+/*
+ * @Date: 2023-11-27 17:18:27
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-05-29 18:26:15
+ * @FilePath: \frontend\packages\core\src\main.tsx
+ */
+import {StrictMode} from 'react'
+import ReactDOM from 'react-dom/client'
+import App from './App.tsx'
+import '@core/index.css'
+import {GlobalProvider} from "@common/contexts/GlobalStateContext.tsx";
+
+async function initializeApp() {
+ try {
+ // 初始化行为
+ // await fetchInitialConfig(); // 示例:获取初始配置
+
+ // 异步操作完成后,渲染React应用
+ ReactDOM.createRoot(document.getElementById('root')!).render(
+
+
+
+
+ ,
+ );
+ } catch (error) {
+ console.error('Initialization failed:', error);
+ // 处理初始化失败的情况,比如渲染一个错误界面
+ }
+}
+
+// 执行初始化
+initializeApp();
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/src/vite-env.d.ts b/frontend/packages/businessEntry/src/vite-env.d.ts
new file mode 100644
index 0000000..11f02fe
--- /dev/null
+++ b/frontend/packages/businessEntry/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/frontend/packages/businessEntry/start-vite.js b/frontend/packages/businessEntry/start-vite.js
new file mode 100644
index 0000000..f55d1cb
--- /dev/null
+++ b/frontend/packages/businessEntry/start-vite.js
@@ -0,0 +1,22 @@
+/*
+ * @Date: 2024-06-05 09:35:25
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-06-05 10:50:12
+ * @FilePath: \frontend\packages\core\start-vite.js
+ */
+// start-vite.js// start-vite.js
+import { exec } from 'child_process';
+
+const viteProcess = exec('pnpm run build');
+
+viteProcess.stdout.on('data', (data) => {
+ console.log(data.toString());
+});
+
+viteProcess.stderr.on('data', (data) => {
+ console.error(data.toString());
+});
+
+viteProcess.on('close', (code) => {
+ console.log(`Vite process exited with code ${code}`);
+});
diff --git a/frontend/packages/businessEntry/tailwind.config.js b/frontend/packages/businessEntry/tailwind.config.js
new file mode 100644
index 0000000..75a018c
--- /dev/null
+++ b/frontend/packages/businessEntry/tailwind.config.js
@@ -0,0 +1,87 @@
+/*
+ * @Date: 2023-11-27 17:31:44
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-06-05 10:36:46
+ * @FilePath: \frontend\packages\core\tailwind.config.js
+ */
+/** @type {import('tailwindcss').Config} */
+
+export default {
+ important:true,
+ content: [
+ `./index.html`,
+ `../*/src/**/*.{js,ts,jsx,tsx}`,
+
+ ],
+ theme: {
+ extend: {
+ width: {
+ INPUT_NORMAL: '100%',
+ // INPUT_NORMAL: '346px',
+ INPUT_LARGE: '508px',
+ GROUP: '240px',
+ SEARCH: '276px',
+ LOG: '254px'
+ },
+ minHeight:{
+ TEXTAREA:'68px'
+ },
+ borderRadius: {
+ DEFAULT: 'var(--border-radius)',
+ SEARCH_RADIUS: '50px'
+ },
+ boxShadow:{
+ SCROLL: '0 2px 2px #0000000d',
+ SCROLL_TOP:' 0 -2px 2px -2px var(--border-color)'
+ },
+ colors: {
+ DISABLE_BG: 'var(--disabled-background-color)',
+ MAIN_TEXT: 'var(--text-color)',
+ MAIN_HOVER_TEXT: 'var(--text-hover-color)',
+ SECOND_TEXT:'var(--disabled-text-color)',
+ MAIN_BG: 'var(--background-color)',
+ MENU_BG:'var(--MENU-BG-COLOR)',
+ 'bar-theme': 'var(--bar-background-color)',
+ BORDER: 'var(--border-color)',
+ NAVBAR_BTN_BG: 'var(--item-active-background-color)',
+ MAIN_DISABLED_BG: 'var(--disabled-background-color)',
+ theme: 'var(--primary-color)',
+ DESC_TEXT: 'var(--TITLE_TEXT)',
+ HOVER_BG: 'var(--item-hover-background-color)',
+ guide_cluster: '#ee6760',
+ guide_upstream: '#f9a429',
+ guide_api: '#71d24d',
+ guide_publishApi: '#5884ff',
+ guide_final: '#915bf9',
+ table_text: 'var(--table-text-color)',
+ status_success:'#138913',
+ status_fail:"#ff3b30",
+ status_update:"#03a9f4",
+ status_pending:"#ffa500",
+ status_offline:"#8f8e93",
+ A_HOVER:'var(--button-primary-hover-background-color)'
+ },
+ spacing: {
+ mbase: 'var(--FORM_SPAN)',
+ label: '12px', // 选择器和label之间的间距,待删
+ btnbase: 'var(--LAYOUT_MARGIN)', // x方向的间距
+ btnybase: 'var(--LAYOUT_MARGIN)', // y轴方向的间距
+ btnrbase: '20px', // 页面最右侧边距20px
+ formtop: 'var(--FORM_SPAN)',
+ icon: '5px',
+ blockbase: '40px',
+ DEFAULT_BORDER_RADIUS: 'var(--border-radius)',
+ TREE_TITLE:'var(--small-padding) var(--LAYOUT_PADDING);'
+ },
+ borderColor: {
+ 'color-base': 'var(--border-color)'
+ }
+ }
+ },
+ plugins: [],
+ corePlugins: {
+ preflight: false,
+ },
+ }
+
+
\ No newline at end of file
diff --git a/frontend/packages/businessEntry/tsconfig.json b/frontend/packages/businessEntry/tsconfig.json
new file mode 100644
index 0000000..6784501
--- /dev/null
+++ b/frontend/packages/businessEntry/tsconfig.json
@@ -0,0 +1,39 @@
+/*
+ * @Date: 2024-06-04 08:54:17
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-07-12 13:54:42
+ * @FilePath: \frontend\packages\core\tsconfig.json
+ */
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "useDefineForClassFields": true,
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react-jsx",
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": false,
+ "noUnusedParameters": false,
+ "noFallthroughCasesInSwitch": true,
+ "paths": {
+ "@core/*": ["../core/src/*"],
+ "@common/*": ["../common/src/*"],
+ "@market/*": ["../market/src/*"],
+ "@dashboard/*": ["../dashboard/src/*"],
+ "@openApi/*": ["../openApi/src/*"],
+ "@systemRunning/*": ["../systemRunning/src/*"],
+ "@businessEntry/*": ["./src/*"],
+ },
+ },
+ "include": ["src", "public/iconpark_eolink.js", "public/iconpark_apinto.js", "../common/src/component/aoplatform/EditableTableWithModal.tsx", "../common/src/components/aoplatform/TransferTable.tsx", "../common/src/components/aoplatform/TreeWithMore.tsx", "../common/src/components/aoplatform/DatePicker.tsx", "../common/src/components/aoplatform/TimeRangeSelector.tsx", "../common/src/components/aoplatform/TimePicker.tsx", "../common/src/components/aoplatform/MemberTransfer.tsx", "../common/src/components/aoplatform/Navigation.tsx", "../common/src/components/aoplatform/PageList.tsx", "../common/src/components/aoplatform/GroupTree.tsx", "../common/src/components/aoplatform/ErrorBoundary.tsx", "../common/src/components/aoplatform/ScrollableSection.tsx", "../common/src/utils/postcat.tsx", "../common/src/utils/curl.ts", "../common/src/components/aoplatform/ResetPsw.tsx", "../common/src/components/aoplatform/SubscribeApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePageForHub.tsx", "src/components/aoplatform/RenderRoutes.tsx", "../common/src/components/aoplatform/PublishApprovalModalContent.tsx", "../common/src/components/aoplatform/InsidePage.tsx", "../common/src/const/type.ts", "../common/src/components/aoplatform/intelligent-plugin", "../common/src/const/domain"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/frontend/packages/businessEntry/tsconfig.node.json b/frontend/packages/businessEntry/tsconfig.node.json
new file mode 100644
index 0000000..42872c5
--- /dev/null
+++ b/frontend/packages/businessEntry/tsconfig.node.json
@@ -0,0 +1,10 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "skipLibCheck": true,
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/frontend/packages/businessEntry/vite.config.ts b/frontend/packages/businessEntry/vite.config.ts
new file mode 100644
index 0000000..665400c
--- /dev/null
+++ b/frontend/packages/businessEntry/vite.config.ts
@@ -0,0 +1,86 @@
+/*
+ * @Date: 2024-01-31 15:00:39
+ * @LastEditors: maggieyyy
+ * @LastEditTime: 2024-07-12 19:53:09
+ * @FilePath: \frontend\packages\businessEntry\vite.config.ts
+ */
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+import path from 'path'
+import dynamicImportVars from '@rollup/plugin-dynamic-import-vars';
+import tailwindcss from 'tailwindcss';
+import autoprefixer from 'autoprefixer';
+
+export default defineConfig({
+ cacheDir: './node_modules/.vite',
+ build:{
+ outDir:'../../dist',
+ sourcemap: false,
+ chunkSizeWarningLimit: 50000,
+ cacheDir: './node_modules/.vite',
+ output: {
+ manualChunks(id) {
+ if (id.includes('node_modules')) {
+ return id.toString().split('node_modules/')[1].split('/')[0].toString();
+ }
+ // 针对 pnpm 和 Monorepo 特殊处理
+ if (id.includes('.pnpm')) {
+ const segments = id.split(path.sep);
+ const packageName = segments[segments.indexOf('.pnpm') + 1].split('@')[0];
+ return packageName;
+ }
+ }
+ },
+ },
+ css: {
+ postcss: {
+ plugins: [
+ tailwindcss(path.resolve(__dirname, '../common/tailwind.config.js')),
+ autoprefixer
+ ],
+ },
+ preprocessorOptions: {
+ less: {
+ javascriptEnabled: true,
+ },
+ },
+ modules:{
+ localsConvention:"camelCase",
+ generateScopedName:"[local]_[hash:base64:2]"
+ }
+ },
+ plugins: [react(),
+ dynamicImportVars({
+ include:["src"],
+ exclude:[],
+ warnOnError:false
+ }),
+ ],
+ resolve: {
+ alias: [
+ { find: /^~/, replacement: '' },
+ { find: '@common', replacement: path.resolve(__dirname, '../common/src') },
+ { find: '@market', replacement: path.resolve(__dirname, '../market/src') },
+ { find: '@core', replacement: path.resolve(__dirname, '../core/src') },
+ { find: '@dashboard', replacement: path.resolve(__dirname, '../dashboard/src') },
+ { find: '@openApi', replacement: path.resolve(__dirname, '../openApi/src') },
+ { find: '@systemRunning', replacement: path.resolve(__dirname, '../systemRunning/src') },
+ { find: '@businessEntry', replacement: path.resolve(__dirname, './src') },
+ ]
+ },
+ server: {
+ proxy: {
+ '/api/v1': {
+ // target: 'http://uat.apikit.com:11204/mockApi/aoplatform/',
+ target: 'http://172.18.166.219:8288/',
+ changeOrigin: true,
+ },
+ '/api2/v1': {
+ // target: 'http://uat.apikit.com:11204/mockApi/aoplatform/',
+ target: 'http://172.18.166.219:8288/',
+ changeOrigin: true,
+ }
+ }
+ },
+ logLevel:'info'
+})
diff --git a/frontend/packages/common/package.json b/frontend/packages/common/package.json
index 1fef57d..619c752 100644
--- a/frontend/packages/common/package.json
+++ b/frontend/packages/common/package.json
@@ -15,7 +15,6 @@
"@mui/x-data-grid-pro": "6.18.1",
"allotment": "^1.20.0",
"echarts": "^5.5.0",
- "echarts-for-react": "^3.0.2",
"mockjs": "^1.1.0",
"rc-picker": "^4.1.1",
"react-dropzone": "^14.2.3",
diff --git a/frontend/packages/common/src/assets/logo.png b/frontend/packages/common/src/assets/logo.png
index e716b6b0b6c3e42cc58c1fb7e1e5ae0ff62489d1..a6895b8c91e3298fbc5109cb835fece6b48dabf9 100644
GIT binary patch
literal 4240
zcmV;B5O42^P)m@)ECBDf#Gjz&FBBF5<0R;*aP6pYTsPPPwY7(4Krhc3Yh
zuYE6uMuw((IQukizNfqJzCprNCk_X26BAAqCI|#DcIIOS2&V|qDI#(wfXe_pzZb^S
zMjI_bkT7weQz(LdX50>7pc2auz@i^0aWZ3T#PoJ!#HxUI0N5RP4{fyZl0cAnlp+dR
zBF2@(7$71r0Z}ZF1Y&^Fzl8MfX(0S@W4A--h-O(aZtOH|v{46wgeji*#g{qEbS7It
z;&CBLKgWOLZHb^I>*x|9{A$&51ui0EShL}?R-{_@#M)>h2d#ATjy48;OyeReLJ%Xd
z@KgoBZZrBFm|r3KGl;w==t>HK!N$P{5Mf$9hqtl+;A8-20C-Wq+gY{^z$aUI(J)~m
z3fX-QNJ@#YSW_kOpZFXaI0?kAhIIpp1!Q9H?@R+Mhv44eyRkP!Gayo~=g>CxAG`&K
zLk6SYNy)93kT8W=ra^$pqVbD>z$y1_2ttX4lGJjkzzLy`g#Jh%j{*qi;_Jh~0R92M
zYclJ93}6v}vB2|P2jIO`ds`d!M_vQq{{Va&z+(ljcPfC-0C0I*d(58$_-D`l?*#Bs
z0MiSMXFGtW0jve^UjQD_-(g=0L^<=$MtRr0-Rk;Y>!
zj%DhtBD4gMzYD#gI$<^0NuK916To=@ZVNnLuXR}q?)xhM1^}D|paNi%YS7zsV*6l)
zXaO)GnPw+@PtN{UhzBzXq_b;5|(>e1dOUebFFWBbkU_NrSv)
zW5oE@IO&iuc;lZjPC}?~#m6NUkeIO)z^ht!>s8nZ`L-OzGDGS5P_1U_(B$^kJ9N^2
z3W!q*3v%`q6+9Q^8WYC1|70M2CcT;iydS_Zf#>+8LXa@^&1B5#Vaz-rSthMmAS{a*
z>#V?7s}pI=MC1t31a?p3r$o4pX2Jz~A+h`>04LVi{#pRP-QqF$U<2rz0UR&|*Y?3$
zt2+Q3G}QxnsUk?2jySXvhaJ+1SG}?W3lHwVoZd*wg>nyB%ZyK1L5Un{JaViRXDD@!
z+;wyj5gn5VSg~bH1`CENF{S}H-Rg-N`&f7F_nT11Sl0OHM*x1}ESqZ_V+HD*7S&K%
zRk#trs?2z5RiXSEfU8?Dmi+=jT7Rr8C?~acu@KFh%U~9ajsaVD7?d*35G6s@-!sX1
zLO3?1#3i;$lEh4uQso4x#!nhc0WXKa<&fAyjZ8K^q6i1gIU6r*`43Pr&+HWd&MvUu
zA^=ALc&f-rbMSKj*8_MW^W6KD_*kl?S6TcifX@RMZQ$BISmFLGfPYu_GKF<*j|A|p
z9EzrC*wgibcNpLf5!^G`c!)|kc<#Aazh!w5VX`~?4uE+DZuJ$KyJ$q1M)dgad$!#N
z;J=koJS?-#em_JlS~FoE`ZECj*R$;r0AE*T@XeWRC0+ML&vA!qj5(lg;XI8=OX@BR
zs}Md7V7bPHd9becwdy@Ug>j849V<+KsMk75zt<~F*Qp1?VuJ26Fm3mVyy~y
zR+ubanfY#?<&^*yt1Fm?>1qWQDua3|fcH7cRTp#ALb|Y)?F60tXE_$N-qQH1RVcI1
zVMqnpr}%Qw6kj|gA`X~N=!hu(o+&LV6XT=I*d8g97dd1@M4oaZ-HwEecr_E27A<8e
zh~qqYCFlh5S-}ByDO!nDIqMH>@pbd?g5y%TaIJZVYWELJB1l>EXxibXob6?gYj2;!
zGL0i$*EE!=gbLDi9zoioG4dUu`NgINw$|O7F`cnsUJ27WDa-af%}mSE9Fr?Jq(nr@
z^eOp}6vr~9`KJ$gG-AE5KjcN8`xkXzuJzE&cHiGqs<>6i<3|r};Wa0NZ=$;6v6KF5
z9^%62WE|BcZ(=Uav3@@E<)jP3GN6d((uXs7I;b1^F#ul;JYS5avqXt85zL;&=qODT
zC<4C7L{Bhf@=G+%;PHgK)C7yuPlS(Hd27NjU!$%<7WZht`HW`&v#_q-5ly&$9`ZE%
ziWXk87UpSyo`oAb+F$qq0H4tByVPZUzdq+4T@Fz!nhru$vO9oR~(d!ji2hcdXNdWNz~LEF}UO#f2Vi
zW-?U=zUm877o*-b-dgU+d;q8AY#XfedXu46RX|Az8XtVF-_6Pnp0AeX7F9~AWm>Op
z-S;xb*=Krm;JB^(c>#b!RViLn;26^T`Mf7~weI8%YOU%nn`)Ub83XjrWOR3BtP|nB
zh;cV*?kUQ)W$1dJ3&@OaCR|SmeOoWAwmsLg{t0E&QhYOq7CkqhR49v72ur#|8k8TQ
zF~=J`$L!RxwE`v2csi6pyaK=<=P5c2_k7QYCu>CiEs38G&vUw)B)X$q2WqwZLF1Iw($skTOe<<
z-{V|U+=~GiP3Tqy%UUT(D8o2ACDaL)i(zmVC3%M`X!1z3H^(Y%S5tqqQ-^2NDhzqF
z*;VQ;gjBWnD4iREZR$R?qNjv48NDd*IN!u0P3Btn`S>P{&jdn&KMdpspS|Z#wLb!0Y%+F%{@7v
zIcc9wPM~cY@p~f-9VU=VC8=r-!Qvd6IntoC?6|(-WbUPhv?4S%svBo<`=M7LH%&PZ#|
zx~Ex-!!Q*=*5jjnmPG*Q2p2WIU
z>@T7RS3qDbI~r#&lIn=Kdlxj@7`aF!4$g~Yz!x={);>nh*{lh_N^91>qKwz3CY`rl
zJP+V;0C#HBVqO94i8+<+H>mIpIV#R*3|KU;l*O(lHH?mAlC{&6i9Ei6YKqXd^~Aq6
zsg)pt$rh&?z$s|Gypj~(eNtaCX|>londoCeGQ%Yt#BCUKyKt)sT+zlty-w2Zei9%@
z>5o1c0kJeEXHqZh5Af~)VcM*HN-LZuJyIdsru6YhBR^&!%1WZ#oe_q0DmZ0LV%CaJ
zqMVBRAF8z)_H1k9{)bTOk(5^`>*0No^UHBk~DLE^GJmTC+8gcq+=pJF8yR?G**RS{KTiX!iu
ziH=dNlNGgLoybKn%hUFKvgSHg7dU=M6Ty!ayk4tet;CZ69%}GBK1Op_&idm#g}i$U
zJCq=KSgrnVDKqQh0#z>Gs^6dGVLK5%M}+g4a0U_1VZsee
z^du8T(ptQT+)i8?PwWzn_c={W@=i~-CEIrot?>m;OEd%TqN3FI{DRA0dM3zh&8-xE
zgdxv+FQC!!RC1J&6`Bt!RsM1`eztoPyXCwMZa*X(*FhrX=2oQE|3G*!qd
zj(^N489PeH9*i(y0#=P%C7ReF>#g9XHAFa11h>{WZG{Lo65&E3Y;-LU(|C2cyN*!3
z-cO0~6LN&GM0*rR{H~`u+^CjX6L9x&?Pa`jRf3XVxXfS%|V3Q<2;sAHJ-YA@#dF8ZeSrsuEVN`PVT4vdY$VW9K$cne4e5+gdX7yjo;E1`i%KP?!zFn&ccjq8X;^OW=4=r6~aR#@e4Yh
zYQQfZB*x_o+%2Fb1bH(9FB4!3$N3BTl87va*)yqGie{i}COosX4YZl(VO4=2^v5AD
z;-~|g1L@nJ>C$Q#Eg}1XQ!1Hd%zmyGelo1rr5-#Rs4!PHL$Of%A4Ip&Msv{qpSEqZ
m(Im8msf{+8gkJ;z0RR8;YC*;~!6lUd0000|YLrgFKai-5P*^mQjvpjO
zBFskgL1FIok9%k4&CI)R=Dm44JC*q*FS&C+&z-sFoqK=x+&d(tM7Ox~ynmk~gv?X~
zJ}U%P2`S$d0P(sS1Qee$fFWYY|KwkzJU{MjuGBM*~Vw}Q6Ux&X2*eU304AIW;8pI%at6XSIW0z<90++nv8F+rIl1|XEu2?7YT>4MeeyARLVPe;;=fUsyJ1z_5cyvmWY
zrI7U=La-mHq@N;yKLD6<<%DbS<6e4n6zjlw%9`WAT^ls)e(w-sDg;LGRx-yERm>cCP6}~
zupmfsF?uAyEo20?B-YH|TX<>3k#0NF0k(CRFJ{rms3T`*B5Jn);IK#hnNU;Cn4z2v
zrP%3+;${FMsut|4vE5b~i=t6$Sy43DioL
z4-sJsz=aX@$q#D_xan31!!p#%rX#jc%aia(DrECk!Idus;4%QQY~EVeuHH6n
zj>7+?vbQT`0svyVg(0s6aH@$em(UEk(1GfMnxYL4pFMxYp%+&?+^sw&==Db|K#_z+
zBeAeFc@Q{qcCVg-dQC5Fi$>y(oGmW2942J*Rw0vgHURM4=!6>B#pcLN(y^gt1DnzQ
zyB`HGnMpc10Aty_Rrbl7fO#rj&;x(6gEl*Yei2N=`(*+E>1^IAhh8&Pad+M-Gto|O
z5~9@swnj#{DRULRJ+WqfdAIWTz+{z5P;W*r^m6T#^GUONB!dz9jbAb(+szS~q_Yjc
zQK;`Q7NDsV6a^m-P{!TvG?Wz$(xzX1aj2JwZOD?&=B*si1p(m(G45x^Z>v6fRlruG*+aQh_zWg&k3ybiw4uW%V4lv6_KGHNV*z8mkf8&V4Dn~WKj>-LB*MQ0Y$*CY
zX!)(^j9}^rK@lnDT`dFvS_+TT32
zYn}3;(bJq7p5;WiJt~<1KvT;pLvqfMvt?}+3WhvA@rY>S^-$=A3>_eDh;Lykvw3R_
zjq9i)fH45;vU!WD4}c9YPqQxzE2u^p>bolhDWol;-x?{W``3W32?#fsu|tBsz>p^a
zig;+D%Nu<6>P#P))Nx(H6&J3ZAAa)43e#dYC{jLYcQl0)9(kgs$xRqt;QG6Qp1Roq
zi>0B~FKIW+=0-Me&18~J8Q$bZB4B$}l>FNCgI1(NFuyo**}Ub+u102=0N}32tbZ`!
z+ivSbo|dY0E!E^5F*SVld{l~VvMe+1b&6J&k|FPcS|@FljBPk_wy==xw}T#FCh8tA
zy!o?vtC-DOtJ)3fFoWI)WdOrn)EP>VfQT&<05D@xg1*dL2c)LQJD|&zg<1>3
z764P-$fD_R+mL*RAibW4+;Y0*f+Bi@FZ%A|bC&V+0;2yAV6yik?THl&w38MwOs
zxKBM%VWLaV_P8Ow=%+|PlQK<>Ragilg^*VZiFHC?r4ab15b}kJzz=ubx8(75lHB>I
z_4bxaom)Y4uOta3=*?TGja!#>YIB(IrVH23KltR4760n^YiNb(ZC^6H?Q>96uI-W5
zjVD41;fV|{rH>kMnD>y{!6;uQ>BOMEw^8(t-p?&iy={MonljzFU7SXQ9}!`g8ax$n
zG7(lYW8m@0@JtAs{3Aug_3c{saEKeqZJpi_Z>AAK9
zaYJ&+qLFb!S{dFye9EGcu};q$MTFd9Px0EI2m@=Uy$^cr2wP~g+1m{!Gf8L0ul^wb
zxci&pgG6|Sfzy>|0!BLioAlb_!!gZLi$$zhQ
zQdjx!U3byi`F+1SvZ5HG^M0;F34~kRZUZnLqFfl{967ttZbaRn2(>mTHz#Nhg#R~>
zavQ2o8%!Da-W_6y2oE#k^v2^6njCQL3u)5e1I%<_clwy|U>`Gmx|xLNKzd+bou!ge`NlW
zU%s&7i2$8W1;`r&F^fi0j-1U!TyIf7kM@9q4}%i4d{EA)Wm87I*%>n=k7e`LUPHO=
z@9B;fWq42br!z^%b2>RhgliZC0loJF07MY_0+gC}Hvks(fi8(A#?!}^3xV(5{J_$A
z0QlCXx7RY!U6SOw+BC0)gs8_=!=8kMyM2;r06~;#A*t-m2)@Y8!TX3qvBzsL6N-T6
z6>Oyt%$RLz!=y-kh%{6`yezB@!*p+m2p{lROKA
zpG(3%CcFxwcO}VHOt=U{!;&OxYgQu|Oos`Z>2iIT@U#G5hRM^r=*Zc1omQe9T#v$A
zF}Gsj&lnxAC>!DvnWU3y_Gfb)m*@*L$(IK396Frt4H4lr0Pj~;i9mX~2j~Hf*1PZA
z!~qyN3GCjJTl!az2EViI^0(G7=ynPDIo3P1rUQgNckjK?$rqvN@R%Vv(0+|0XUi6i
z%)op7wHP${ae-{!Dr)y2+aq~8lXSMC?z5LbA3O18^HwR7bSBW@bdQPf8~2p1%G$YE
zy_$0>HQY2*A;#ui_bo|}-|wkN0D!%ZEPIIwmoQ)&yxL}2(+6P{!WzW>8aH!$OQ(&wBS4ilR0-ebJTL=SdQy&r>@
z3o5G%ChHXI^Q*WP8^h>)|0oSbyZ0sZ{T8NiU_)8izdmuUo3;k%59p~-+!YmO
z538@y@@HqcUGh9Bu~AB#D+E?bDPI>7&kBKuGPm*XqH6f-qt1{JxUwR!NeKA~A+WL{
v
diff --git a/frontend/packages/common/src/components/aoplatform/Navigation.tsx b/frontend/packages/common/src/components/aoplatform/Navigation.tsx
index 4fa8f96..e7c952f 100644
--- a/frontend/packages/common/src/components/aoplatform/Navigation.tsx
+++ b/frontend/packages/common/src/components/aoplatform/Navigation.tsx
@@ -17,6 +17,7 @@ export type MenuItem = Required['items'][number];
// access:string [],
// children: NavigationItemType[]
// }
+const APP_MODE = import.meta.env.VITE_APP_MODE;
const routerKeyMap = new Map([
['assets','/assets'],
@@ -35,13 +36,14 @@ const routerKeyMap = new Map([
['logsettings','/logsettings'],
['resourcesettings','/resourcesettings']])
+
const TOTAL_MENU_ITEMS: MenuProps['items'] = [
- getItem('仪表盘', 'mainPage', ,[
+ APP_MODE === 'pro' ? getItem('仪表盘', 'mainPage', ,[
// getItem(资产视图, 'assets',null,undefined,undefined,''),
getItem(运行视图, 'dashboard',null,undefined,undefined,''),
getItem(系统拓扑图, 'systemrunning',null,undefined,undefined,''),
// getItem((审批), 'approval', null),
- ]),
+ ]):null,
getItem('数据服务资产', 'dataAssets',, [
getItem(内部数据服务, 'system',null,undefined,undefined,''),
@@ -60,9 +62,9 @@ const TOTAL_MENU_ITEMS: MenuProps['items'] = [
getItem('运维与集成', 'maintenanceCenter', , [
getItem(部署管理, 'partition',null,undefined,undefined,'system.partition.self.view'),
getItem(日志配置, 'logsettings',null,undefined,undefined,'system.partition.self.view'),
- getItem(资源配置, 'resourcesettings',null,undefined,undefined,'system.partition.self.view'),
+ APP_MODE === 'pro' ? getItem(资源配置, 'resourcesettings',null,undefined,undefined,'system.partition.self.view'):null,
// getItem(邮箱设置, 'email'),
- getItem(Open API, 'openapi',null,undefined,undefined,'system.openapi.self.view'),
+ APP_MODE === 'pro' ? getItem(Open API, 'openapi',null,undefined,undefined,'system.openapi.self.view'):null,
// getItem(Webhook, 'webhook'),
// getItem(HTTP 日志配置, 'httplog'),
// getItem(日志检索, 'logretrieval',null,undefined,undefined,'system.logRetrieval.self.view'),
@@ -126,10 +128,9 @@ const Navigation: FC = () => {
const menuData = useMemo(()=>{
const filterMenu = (menu:Array<{[k:string]:unknown}>)=>{
- return menu.filter(x=>x.access ? checkPermission(x.access as keyof typeof PERMISSION_DEFINITION[0]): true)
+ return menu.filter(x=> x && (x.access ? checkPermission(x.access as keyof typeof PERMISSION_DEFINITION[0]): true))
}
-
- return TOTAL_MENU_ITEMS!.map((x)=> ( x.children ? {...x, children:filterMenu(x.children)} : x))?.filter(x=> x.key === 'system' || (x.children && x.children?.length > 0))
+ return TOTAL_MENU_ITEMS!.filter(x=>x).map((x)=> ( x.children ? {...x, children:filterMenu(x.children)} : x))?.filter(x=> x.key === 'system' || (x.children && x.children?.length > 0))
},[accessData])
useEffect(() => {
diff --git a/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx b/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx
index 3d7a856..99d65ad 100644
--- a/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx
+++ b/frontend/packages/common/src/components/aoplatform/PublishApprovalModalContent.tsx
@@ -57,7 +57,7 @@ const apiColumns = [
const upstreamColumns = [
{
- title:'分区',
+ title:'环境',
dataIndex:['partition','name'],
copyable: true,
ellipsis:true
diff --git a/frontend/packages/common/src/components/aoplatform/SubscribeApprovalModalContent.tsx b/frontend/packages/common/src/components/aoplatform/SubscribeApprovalModalContent.tsx
index e100060..68cca34 100644
--- a/frontend/packages/common/src/components/aoplatform/SubscribeApprovalModalContent.tsx
+++ b/frontend/packages/common/src/components/aoplatform/SubscribeApprovalModalContent.tsx
@@ -112,7 +112,7 @@ export const SubscribeApprovalModalContent = forwardRef
- label="申请的分区"
+ label="申请的环境"
name="partition"
rules={[{ required: true, message: '必填项' }]}
>
diff --git a/frontend/packages/common/src/components/aoplatform/TreeWithMore.tsx b/frontend/packages/common/src/components/aoplatform/TreeWithMore.tsx
index b5604b5..971c8a5 100644
--- a/frontend/packages/common/src/components/aoplatform/TreeWithMore.tsx
+++ b/frontend/packages/common/src/components/aoplatform/TreeWithMore.tsx
@@ -17,9 +17,10 @@ export type TreeWithMoreProp = {
editKey?:string
entity?:{id:string,[k:string]:unknown | string}
onBlur?:()=>void
+ stopClick?:boolean
}
-const TreeWithMore = ({children,dropdownMenu,editable,editingId,entity,editKey='name',afterEdit,onBlur}:TreeWithMoreProp)=>{
+const TreeWithMore = ({children,dropdownMenu,editable,editingId,entity,editKey='name',afterEdit,onBlur,stopClick=true}:TreeWithMoreProp)=>{
const [editValue, setEditValue] = useState(entity?.[editKey] as string)
const [submitting, setSubmitting] = useState(false)
const inputRef = useRef(null)
@@ -34,12 +35,12 @@ const TreeWithMore = ({children,dropdownMenu,editable,editingId,entity,editKey='
return (<>
{
- editable && editingId && entity?.id && editingId === entity.id ? {setEditValue(e.target.value)}} onBlur={()=>{onBlur?.()}} onClick={(e)=>e?.stopPropagation()} onPressEnter={()=>{handleSubmit(editValue)}} suffix={submitting ? :{handleSubmit(editValue)}}/>} />:
+ editable && editingId && entity?.id && editingId === entity.id ? {setEditValue(e.target.value)}} onBlur={()=>{onBlur?.()}} onClick={(e)=>stopClick&&e?.stopPropagation()} onPressEnter={()=>{handleSubmit(editValue)}} suffix={submitting ? :{handleSubmit(editValue)}}/>} />:
{children}
- { e.stopPropagation();}}>
+ { stopClick && e.stopPropagation();}}>
- { e.stopPropagation();}} />
+ { stopClick && e.stopPropagation(); }} />
diff --git a/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx b/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx
index e26ca9a..be6f968 100644
--- a/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx
+++ b/frontend/packages/common/src/components/aoplatform/intelligent-plugin/IntelligentPluginList.tsx
@@ -76,7 +76,7 @@ export default function IntelligentPluginList(){
const { modal,message } = App.useApp()
const [searchWord, setSearchWord] = useState('')
const { moduleId } = useParams();
- const [pluginName,setPluginName] = useState()
+ const [pluginName,setPluginName] = useState('-')
const [partitionOptions, setPartitionOption] = useState([])
const { setBreadcrumb } = useBreadcrumb()
// const [confirmLoading, setConfirmLoading] = useState(false);
@@ -373,7 +373,7 @@ export default function IntelligentPluginList(){
})
}
- // 渲染配置页时需要用到分区数据,在此合并数据
+ // 渲染配置页时需要用到环境数据,在此合并数据
const getFinalRender = ()=>{
Promise.all([getRender(),getPartitionList()]).then(([render, partitions])=>{
if(!partitions || partitions.length === 0) return
@@ -414,7 +414,7 @@ export default function IntelligentPluginList(){
mode="multiple"
allowClear
style={{ width: '100%' }}
- placeholder="所有分区"
+ placeholder="所有环境"
value={partition}
onChange={handleClusterChange}
options={partitionOptions}
@@ -427,7 +427,7 @@ export default function IntelligentPluginList(){
onSearchWordChange={(e)=>{setSearchWord(e.target.value);setTableHttpReload(true);setTableHttpReload(true)}}
/>
- {setCurDetail(undefined);setDrawerOpen(false)}} onSubmit={()=>drawerFormRef.current?.save()?.then((res)=>{res && manualReloadTable();return res})} submitAccess='system.partition.self.edit'>
+ {setCurDetail(undefined);setDrawerOpen(false)}} onSubmit={()=>drawerFormRef.current?.save()?.then((res)=>{res && manualReloadTable();return res})} submitAccess='system.partition.self.edit'>
} spinning={drawerLoading}>
(false)
const apiColumns = [
{
- title:'分区',
+ title:'环境',
dataIndex:'title',
copyable: true,
ellipsis:true
@@ -54,7 +54,7 @@ export const IntelligentPluginPublish = forwardRefsetBody($body);\r\n\r\n' +
`$request->getBody()->${langTmp.paramsStr}\r\n\r\n` +
'$request->setHeaders(array(\r\n' +
- `${langTmp.headerStr}\r\n` +
+ `${langTmp.headerStr ? `${langTmp.headerStr}\r\n` : ''}` +
' "Content-Type":"multipart/form-data"\r\n' +
'));\r\n\r\n' +
'$client->enqueue($request)->send();\r\n' +
@@ -548,7 +554,7 @@ export function generateCode(
'$request->setBody($body);\r\n\r\n' +
`${langTmp.queryStr ? `${langTmp.queryStr}\r\n\r\n` : ''}` +
'$request->setHeaders(array(\r\n' +
- `${langTmp.headerStr}\r\n` +
+ `${langTmp.headerStr ? `${langTmp.headerStr}\r\n` : ''}` +
'));\r\n\r\n' +
'$client->enqueue($request)->send();\r\n' +
'$response = $client->getResponse();\r\n\r\n' +
@@ -610,7 +616,7 @@ export function generateCode(
` CURLOPT_CUSTOMREQUEST => "${method}",\r\n` +
` CURLOPT_POSTFIELDS => ${langTmp.paramsStr},\r\n` +
' CURLOPT_HTTPHEADER => array(\r\n' +
- `${langTmp.headerStr},\r\n` +
+ `${langTmp.headerStr ? `${langTmp.headerStr},\r\n` : ''}` +
' "Content-Type:multipart/form-data"' +
'\r\n ),\r\n' +
'));\r\n\r\n' +
@@ -843,7 +849,7 @@ export function generateCode(
`request = Net::HTTP::${method.toLowerCase().replace(/^\S/, (s: string) => {
return s?.toUpperCase()
})}.new(url)\r\n` +
- `${langTmp.headerStr}\r\n` +
+ `${langTmp.headerStr ? `${langTmp.headerStr}\r\n` : ''}` +
`request.body = ${langTmp.paramsStr}\r\n\r\n` +
'response = http.request(request)\r\n' +
'puts response.read_body'
@@ -1020,7 +1026,7 @@ export function generateCode(
' if err != nil {\r\n' +
' return nil, err\r\n' +
' }\r\n' +
- `${langTmp.headerStr}\r\n` +
+ `${langTmp.headerStr ? `${langTmp.headerStr}\r\n` : ''}` +
' req.Header.Add("Content-Type", writer.FormDataContentType())\r\n\r\n' +
' client := &http.Client{}\r\n' +
' resp, err := client.Do(req)\r\n' +
@@ -1112,7 +1118,7 @@ export function generateCode(
map: stringifyHeaders
})
let mediaType = 'application/octet-stream'
- switch (requestType || 'FORMDATA') {
+ switch ( (requestType || 'FORMDATA').toUpperCase()) {
case 'FORMDATA': {
if (multipart) {
mediaType = 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
@@ -1158,10 +1164,10 @@ export function generateCode(
`RequestBody fileBody = RequestBody.create(MediaType.parse("${langTmp.fileType}"), file); \r\n\r\n` +
'MultipartBody.Builder builder = new MultipartBody.Builder()\r\n' +
' .setType(MultipartBody.FORM)\r\n' +
- `${langTmp.paramsStr} \r\n` +
+ `${langTmp.paramsStr ? `${langTmp.paramsStr}\r\n` : ''}` +
'Request request = new Request.Builder()\r\n' +
` .url("${urlObj.href}")\r\n` +
- `${langTmp.headerStr}\r\n` +
+ `${langTmp.headerStr ? `${langTmp.headerStr}\r\n` : ''}` +
' .post(builder.build())\r\n' +
' .build();\r\n\r\n' +
'Response response = client.newCall(request).execute();\r\n' +
@@ -1179,7 +1185,7 @@ export function generateCode(
'Request request = new Request.Builder()\r\n' +
` .url("${urlObj.href}")\r\n` +
` .method("${method}",${method === 'GET' ? 'null' : 'body'})\r\n` +
- `${langTmp.headerStr}\r\n` +
+ `${langTmp.headerStr ? `${langTmp.headerStr}\r\n` : ''}` +
' .build();\r\n\r\n' +
'Response response = client.newCall(request).execute();\r\n' +
'System.out.println(response.body().string());\r\n'
diff --git a/frontend/packages/common/src/components/apispace/code-snippet/index.tsx b/frontend/packages/common/src/components/apispace/code-snippet/index.tsx
index 008171d..2a043ca 100644
--- a/frontend/packages/common/src/components/apispace/code-snippet/index.tsx
+++ b/frontend/packages/common/src/components/apispace/code-snippet/index.tsx
@@ -88,10 +88,10 @@ type CodeSnippetCompoType = {
})
result.params = []
-
+ console.log('检查请求参数类型',result.requestParams?.bodyParams?.[0]?.contentType)
//为请求参数 中的header、reset、body、query 添加 value 和 valueQuery 的值
switch (result.requestParams?.bodyParams?.[0]?.contentType) {
- case 'FORMDATA': {
+ case 0: {
result.requestParams?.bodyParams?.forEach((body: unknown, key: unknown) => {
if ((body.checkbox || !body.hasOwnProperty('checkbox')) && body.name) {
if (paramsJsonType[body.dataType] == 'string' && body.paramAttr.example) {
@@ -119,11 +119,11 @@ type CodeSnippetCompoType = {
}
break
}
- case 'RAW': {
+ case 1: {
result.params = apiDoc.requestParams?.bodyParams
break
}
- case 'JSON': {
+ case 2: {
result.params = apiDoc.requestParams?.bodyParams
if (!alreadyHadContentType) {
result.headers.push({
@@ -134,7 +134,7 @@ type CodeSnippetCompoType = {
}
break
}
- case 'XML': {
+ case 3: {
result.params = apiDoc.requestParams?.bodyParams
if (!alreadyHadContentType) {
result.headers.push({
@@ -146,7 +146,8 @@ type CodeSnippetCompoType = {
break
}
}
-
+
+ result.requestType = result.requestParams?.bodyParams?.[0]?.contentType || 0
return result
}
@@ -160,6 +161,7 @@ type CodeSnippetCompoType = {
setCode(tempCode)
return
}
+ console.log(cloneDeep(api))
tempCode = generateCode(
language.toString(),
isMultipart,
diff --git a/frontend/packages/common/src/const/approval/const.tsx b/frontend/packages/common/src/const/approval/const.tsx
index d976c60..9e0ba33 100644
--- a/frontend/packages/common/src/const/approval/const.tsx
+++ b/frontend/packages/common/src/const/approval/const.tsx
@@ -10,7 +10,7 @@ export const SUBSCRIBE_APPROVAL_TABLE_COLUMN : ProColumns
title: '申请时间',
dataIndex: 'applyTime',
ellipsis:true,
- width:176,
+ width:182,
fixed:'left',
sorter: (a,b)=> {
return a.applyTime.localeCompare(b.applyTime)
@@ -62,7 +62,7 @@ export const SUBSCRIBE_APPROVAL_TABLE_COLUMN : ProColumns
dataIndex: 'approvalTime',
ellipsis: true,
// sorter: true,,
- width:176,
+ width:182,
sorter: (a,b)=> {
return a.approvalTime.localeCompare(b.approvalTime)
},
@@ -76,7 +76,7 @@ export const SUBSCRIBE_APPROVAL_INNER_TODO_TABLE_COLUMN : ProColumns {
return a.applyTime.localeCompare(b.applyTime)
@@ -114,7 +114,7 @@ export const SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN : ProColumns {
return a.applyTime.localeCompare(b.applyTime)
@@ -169,7 +169,7 @@ export const SUBSCRIBE_APPROVAL_INNER_DONE_TABLE_COLUMN : ProColumns {
return a.approvalTime.localeCompare(b.approvalTime)
},
@@ -290,7 +290,7 @@ export const PUBLISH_APPROVAL_RECORD_INNER_TABLE_COLUMN : ProColumns[]
dataIndex: 'applyTime',
copyable: true,
ellipsis:true,
- width:176,
+ width:182,
fixed:'left',
sorter: (a,b)=> {
return a.applyTime.localeCompare(b.applyTime)
@@ -414,7 +414,7 @@ export const PUBLISH_APPROVAL_TABLE_COLUMN : ProColumns[]
// sorter: true,
ellipsis:true,
hideInSearch: true,
- width:176,
+ width:182,
sorter: (a,b)=> {
return a.approvalTime.localeCompare(b.approvalTime)
},
diff --git a/frontend/packages/common/src/const/const.ts b/frontend/packages/common/src/const/const.ts
index b4ceff6..50d77c6 100644
--- a/frontend/packages/common/src/const/const.ts
+++ b/frontend/packages/common/src/const/const.ts
@@ -20,4 +20,4 @@ export const STATUS_CODE = {
export const STATUS_COLOR = {
'done':'text-[#03a9f4]',
'error':'text-[#ff3b30]'
-}
\ No newline at end of file
+}
diff --git a/frontend/packages/common/src/const/permissions.ts b/frontend/packages/common/src/const/permissions.ts
index c5c03e8..cdbb690 100644
--- a/frontend/packages/common/src/const/permissions.ts
+++ b/frontend/packages/common/src/const/permissions.ts
@@ -19,6 +19,11 @@ export const PERMISSION_DEFINITION = [
"anyOf": [{ "backend": ["system.user_manager"] }]
}
},
+ "system.member.member.remove": {
+ "granted": {
+ "anyOf": [{ "backend": ["system.user_manager"] }]
+ }
+ },
"system.member.member.delete": {
"granted": {
"anyOf": [{ "backend": ["system.user_manager"] }]
diff --git a/frontend/packages/common/src/const/type.ts b/frontend/packages/common/src/const/type.ts
index ef809b2..c1971df 100644
--- a/frontend/packages/common/src/const/type.ts
+++ b/frontend/packages/common/src/const/type.ts
@@ -99,3 +99,13 @@ export type DynamicMenuItem = {
}
export type AccessDataType = keyof typeof PERMISSION_DEFINITION[0]
+
+
+
+export type SimpleMemberItem = {
+ id:string
+ name:string
+ email:string
+ department:string
+ avatar:string
+}
\ No newline at end of file
diff --git a/frontend/packages/common/src/contexts/GlobalStateContext.tsx b/frontend/packages/common/src/contexts/GlobalStateContext.tsx
index 5d53535..1680f62 100644
--- a/frontend/packages/common/src/contexts/GlobalStateContext.tsx
+++ b/frontend/packages/common/src/contexts/GlobalStateContext.tsx
@@ -105,7 +105,7 @@ export const GlobalProvider: FC<{children:ReactNode}> = ({ children }) => {
userData: null,
version: '1.0.0',
updateDate: '2024-07-01',
- powered:'Powered by https://eolink.com',
+ powered:'Powered by https://apipark.com',
mainPage:'/system/list'
});
const [accessData,setAccessData] = useState