{ "openapi" : "3.1.0", "info" : { "title" : "CraftLabs 交付管理平台 API", "description" : "I1+:JWT 认证;迭代扩展 M1~M11", "version" : "0.1.0-SNAPSHOT" }, "servers" : [ { "url" : "http://localhost", "description" : "Generated server url" } ], "paths" : { "/api/v1/projects/{id}" : { "get" : { "tags" : [ "project-controller" ], "operationId" : "get", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ProjectResponse" } } } } } }, "put" : { "tags" : [ "project-controller" ], "operationId" : "update", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ProjectRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ProjectResponse" } } } } } }, "delete" : { "tags" : [ "project-controller" ], "operationId" : "delete", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "204" : { "description" : "No Content" } } } }, "/api/v1/customers/{id}" : { "get" : { "tags" : [ "customer-controller" ], "operationId" : "get_1", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/CustomerResponse" } } } } } }, "put" : { "tags" : [ "customer-controller" ], "operationId" : "update_1", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CustomerRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/CustomerResponse" } } } } } }, "delete" : { "tags" : [ "customer-controller" ], "operationId" : "delete_1", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "204" : { "description" : "No Content" } } } }, "/api/v1/contracts/{id}" : { "get" : { "tags" : [ "contract-controller" ], "operationId" : "get_2", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ContractResponse" } } } } } }, "put" : { "tags" : [ "contract-controller" ], "operationId" : "update_2", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ContractUpdateRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ContractResponse" } } } } } } }, "/api/v1/contracts/{id}/lines/{lineId}" : { "put" : { "tags" : [ "contract-controller" ], "operationId" : "updateLine", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } }, { "name" : "lineId", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ContractLineRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ContractLineResponse" } } } } } }, "delete" : { "tags" : [ "contract-controller" ], "operationId" : "deleteLine", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } }, { "name" : "lineId", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "204" : { "description" : "No Content" } } } }, "/api/v1/projects" : { "get" : { "tags" : [ "project-controller" ], "operationId" : "list", "parameters" : [ { "name" : "page", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 0, "minimum" : 0 } }, { "name" : "size", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 20, "maximum" : 200, "minimum" : 1 } }, { "name" : "customerId", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/PageResponseProjectResponse" } } } } } }, "post" : { "tags" : [ "project-controller" ], "operationId" : "create", "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ProjectRequest" } } }, "required" : true }, "responses" : { "201" : { "description" : "Created", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ProjectResponse" } } } } } } }, "/api/v1/customers" : { "get" : { "tags" : [ "customer-controller" ], "operationId" : "list_1", "parameters" : [ { "name" : "page", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 0, "minimum" : 0 } }, { "name" : "size", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 20, "maximum" : 200, "minimum" : 1 } }, { "name" : "keyword", "in" : "query", "required" : false, "schema" : { "type" : "string" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/PageResponseCustomerResponse" } } } } } }, "post" : { "tags" : [ "customer-controller" ], "operationId" : "create_1", "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CustomerRequest" } } }, "required" : true }, "responses" : { "201" : { "description" : "Created", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/CustomerResponse" } } } } } } }, "/api/v1/contracts" : { "get" : { "tags" : [ "contract-controller" ], "operationId" : "list_2", "parameters" : [ { "name" : "page", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 0, "minimum" : 0 } }, { "name" : "size", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 20, "maximum" : 200, "minimum" : 1 } }, { "name" : "customerId", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int64" } }, { "name" : "projectId", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int64" } }, { "name" : "keyword", "in" : "query", "required" : false, "schema" : { "type" : "string" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/PageResponseContractResponse" } } } } } }, "post" : { "tags" : [ "contract-controller" ], "operationId" : "create_2", "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ContractCreateRequest" } } }, "required" : true }, "responses" : { "201" : { "description" : "Created", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ContractResponse" } } } } } } }, "/api/v1/contracts/{id}/lines" : { "get" : { "tags" : [ "contract-controller" ], "operationId" : "listLines", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ContractLineResponse" } } } } } } }, "post" : { "tags" : [ "contract-controller" ], "operationId" : "addLine", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ContractLineRequest" } } }, "required" : true }, "responses" : { "201" : { "description" : "Created", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ContractLineResponse" } } } } } } }, "/api/v1/auth/login" : { "post" : { "tags" : [ "auth-controller" ], "operationId" : "login", "requestBody" : { "content" : { "application/json" : { "schema" : { "type" : "object", "additionalProperties" : { "type" : "string" } } } }, "required" : true }, "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "type" : "object", "additionalProperties" : { } } } } } } } }, "/api/v1/contracts/{id}/status" : { "patch" : { "tags" : [ "contract-controller" ], "operationId" : "patchStatus", "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ContractStatusPatchRequest" } } }, "required" : true }, "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/ContractResponse" } } } } } } }, "/api/v1/ping" : { "get" : { "tags" : [ "ping-controller" ], "operationId" : "ping", "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "type" : "object", "additionalProperties" : { "type" : "string" } } } } } } } }, "/api/v1/dictionaries/{type}" : { "get" : { "tags" : [ "dictionary-controller" ], "operationId" : "listByType", "parameters" : [ { "name" : "type", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/DictionaryItemResponse" } } } } } } } }, "/api/v1/audit-events" : { "get" : { "tags" : [ "audit-controller" ], "operationId" : "list_3", "parameters" : [ { "name" : "entityType", "in" : "query", "required" : true, "schema" : { "type" : "string", "minLength" : 1 } }, { "name" : "entityId", "in" : "query", "required" : true, "schema" : { "type" : "integer", "format" : "int64" } }, { "name" : "page", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 0, "minimum" : 0 } }, { "name" : "size", "in" : "query", "required" : false, "schema" : { "type" : "integer", "format" : "int32", "default" : 20, "maximum" : 200, "minimum" : 1 } } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/PageResponseAuditEventResponse" } } } } } } } }, "components" : { "schemas" : { "ProjectRequest" : { "type" : "object", "properties" : { "customerId" : { "type" : "integer", "format" : "int64" }, "name" : { "type" : "string", "maxLength" : 256, "minLength" : 0 }, "phase" : { "type" : "string", "maxLength" : 64, "minLength" : 0 } }, "required" : [ "customerId", "name" ] }, "ProjectResponse" : { "type" : "object", "properties" : { "id" : { "type" : "integer", "format" : "int64" }, "customerId" : { "type" : "integer", "format" : "int64" }, "name" : { "type" : "string" }, "phase" : { "type" : "string" }, "createdAt" : { "type" : "string", "format" : "date-time" }, "updatedAt" : { "type" : "string", "format" : "date-time" } } }, "CustomerRequest" : { "type" : "object", "properties" : { "name" : { "type" : "string", "maxLength" : 256, "minLength" : 0 }, "creditCode" : { "type" : "string", "maxLength" : 64, "minLength" : 0 }, "status" : { "type" : "string", "maxLength" : 32, "minLength" : 0 } }, "required" : [ "name" ] }, "CustomerResponse" : { "type" : "object", "properties" : { "id" : { "type" : "integer", "format" : "int64" }, "name" : { "type" : "string" }, "creditCode" : { "type" : "string" }, "status" : { "type" : "string" }, "createdAt" : { "type" : "string", "format" : "date-time" }, "updatedAt" : { "type" : "string", "format" : "date-time" } } }, "ContractUpdateRequest" : { "type" : "object", "properties" : { "title" : { "type" : "string", "maxLength" : 256, "minLength" : 0 }, "remarks" : { "type" : "string", "maxLength" : 4000, "minLength" : 0 } } }, "ContractLineResponse" : { "type" : "object", "properties" : { "id" : { "type" : "integer", "format" : "int64" }, "contractId" : { "type" : "integer", "format" : "int64" }, "sortOrder" : { "type" : "integer", "format" : "int32" }, "itemName" : { "type" : "string" }, "quantity" : { "type" : "number" }, "unit" : { "type" : "string" }, "amount" : { "type" : "number" }, "remark" : { "type" : "string" }, "createdAt" : { "type" : "string", "format" : "date-time" }, "updatedAt" : { "type" : "string", "format" : "date-time" } } }, "ContractResponse" : { "type" : "object", "properties" : { "id" : { "type" : "integer", "format" : "int64" }, "customerId" : { "type" : "integer", "format" : "int64" }, "projectId" : { "type" : "integer", "format" : "int64" }, "title" : { "type" : "string" }, "remarks" : { "type" : "string" }, "status" : { "type" : "string" }, "createdAt" : { "type" : "string", "format" : "date-time" }, "updatedAt" : { "type" : "string", "format" : "date-time" }, "lines" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ContractLineResponse" } } } }, "ContractLineRequest" : { "type" : "object", "properties" : { "sortOrder" : { "type" : "integer", "format" : "int32" }, "itemName" : { "type" : "string", "maxLength" : 256, "minLength" : 0 }, "quantity" : { "type" : "number", "minimum" : 1.0E-4 }, "unit" : { "type" : "string", "maxLength" : 32, "minLength" : 0 }, "amount" : { "type" : "number" }, "remark" : { "type" : "string", "maxLength" : 512, "minLength" : 0 } }, "required" : [ "itemName", "quantity" ] }, "ContractCreateRequest" : { "type" : "object", "properties" : { "customerId" : { "type" : "integer", "format" : "int64" }, "projectId" : { "type" : "integer", "format" : "int64" }, "title" : { "type" : "string", "maxLength" : 256, "minLength" : 0 }, "remarks" : { "type" : "string", "maxLength" : 4000, "minLength" : 0 } }, "required" : [ "customerId", "projectId" ] }, "ContractStatusPatchRequest" : { "type" : "object", "properties" : { "status" : { "type" : "string", "minLength" : 1 } }, "required" : [ "status" ] }, "PageResponseProjectResponse" : { "type" : "object", "properties" : { "content" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ProjectResponse" } }, "totalElements" : { "type" : "integer", "format" : "int64" }, "number" : { "type" : "integer", "format" : "int32" }, "size" : { "type" : "integer", "format" : "int32" } } }, "DictionaryItemResponse" : { "type" : "object", "properties" : { "dictCode" : { "type" : "string" }, "dictLabel" : { "type" : "string" }, "sortOrder" : { "type" : "integer", "format" : "int32" } } }, "PageResponseCustomerResponse" : { "type" : "object", "properties" : { "content" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/CustomerResponse" } }, "totalElements" : { "type" : "integer", "format" : "int64" }, "number" : { "type" : "integer", "format" : "int32" }, "size" : { "type" : "integer", "format" : "int32" } } }, "PageResponseContractResponse" : { "type" : "object", "properties" : { "content" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/ContractResponse" } }, "totalElements" : { "type" : "integer", "format" : "int64" }, "number" : { "type" : "integer", "format" : "int32" }, "size" : { "type" : "integer", "format" : "int32" } } }, "AuditEventResponse" : { "type" : "object", "properties" : { "id" : { "type" : "integer", "format" : "int64" }, "entityType" : { "type" : "string" }, "entityId" : { "type" : "integer", "format" : "int64" }, "action" : { "type" : "string" }, "fieldName" : { "type" : "string" }, "oldValue" : { "type" : "string" }, "newValue" : { "type" : "string" }, "actorUserId" : { "type" : "string" }, "createdAt" : { "type" : "string", "format" : "date-time" } } }, "PageResponseAuditEventResponse" : { "type" : "object", "properties" : { "content" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/AuditEventResponse" } }, "totalElements" : { "type" : "integer", "format" : "int64" }, "number" : { "type" : "integer", "format" : "int32" }, "size" : { "type" : "integer", "format" : "int32" } } } }, "securitySchemes" : { "bearer-jwt" : { "type" : "http", "name" : "bearer-jwt", "scheme" : "bearer", "bearerFormat" : "JWT" } } } }