{ "swagger": "2.0", "info": { "description": "ADDP 资产目录、发布、申请、授权和评价 API | ADDP asset directory, publishing, application, authorization and rating API", "title": "ADDP Asset API", "contact": {}, "version": "1.0" }, "basePath": "/api/v1/asset", "paths": { "/applications": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Application" ], "summary": "获取资产申请 | List asset applications", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.application.read" ] } }, "/applications/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Application" ], "summary": "获取资产申请详情 | Get asset application", "parameters": [ { "type": "integer", "description": "申请 ID | Application ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.application.read" ] } }, "/applications/{id}/approve": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Application" ], "summary": "批准资产申请 | Approve asset application", "parameters": [ { "type": "integer", "description": "申请 ID | Application ID", "name": "id", "in": "path", "required": true }, { "description": "审批 | Review", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.ApproveApplicationReq" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.application.approve" ] } }, "/applications/{id}/reject": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Application" ], "summary": "驳回资产申请 | Reject asset application", "parameters": [ { "type": "integer", "description": "申请 ID | Application ID", "name": "id", "in": "path", "required": true }, { "description": "审批 | Review", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.RejectApplicationReq" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.application.reject" ] } }, "/applications/{id}/revoke": { "post": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Application" ], "summary": "撤销申请授权 | Revoke application authorization", "parameters": [ { "type": "integer", "description": "申请 ID | Application ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.application.revoke" ] } }, "/assets": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "获取资产列表 | List assets", "parameters": [ { "type": "integer", "description": "直接归属的资产分类 ID;-1 表示未分类 | Directly assigned asset category ID; -1 means uncategorized", "name": "category_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "无效的资产分类 ID | Invalid asset category ID", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.read" ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "选择一个或多个 CatalogEntry 原子创建资产草稿 | Atomically create an asset draft by selecting one or more CatalogEntry references", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "创建资产 | Create asset", "parameters": [ { "description": "完整资产聚合 | Complete asset aggregate", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.CreateAssetReq" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.update" ] } }, "/assets/batch-category": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "批量设置资产分类 | Batch categorize assets", "parameters": [ { "description": "资产分类变更 | Asset category change", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.BatchCategoryRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.update" ] } }, "/assets/batch-offline": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "批量下架资产 | Batch offline assets", "parameters": [ { "description": "资产 ID | Asset IDs", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.BatchIDsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.offline" ] } }, "/assets/batch-publish": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "批量上架资产 | Batch publish assets", "parameters": [ { "description": "资产 ID | Asset IDs", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.BatchIDsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.publish" ] } }, "/assets/stats": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "获取资产统计 | Get asset statistics", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.read" ] } }, "/assets/stats/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "按资产类型或具体资产统计 Asset 自有的状态、申请结果、有效授权用户、评价和近 30 天趋势 | Aggregate Asset-owned status, application results, effective authorized users, ratings, and 30-day trends by asset type or a specific asset", "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "获取资产运营统计 | Get asset dashboard statistics", "parameters": [ { "type": "string", "description": "资产类型代码 | Asset type code", "name": "type_code", "in": "query" }, { "type": "integer", "description": "资产 ID;与 type_code 同时存在时取交集 | Asset ID; intersects with type_code when both are present", "name": "asset_id", "in": "query" } ], "responses": { "200": { "description": "资产运营统计 | Asset dashboard statistics", "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.DashboardStats" } }, "400": { "description": "参数无效 | Invalid parameter", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "资产不存在或不属于统计范围 | Asset not found or outside the requested scope", "schema": { "type": "object", "additionalProperties": true } }, "500": { "description": "统计失败 | Statistics query failed", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.read", "asset.application.read", "asset.authorization.read", "asset.rating.read" ] } }, "/assets/type-fields/{type_id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "获取资产类型字段 | Get asset type fields", "parameters": [ { "type": "integer", "description": "类型 ID | Type ID", "name": "type_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.read" ] } }, "/assets/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "获取资产详情 | Get asset", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.read" ] }, "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "更新资产 | Update asset", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true }, { "description": "资产 | Asset", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.UpdateAssetReq" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.update" ] }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "已发布资产必须先下架再删除 | Published assets must be offlined before deletion", "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "删除草稿或已下架资产 | Delete draft or offline asset", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.delete" ] } }, "/assets/{id}/offline": { "post": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "下架资产 | Offline asset", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.offline" ] } }, "/assets/{id}/publish": { "post": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset" ], "summary": "上架资产 | Publish asset", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.publish" ] } }, "/authorizations": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Authorization" ], "summary": "获取资产授权 | List asset authorizations", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.authorization.read" ] } }, "/authorizations/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Authorization" ], "summary": "获取资产授权详情 | Get asset authorization", "parameters": [ { "type": "integer", "description": "授权 ID | Authorization ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.authorization.read" ] } }, "/authorizations/{id}/revoke": { "post": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Authorization" ], "summary": "撤销资产授权 | Revoke asset authorization", "parameters": [ { "type": "integer", "description": "授权 ID | Authorization ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.authorization.revoke" ] } }, "/categories": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Category" ], "summary": "获取资产分类 | List asset categories", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.category.read" ] }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Category" ], "summary": "创建资产分类 | Create asset category", "parameters": [ { "description": "资产分类 | Asset category", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.CreateAssetCategoryRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.category.create" ] } }, "/categories/tree": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Category" ], "summary": "获取资产分类树 | Get asset category tree", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.category.read" ] } }, "/categories/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Category" ], "summary": "获取资产分类详情 | Get asset category", "parameters": [ { "type": "integer", "description": "资产分类 ID | Asset category ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.category.read" ] }, "put": { "security": [ { "BearerAuth": [] } ], "description": "完整更新名称、父目录、说明和排序;parent_id 为 null 时移动到根目录 | Fully updates name, parent, description, and sort order; null parent_id moves the category to the root", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Category" ], "summary": "完整更新资产目录节点 | Fully update an asset category", "parameters": [ { "type": "integer", "description": "资产分类 ID | Asset category ID", "name": "id", "in": "path", "required": true }, { "description": "资产分类 | Asset category", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.UpdateAssetCategoryRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.category.update" ] }, "delete": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Category" ], "summary": "删除资产分类 | Delete asset category", "parameters": [ { "type": "integer", "description": "资产分类 ID | Asset category ID", "name": "id", "in": "path", "required": true }, { "description": "并发版本 | Concurrency version", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.DeleteAssetCategoryRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.category.delete" ] } }, "/cleanup-executions/{execution_id}/result": { "get": { "security": [ { "BearerAuth": [] } ], "description": "仅第一方 unrestricted 租户用户;同时要求本模块专业结果权限、Cleanup公共读取权限及本人子执行归属。不返回SQL、凭据、对象路径或原始错误。 | First-party unrestricted tenant Users only; requires both professional and public Cleanup read permissions and ownership of the child execution. No SQL, credentials, object paths or raw errors.", "produces": [ "application/json" ], "tags": [ "Cleanup" ], "summary": "获取本模块资源回收专业结果 | Get module cleanup professional result", "parameters": [ { "type": "string", "description": "子执行UUID | Child execution UUID", "name": "execution_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/cleanup.Result" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "403": { "description": "Forbidden", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "Conflict", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.cleanup_result.read", "system.cleanup.read" ] } }, "/consumer/applications": { "get": { "security": [ { "BearerAuth": [] } ], "description": "仅当前租户内的 User 可查询本人提交的申请 | Only a User in the current tenant can list their own applications", "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "获取我的资产申请 | List my asset applications", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "403": { "description": "禁止访问 | Forbidden", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.application.read" ] } }, "/consumer/assets": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "浏览已上架资产 | Browse published assets", "parameters": [ { "type": "integer", "description": "资产目录节点 ID;返回该节点及全部后代节点中的已上架资产 | Asset directory node ID; returns published assets in the node subtree", "name": "category_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "无效的资产目录节点 ID | Invalid asset directory node ID", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "资产目录节点不存在 | Asset directory node not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.entry.read" ] } }, "/consumer/assets/stats": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "获取已上架资产统计 | Get published asset statistics", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.entry.read" ] } }, "/consumer/assets/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "获取已上架资产详情 | Get published asset detail", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.entry.read" ] } }, "/consumer/assets/{id}/application-status": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "获取我的资产申请状态 | Get my asset application status", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/github_com_addp_asset_internal_service.ConsumerAccessStatus" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.application.read", "asset.authorization.read" ] } }, "/consumer/assets/{id}/applications": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "申请使用资产 | Apply for asset access", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true }, { "description": "申请 | Application", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_api.consumerApplicationRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.application.create" ] } }, "/consumer/assets/{id}/my-rating": { "get": { "security": [ { "BearerAuth": [] } ], "description": "仅返回当前用户在已上架资产上的评价,不开放其他用户评价列表 | Return only the current user's rating on a published asset, without listing other users' ratings", "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "获取本人评价以修改 | Get own rating for editing", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/internal_api.ownConsumerRatingResponse" } }, "404": { "description": "资产不存在 | Asset not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.rating.update" ] } }, "/consumer/assets/{id}/ratings": { "get": { "security": [ { "BearerAuth": [] } ], "description": "分页返回公开评价,并独立返回当前用户评价与全量平均分 | Paginate published ratings and independently return the current user's rating and overall average", "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "获取已上架资产评价 | List published asset ratings", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/internal_api.consumerRatingsResponse" } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.rating.read" ] }, "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "修改本人资产评价 | Update own asset rating", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true }, { "description": "评价 | Rating", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_api.consumerRatingRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "403": { "description": "没有有效资产授权 | No effective asset authorization", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "本人评价不存在 | Own rating not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.rating.update" ] }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "创建资产评价 | Create asset rating", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "id", "in": "path", "required": true }, { "description": "评价 | Rating", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_api.consumerRatingRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "403": { "description": "没有有效资产授权 | No effective asset authorization", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "本人评价已存在 | Own rating already exists", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.rating.create" ] } }, "/consumer/categories": { "get": { "security": [ { "BearerAuth": [] } ], "description": "仅返回包含已上架资产的目录分支,count 为当前节点整棵子树的已上架资产数 | Returns only branches containing published assets; count is the published asset total for the entire subtree", "produces": [ "application/json" ], "tags": [ "Asset Consumer" ], "summary": "浏览已上架资产分类 | Browse published asset categories", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/github_com_addp_asset_internal_service.AssetCategoryTreeNode" } } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.category.read" ] } }, "/execution-read-scope": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Execution diagnostics" ], "summary": "获取执行读取范围 | Get execution read scope", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/execution.ReadScope" } }, "403": { "description": "Forbidden", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } }, "x-addp-auth-mode": "authenticated" } }, "/ratings": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Rating" ], "summary": "获取资产评价 | List asset ratings", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.rating.read" ] } }, "/ratings/stats": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Rating" ], "summary": "获取资产评价统计 | Get asset rating statistics", "parameters": [ { "type": "integer", "description": "资产 ID | Asset ID", "name": "asset_id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.rating.read" ] } }, "/ratings/{id}/mark-handled": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Asset Rating" ], "summary": "标记评价反馈状态 | Mark rating feedback status", "parameters": [ { "type": "integer", "description": "评价 ID | Rating ID", "name": "id", "in": "path", "required": true }, { "description": "处理状态 | Handled status", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_api.ratingHandledRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.rating.update" ] } }, "/type-definitions": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Type" ], "summary": "获取资产类型 | List asset types", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.read" ] } }, "/type-definitions/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "Asset Type" ], "summary": "获取资产类型详情 | Get asset type", "parameters": [ { "type": "integer", "description": "类型 ID | Type ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } } }, "x-addp-auth-mode": "permission", "x-addp-required-permissions": [ "asset.management.read", "asset.entry.read" ] } } }, "definitions": { "cleanup.Result": { "type": "object", "properties": { "action": { "type": "string" }, "attempt": { "type": "integer" }, "cleanup_mode": { "type": "string" }, "execution_id": { "type": "string" }, "module": { "type": "string" }, "reason": { "type": "string" }, "request_id": { "type": "string" }, "schema": { "type": "string" }, "statistics": { "type": "object", "additionalProperties": { "type": "integer", "format": "int64" } }, "status": { "type": "string" }, "summary": { "$ref": "#/definitions/events.CleanupResultSummary" } } }, "events.CleanupResultSummary": { "type": "object", "properties": { "affected_records": { "type": "integer" }, "deleted_physical_artifacts": { "type": "integer" }, "deleted_task_definitions": { "type": "integer" }, "disabled_task_definitions": { "type": "integer" }, "error_count": { "type": "integer" }, "freed_bytes": { "type": "integer" }, "marked_missing_source": { "type": "integer" }, "marked_outdated": { "type": "integer" }, "risk_level": { "type": "string" }, "scanned_items": { "type": "integer" }, "skipped_items": { "type": "integer" } } }, "execution.ReadGrant": { "type": "object", "properties": { "own_ad_hoc": { "type": "boolean" }, "task_history": { "type": "boolean" }, "task_type": { "type": "string" } } }, "execution.ReadScope": { "type": "object", "properties": { "grants": { "type": "array", "items": { "$ref": "#/definitions/execution.ReadGrant" } }, "module": { "type": "string" }, "principal_id": { "type": "integer" }, "tenant_id": { "type": "integer" } } }, "github_com_addp_asset_internal_models.Rating": { "type": "object", "properties": { "asset_id": { "type": "integer" }, "comment": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "is_handled": { "description": "管理员是否已处理问题反馈", "type": "boolean" }, "score": { "description": "1-5 分", "type": "number" }, "tags": { "description": "反馈标签(问题反馈时填写,如:数据质量问题/文档不清晰)", "type": "array", "items": { "type": "string" } }, "tenant_id": { "type": "integer" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" } } }, "github_com_addp_asset_internal_service.ApproveApplicationReq": { "type": "object", "properties": { "note": { "description": "可选备注", "type": "string" } } }, "github_com_addp_asset_internal_service.AssetCategoryTreeNode": { "type": "object", "properties": { "children": { "type": "array", "items": { "$ref": "#/definitions/github_com_addp_asset_internal_service.AssetCategoryTreeNode" } }, "count": { "type": "integer" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "parent_id": { "type": "integer" }, "sort_order": { "type": "integer" }, "tenant_id": { "type": "integer" }, "updated_at": { "type": "string" }, "version": { "type": "integer" } } }, "github_com_addp_asset_internal_service.AssetComponentInput": { "type": "object", "properties": { "catalog_entry_id": { "type": "string" }, "role": { "type": "string" }, "sort_order": { "type": "integer" } } }, "github_com_addp_asset_internal_service.BatchCategoryRequest": { "type": "object", "required": [ "ids" ], "properties": { "category_id": { "description": "null 表示清除分类", "type": "integer" }, "ids": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "github_com_addp_asset_internal_service.BatchIDsReq": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "github_com_addp_asset_internal_service.ConsumerAccessStatus": { "type": "object", "properties": { "open_path": { "type": "string" }, "status": { "type": "string", "enum": [ "none", "pending", "fulfilling", "effective", "revoking" ] } } }, "github_com_addp_asset_internal_service.CreateAssetCategoryRequest": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "parent_id": { "type": "integer" }, "sort_order": { "type": "integer" } } }, "github_com_addp_asset_internal_service.CreateAssetReq": { "type": "object", "required": [ "components", "name", "type_id" ], "properties": { "category_id": { "type": "integer" }, "components": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/github_com_addp_asset_internal_service.AssetComponentInput" } }, "description": { "type": "string" }, "name": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "type_id": { "type": "integer" } } }, "github_com_addp_asset_internal_service.DailyCount": { "type": "object", "properties": { "count": { "type": "integer" }, "date": { "type": "string" } } }, "github_com_addp_asset_internal_service.DashboardStats": { "type": "object", "properties": { "application_approved": { "type": "integer" }, "application_pending": { "type": "integer" }, "application_rejected": { "type": "integer" }, "application_total": { "description": "申请结果与当前有效授权用户汇总", "type": "integer" }, "application_trend": { "type": "array", "items": { "$ref": "#/definitions/github_com_addp_asset_internal_service.DailyCount" } }, "asset_draft": { "type": "integer" }, "asset_offline": { "type": "integer" }, "asset_published": { "type": "integer" }, "asset_total": { "description": "资产状态汇总", "type": "integer" }, "effective_authorized_users": { "type": "integer" }, "publish_trend": { "description": "时间趋势(近 30 天,按天汇总)", "type": "array", "items": { "$ref": "#/definitions/github_com_addp_asset_internal_service.DailyCount" } }, "rating_avg_score": { "type": "number" }, "rating_count": { "description": "评价汇总", "type": "integer" } } }, "github_com_addp_asset_internal_service.DeleteAssetCategoryRequest": { "type": "object", "required": [ "version" ], "properties": { "version": { "type": "integer", "minimum": 1 } } }, "github_com_addp_asset_internal_service.RatingWithUser": { "type": "object", "properties": { "asset_id": { "type": "integer" }, "asset_name": { "type": "string" }, "comment": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "is_handled": { "description": "管理员是否已处理问题反馈", "type": "boolean" }, "score": { "description": "1-5 分", "type": "number" }, "tags": { "description": "反馈标签(问题反馈时填写,如:数据质量问题/文档不清晰)", "type": "array", "items": { "type": "string" } }, "tenant_id": { "type": "integer" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" }, "user_name": { "type": "string" } } }, "github_com_addp_asset_internal_service.RejectApplicationReq": { "type": "object", "required": [ "reason" ], "properties": { "reason": { "description": "必填驳回原因", "type": "string" } } }, "github_com_addp_asset_internal_service.UpdateAssetCategoryRequest": { "type": "object", "required": [ "description", "name", "parent_id", "sort_order", "version" ], "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "parent_id": { "type": "integer", "x-nullable": true }, "sort_order": { "type": "integer", "minimum": 0 }, "version": { "type": "integer", "minimum": 1 } } }, "github_com_addp_asset_internal_service.UpdateAssetReq": { "type": "object", "required": [ "components", "name", "type_id", "version" ], "properties": { "category_id": { "type": "integer" }, "components": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/github_com_addp_asset_internal_service.AssetComponentInput" } }, "description": { "type": "string" }, "name": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "type_id": { "type": "integer" }, "version": { "type": "integer", "minimum": 1 } } }, "internal_api.consumerApplicationRequest": { "type": "object", "required": [ "reason" ], "properties": { "duration_day": { "type": "integer" }, "reason": { "type": "string" } } }, "internal_api.consumerRatingRequest": { "type": "object", "required": [ "score" ], "properties": { "comment": { "type": "string" }, "score": { "type": "number", "maximum": 5, "minimum": 1 }, "tags": { "type": "array", "items": { "type": "string" } } } }, "internal_api.consumerRatingsResponse": { "type": "object", "properties": { "avg_score": { "type": "number" }, "data": { "type": "array", "items": { "$ref": "#/definitions/github_com_addp_asset_internal_service.RatingWithUser" } }, "my_rating": { "$ref": "#/definitions/github_com_addp_asset_internal_models.Rating" }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "internal_api.ownConsumerRatingResponse": { "type": "object", "properties": { "rating": { "$ref": "#/definitions/github_com_addp_asset_internal_models.Rating" } } }, "internal_api.ratingHandledRequest": { "type": "object", "properties": { "is_handled": { "type": "boolean" } } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }