From d17432fde228c00968241d2a1c37ddabe7562893 Mon Sep 17 00:00:00 2001 From: tiankaima <91816094+tiankaima@users.noreply.github.com> Date: Sun, 20 Sep 2026 06:04:49 +0000 Subject: [PATCH] chore: sync OpenAPI contract --- api/openapi.json | 678 ++++++++++++++++++++++++++- api/openapi.provenance.json | 4 +- internal/cmd/apicmd/api_paths_gen.go | 2 + internal/openapi/client.gen.go | 498 +++++++++++++++++--- 4 files changed, 1107 insertions(+), 75 deletions(-) diff --git a/api/openapi.json b/api/openapi.json index fb285b5..361f93e 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -597,8 +597,16 @@ "schema": { "type": "string", "minLength": 1, - "maxLength": 64, - "pattern": "^[a-z0-9][a-z0-9._-]*$" + "description": "Comma-separated source ids, at most 20 entries. A repeated source parameter is accepted as the same list." + } + }, + { + "in": "query", + "name": "organizationLevel", + "schema": { + "type": "string", + "minLength": 1, + "description": "Comma-separated source organization levels (university, office, department, college, center, research, service, program, society, journal, student, unknown). A repeated organizationLevel parameter is accepted as the same list." } }, { @@ -2288,6 +2296,28 @@ }, "description": "Exact category filter, e.g. 单次项目 or 系列项目." }, + { + "in": "query", + "name": "module", + "schema": { + "description": "Exact second-classroom module filter, e.g. 德/智/体/美/劳.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "description": "Exact second-classroom module filter, e.g. 德/智/体/美/劳." + }, + { + "in": "query", + "name": "activityLevel", + "schema": { + "description": "Exact activity-level filter, e.g. 院级 or 校级.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "description": "Exact activity-level filter, e.g. 院级 or 校级." + }, { "in": "query", "name": "search", @@ -3239,6 +3269,27 @@ } } }, + "/api/publications/sources": { + "get": { + "operationId": "get-api-publications-sources", + "summary": "List registered publication sources grouped by organization level", + "tags": [ + "Api" + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicPublicationSourceDirectoryResponseSchema" + } + } + } + } + } + } + }, "/api/workspace/bus-preferences": { "get": { "operationId": "workspace_bus_preferences_get", @@ -7130,6 +7181,16 @@ } } }, + "413": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, "429": { "description": "Error response", "headers": { @@ -9646,6 +9707,83 @@ } } }, + "/api/catalog/young-events/images/{path}": { + "get": { + "operationId": "get-api-catalog-young-events-images-path", + "summary": "Serve a cached rich-text inline image for second-classroom (Young) events by", + "tags": [ + "catalog.young-events" + ], + "parameters": [ + { + "in": "path", + "name": "path", + "schema": { + "type": "string", + "minLength": 1, + "description": "Upstream young.ustc.edu.cn image path, e.g. `group1/M00/00/00/example.png`. May contain slashes." + }, + "required": true, + "description": "Upstream young.ustc.edu.cn image path, e.g. `group1/M00/00/00/example.png`. May contain slashes." + } + ], + "responses": { + "200": { + "description": "Binary response", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "304": { + "description": "Response 304" + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "502": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "503": { + "description": "Error response", + "headers": { + "Retry-After": { + "description": "Seconds before retrying the mutation", + "schema": { + "type": "integer", + "minimum": 0 + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/community/comments/{id}/reactions": { "post": { "operationId": "addCommentReaction", @@ -11156,7 +11294,8 @@ "type": "string" }, "organizationLevel": { - "type": "string" + "type": "string", + "description": "Source organization level. Currently one of: university, office, department, college, center, research, service, program, society, journal, student, unknown. Treat an unrecognized value as unknown rather than an error." } }, "required": [ @@ -15613,6 +15752,7 @@ }, "registrationStatus": { "nullable": true, + "description": "Deprecated: always null. Upstream never populates it; use status for the signup state.", "type": "string" }, "location": { @@ -15680,6 +15820,115 @@ "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "activityLevel": { + "nullable": true, + "type": "string" + }, + "module": { + "nullable": true, + "type": "string" + }, + "form": { + "nullable": true, + "type": "string" + }, + "grades": { + "nullable": true, + "type": "string" + }, + "sponsor": { + "nullable": true, + "type": "string" + }, + "contactName": { + "nullable": true, + "type": "string" + }, + "contactTel": { + "nullable": true, + "type": "string" + }, + "duration": { + "nullable": true, + "type": "number" + }, + "serviceHour": { + "nullable": true, + "type": "number" + }, + "sumHours": { + "nullable": true, + "type": "number" + }, + "sumPersons": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "partakeNum": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "favCount": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "limitNum": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "createdAtUpstream": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "auditedAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "updatedAtUpstream": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "places": { + "nullable": true, + "type": "array", + "items": { + "type": "object", + "properties": { + "placeInfo": { + "nullable": true, + "type": "string" + }, + "placeSt": { + "nullable": true, + "type": "string" + }, + "placeEt": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "placeInfo", + "placeSt", + "placeEt" + ], + "additionalProperties": false + } } }, "required": [ @@ -15703,7 +15952,25 @@ "isActive", "sourceMissing", "lastSeenAt", - "createdAt" + "createdAt", + "activityLevel", + "module", + "form", + "grades", + "sponsor", + "contactName", + "contactTel", + "duration", + "serviceHour", + "sumHours", + "sumPersons", + "partakeNum", + "favCount", + "limitNum", + "createdAtUpstream", + "auditedAt", + "updatedAtUpstream", + "places" ], "additionalProperties": false } @@ -17566,7 +17833,8 @@ "type": "string" }, "organizationLevel": { - "type": "string" + "type": "string", + "description": "Source organization level. Currently one of: university, office, department, college, center, research, service, program, society, journal, student, unknown. Treat an unrecognized value as unknown rather than an error." } }, "required": [ @@ -17743,7 +18011,8 @@ "type": "string" }, "organizationLevel": { - "type": "string" + "type": "string", + "description": "Source organization level. Currently one of: university, office, department, college, center, research, service, program, society, journal, student, unknown. Treat an unrecognized value as unknown rather than an error." } }, "required": [ @@ -17780,6 +18049,135 @@ ], "additionalProperties": false }, + "publicPublicationSourceDirectoryResponseSchema": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "organizationLevel": { + "type": "string", + "enum": [ + "university", + "office", + "department", + "college", + "center", + "research", + "service", + "program", + "society", + "journal", + "student", + "unknown" + ] + }, + "sourceCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "publicationCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "sources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organizationLevel": { + "type": "string", + "enum": [ + "university", + "office", + "department", + "college", + "center", + "research", + "service", + "program", + "society", + "journal", + "student", + "unknown" + ] + }, + "hosts": { + "type": "array", + "items": { + "type": "string" + } + }, + "publicationCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "lastPublishedAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "id", + "name", + "organizationLevel", + "hosts", + "publicationCount", + "lastPublishedAt" + ], + "additionalProperties": false + } + } + }, + "required": [ + "organizationLevel", + "sourceCount", + "publicationCount", + "sources" + ], + "additionalProperties": false + } + }, + "totals": { + "type": "object", + "properties": { + "sourceCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "publicationCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + } + }, + "required": [ + "sourceCount", + "publicationCount" + ], + "additionalProperties": false + } + }, + "required": [ + "groups", + "totals" + ], + "additionalProperties": false + }, "busPreferenceResponseSchema": { "type": "object", "properties": { @@ -23288,6 +23686,7 @@ }, "registrationStatus": { "nullable": true, + "description": "Deprecated: always null. Upstream never populates it; use status for the signup state.", "type": "string" }, "location": { @@ -23355,6 +23754,115 @@ "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "activityLevel": { + "nullable": true, + "type": "string" + }, + "module": { + "nullable": true, + "type": "string" + }, + "form": { + "nullable": true, + "type": "string" + }, + "grades": { + "nullable": true, + "type": "string" + }, + "sponsor": { + "nullable": true, + "type": "string" + }, + "contactName": { + "nullable": true, + "type": "string" + }, + "contactTel": { + "nullable": true, + "type": "string" + }, + "duration": { + "nullable": true, + "type": "number" + }, + "serviceHour": { + "nullable": true, + "type": "number" + }, + "sumHours": { + "nullable": true, + "type": "number" + }, + "sumPersons": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "partakeNum": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "favCount": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "limitNum": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "createdAtUpstream": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "auditedAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "updatedAtUpstream": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "places": { + "nullable": true, + "type": "array", + "items": { + "type": "object", + "properties": { + "placeInfo": { + "nullable": true, + "type": "string" + }, + "placeSt": { + "nullable": true, + "type": "string" + }, + "placeEt": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "placeInfo", + "placeSt", + "placeEt" + ], + "additionalProperties": false + } } }, "required": [ @@ -23378,7 +23886,25 @@ "isActive", "sourceMissing", "lastSeenAt", - "createdAt" + "createdAt", + "activityLevel", + "module", + "form", + "grades", + "sponsor", + "contactName", + "contactTel", + "duration", + "serviceHour", + "sumHours", + "sumPersons", + "partakeNum", + "favCount", + "limitNum", + "createdAtUpstream", + "auditedAt", + "updatedAtUpstream", + "places" ], "additionalProperties": false } @@ -28603,6 +29129,7 @@ }, "registrationStatus": { "nullable": true, + "description": "Deprecated: always null. Upstream never populates it; use status for the signup state.", "type": "string" }, "location": { @@ -28671,6 +29198,123 @@ "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" }, + "activityLevel": { + "nullable": true, + "type": "string" + }, + "module": { + "nullable": true, + "type": "string" + }, + "form": { + "nullable": true, + "type": "string" + }, + "grades": { + "nullable": true, + "type": "string" + }, + "sponsor": { + "nullable": true, + "type": "string" + }, + "contactName": { + "nullable": true, + "type": "string" + }, + "contactTel": { + "nullable": true, + "type": "string" + }, + "duration": { + "nullable": true, + "type": "number" + }, + "serviceHour": { + "nullable": true, + "type": "number" + }, + "sumHours": { + "nullable": true, + "type": "number" + }, + "sumPersons": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "partakeNum": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "favCount": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "limitNum": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "createdAtUpstream": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "auditedAt": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "updatedAtUpstream": { + "nullable": true, + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "places": { + "nullable": true, + "type": "array", + "items": { + "type": "object", + "properties": { + "placeInfo": { + "nullable": true, + "type": "string" + }, + "placeSt": { + "nullable": true, + "type": "string" + }, + "placeEt": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "placeInfo", + "placeSt", + "placeEt" + ], + "additionalProperties": false + } + }, + "description": { + "nullable": true, + "type": "string" + }, + "participationNotes": { + "nullable": true, + "type": "string" + }, "rawJson": {} }, "required": [ @@ -28695,6 +29339,26 @@ "sourceMissing", "lastSeenAt", "createdAt", + "activityLevel", + "module", + "form", + "grades", + "sponsor", + "contactName", + "contactTel", + "duration", + "serviceHour", + "sumHours", + "sumPersons", + "partakeNum", + "favCount", + "limitNum", + "createdAtUpstream", + "auditedAt", + "updatedAtUpstream", + "places", + "description", + "participationNotes", "rawJson" ], "additionalProperties": false diff --git a/api/openapi.provenance.json b/api/openapi.provenance.json index e9815d4..4d8606f 100644 --- a/api/openapi.provenance.json +++ b/api/openapi.provenance.json @@ -1,5 +1,5 @@ { "repository": "Life-USTC/server", - "commit": "222eeb61c04981b7add82c0d7528c202bb81f2e4", - "sha256": "69eb77501e8ce88daf0662dcd882243db1eab76ccbdbe3cfd8ccf31a07ae8058" + "commit": "4651fd9f20aa64873bcd0844e116da9bfb84a17b", + "sha256": "4c1265b490519bc921fbab91495043adb8b54d2b9e67462d109ec9d6a783a422" } diff --git a/internal/cmd/apicmd/api_paths_gen.go b/internal/cmd/apicmd/api_paths_gen.go index 99e9a8a..236b83d 100644 --- a/internal/cmd/apicmd/api_paths_gen.go +++ b/internal/cmd/apicmd/api_paths_gen.go @@ -51,6 +51,7 @@ var generatedAPIPaths = []string{ "/api/catalog/teachers/{id}", "/api/catalog/weather", "/api/catalog/young-events", + "/api/catalog/young-events/images/{path}", "/api/catalog/young-events/{youngId}", "/api/catalog/young-events/{youngId}/image", "/api/catalog/young-organizers", @@ -76,6 +77,7 @@ var generatedAPIPaths = []string{ "/api/publications", "/api/publications/images/{hash}", "/api/publications/objects/{kind}/{sha256}", + "/api/publications/sources", "/api/publications/{id}", "/api/search", "/api/workspace/bus-preferences", diff --git a/internal/openapi/client.gen.go b/internal/openapi/client.gen.go index 9cc7cdd..6e84468 100644 --- a/internal/openapi/client.gen.go +++ b/internal/openapi/client.gen.go @@ -1174,19 +1174,19 @@ func (e OauthTokenResponseSchemaTokenType) Valid() bool { // Defines values for PaginatedYoungEventResponseSchemaSourceStatus. const ( - Fresh PaginatedYoungEventResponseSchemaSourceStatus = "fresh" - Stale PaginatedYoungEventResponseSchemaSourceStatus = "stale" - Unknown PaginatedYoungEventResponseSchemaSourceStatus = "unknown" + PaginatedYoungEventResponseSchemaSourceStatusFresh PaginatedYoungEventResponseSchemaSourceStatus = "fresh" + PaginatedYoungEventResponseSchemaSourceStatusStale PaginatedYoungEventResponseSchemaSourceStatus = "stale" + PaginatedYoungEventResponseSchemaSourceStatusUnknown PaginatedYoungEventResponseSchemaSourceStatus = "unknown" ) // Valid indicates whether the value is a known member of the PaginatedYoungEventResponseSchemaSourceStatus enum. func (e PaginatedYoungEventResponseSchemaSourceStatus) Valid() bool { switch e { - case Fresh: + case PaginatedYoungEventResponseSchemaSourceStatusFresh: return true - case Stale: + case PaginatedYoungEventResponseSchemaSourceStatusStale: return true - case Unknown: + case PaginatedYoungEventResponseSchemaSourceStatusUnknown: return true default: return false @@ -1283,6 +1283,102 @@ func (e PublicPublicationDetailSchemaRevisionObjectsStatus) Valid() bool { } } +// Defines values for PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel. +const ( + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelCenter PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "center" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelCollege PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "college" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelDepartment PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "department" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelJournal PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "journal" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelOffice PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "office" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelProgram PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "program" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelResearch PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "research" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelService PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "service" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelSociety PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "society" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelStudent PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "student" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelUniversity PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "university" + PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelUnknown PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel = "unknown" +) + +// Valid indicates whether the value is a known member of the PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel enum. +func (e PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel) Valid() bool { + switch e { + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelCenter: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelCollege: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelDepartment: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelJournal: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelOffice: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelProgram: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelResearch: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelService: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelSociety: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelStudent: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelUniversity: + return true + case PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevelUnknown: + return true + default: + return false + } +} + +// Defines values for PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel. +const ( + Center PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "center" + College PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "college" + Department PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "department" + Journal PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "journal" + Office PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "office" + Program PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "program" + Research PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "research" + Service PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "service" + Society PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "society" + Student PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "student" + University PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "university" + Unknown PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel = "unknown" +) + +// Valid indicates whether the value is a known member of the PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel enum. +func (e PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel) Valid() bool { + switch e { + case Center: + return true + case College: + return true + case Department: + return true + case Journal: + return true + case Office: + return true + case Program: + return true + case Research: + return true + case Service: + return true + case Society: + return true + case Student: + return true + case University: + return true + case Unknown: + return true + default: + return false + } +} + // Defines values for PublicPublicationsResponseSchemaDataObjectsKind. const ( PublicPublicationsResponseSchemaDataObjectsKindAsset PublicPublicationsResponseSchemaDataObjectsKind = "asset" @@ -7172,26 +7268,50 @@ type PaginatedTeacherResponseSchema struct { // PaginatedYoungEventResponseSchema defines model for paginatedYoungEventResponseSchema. type PaginatedYoungEventResponseSchema struct { Data []struct { - AppliedCount *int `json:"appliedCount"` - ApplyEndAt *time.Time `json:"applyEndAt"` - ApplyStartAt *time.Time `json:"applyStartAt"` - Capacity *int `json:"capacity"` - Category *string `json:"category"` - CreatedAt *time.Time `json:"createdAt"` - Department *string `json:"department"` - EndAt *time.Time `json:"endAt"` - Hours *float32 `json:"hours"` - ImageUrl *string `json:"imageUrl"` - IsActive bool `json:"isActive"` - LastSeenAt *time.Time `json:"lastSeenAt"` - Location *string `json:"location"` - Name string `json:"name"` - Organizer *string `json:"organizer"` - OrganizerId *string `json:"organizerId"` + ActivityLevel *string `json:"activityLevel"` + AppliedCount *int `json:"appliedCount"` + ApplyEndAt *time.Time `json:"applyEndAt"` + ApplyStartAt *time.Time `json:"applyStartAt"` + AuditedAt *time.Time `json:"auditedAt"` + Capacity *int `json:"capacity"` + Category *string `json:"category"` + ContactName *string `json:"contactName"` + ContactTel *string `json:"contactTel"` + CreatedAt *time.Time `json:"createdAt"` + CreatedAtUpstream *time.Time `json:"createdAtUpstream"` + Department *string `json:"department"` + Duration *float32 `json:"duration"` + EndAt *time.Time `json:"endAt"` + FavCount *int `json:"favCount"` + Form *string `json:"form"` + Grades *string `json:"grades"` + Hours *float32 `json:"hours"` + ImageUrl *string `json:"imageUrl"` + IsActive bool `json:"isActive"` + LastSeenAt *time.Time `json:"lastSeenAt"` + LimitNum *int `json:"limitNum"` + Location *string `json:"location"` + Module *string `json:"module"` + Name string `json:"name"` + Organizer *string `json:"organizer"` + OrganizerId *string `json:"organizerId"` + PartakeNum *int `json:"partakeNum"` + Places *[]struct { + PlaceEt *string `json:"placeEt"` + PlaceInfo *string `json:"placeInfo"` + PlaceSt *string `json:"placeSt"` + } `json:"places"` + + // RegistrationStatus Deprecated: always null. Upstream never populates it; use status for the signup state. RegistrationStatus *string `json:"registrationStatus"` + ServiceHour *float32 `json:"serviceHour"` SourceMissing bool `json:"sourceMissing"` + Sponsor *string `json:"sponsor"` StartAt *time.Time `json:"startAt"` Status *string `json:"status"` + SumHours *float32 `json:"sumHours"` + SumPersons *int `json:"sumPersons"` + UpdatedAtUpstream *time.Time `json:"updatedAtUpstream"` YoungId string `json:"youngId"` } `json:"data"` Pagination struct { @@ -7251,8 +7371,10 @@ type PublicPublicationDetailSchema struct { Id string `json:"id"` PublishedAt *time.Time `json:"publishedAt"` Source struct { - Id string `json:"id"` - Name string `json:"name"` + Id string `json:"id"` + Name string `json:"name"` + + // OrganizationLevel Source organization level. Currently one of: university, office, department, college, center, research, service, program, society, journal, student, unknown. Treat an unrecognized value as unknown rather than an error. OrganizationLevel string `json:"organizationLevel"` } `json:"source"` } `json:"alsoPublishedIn"` @@ -7286,8 +7408,10 @@ type PublicPublicationDetailSchema struct { UpdatedAtSource *time.Time `json:"updatedAtSource"` } `json:"revision"` Source struct { - Id string `json:"id"` - Name string `json:"name"` + Id string `json:"id"` + Name string `json:"name"` + + // OrganizationLevel Source organization level. Currently one of: university, office, department, college, center, research, service, program, society, journal, student, unknown. Treat an unrecognized value as unknown rather than an error. OrganizationLevel string `json:"organizationLevel"` } `json:"source"` } @@ -7301,6 +7425,33 @@ type PublicPublicationDetailSchemaRevisionObjectsKind string // PublicPublicationDetailSchemaRevisionObjectsStatus defines model for PublicPublicationDetailSchema.Revision.Objects.Status. type PublicPublicationDetailSchemaRevisionObjectsStatus string +// PublicPublicationSourceDirectoryResponseSchema defines model for publicPublicationSourceDirectoryResponseSchema. +type PublicPublicationSourceDirectoryResponseSchema struct { + Groups []struct { + OrganizationLevel PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel `json:"organizationLevel"` + PublicationCount int `json:"publicationCount"` + SourceCount int `json:"sourceCount"` + Sources []struct { + Hosts []string `json:"hosts"` + Id string `json:"id"` + LastPublishedAt *time.Time `json:"lastPublishedAt"` + Name string `json:"name"` + OrganizationLevel PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel `json:"organizationLevel"` + PublicationCount int `json:"publicationCount"` + } `json:"sources"` + } `json:"groups"` + Totals struct { + PublicationCount int `json:"publicationCount"` + SourceCount int `json:"sourceCount"` + } `json:"totals"` +} + +// PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel defines model for PublicPublicationSourceDirectoryResponseSchema.Groups.OrganizationLevel. +type PublicPublicationSourceDirectoryResponseSchemaGroupsOrganizationLevel string + +// PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel defines model for PublicPublicationSourceDirectoryResponseSchema.Groups.Sources.OrganizationLevel. +type PublicPublicationSourceDirectoryResponseSchemaGroupsSourcesOrganizationLevel string + // PublicPublicationsResponseSchema defines model for publicPublicationsResponseSchema. type PublicPublicationsResponseSchema struct { Data []struct { @@ -7333,8 +7484,10 @@ type PublicPublicationsResponseSchema struct { UpdatedAtSource *time.Time `json:"updatedAtSource"` } `json:"revision"` Source struct { - Id string `json:"id"` - Name string `json:"name"` + Id string `json:"id"` + Name string `json:"name"` + + // OrganizationLevel Source organization level. Currently one of: university, office, department, college, center, research, service, program, society, journal, student, unknown. Treat an unrecognized value as unknown rather than an error. OrganizationLevel string `json:"organizationLevel"` } `json:"source"` } `json:"data"` @@ -8614,28 +8767,54 @@ type WorkspaceLinkPinResponseSchema struct { // YoungEventDetailSchema defines model for youngEventDetailSchema. type YoungEventDetailSchema struct { - AppliedCount *int `json:"appliedCount"` - ApplyEndAt *time.Time `json:"applyEndAt"` - ApplyStartAt *time.Time `json:"applyStartAt"` - Capacity *int `json:"capacity"` - Category *string `json:"category"` - CreatedAt *time.Time `json:"createdAt"` - Department *string `json:"department"` - EndAt *time.Time `json:"endAt"` - Hours *float32 `json:"hours"` - ImageUrl *string `json:"imageUrl"` - IsActive bool `json:"isActive"` - LastSeenAt *time.Time `json:"lastSeenAt"` - Location *string `json:"location"` - Name string `json:"name"` - Organizer *string `json:"organizer"` - OrganizerId *string `json:"organizerId"` - RawJson interface{} `json:"rawJson"` - RegistrationStatus *string `json:"registrationStatus"` - SourceMissing bool `json:"sourceMissing"` - StartAt *time.Time `json:"startAt"` - Status *string `json:"status"` - YoungId string `json:"youngId"` + ActivityLevel *string `json:"activityLevel"` + AppliedCount *int `json:"appliedCount"` + ApplyEndAt *time.Time `json:"applyEndAt"` + ApplyStartAt *time.Time `json:"applyStartAt"` + AuditedAt *time.Time `json:"auditedAt"` + Capacity *int `json:"capacity"` + Category *string `json:"category"` + ContactName *string `json:"contactName"` + ContactTel *string `json:"contactTel"` + CreatedAt *time.Time `json:"createdAt"` + CreatedAtUpstream *time.Time `json:"createdAtUpstream"` + Department *string `json:"department"` + Description *string `json:"description"` + Duration *float32 `json:"duration"` + EndAt *time.Time `json:"endAt"` + FavCount *int `json:"favCount"` + Form *string `json:"form"` + Grades *string `json:"grades"` + Hours *float32 `json:"hours"` + ImageUrl *string `json:"imageUrl"` + IsActive bool `json:"isActive"` + LastSeenAt *time.Time `json:"lastSeenAt"` + LimitNum *int `json:"limitNum"` + Location *string `json:"location"` + Module *string `json:"module"` + Name string `json:"name"` + Organizer *string `json:"organizer"` + OrganizerId *string `json:"organizerId"` + PartakeNum *int `json:"partakeNum"` + ParticipationNotes *string `json:"participationNotes"` + Places *[]struct { + PlaceEt *string `json:"placeEt"` + PlaceInfo *string `json:"placeInfo"` + PlaceSt *string `json:"placeSt"` + } `json:"places"` + RawJson interface{} `json:"rawJson"` + + // RegistrationStatus Deprecated: always null. Upstream never populates it; use status for the signup state. + RegistrationStatus *string `json:"registrationStatus"` + ServiceHour *float32 `json:"serviceHour"` + SourceMissing bool `json:"sourceMissing"` + Sponsor *string `json:"sponsor"` + StartAt *time.Time `json:"startAt"` + Status *string `json:"status"` + SumHours *float32 `json:"sumHours"` + SumPersons *int `json:"sumPersons"` + UpdatedAtUpstream *time.Time `json:"updatedAtUpstream"` + YoungId string `json:"youngId"` } // YoungEventSubscriptionListSchema defines model for youngEventSubscriptionListSchema. @@ -8643,26 +8822,50 @@ type YoungEventSubscriptionListSchema struct { Data []struct { CreatedAt time.Time `json:"createdAt"` Event struct { - AppliedCount *int `json:"appliedCount"` - ApplyEndAt *time.Time `json:"applyEndAt"` - ApplyStartAt *time.Time `json:"applyStartAt"` - Capacity *int `json:"capacity"` - Category *string `json:"category"` - CreatedAt *time.Time `json:"createdAt"` - Department *string `json:"department"` - EndAt *time.Time `json:"endAt"` - Hours *float32 `json:"hours"` - ImageUrl *string `json:"imageUrl"` - IsActive bool `json:"isActive"` - LastSeenAt *time.Time `json:"lastSeenAt"` - Location *string `json:"location"` - Name string `json:"name"` - Organizer *string `json:"organizer"` - OrganizerId *string `json:"organizerId"` + ActivityLevel *string `json:"activityLevel"` + AppliedCount *int `json:"appliedCount"` + ApplyEndAt *time.Time `json:"applyEndAt"` + ApplyStartAt *time.Time `json:"applyStartAt"` + AuditedAt *time.Time `json:"auditedAt"` + Capacity *int `json:"capacity"` + Category *string `json:"category"` + ContactName *string `json:"contactName"` + ContactTel *string `json:"contactTel"` + CreatedAt *time.Time `json:"createdAt"` + CreatedAtUpstream *time.Time `json:"createdAtUpstream"` + Department *string `json:"department"` + Duration *float32 `json:"duration"` + EndAt *time.Time `json:"endAt"` + FavCount *int `json:"favCount"` + Form *string `json:"form"` + Grades *string `json:"grades"` + Hours *float32 `json:"hours"` + ImageUrl *string `json:"imageUrl"` + IsActive bool `json:"isActive"` + LastSeenAt *time.Time `json:"lastSeenAt"` + LimitNum *int `json:"limitNum"` + Location *string `json:"location"` + Module *string `json:"module"` + Name string `json:"name"` + Organizer *string `json:"organizer"` + OrganizerId *string `json:"organizerId"` + PartakeNum *int `json:"partakeNum"` + Places *[]struct { + PlaceEt *string `json:"placeEt"` + PlaceInfo *string `json:"placeInfo"` + PlaceSt *string `json:"placeSt"` + } `json:"places"` + + // RegistrationStatus Deprecated: always null. Upstream never populates it; use status for the signup state. RegistrationStatus *string `json:"registrationStatus"` + ServiceHour *float32 `json:"serviceHour"` SourceMissing bool `json:"sourceMissing"` + Sponsor *string `json:"sponsor"` StartAt *time.Time `json:"startAt"` Status *string `json:"status"` + SumHours *float32 `json:"sumHours"` + SumPersons *int `json:"sumPersons"` + UpdatedAtUpstream *time.Time `json:"updatedAtUpstream"` YoungId string `json:"youngId"` } `json:"event"` RemindDeadline bool `json:"remindDeadline"` @@ -9051,6 +9254,12 @@ type GetApiCatalogYoungEventsParams struct { // Category Exact category filter, e.g. 单次项目 or 系列项目. Category *string `form:"category,omitempty" json:"category,omitempty"` + // Module Exact second-classroom module filter, e.g. 德/智/体/美/劳. + Module *string `form:"module,omitempty" json:"module,omitempty"` + + // ActivityLevel Exact activity-level filter, e.g. 院级 or 校级. + ActivityLevel *string `form:"activityLevel,omitempty" json:"activityLevel,omitempty"` + // Search Case-insensitive substring match on the event name. Search *string `form:"search,omitempty" json:"search,omitempty"` @@ -12389,6 +12598,9 @@ type ClientInterface interface { // GetApiCatalogYoungEvents request GetApiCatalogYoungEvents(ctx context.Context, params *GetApiCatalogYoungEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiCatalogYoungEventsImagesPath request + GetApiCatalogYoungEventsImagesPath(ctx context.Context, path string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiCatalogYoungEventsYoungId request GetApiCatalogYoungEventsYoungId(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -13158,6 +13370,18 @@ func (c *Client) GetApiCatalogYoungEvents(ctx context.Context, params *GetApiCat return c.Client.Do(req) } +func (c *Client) GetApiCatalogYoungEventsImagesPath(ctx context.Context, path string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiCatalogYoungEventsImagesPathRequest(c.Server, path) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetApiCatalogYoungEventsYoungId(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetApiCatalogYoungEventsYoungIdRequest(c.Server, youngId) if err != nil { @@ -17078,6 +17302,38 @@ func NewGetApiCatalogYoungEventsRequest(server string, params *GetApiCatalogYoun } + if params.Module != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "module", *params.Module, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ActivityLevel != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "activityLevel", *params.ActivityLevel, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.Search != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "search", *params.Search, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { @@ -17217,6 +17473,40 @@ func NewGetApiCatalogYoungEventsRequest(server string, params *GetApiCatalogYoun return req, nil } +// NewGetApiCatalogYoungEventsImagesPathRequest generates requests for GetApiCatalogYoungEventsImagesPath +func NewGetApiCatalogYoungEventsImagesPathRequest(server string, path string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "path", path, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/catalog/young-events/images/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewGetApiCatalogYoungEventsYoungIdRequest generates requests for GetApiCatalogYoungEventsYoungId func NewGetApiCatalogYoungEventsYoungIdRequest(server string, youngId string) (*http.Request, error) { var err error @@ -20746,6 +21036,9 @@ type ClientWithResponsesInterface interface { // GetApiCatalogYoungEventsWithResponse request GetApiCatalogYoungEventsWithResponse(ctx context.Context, params *GetApiCatalogYoungEventsParams, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungEventsResponse, error) + // GetApiCatalogYoungEventsImagesPathWithResponse request + GetApiCatalogYoungEventsImagesPathWithResponse(ctx context.Context, path string, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungEventsImagesPathResponse, error) + // GetApiCatalogYoungEventsYoungIdWithResponse request GetApiCatalogYoungEventsYoungIdWithResponse(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungEventsYoungIdResponse, error) @@ -21900,6 +22193,30 @@ func (r GetApiCatalogYoungEventsResponse) StatusCode() int { return 0 } +type GetApiCatalogYoungEventsImagesPathResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *OpenApiErrorSchema + JSON502 *OpenApiErrorSchema + JSON503 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiCatalogYoungEventsImagesPathResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiCatalogYoungEventsImagesPathResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type GetApiCatalogYoungEventsYoungIdResponse struct { Body []byte HTTPResponse *http.Response @@ -23875,6 +24192,15 @@ func (c *ClientWithResponses) GetApiCatalogYoungEventsWithResponse(ctx context.C return ParseGetApiCatalogYoungEventsResponse(rsp) } +// GetApiCatalogYoungEventsImagesPathWithResponse request returning *GetApiCatalogYoungEventsImagesPathResponse +func (c *ClientWithResponses) GetApiCatalogYoungEventsImagesPathWithResponse(ctx context.Context, path string, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungEventsImagesPathResponse, error) { + rsp, err := c.GetApiCatalogYoungEventsImagesPath(ctx, path, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiCatalogYoungEventsImagesPathResponse(rsp) +} + // GetApiCatalogYoungEventsYoungIdWithResponse request returning *GetApiCatalogYoungEventsYoungIdResponse func (c *ClientWithResponses) GetApiCatalogYoungEventsYoungIdWithResponse(ctx context.Context, youngId string, reqEditors ...RequestEditorFn) (*GetApiCatalogYoungEventsYoungIdResponse, error) { rsp, err := c.GetApiCatalogYoungEventsYoungId(ctx, youngId, reqEditors...) @@ -26173,6 +26499,46 @@ func ParseGetApiCatalogYoungEventsResponse(rsp *http.Response) (*GetApiCatalogYo return response, nil } +// ParseGetApiCatalogYoungEventsImagesPathResponse parses an HTTP response from a GetApiCatalogYoungEventsImagesPathWithResponse call +func ParseGetApiCatalogYoungEventsImagesPathResponse(rsp *http.Response) (*GetApiCatalogYoungEventsImagesPathResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetApiCatalogYoungEventsImagesPathResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + + } + + return response, nil +} + // ParseGetApiCatalogYoungEventsYoungIdResponse parses an HTTP response from a GetApiCatalogYoungEventsYoungIdWithResponse call func ParseGetApiCatalogYoungEventsYoungIdResponse(rsp *http.Response) (*GetApiCatalogYoungEventsYoungIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body)