From 6944260767ec470e947a27ec6b577edf2a69b3e1 Mon Sep 17 00:00:00 2001 From: lidongjie Date: Thu, 24 Oct 2024 15:47:43 +0800 Subject: [PATCH 01/13] add:ai provider 360-zhinao --- ai-provider/model-runtime/model-providers/zhinao/zhinao.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai-provider/model-runtime/model-providers/zhinao/zhinao.yaml b/ai-provider/model-runtime/model-providers/zhinao/zhinao.yaml index 39a2c595..7d2c5372 100644 --- a/ai-provider/model-runtime/model-providers/zhinao/zhinao.yaml +++ b/ai-provider/model-runtime/model-providers/zhinao/zhinao.yaml @@ -30,4 +30,4 @@ provider_credential_schema: placeholder: zh_Hans: 在此输入您的 API Key en_US: Enter your API Key -address: https://api.openai.com \ No newline at end of file +address: https://api.360.cn \ No newline at end of file From 00bd72c1e4d02b7ea19a42f23c6b2b63c9cd33cd Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Thu, 24 Oct 2024 23:42:55 +0800 Subject: [PATCH 02/13] fix get llm error --- module/ai/iml.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ai/iml.go b/module/ai/iml.go index 65d17cc5..a6a0c8a2 100644 --- a/module/ai/iml.go +++ b/module/ai/iml.go @@ -201,7 +201,7 @@ func (i *imlProviderModule) LLMs(ctx context.Context, driver string) ([]*ai_dto. DefaultLLMLogo: defaultLLM.Logo(), Logo: p.Logo(), Configured: false, - }, err + }, nil } return items, &ai_dto.ProviderItem{Id: info.Id, Name: info.Name, DefaultLLM: info.DefaultLLM, Logo: p.Logo(), Configured: true}, nil From 885cec57dbc7c84cd02a0487b44d7ffe9241a14d Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 25 Oct 2024 09:32:12 +0800 Subject: [PATCH 03/13] update issue templete --- .github/ISSUE_TEMPLATE/bug_report.yml | 11 +++++------ .github/ISSUE_TEMPLATE/request_help.yml | 2 +- common/version/version.go | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index da994f4f..c8806d68 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -45,19 +45,18 @@ body: label: Steps to Reproduce description: Share the steps you took so that we can reproduce the issue. Reports without proper steps details will likely be closed. placeholder: | - 1. Run apinto via the Docker image. - 2. Create a Route with the Admin API. - 3. Try configuring ... - 4. ... + 1. Run APIPark via the Docker image. + 2. Try configuring ... + 3. ... validations: - required: true + required: false - type: textarea id: environment attributes: label: Environment description: Share your environment details. Reports without proper environment details will likely be closed. value: | - - APINTO Dashboard version (run `apinto dashboard version`): + - APINTO Dashboard version: - Operating system (run `uname -a`): validations: required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/request_help.yml b/.github/ISSUE_TEMPLATE/request_help.yml index 076cbb92..5ffa869a 100644 --- a/.github/ISSUE_TEMPLATE/request_help.yml +++ b/.github/ISSUE_TEMPLATE/request_help.yml @@ -25,7 +25,7 @@ body: label: Environment description: Share your environment details. Reports without proper environment details will likely be closed. value: | - - APIPark version (run `apinto dashboard version`): + - APIPark version: - Operating system (run `uname -a`): validations: required: true \ No newline at end of file diff --git a/common/version/version.go b/common/version/version.go index bcacbb3c..b6e5d2e7 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/urfave/cli/v2" + "github.com/urfave/cli" ) // These should be set via go build -ldflags -X 'xxxx'. @@ -20,7 +20,7 @@ var profileInfo []byte func init() { buffer := &bytes.Buffer{} - fmt.Fprintf(buffer, "Apinto version: %s\n", Version) + fmt.Fprintf(buffer, "APIPark version: %s\n", Version) fmt.Fprintf(buffer, "Golang version: %s\n", goVersion) fmt.Fprintf(buffer, "Git commit hash: %s\n", gitCommit) fmt.Fprintf(buffer, "Built on: %s\n", BuildTime) From ceee52010211b41237e573d2eeda1eb95408a6b6 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 25 Oct 2024 14:21:50 +0800 Subject: [PATCH 04/13] tmp commit --- go.mod | 7 +++---- go.sum | 11 +++++------ module/team/iml.go | 4 ++-- resources/access/role.yaml | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 03187bb3..0bc17fb0 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/gin-gonic/gin v1.10.0 github.com/google/uuid v1.6.0 github.com/influxdata/influxdb-client-go/v2 v2.14.0 - github.com/urfave/cli/v2 v2.27.2 + github.com/urfave/cli v1.22.16 golang.org/x/crypto v0.24.0 gopkg.in/yaml.v3 v3.0.1 gorm.io/gorm v1.25.5 @@ -26,7 +26,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect @@ -62,7 +62,6 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect - github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect @@ -76,4 +75,4 @@ require ( gorm.io/driver/mysql v1.5.2 // indirect ) -//replace github.com/eolinker/ap-account => ../../eolinker/ap-account +replace github.com/eolinker/ap-account => ../../eolinker/ap-account diff --git a/go.sum b/go.sum index 13e39a7e..c10fa993 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= @@ -18,8 +19,8 @@ github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/ github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= +github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -139,10 +140,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI= -github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM= -github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw= -github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk= +github.com/urfave/cli v1.22.16 h1:MH0k6uJxdwdeWQTwhSO42Pwr4YLrNLwBtg1MRgTqPdQ= +github.com/urfave/cli v1.22.16/go.mod h1:EeJR6BKodywf4zciqrdw6hpCPk68JO9z5LazXZMn5Po= go.etcd.io/etcd/client/pkg/v3 v3.5.13 h1:RVZSAnWWWiI5IrYAXjQorajncORbS0zI48LQlE2kQWg= go.etcd.io/etcd/client/pkg/v3 v3.5.13/go.mod h1:XxHT4u1qU12E2+po+UVPrEeL94Um6zL58ppuJWXSAB8= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= diff --git a/module/team/iml.go b/module/team/iml.go index a61f9854..4a291939 100644 --- a/module/team/iml.go +++ b/module/team/iml.go @@ -111,13 +111,13 @@ func (m *imlTeamModule) Create(ctx context.Context, input *team_dto.CreateTeam) if err != nil { return err } - supperRole, err := m.roleService.GetSupperRole(ctx, role.GroupTeam) + superRole, err := m.roleService.GetSupperRole(ctx, role.GroupTeam) if err != nil { return err } return m.roleMemberService.Add(ctx, &role.AddMember{ - Role: supperRole.Id, + Role: superRole.Id, User: input.Master, Target: role.TeamTarget(input.Id), }) diff --git a/resources/access/role.yaml b/resources/access/role.yaml index 30054bb5..5b752025 100644 --- a/resources/access/role.yaml +++ b/resources/access/role.yaml @@ -1,6 +1,6 @@ system: - - name: supper admin - value: supper_admin + - name: super admin + value: super_admin permits: - system.dashboard.run_view.view - system.devops.ai_provider.manager From 396464c5739f1cd75c8c9b3145e8abbfbc4fc158 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 25 Oct 2024 14:30:58 +0800 Subject: [PATCH 05/13] update ao-account dependent version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0bc17fb0..4d86b706 100644 --- a/go.mod +++ b/go.mod @@ -75,4 +75,4 @@ require ( gorm.io/driver/mysql v1.5.2 // indirect ) -replace github.com/eolinker/ap-account => ../../eolinker/ap-account +replace github.com/eolinker/ap-account => ../ap-account From ada121015d84acc2736525673c5196391e6d2b9e Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 25 Oct 2024 14:32:11 +0800 Subject: [PATCH 06/13] update ao-account dependent version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4d86b706..2d2bf464 100644 --- a/go.mod +++ b/go.mod @@ -75,4 +75,4 @@ require ( gorm.io/driver/mysql v1.5.2 // indirect ) -replace github.com/eolinker/ap-account => ../ap-account +replace github.com/eolinker/ap-account => ../aoaccount From c01e95c716f6c06e9ad110f18a0962a0ec9e361c Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 25 Oct 2024 18:45:38 +0800 Subject: [PATCH 07/13] update translate --- resources/locale/i18n/en-US.json | 2 +- resources/locale/i18n/ja-JP.json | 2 +- resources/locale/i18n/zh-CN.json | 2 +- resources/locale/i18n/zh-TW.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/locale/i18n/en-US.json b/resources/locale/i18n/en-US.json index 4d865e69..0db78da0 100644 --- a/resources/locale/i18n/en-US.json +++ b/resources/locale/i18n/en-US.json @@ -29,7 +29,7 @@ "ssl certificate": "SSL Certificate", "subscription management": "Subscription Management", "subscription service": "Subscription Service", - "supper admin": "Super Administrator", + "super admin": "Super Administrator", "system settings": "System Settings", "team": "Team", "team admin": "Team Administrator", diff --git a/resources/locale/i18n/ja-JP.json b/resources/locale/i18n/ja-JP.json index 894c899c..a6c81be1 100644 --- a/resources/locale/i18n/ja-JP.json +++ b/resources/locale/i18n/ja-JP.json @@ -29,7 +29,7 @@ "ssl certificate": "SSL証明書", "subscription management": "サブスクリプション管理", "subscription service": "サブスクリプションサービス", - "supper admin": "スーパ管理者", + "super admin": "スーパ管理者", "system settings": "システム設定", "team": "チーム", "team admin": "チーム管理者", diff --git a/resources/locale/i18n/zh-CN.json b/resources/locale/i18n/zh-CN.json index ea248a81..5fb14ae1 100644 --- a/resources/locale/i18n/zh-CN.json +++ b/resources/locale/i18n/zh-CN.json @@ -29,7 +29,7 @@ "ssl certificate": "SSL证书", "subscription management": "订阅方管理", "subscription service": "订阅服务", - "supper admin": "超级管理员", + "super admin": "超级管理员", "system settings": "系统设置", "team": "团队", "team admin": "团队管理员", diff --git a/resources/locale/i18n/zh-TW.json b/resources/locale/i18n/zh-TW.json index 44c6075f..5b35ad94 100644 --- a/resources/locale/i18n/zh-TW.json +++ b/resources/locale/i18n/zh-TW.json @@ -29,7 +29,7 @@ "ssl certificate": "SSL證書", "subscription management": "訂閱方管理", "subscription service": "訂閱服務", - "supper admin": "超級管理員", + "super admin": "超級管理員", "system settings": "系統設置", "team": "團隊", "team admin": "團隊管理員", From 7155e14e641dba3c96f7dea0f516bc73c1b73532 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sat, 26 Oct 2024 21:25:13 +0800 Subject: [PATCH 08/13] create ai service add provider --- controller/service/iml.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controller/service/iml.go b/controller/service/iml.go index aac8c32b..b8cfdc8a 100644 --- a/controller/service/iml.go +++ b/controller/service/iml.go @@ -151,8 +151,9 @@ func (i *imlServiceController) createAIService(ctx *gin.Context, teamID string, Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}", } aiModel := &ai_api_dto.AiModel{ - Id: m.ID(), - Config: m.DefaultConfig(), + Id: m.ID(), + Config: m.DefaultConfig(), + Provider: *input.Provider, } name := "Demo Translation API" description := "A demo that shows you how to use a prompt to create a Translation API." From 2f1677f58157f3d8afbbc3ca4786cfcd8f645cbf Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sun, 27 Oct 2024 00:47:48 +0800 Subject: [PATCH 09/13] role update --- resources/access/access.yaml | 6 ------ resources/access/role.yaml | 4 ++-- resources/locale/i18n/en-US.json | 2 +- resources/locale/i18n/zh-CN.json | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/resources/access/access.yaml b/resources/access/access.yaml index 1ff6ba0b..76d3d327 100644 --- a/resources/access/access.yaml +++ b/resources/access/access.yaml @@ -262,11 +262,9 @@ system: apis: - "GET:/api/v1/manager/teams" - name: api market -# cname: API市场 value: 'api_market' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: @@ -274,15 +272,12 @@ system: - "GET:/api/v1/catalogue/service" team: - name: service -# cname: 服务 value: 'service' children: - name: router -# cname: 路由 value: 'router' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: @@ -291,7 +286,6 @@ team: - "GET:/api/v1/service/router/detail/simple" - "GET:/api/v1/service/router/define" - name: manager -# cname: 管理 value: 'manager' apis: - "POST:/api/v1/service/router" diff --git a/resources/access/role.yaml b/resources/access/role.yaml index 30054bb5..5b752025 100644 --- a/resources/access/role.yaml +++ b/resources/access/role.yaml @@ -1,6 +1,6 @@ system: - - name: supper admin - value: supper_admin + - name: super admin + value: super_admin permits: - system.dashboard.run_view.view - system.devops.ai_provider.manager diff --git a/resources/locale/i18n/en-US.json b/resources/locale/i18n/en-US.json index 0db78da0..12c793a1 100644 --- a/resources/locale/i18n/en-US.json +++ b/resources/locale/i18n/en-US.json @@ -1,6 +1,6 @@ { "ai provider": "AI Provider", - "api market": "API Market", + "api market": "API Portal", "api doc": "API Documentation", "application": "Application", "application admin": "Application Administrator", diff --git a/resources/locale/i18n/zh-CN.json b/resources/locale/i18n/zh-CN.json index 5fb14ae1..3882a74f 100644 --- a/resources/locale/i18n/zh-CN.json +++ b/resources/locale/i18n/zh-CN.json @@ -1,6 +1,6 @@ { "ai provider": "AI供应商", - "api market": "API市场", + "api market": "API门户", "api doc": "API文档", "application": "应用", "application admin": "应用管理员", From 1d1c7c78e865bd99ee281b34a7679b15f6fa3646 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Mon, 28 Oct 2024 10:00:34 +0800 Subject: [PATCH 10/13] update go.mod --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2d2bf464..3c8d6cad 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 //toolchain go1.21.1 require ( - github.com/eolinker/ap-account v1.0.13 + github.com/eolinker/ap-account v1.0.14 github.com/eolinker/eosc v0.17.3 github.com/eolinker/go-common v1.1.0 github.com/gabriel-vasile/mimetype v1.4.4 @@ -75,4 +75,4 @@ require ( gorm.io/driver/mysql v1.5.2 // indirect ) -replace github.com/eolinker/ap-account => ../aoaccount +//replace github.com/eolinker/ap-account => ../../eolinker/ap-account diff --git a/go.sum b/go.sum index c10fa993..40b6a55c 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,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.13 h1:6iWdyxLAIkJfgw9JvkHEq0t2m8Levpg30kSx5pTK2wY= -github.com/eolinker/ap-account v1.0.13/go.mod h1:qLKg4xervGHTNBWaGckfPkQb+FZT0XfhwPEdNpzvsjE= +github.com/eolinker/ap-account v1.0.14 h1:QE9LWx9F/t/BbTeBcjPX+Alzh3mdlHv+BVvKcBwr5dc= +github.com/eolinker/ap-account v1.0.14/go.mod h1:qLKg4xervGHTNBWaGckfPkQb+FZT0XfhwPEdNpzvsjE= 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.1.0 h1:n/XXK7yVRen3jhNG/SfZGXJA+KNnaYf0XTDfMeviaBw= From ee8e93d1e80db6a62b06d4917e57fa40a86a1551 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Mon, 28 Oct 2024 10:46:17 +0800 Subject: [PATCH 11/13] update action --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 040fe3ce..cf815dfc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: echo "Build frontend..." cd ./frontend && pnpm run build - name: upload frontend release - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: frontend-package path: frontend/dist From c5fecf73c8199572ebfe460e06e7b9a1cde98914 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Mon, 28 Oct 2024 10:53:28 +0800 Subject: [PATCH 12/13] update action --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cf815dfc..49b80caa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,7 +41,7 @@ jobs: - name: Checkout #Checkout代码 uses: actions/checkout@v3 - name: download frontend release - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: frontend-package path: frontend/dist @@ -71,7 +71,7 @@ jobs: - uses: actions/checkout@v3 - name: download frontend release - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: frontend-package path: frontend/dist From 4de0d29f3087ab095745bf62d3627a372f4f3969 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Mon, 28 Oct 2024 15:03:04 +0800 Subject: [PATCH 13/13] update access --- .../model-providers/openAI/openai.yaml | 9 - controller/system/iml.go | 5 +- module/ai/iml.go | 20 +- module/team/iml.go | 3 +- resources/access/access.yaml | 369 +++++++----------- resources/access/role.yaml | 206 +++++----- service/service/iml.go | 4 +- 7 files changed, 267 insertions(+), 349 deletions(-) diff --git a/ai-provider/model-runtime/model-providers/openAI/openai.yaml b/ai-provider/model-runtime/model-providers/openAI/openai.yaml index 475a8700..2d5cfca6 100644 --- a/ai-provider/model-runtime/model-providers/openAI/openai.yaml +++ b/ai-provider/model-runtime/model-providers/openAI/openai.yaml @@ -69,15 +69,6 @@ provider_credential_schema: placeholder: zh_Hans: 在此输入您的 API Key en_US: Enter your API Key - - variable: openai_organization - label: - zh_Hans: 组织 ID - en_US: Organization - type: text-input - required: false - placeholder: - zh_Hans: 在此输入您的组织 ID - en_US: Enter your Organization ID - variable: openai_api_base label: zh_Hans: API Base diff --git a/controller/system/iml.go b/controller/system/iml.go index b05cac3c..1c1269d5 100644 --- a/controller/system/iml.go +++ b/controller/system/iml.go @@ -381,8 +381,9 @@ func (i *imlInitController) createAIService(ctx context.Context, teamID string, Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}", } aiModel := &ai_api_dto.AiModel{ - Id: m.ID(), - Config: m.DefaultConfig(), + Id: m.ID(), + Config: m.DefaultConfig(), + Provider: providerId, } name := "Demo Translation API" description := "A demo that shows you how to use a prompt to create a Translation API." diff --git a/module/ai/iml.go b/module/ai/iml.go index a6a0c8a2..83616431 100644 --- a/module/ai/iml.go +++ b/module/ai/iml.go @@ -85,10 +85,7 @@ func (i *imlProviderModule) Providers(ctx context.Context) ([]*ai_dto.ProviderIt }) items := make([]*ai_dto.ProviderItem, 0, len(providers)) for _, v := range providers { - defaultLLM, has := v.DefaultModel(model_runtime.ModelTypeLLM) - if !has { - continue - } + item := &ai_dto.ProviderItem{ Id: v.ID(), Name: v.Name(), @@ -97,6 +94,10 @@ func (i *imlProviderModule) Providers(ctx context.Context) ([]*ai_dto.ProviderIt Sort: v.Sort(), } if info, has := providerMap[v.ID()]; has { + defaultLLM, has := v.GetModel(info.DefaultLLM) + if !has { + continue + } item.Configured = true item.DefaultLLM = defaultLLM.ID() item.DefaultLLMLogo = defaultLLM.Logo() @@ -279,10 +280,13 @@ func (i *imlProviderModule) UpdateProviderConfig(ctx context.Context, id string, if !errors.Is(err, gorm.ErrRecordNotFound) { return err } - //defaultLLm, ok := p.DefaultModel(model_runtime.ModelTypeLLM) - //if !ok { - // return fmt.Errorf("ai provider default llm not found") - //} + if input.DefaultLLM == "" { + defaultLLM, has := p.DefaultModel(model_runtime.ModelTypeLLM) + if !has { + return fmt.Errorf("ai provider default llm not found") + } + input.DefaultLLM = defaultLLM.ID() + } info = &ai.Provider{ Id: id, Name: p.Name(), diff --git a/module/team/iml.go b/module/team/iml.go index 4a291939..f8c4a1aa 100644 --- a/module/team/iml.go +++ b/module/team/iml.go @@ -145,7 +145,8 @@ func (m *imlTeamModule) Edit(ctx context.Context, id string, input *team_dto.Edi func (m *imlTeamModule) Delete(ctx context.Context, id string) error { err := m.transaction.Transaction(ctx, func(ctx context.Context) error { count, err := m.serviceService.Count(ctx, "", map[string]interface{}{ - "team": id, + "team": id, + "is_delete": false, }) if err != nil { return err diff --git a/resources/access/access.yaml b/resources/access/access.yaml index 76d3d327..a78cbe6b 100644 --- a/resources/access/access.yaml +++ b/resources/access/access.yaml @@ -1,21 +1,75 @@ system: - - name: organization -# cname: '组织管理' - value: 'organization' + - name: workspace + value: 'workspace' children: - - name: member -# cname: '成员' - value: 'member' + - name: consumer + value: 'application' + children: + - name: view all consumer + value: 'view_all' + guest_allow: true + - name: manager all consumer + value: "manager_all" + dependents: + - system.workspace.consumer.view_all + - name: service + value: 'service' + children: + - name: view all service + value: 'view_all' + guest_allow: true + - name: manager all consumer + value: "manager_all" + dependents: + - system.workspace.service.view_all + - name: team + value: 'team' + children: + - name: view all team + value: 'view_all' + guest_allow: true + - name: create + value: 'create' + - name: manager + value: 'manager' + dependents: + - system.workspace.team.view_all + - name: api portal + value: 'api_portal' + children: + - name: api portal + value: 'api_portal' + children: + - name: view + value: 'view' + guest_allow: true + - name: analysis + value: 'analysis' + children: + - name: run view + value: 'run_view' + children: + - name: view + value: 'view' + guest_allow: true + - name: system settings + value: 'settings' + children: + - name: general + value: 'general' + children: + - name: view + value: 'view' + guest_allow: true + - name: manager + value: 'manager' + - name: account + value: 'account' children: - name: view -# cname: '查看' value: 'view' guest_allow: true - apis: - - "GET:/api/v1/user/accounts" - - "GET:/api/v1/user/departments" - name: manager -# cname: '管理' value: 'manager' apis: - "POST:/api/v1/user/account" @@ -31,148 +85,85 @@ system: - "POST:/api/v1/user/department/member/remove" - "POST:/api/v1/account/role" dependents: - - system.organization.member.view - - name: team - cname: '团队' - value: 'team' - children: - - name: view -# cname: '查看' - value: 'view' - guest_allow: true - apis: - - "GET:/api/v1/manager/teams" - - "GET:/api/v1/manager/team" - - name: manager -# cname: '管理' - value: 'manager' - apis: - - "POST:/api/v1/manager/team" - - "PUT:/api/v1/manager/team" - - "DELETE:/api/v1/manager/team" - dependents: - - system.organization.team.view + - system.settings.account.view - name: role -# cname: '角色' value: 'role' children: - - name: view system role - cname: '查看系统角色' + - name: view guest_allow: true - value: 'view_system_role' + value: 'view' apis: - "GET:/api/v1/system/roles" - "GET:/api/v1/system/role" - - name: view team role - cname: '查看团队角色' - guest_allow: true - value: 'view_team_role' - apis: - "GET:/api/v1/team/roles" - "GET:/api/v1/team/role" - - name: System Settings -# cname: '系统设置' - value: 'settings' - children: - - name: service classification -# cname: '服务分类' - value: 'service_classification' + - name: api gateway + value: 'api_gateway' children: - name: view -# cname: '查看' - value: 'view' - guest_allow: true -# apis: -# - "GET:/api/v1/catalogues" - - name: manager -# cname: '管理' - value: 'manager' - apis: - - "POST:/api/v1/catalogue" - - "PUT:/api/v1/catalogue" - - "DELETE:/api/v1/catalogue" - - "PUT:/api/v1/catalogue/sort" - dependents: - - system.settings.service_classification.view - - name: General -# cname: 常规设置 - value: 'general' - children: - - name: view -# cname: 查看 + cname: 查看 value: 'view' guest_allow: true apis: -# - "GET:/api/v1/setting" + - "GET:/api/v1/cluster/nodes" - name: manager -# cname: 管理 value: 'manager' apis: -# - "PUT:/api/v1/setting" - dependents: - - system.settings.general.view - - name: Devops -# cname: 运维 - value: 'devops' - children: - - name: cluster - cname: 集群 - value: 'cluster' + - "PUT:/api/v1/cluster/reset" + - "POST:/api/v1/cluster/check" + - name: ai provider + value: 'ai_provider' children: - name: view - cname: 查看 value: 'view' guest_allow: true apis: - - "GET:/api/v1/cluster/nodes" + - "GET:/api/v1/ai/providers" + - "GET:/api/v1/ai/provider/config" - name: manager -# cname: 管理 value: 'manager' apis: - - "PUT:/api/v1/cluster/reset" - - "POST:/api/v1/cluster/check" + - "PUT:/api/v1/ai/provider/config" + - "PUT:/api/v1/ai/provider/default-llm" + dependents: + - system.settings.ai_provider.view - name: ssl certificate cname: 证书 value: 'ssl_certificate' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: - "GET:/api/v1/certificates" - "GET:/api/v1/certificate" - name: manager -# cname: 管理 value: 'manager' apis: - "POST:/api/v1/certificate" - "PUT:/api/v1/certificate" - "DELETE:/api/v1/certificate" dependents: - - system.devops.ssl_certificate.view + - system.settings.ssl_certificate.view - name: Data Source -# cname: '数据源' value: 'data_source' children: - name: view -# cname: '查看' value: 'view' guest_allow: true apis: - "GET:/api/v1/monitor/config" - name: manager -# cname: '管理' value: 'manager' apis: - "POST:/api/v1/monitor/config" - "PUT:/api/v1/monitor/config" + dependents: + - system.settings.data_source.view - name: log configuration -# cname: 日志 value: 'log_configuration' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: @@ -180,7 +171,6 @@ system: - "GET:/api/v1/dynamic/{name}/list" - "GET:/api/v1/dynamic/{name}/render" - name: manager -# cname: 管理 value: 'manager' apis: - "POST:/api/v1/dynamic/{name}" @@ -189,93 +179,13 @@ system: - "PUT:/api/v1/dynamic/{name}/online" - "PUT:/api/v1/dynamic/{name}/offline" dependents: - - system.devops.log_configuration.view - - name: ai provider -# cname: AI 模型供应商 - value: 'ai_provider' - children: - - name: view -# cname: 查看 - value: 'view' - guest_allow: true - apis: - - "GET:/api/v1/ai/providers" - - "GET:/api/v1/ai/provider/config" - - name: manager -# cname: 管理 - value: 'manager' - apis: - - "PUT:/api/v1/ai/provider/config" - - "PUT:/api/v1/ai/provider/default-llm" - dependents: - - system.devops.ai_provider.view - - - name: dashboard -# cname: 仪表盘 - value: 'dashboard' - children: - - name: run view -# cname: 运行视图 - value: 'run_view' - children: - - name: view -# cname: 查看 - value: 'view' - guest_allow: true - apis: - - "GET:/api/v1/monitor/overview/invoke" - - "GET:/api/v1/monitor/overview/message" - - "GET:/api/v1/monitor/overview/top10" - - "GET:/api/v1/monitor/overview/summary" - - name: workspace -# cname: 工作空间 - value: 'workspace' - children: - - name: application -# cname: 应用 - value: 'application' - children: - - name: view all application -# cname: 查看所有应用 - value: 'view_all' - guest_allow: true - apis: - - "GET:/api/v1/apps" - - name: service -# cname: 服务 - value: 'service' - children: - - name: view all service -# cname: 查看所有服务 - value: 'view_all' - guest_allow: true - apis: - - "GET:/api/v1/services" - - name: team -# cname: 团队 - value: 'team' - children: - - name: view all team -# cname: 查看所有团队 - value: 'view_all' - guest_allow: true - apis: - - "GET:/api/v1/manager/teams" - - name: api market - value: 'api_market' - children: - - name: view - value: 'view' - guest_allow: true - apis: - - "GET:/api/v1/catalogue/services" - - "GET:/api/v1/catalogue/service" + - system.settings.log_configuration.view team: - name: service value: 'service' children: - - name: router - value: 'router' + - name: api + value: 'api' children: - name: view value: 'view' @@ -291,43 +201,53 @@ team: - "POST:/api/v1/service/router" - "PUT:/api/v1/service/router" - "DELETE:/api/v1/service/router" + dependents: + - team.service.api.view - name: api doc cname: API文档 value: 'api_doc' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: - "GET:/api/v1/service/api_doc" - name: manager -# cname: 管理 value: 'manager' apis: - "PUT:/api/v1/service/api_doc" - "POST:/api/v1/service/api_doc/upload" + dependents: + - team.service.api_doc.view + - name: service intro + value: 'service_intro' + children: + - name: view + value: 'view' + guest_allow: true + - name: manager + value: 'manager' + dependents: + - team.service.service_intro.view - name: upstream cname: 上游 value: 'upstream' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: - "GET:/api/v1/service/upstream" - name: manager -# cname: 管理 value: 'manager' apis: - "PUT:/api/v1/service/upstream" + dependents: + - team.service.upstream.view - name: release -# cname: 发布 value: 'release' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: @@ -338,18 +258,16 @@ team: - "GET:/api/v1/service/release/preview" - "GET:/api/v1/service/publish/status" - name: manager -# cname: 管理 value: 'manager' apis: - "POST:/api/v1/service/publish/release/do" -# - "PUT:/api/v1/service/publish/execute" - "DELETE:/api/v1/service/release" + dependents: + - team.service.release.view - name: subscription management -# cname: 订阅方管理 value: 'subscription' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: @@ -357,50 +275,49 @@ team: - "GET:/api/v1/service/approval/subscribe" - "GET:/api/v1/service/subscribers" - name: manager -# cname: 管理 value: 'manager' apis: - "POST:/api/v1/service/approval/subscribe" - "POST:/api/v1/service/subscriber" - "DELETE:/api/v1/service/subscriber" + dependents: + - team.service.subscription.view - name: service -# cname: 服务管理 value: 'service' children: - name: manager -# cname: 管理 value: 'manager' apis: - "PUT:/api/v1/service/info" - "POST:/api/v1/team/service" - "DELETE:/api/v1/team/service" - - name: application - cname: 应用 - value: 'application' + dependents: + - team.service.service.manager + - name: consumer + value: 'consumer' children: - name: subscription Service cname: 订阅服务 value: 'subscription' children: - - name: view -# cname: 查看 - value: 'view' + - name: subscribe + value: 'subscribe' + + - name: view subscribed services + value: 'view_subscribed_service' guest_allow: true apis: - - "GET:/api/v1/application/subscriptions" - - name: manager -# cname: 管理 - value: 'manager' + - "GET:/api/v1/application/subscription" + - name: manager subscribed services + value: 'manager_subscribed_services' apis: - "POST:/api/v1/catalogue/service/subscribe" - "POST:/api/v1/application/subscription/cancel" - "POST:/api/v1/application/subscription/cancel_apply" - name: authorization -# cname: 访问授权 value: 'authorization' children: - name: view -# cname: 查看 value: 'view' guest_allow: true apis: @@ -408,60 +325,66 @@ team: - "GET:/api/v1/app/authorizations" - "GET:/api/v1/app/authorization/details" - name: manager -# cname: 管理 value: 'manager' apis: - "POST:/api/v1/app/authorization" - "PUT:/api/v1/app/authorization" - "DELETE:/api/v1/app/authorization" - - name: application -# cname: 应用 + - name: consumer value: 'application' children: - name: manager -# cname: 管理 value: 'manager' apis: - "PUT:/api/v1/app/info" - "POST:/api/v1/team/app" - - "DELETE:/api/v1/app" - name: team -# cname: 团队 value: 'team' children: + - name: service + value: 'service' + children: + - name: view + value: 'view' + guest_allow: true + - name: manager + value: 'manager' + dependents: + - team.team.service.view + - name: consumer + value: 'consumer' + children: + - name: view + value: 'view' + guest_allow: true + - name: manager + value: 'manager' + dependents: + - team.team.consumer.view - name: member -# cname: 成员 value: 'member' children: - name: view -# cname: 查看 value: 'view' guest_allow: true - apis: - - "GET:/api/v1/team/members" - - "GET:/api/v1/team/members/toadd" - name: manager -# cname: 管理 value: 'manager' - apis: - - "POST:/api/v1/team/member" - - "DELETE:/api/v1/team/member" - - "PUT:/api/v1/team/member/role" + dependents: + - team.team.member.view - name: team -# cname: 团队管理 value: 'team' children: - name: view -# cname: '查看' value: 'view' guest_allow: true apis: - "GET:/api/v1/manager/teams" - "GET:/api/v1/manager/team" - name: manager -# cname: '管理' value: 'manager' apis: - "POST:/api/v1/manager/team" - "PUT:/api/v1/manager/team" - - "DELETE:/api/v1/manager/team" \ No newline at end of file + - "DELETE:/api/v1/manager/team" + dependents: + - team.team.team.view \ No newline at end of file diff --git a/resources/access/role.yaml b/resources/access/role.yaml index 5b752025..19772f90 100644 --- a/resources/access/role.yaml +++ b/resources/access/role.yaml @@ -2,163 +2,159 @@ system: - name: super admin value: super_admin permits: - - system.dashboard.run_view.view - - system.devops.ai_provider.manager - - system.devops.ai_provider.view - - system.devops.cluster.manager - - system.devops.cluster.view - - system.devops.data_source.manager - - system.devops.data_source.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.analysis.run_view.view + - system.api_portal.api_portal.view + - system.settings.account.manager + - system.settings.account.view + - system.settings.ai_provider.manager + - system.settings.ai_provider.view + - system.settings.api_gateway.manager + - system.settings.api_gateway.view + - system.settings.data_source.manager + - system.settings.data_source.view - system.settings.general.manager - system.settings.general.view - - system.settings.service_classification.manager - - system.settings.service_classification.view - - system.workspace.api_market.view + - system.settings.log_configuration.manager + - system.settings.log_configuration.view + - system.settings.role.view + - system.settings.ssl_certificate.manager + - system.settings.ssl_certificate.view + - system.workspace.application.manager_all - system.workspace.application.view_all + - system.workspace.service.manager_all - system.workspace.service.view_all + - system.workspace.team.create + - system.workspace.team.manager - system.workspace.team.view_all supper: true - name: team admin value: team_admin 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 + - system.api_portal.api_portal.view + - system.workspace.team.create - name: devops admin value: devops_admin permits: - - system.dashboard.run_view.view - - system.devops.ai_provider.manager - - system.devops.ai_provider.view - - system.devops.cluster.manager - - system.devops.cluster.view - - system.devops.data_source.manager - - system.devops.data_source.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.analysis.run_view.view + - system.api_portal.api_portal.view + - system.settings.ai_provider.manager + - system.settings.ai_provider.view + - system.settings.api_gateway.manager + - system.settings.api_gateway.view + - system.settings.data_source.manager + - system.settings.data_source.view + - system.settings.general.manager + - system.settings.general.view + - system.settings.log_configuration.manager + - system.settings.log_configuration.view + - system.settings.ssl_certificate.manager + - system.settings.ssl_certificate.view - system.workspace.application.view_all - system.workspace.service.view_all - system.workspace.team.view_all - - system.settings.general.manager - - system.settings.general.view - - system.settings.service_classification.manager - - system.settings.service_classification.view - name: general member value: member permits: - - system.workspace.api_market.view + - system.api_portal.api_portal.view default: true - - name: guest - value: guest - permits: - - system.settings.service_classification.view - - system.devops.cluster.view - - system.devops.log_configuration.view - - system.devops.ssl_certificate.view - - system.devops.monitor.view - - system.organization.member.view - - system.organization.role.view_system_role - - system.organization.role.view_team_role - - system.organization.team.view - - system.workspace.api_market.view - - system.workspace.application.view_all - - system.workspace.service.view_all - - system.workspace.team.view_all - - system.dashboard.run_view.view + team: - name: team admin value: team_admin permits: - - team.application.application.manager - - team.application.authorization.manager - - team.application.authorization.view - - team.application.subscription.manager - - team.application.subscription.view - - team.service.api_doc.view + - team.consumer.application.manager + - team.consumer.authorization.manager + - team.consumer.authorization.view + - team.consumer.subscription.manager_subscribed_services + - team.consumer.subscription.subscribe + - team.consumer.subscription.view_subscribed_service + - team.service.api.manager + - team.service.api.view - team.service.api_doc.manager - - team.service.router.manager - - team.service.router.view + - team.service.api_doc.view - team.service.release.manager - team.service.release.view - team.service.service.manager + - team.service.service_intro.manager + - team.service.service_intro.view - team.service.subscription.manager - team.service.subscription.view - team.service.upstream.manager - team.service.upstream.view + - team.team.consumer.manager + - team.team.consumer.view - team.team.member.manager - team.team.member.view + - team.team.service.manager + - team.team.service.view - team.team.team.manager - team.team.team.view supper: true - name: service admin value: service_admin permits: - - team.service.service.manager - - team.service.upstream.manager - - team.service.upstream.view - - team.service.api_doc.view + - team.service.api.manager + - team.service.api.view - team.service.api_doc.manager - - team.service.router.manager - - team.service.router.view - - team.service.subscription.manager - - team.service.subscription.view + - team.service.api_doc.view - team.service.release.manager - team.service.release.view + - team.service.service.manager + - team.service.service_intro.manager + - team.service.service_intro.view + - team.service.subscription.manager + - team.service.subscription.view + - team.service.upstream.manager + - team.service.upstream.view + - team.team.consumer.view - team.team.member.view + - team.team.service.manager + - team.team.service.view + - team.team.team.view - name: service developer value: service_developer permits: - - team.service.upstream.manager - - team.service.upstream.view - - team.service.api_doc.view + - team.service.api.manager + - team.service.api.view - team.service.api_doc.manager - - team.service.router.manager - - team.service.router.view + - team.service.api_doc.view - team.service.release.manager - team.service.release.view + - team.service.service.manager + - team.service.service_intro.manager + - team.service.service_intro.view + - team.service.subscription.manager + - team.service.subscription.view + - team.service.upstream.manager + - team.service.upstream.view + - team.team.consumer.view - team.team.member.view - - name: application admin - value: application_admin + - team.team.service.view + - team.team.team.view + - name: consumer admin + value: consumer_admin permits: - - team.application.application.manager - - team.application.authorization.manager - - team.application.authorization.view - - team.application.subscription.manager - - team.application.subscription.view + - team.consumer.application.manager + - team.consumer.authorization.manager + - team.consumer.authorization.view + - team.consumer.subscription.manager_subscribed_services + - team.consumer.subscription.subscribe + - team.consumer.subscription.view_subscribed_service + - team.team.consumer.manager + - team.team.consumer.view - team.team.member.view - - name: application developer - value: application_developer + - team.team.service.view + - team.team.team.view + - name: consumer developer + value: consumer_developer permits: - - team.application.authorization.view - - team.application.subscription.manager - - team.application.subscription.view + - team.consumer.application.manager + - team.consumer.authorization.manager + - team.consumer.authorization.view + - team.consumer.subscription.subscribe + - team.consumer.subscription.view_subscribed_service + - team.team.consumer.view - team.team.member.view + - team.team.service.view + - team.team.team.view default: true - - name: guest - value: guest - permits: - - team.application.authorization.view - - team.application.subscription.view - - team.service.router.view - - team.service.release.view - - team.service.subscription.view - - team.service.upstream.view - - team.team.member.view - - team.team.team.view \ No newline at end of file diff --git a/service/service/iml.go b/service/service/iml.go index 69604366..e799e836 100644 --- a/service/service/iml.go +++ b/service/service/iml.go @@ -68,6 +68,7 @@ func (i *imlServiceService) SearchPublicServices(ctx context.Context, keyword st func (i *imlServiceService) ServiceCountByTeam(ctx context.Context, teamId ...string) (map[string]int64, error) { w := map[string]interface{}{ "as_server": true, + "is_delete": false, } if len(teamId) > 0 { w["team"] = teamId @@ -77,7 +78,8 @@ func (i *imlServiceService) ServiceCountByTeam(ctx context.Context, teamId ...st func (i *imlServiceService) AppCountByTeam(ctx context.Context, teamId ...string) (map[string]int64, error) { w := map[string]interface{}{ - "as_app": true, + "as_app": true, + "is_delete": false, } if len(teamId) > 0 { w["team"] = teamId