0.11.1: 旗舰版完善(资源权限等级/个人环境变量/收藏/企业报表/租户概览/ARM64发布/多渠道接入)

- 迁移 000035-000037(权限等级/环境变量/渠道)
- 新增 internal/channel 渠道抽象层(webhook/企微/钉钉/飞书)
- 全部功能端到端验证通过(25 包单测)
This commit is contained in:
2026-08-13 11:54:34 +08:00
parent c22669c31d
commit 4563979a15
25 changed files with 1664 additions and 7 deletions
+6 -2
View File
@@ -19,6 +19,7 @@ import (
var ErrNotFound = errors.New("portal resource not found")
type Service struct {
envVars *workbench.EnvVarService
pool *pgxpool.Pool
assets *workbench.Service
tools *workbench.ToolService
@@ -32,6 +33,9 @@ func NewService(pool *pgxpool.Pool, assets *workbench.Service, tools *workbench.
return &Service{pool: pool, assets: assets, tools: tools, identity: identityService}
}
// SetEnvVarService 启用个人环境变量合并(对话请求未提供的变量用用户配置补充)。
func (s *Service) SetEnvVarService(service *workbench.EnvVarService) { s.envVars = service }
func (s *Service) SetApplicationRuntime(credentials *RuntimeCredentials, runtime http.Handler) {
s.credentials = credentials
s.runtime = runtime
@@ -332,7 +336,7 @@ func (s *Service) MarketplaceDetail(ctx context.Context, account identity.Accoun
// MarketplaceInstall binds a published, visible resource to the portal user's
// workspace. Cross-department resources the user cannot see cannot be installed.
func (s *Service) MarketplaceInstall(ctx context.Context, account identity.Account, resourceType, code string) (bool, error) {
func (s *Service) MarketplaceInstall(ctx context.Context, account identity.Account, resourceType, code, permissionLevel string) (bool, error) {
if s.market == nil {
return false, ErrNotFound
}
@@ -343,7 +347,7 @@ func (s *Service) MarketplaceInstall(ctx context.Context, account identity.Accou
if !visible(item.DepartmentIDs, account.DepartmentID) {
return false, ErrNotFound
}
return s.market.Install(ctx, resourceType, code, account.ID)
return s.market.Install(ctx, resourceType, code, account.ID, permissionLevel)
}
func (s *Service) MarketplaceUninstall(ctx context.Context, account identity.Account, resourceType, code string) error {