diff --git a/api/openapi.json b/api/openapi.json index b39be42..c8a7243 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -5930,6 +5930,56 @@ } }, "/api/community/section-homeworks/{id}": { + "get": { + "operationId": "get-api-community-section-homeworks-id", + "summary": "Read one shared section homework with its detail relations and audit history", + "tags": [ + "community.section-homework" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/homeworkDetailResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + }, "patch": { "operationId": "community_section_homework_update", "summary": "Update one shared section homework", @@ -6163,6 +6213,73 @@ } } }, + "/api/community/section-homeworks/audit": { + "get": { + "operationId": "get-api-community-section-homeworks-audit", + "summary": "List section homework audit history after an explicit request", + "tags": [ + "community.section-homework" + ], + "parameters": [ + { + "in": "query", + "name": "sectionId", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "in": "query", + "name": "sectionIds", + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "in": "query", + "name": "sectionJwId", + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/homeworkAuditListResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/community/users/{identifier}": { "get": { "operationId": "community_user_get", @@ -8171,6 +8288,87 @@ } } }, + "/api/community/comments/{id}/replies": { + "get": { + "operationId": "get-api-community-comments-id-replies", + "summary": "Continue a bounded reply preview for one comment root", + "tags": [ + "community.comments" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true + }, + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 20 + }, + "description": "Number of items per page." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/commentRepliesResponseSchema" + } + } + } + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "403": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + }, + "404": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/workspace/homeworks/{id}/completion": { "put": { "operationId": "setHomeworkCompletion", @@ -8436,6 +8634,13 @@ "$ref": "#/components/schemas/__schema0" } }, + "repliesNextCursor": { + "nullable": true, + "type": "string" + }, + "isAncestryPlaceholder": { + "type": "boolean" + }, "attachments": { "type": "array", "items": { @@ -8528,6 +8733,7 @@ "parentId", "rootId", "replies", + "repliesNextCursor", "attachments", "reactions", "canReact", @@ -8663,6 +8869,13 @@ "$ref": "#/components/schemas/__schema1" } }, + "repliesNextCursor": { + "nullable": true, + "type": "string" + }, + "isAncestryPlaceholder": { + "type": "boolean" + }, "attachments": { "type": "array", "items": { @@ -8757,6 +8970,7 @@ "parentId", "rootId", "replies", + "repliesNextCursor", "attachments", "reactions", "canReact", @@ -13602,471 +13816,18 @@ "nullable": true, "type": "string" }, - "section": { + "completion": { + "nullable": true, "type": "object", "properties": { - "id": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "jwId": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "retiredAt": { - "nullable": true, + "completedAt": { "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)))$" - }, - "code": { - "type": "string" - }, - "bizTypeId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "credits": { - "nullable": true, - "type": "number" - }, - "period": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "periodsPerWeek": { - "nullable": true, - "type": "number" - }, - "timesPerWeek": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "stdCount": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "limitCount": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "graduateAndPostgraduate": { - "nullable": true, - "type": "boolean" - }, - "dateTimePlaceText": { - "nullable": true, - "type": "string" - }, - "dateTimePlacePersonText": { - "nullable": true - }, - "actualPeriods": { - "nullable": true, - "type": "number" - }, - "theoryPeriods": { - "nullable": true, - "type": "number" - }, - "practicePeriods": { - "nullable": true, - "type": "number" - }, - "experimentPeriods": { - "nullable": true, - "type": "number" - }, - "machinePeriods": { - "nullable": true, - "type": "number" - }, - "designPeriods": { - "nullable": true, - "type": "number" - }, - "testPeriods": { - "nullable": true, - "type": "number" - }, - "scheduleState": { - "nullable": true, - "type": "string" - }, - "suggestScheduleWeeks": { - "nullable": true - }, - "suggestScheduleWeekInfo": { - "nullable": true, - "type": "string" - }, - "scheduleJsonParams": { - "nullable": true - }, - "selectedStdCount": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "remark": { - "nullable": true, - "type": "string" - }, - "scheduleRemark": { - "nullable": true, - "type": "string" - }, - "courseId": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "semesterId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "campusId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "examModeId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "openDepartmentId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "teachLanguageId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "roomTypeId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "course": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "jwId": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "code": { - "type": "string" - }, - "nameCn": { - "type": "string" - }, - "nameEn": { - "nullable": true, - "type": "string" - }, - "categoryId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "classTypeId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "classifyId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "educationLevelId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "gradationId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "typeId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "namePrimary": { - "type": "string" - }, - "nameSecondary": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "id", - "jwId", - "code", - "nameCn", - "nameEn", - "categoryId", - "classTypeId", - "classifyId", - "educationLevelId", - "gradationId", - "typeId", - "namePrimary", - "nameSecondary" - ], - "additionalProperties": false - }, - "semester": { - "nullable": true, - "allOf": [ - { - "$ref": "#/components/schemas/semesterSchema" - } - ] } }, "required": [ - "id", - "jwId", - "retiredAt", - "code", - "bizTypeId", - "credits", - "period", - "periodsPerWeek", - "timesPerWeek", - "stdCount", - "limitCount", - "graduateAndPostgraduate", - "dateTimePlaceText", - "dateTimePlacePersonText", - "actualPeriods", - "theoryPeriods", - "practicePeriods", - "experimentPeriods", - "machinePeriods", - "designPeriods", - "testPeriods", - "scheduleState", - "suggestScheduleWeeks", - "suggestScheduleWeekInfo", - "scheduleJsonParams", - "selectedStdCount", - "remark", - "scheduleRemark", - "courseId", - "semesterId", - "campusId", - "examModeId", - "openDepartmentId", - "teachLanguageId", - "roomTypeId", - "course", - "semester" - ], - "additionalProperties": false - }, - "description": { - "nullable": true, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "content": { - "type": "string" - }, - "createdAt": { - "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)))$" - }, - "updatedAt": { - "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)))$" - }, - "lastEditedAt": { - "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)))$" - }, - "lastEditedById": { - "nullable": true, - "type": "string" - }, - "sectionId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "courseId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "teacherId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "homeworkId": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "id", - "content", - "createdAt", - "updatedAt", - "lastEditedAt", - "lastEditedById", - "sectionId", - "courseId", - "teacherId", - "homeworkId" - ], - "additionalProperties": false - }, - "createdBy": { - "nullable": true, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "nullable": true, - "type": "string" - }, - "username": { - "nullable": true, - "type": "string" - }, - "image": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "id", - "name", - "username", - "image" - ], - "additionalProperties": false - }, - "updatedBy": { - "nullable": true, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "nullable": true, - "type": "string" - }, - "username": { - "nullable": true, - "type": "string" - }, - "image": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "id", - "name", - "username", - "image" - ], - "additionalProperties": false - }, - "deletedBy": { - "nullable": true, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "nullable": true, - "type": "string" - }, - "username": { - "nullable": true, - "type": "string" - }, - "image": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "id", - "name", - "username", - "image" - ], - "additionalProperties": false - }, - "completion": { - "nullable": true, - "type": "object", - "properties": { - "completedAt": { - "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": [ - "completedAt" + "completedAt" ], "additionalProperties": false }, @@ -14091,11 +13852,6 @@ "createdById", "updatedById", "deletedById", - "section", - "description", - "createdBy", - "updatedBy", - "deletedBy", "completion", "commentCount" ], @@ -14180,93 +13936,12 @@ "suspensionExpiresAt" ], "additionalProperties": false - }, - "auditLogs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "action": { - "type": "string", - "enum": [ - "created", - "updated", - "deleted" - ] - }, - "titleSnapshot": { - "nullable": true, - "type": "string" - }, - "createdAt": { - "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)))$" - }, - "sectionId": { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "homeworkId": { - "nullable": true, - "type": "string" - }, - "actorId": { - "nullable": true, - "type": "string" - }, - "actor": { - "nullable": true, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "nullable": true, - "type": "string" - }, - "username": { - "nullable": true, - "type": "string" - }, - "image": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "id", - "name", - "username", - "image" - ], - "additionalProperties": false - } - }, - "required": [ - "id", - "action", - "titleSnapshot", - "createdAt", - "sectionId", - "homeworkId", - "actorId", - "actor" - ], - "additionalProperties": false - } } }, "required": [ "data", "pagination", - "viewer", - "auditLogs" + "viewer" ], "additionalProperties": false }, @@ -26233,214 +25908,869 @@ "nullable": true, "type": "string" }, - "homeworkSectionJwId": { + "homeworkSectionJwId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "homeworkSectionCode": { + "nullable": true, + "type": "string" + }, + "sectionJwId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "sectionCode": { + "nullable": true, + "type": "string" + }, + "courseJwId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "courseName": { + "nullable": true, + "type": "string" + }, + "teacherName": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "sectionId", + "courseId", + "teacherId", + "sectionTeacherId", + "sectionTeacherSectionId", + "sectionTeacherTeacherId", + "sectionTeacherSectionJwId", + "sectionTeacherSectionCode", + "sectionTeacherTeacherName", + "sectionTeacherCourseJwId", + "sectionTeacherCourseName", + "homeworkId", + "homeworkTitle", + "homeworkSectionJwId", + "homeworkSectionCode", + "sectionJwId", + "sectionCode", + "courseJwId", + "courseName", + "teacherName" + ], + "additionalProperties": false + } + }, + "required": [ + "thread", + "focusId", + "hiddenCount", + "viewer", + "target" + ], + "additionalProperties": false + }, + "commentUpdateRequestSchema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "minLength": 1, + "maxLength": 8000 + }, + "visibility": { + "type": "string", + "enum": [ + "public", + "logged_in_only" + ] + }, + "isAnonymous": { + "type": "boolean" + }, + "attachmentIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "body" + ], + "additionalProperties": false + }, + "commentUpdateResponseSchema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "comment": { + "$ref": "#/components/schemas/__schema1" + } + }, + "required": [ + "success", + "comment" + ], + "additionalProperties": false + }, + "commentBatchDeleteRequestSchema": { + "type": "object", + "properties": { + "ids": { + "minItems": 1, + "maxItems": 50, + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + } + }, + "required": [ + "ids" + ], + "additionalProperties": false + }, + "commentBatchDeleteResponseSchema": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "enum": [ + true + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "success", + "id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "enum": [ + false + ] + }, + "id": { + "type": "string" + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "not_found", + "forbidden", + "locked", + "suspended" + ] + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ], + "additionalProperties": false + } + }, + "required": [ + "success", + "id", + "error" + ], + "additionalProperties": false + } + ], + "type": "object" + } + } + }, + "required": [ + "results" + ], + "additionalProperties": false + }, + "homeworkDetailResponseSchema": { + "type": "object", + "properties": { + "homework": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "isMajor": { + "type": "boolean" + }, + "requiresTeam": { + "type": "boolean" + }, + "publishedAt": { + "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)))$" + }, + "submissionStartAt": { + "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)))$" + }, + "submissionDueAt": { + "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)))$" + }, + "createdAt": { + "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)))$" + }, + "updatedAt": { + "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)))$" + }, + "deletedAt": { + "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)))$" + }, + "sectionId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "createdById": { + "nullable": true, + "type": "string" + }, + "updatedById": { + "nullable": true, + "type": "string" + }, + "deletedById": { + "nullable": true, + "type": "string" + }, + "section": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "retiredAt": { + "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)))$" + }, + "code": { + "type": "string" + }, + "bizTypeId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "credits": { + "nullable": true, + "type": "number" + }, + "period": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "periodsPerWeek": { + "nullable": true, + "type": "number" + }, + "timesPerWeek": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "stdCount": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "limitCount": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "graduateAndPostgraduate": { + "nullable": true, + "type": "boolean" + }, + "dateTimePlaceText": { + "nullable": true, + "type": "string" + }, + "dateTimePlacePersonText": { + "nullable": true + }, + "actualPeriods": { + "nullable": true, + "type": "number" + }, + "theoryPeriods": { + "nullable": true, + "type": "number" + }, + "practicePeriods": { + "nullable": true, + "type": "number" + }, + "experimentPeriods": { + "nullable": true, + "type": "number" + }, + "machinePeriods": { + "nullable": true, + "type": "number" + }, + "designPeriods": { + "nullable": true, + "type": "number" + }, + "testPeriods": { + "nullable": true, + "type": "number" + }, + "scheduleState": { + "nullable": true, + "type": "string" + }, + "suggestScheduleWeeks": { + "nullable": true + }, + "suggestScheduleWeekInfo": { + "nullable": true, + "type": "string" + }, + "scheduleJsonParams": { + "nullable": true + }, + "selectedStdCount": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "remark": { + "nullable": true, + "type": "string" + }, + "scheduleRemark": { + "nullable": true, + "type": "string" + }, + "courseId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "semesterId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "campusId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "examModeId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "openDepartmentId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "teachLanguageId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "roomTypeId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "course": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "code": { + "type": "string" + }, + "nameCn": { + "type": "string" + }, + "nameEn": { + "nullable": true, + "type": "string" + }, + "categoryId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "classTypeId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "classifyId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "educationLevelId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "gradationId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "typeId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "namePrimary": { + "type": "string" + }, + "nameSecondary": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "jwId", + "code", + "nameCn", + "nameEn", + "categoryId", + "classTypeId", + "classifyId", + "educationLevelId", + "gradationId", + "typeId", + "namePrimary", + "nameSecondary" + ], + "additionalProperties": false + }, + "semester": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/semesterSchema" + } + ] + } + }, + "required": [ + "id", + "jwId", + "retiredAt", + "code", + "bizTypeId", + "credits", + "period", + "periodsPerWeek", + "timesPerWeek", + "stdCount", + "limitCount", + "graduateAndPostgraduate", + "dateTimePlaceText", + "dateTimePlacePersonText", + "actualPeriods", + "theoryPeriods", + "practicePeriods", + "experimentPeriods", + "machinePeriods", + "designPeriods", + "testPeriods", + "scheduleState", + "suggestScheduleWeeks", + "suggestScheduleWeekInfo", + "scheduleJsonParams", + "selectedStdCount", + "remark", + "scheduleRemark", + "courseId", + "semesterId", + "campusId", + "examModeId", + "openDepartmentId", + "teachLanguageId", + "roomTypeId", + "course", + "semester" + ], + "additionalProperties": false + }, + "description": { + "nullable": true, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "content": { + "type": "string" + }, + "createdAt": { + "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)))$" + }, + "updatedAt": { + "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)))$" + }, + "lastEditedAt": { + "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)))$" + }, + "lastEditedById": { + "nullable": true, + "type": "string" + }, + "sectionId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "courseId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "teacherId": { + "nullable": true, + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "homeworkId": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "content", + "createdAt", + "updatedAt", + "lastEditedAt", + "lastEditedById", + "sectionId", + "courseId", + "teacherId", + "homeworkId" + ], + "additionalProperties": false + }, + "createdBy": { "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "nullable": true, + "type": "string" + }, + "username": { + "nullable": true, + "type": "string" + }, + "image": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "name", + "username", + "image" + ], + "additionalProperties": false }, - "homeworkSectionCode": { + "updatedBy": { "nullable": true, - "type": "string" + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "nullable": true, + "type": "string" + }, + "username": { + "nullable": true, + "type": "string" + }, + "image": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "name", + "username", + "image" + ], + "additionalProperties": false }, - "sectionJwId": { + "deletedBy": { "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "nullable": true, + "type": "string" + }, + "username": { + "nullable": true, + "type": "string" + }, + "image": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "name", + "username", + "image" + ], + "additionalProperties": false }, - "sectionCode": { + "completion": { "nullable": true, - "type": "string" + "type": "object", + "properties": { + "completedAt": { + "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": [ + "completedAt" + ], + "additionalProperties": false }, - "courseJwId": { - "nullable": true, + "commentCount": { "type": "integer", - "minimum": -9007199254740991, + "minimum": 0, "maximum": 9007199254740991 - }, - "courseName": { - "nullable": true, - "type": "string" - }, - "teacherName": { - "nullable": true, - "type": "string" } }, "required": [ + "id", + "title", + "isMajor", + "requiresTeam", + "publishedAt", + "submissionStartAt", + "submissionDueAt", + "createdAt", + "updatedAt", + "deletedAt", "sectionId", - "courseId", - "teacherId", - "sectionTeacherId", - "sectionTeacherSectionId", - "sectionTeacherTeacherId", - "sectionTeacherSectionJwId", - "sectionTeacherSectionCode", - "sectionTeacherTeacherName", - "sectionTeacherCourseJwId", - "sectionTeacherCourseName", - "homeworkId", - "homeworkTitle", - "homeworkSectionJwId", - "homeworkSectionCode", - "sectionJwId", - "sectionCode", - "courseJwId", - "courseName", - "teacherName" + "createdById", + "updatedById", + "deletedById", + "section", + "description", + "createdBy", + "updatedBy", + "deletedBy", + "completion", + "commentCount" ], "additionalProperties": false - } - }, - "required": [ - "thread", - "focusId", - "hiddenCount", - "viewer", - "target" - ], - "additionalProperties": false - }, - "commentUpdateRequestSchema": { - "type": "object", - "properties": { - "body": { - "type": "string", - "minLength": 1, - "maxLength": 8000 - }, - "visibility": { - "type": "string", - "enum": [ - "public", - "logged_in_only" - ] - }, - "isAnonymous": { - "type": "boolean" }, - "attachmentIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "body" - ], - "additionalProperties": false - }, - "commentUpdateResponseSchema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "comment": { - "$ref": "#/components/schemas/__schema1" - } - }, - "required": [ - "success", - "comment" - ], - "additionalProperties": false - }, - "commentBatchDeleteRequestSchema": { - "type": "object", - "properties": { - "ids": { - "minItems": 1, - "maxItems": 50, - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - } - }, - "required": [ - "ids" - ], - "additionalProperties": false - }, - "commentBatchDeleteResponseSchema": { - "type": "object", - "properties": { - "results": { + "auditLogs": { "type": "array", "items": { - "oneOf": [ - { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "created", + "updated", + "deleted" + ] + }, + "titleSnapshot": { + "nullable": true, + "type": "string" + }, + "createdAt": { + "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)))$" + }, + "sectionId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "homeworkId": { + "nullable": true, + "type": "string" + }, + "actorId": { + "nullable": true, + "type": "string" + }, + "actor": { + "nullable": true, "type": "object", "properties": { - "success": { - "type": "boolean", - "enum": [ - true - ] - }, "id": { "type": "string" - } - }, - "required": [ - "success", - "id" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "enum": [ - false - ] }, - "id": { + "name": { + "nullable": true, "type": "string" }, - "error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "not_found", - "forbidden", - "locked", - "suspended" - ] - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false + "username": { + "nullable": true, + "type": "string" + }, + "image": { + "nullable": true, + "type": "string" } }, "required": [ - "success", "id", - "error" + "name", + "username", + "image" ], "additionalProperties": false } + }, + "required": [ + "id", + "action", + "titleSnapshot", + "createdAt", + "sectionId", + "homeworkId", + "actorId", + "actor" ], - "type": "object" + "additionalProperties": false } } }, "required": [ - "results" + "homework", + "auditLogs" ], "additionalProperties": false }, @@ -27086,6 +27416,95 @@ ], "additionalProperties": false }, + "homeworkAuditListResponseSchema": { + "type": "object", + "properties": { + "auditLogs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "created", + "updated", + "deleted" + ] + }, + "titleSnapshot": { + "nullable": true, + "type": "string" + }, + "createdAt": { + "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)))$" + }, + "sectionId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "homeworkId": { + "nullable": true, + "type": "string" + }, + "actorId": { + "nullable": true, + "type": "string" + }, + "actor": { + "nullable": true, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "nullable": true, + "type": "string" + }, + "username": { + "nullable": true, + "type": "string" + }, + "image": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "name", + "username", + "image" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "action", + "titleSnapshot", + "createdAt", + "sectionId", + "homeworkId", + "actorId", + "actor" + ], + "additionalProperties": false + } + } + }, + "required": [ + "auditLogs" + ], + "additionalProperties": false + }, "publicUserProfileResponseSchema": { "type": "object", "properties": { @@ -33582,6 +34001,78 @@ ], "additionalProperties": false }, + "commentRepliesResponseSchema": { + "type": "object", + "properties": { + "rootId": { + "type": "string" + }, + "thread": { + "type": "array", + "items": { + "$ref": "#/components/schemas/__schema1" + } + }, + "nextCursor": { + "nullable": true, + "type": "string" + }, + "viewer": { + "type": "object", + "properties": { + "userId": { + "nullable": true, + "type": "string" + }, + "name": { + "nullable": true, + "type": "string" + }, + "image": { + "nullable": true, + "type": "string" + }, + "isAdmin": { + "type": "boolean" + }, + "isAuthenticated": { + "type": "boolean" + }, + "isSuspended": { + "type": "boolean" + }, + "suspensionReason": { + "nullable": true, + "type": "string" + }, + "suspensionExpiresAt": { + "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": [ + "userId", + "name", + "image", + "isAdmin", + "isAuthenticated", + "isSuspended", + "suspensionReason", + "suspensionExpiresAt" + ], + "additionalProperties": false + } + }, + "required": [ + "rootId", + "thread", + "nextCursor", + "viewer" + ], + "additionalProperties": false + }, "homeworkCompletionRequestSchema": { "type": "object", "properties": { diff --git a/api/openapi.provenance.json b/api/openapi.provenance.json index a03ea76..af7814c 100644 --- a/api/openapi.provenance.json +++ b/api/openapi.provenance.json @@ -1,5 +1,5 @@ { "repository": "Life-USTC/server", - "commit": "47f09f72438293fca59e5fbf2da4c13d13455268", - "sha256": "fba8624277f766ac924cf070807bb071059157f75849c996ea4a943258ba402a" + "commit": "bc7fe0e5ce1b353281bc0ba0a82ce46d199a8dbb", + "sha256": "e7aaa80c2ae5a69ba64d3f4ba345151a1cfa11a737f6d21c7d453acddd24d265" } diff --git a/internal/cmd/apicmd/api_paths_gen.go b/internal/cmd/apicmd/api_paths_gen.go index f91f671..e6d68ee 100644 --- a/internal/cmd/apicmd/api_paths_gen.go +++ b/internal/cmd/apicmd/api_paths_gen.go @@ -52,8 +52,10 @@ var generatedAPIPaths = []string{ "/api/community/comments/batch", "/api/community/comments/{id}", "/api/community/comments/{id}/reactions", + "/api/community/comments/{id}/replies", "/api/community/descriptions", "/api/community/section-homeworks", + "/api/community/section-homeworks/audit", "/api/community/section-homeworks/{id}", "/api/community/users/{identifier}", "/api/health", diff --git a/internal/openapi/client.gen.go b/internal/openapi/client.gen.go index aa82f94..4b867dc 100644 --- a/internal/openapi/client.gen.go +++ b/internal/openapi/client.gen.go @@ -800,6 +800,27 @@ func (e DescriptionUpsertRequestSchema4TargetType) Valid() bool { } } +// Defines values for HomeworkAuditListResponseSchemaAuditLogsAction. +const ( + HomeworkAuditListResponseSchemaAuditLogsActionCreated HomeworkAuditListResponseSchemaAuditLogsAction = "created" + HomeworkAuditListResponseSchemaAuditLogsActionDeleted HomeworkAuditListResponseSchemaAuditLogsAction = "deleted" + HomeworkAuditListResponseSchemaAuditLogsActionUpdated HomeworkAuditListResponseSchemaAuditLogsAction = "updated" +) + +// Valid indicates whether the value is a known member of the HomeworkAuditListResponseSchemaAuditLogsAction enum. +func (e HomeworkAuditListResponseSchemaAuditLogsAction) Valid() bool { + switch e { + case HomeworkAuditListResponseSchemaAuditLogsActionCreated: + return true + case HomeworkAuditListResponseSchemaAuditLogsActionDeleted: + return true + case HomeworkAuditListResponseSchemaAuditLogsActionUpdated: + return true + default: + return false + } +} + // Defines values for HomeworkCompletionBatchResponseSchemaResults0Success. const ( HomeworkCompletionBatchResponseSchemaResults0SuccessTrue HomeworkCompletionBatchResponseSchemaResults0Success = true @@ -938,6 +959,27 @@ func (e HomeworkCreateRequestSchema1SubmissionStartAt1) Valid() bool { } } +// Defines values for HomeworkDetailResponseSchemaAuditLogsAction. +const ( + HomeworkDetailResponseSchemaAuditLogsActionCreated HomeworkDetailResponseSchemaAuditLogsAction = "created" + HomeworkDetailResponseSchemaAuditLogsActionDeleted HomeworkDetailResponseSchemaAuditLogsAction = "deleted" + HomeworkDetailResponseSchemaAuditLogsActionUpdated HomeworkDetailResponseSchemaAuditLogsAction = "updated" +) + +// Valid indicates whether the value is a known member of the HomeworkDetailResponseSchemaAuditLogsAction enum. +func (e HomeworkDetailResponseSchemaAuditLogsAction) Valid() bool { + switch e { + case HomeworkDetailResponseSchemaAuditLogsActionCreated: + return true + case HomeworkDetailResponseSchemaAuditLogsActionDeleted: + return true + case HomeworkDetailResponseSchemaAuditLogsActionUpdated: + return true + default: + return false + } +} + // Defines values for HomeworkUpdateRequestSchemaPublishedAt1. const ( HomeworkUpdateRequestSchemaPublishedAt1LessThannil HomeworkUpdateRequestSchemaPublishedAt1 = "" @@ -983,27 +1025,6 @@ func (e HomeworkUpdateRequestSchemaSubmissionStartAt1) Valid() bool { } } -// Defines values for HomeworksListResponseSchemaAuditLogsAction. -const ( - HomeworksListResponseSchemaAuditLogsActionCreated HomeworksListResponseSchemaAuditLogsAction = "created" - HomeworksListResponseSchemaAuditLogsActionDeleted HomeworksListResponseSchemaAuditLogsAction = "deleted" - HomeworksListResponseSchemaAuditLogsActionUpdated HomeworksListResponseSchemaAuditLogsAction = "updated" -) - -// Valid indicates whether the value is a known member of the HomeworksListResponseSchemaAuditLogsAction enum. -func (e HomeworksListResponseSchemaAuditLogsAction) Valid() bool { - switch e { - case HomeworksListResponseSchemaAuditLogsActionCreated: - return true - case HomeworksListResponseSchemaAuditLogsActionDeleted: - return true - case HomeworksListResponseSchemaAuditLogsActionUpdated: - return true - default: - return false - } -} - // Defines values for LocaleUpdateRequestSchemaLocale. const ( LocaleUpdateRequestSchemaLocaleEnUs LocaleUpdateRequestSchemaLocale = "en-us" @@ -1123,16 +1144,16 @@ func (e TodoCompletionBatchResponseSchemaResults0TodoPriority) Valid() bool { // Defines values for TodoCompletionBatchResponseSchemaResults1ErrorCode. const ( - Forbidden TodoCompletionBatchResponseSchemaResults1ErrorCode = "forbidden" - NotFound TodoCompletionBatchResponseSchemaResults1ErrorCode = "not_found" + TodoCompletionBatchResponseSchemaResults1ErrorCodeForbidden TodoCompletionBatchResponseSchemaResults1ErrorCode = "forbidden" + TodoCompletionBatchResponseSchemaResults1ErrorCodeNotFound TodoCompletionBatchResponseSchemaResults1ErrorCode = "not_found" ) // Valid indicates whether the value is a known member of the TodoCompletionBatchResponseSchemaResults1ErrorCode enum. func (e TodoCompletionBatchResponseSchemaResults1ErrorCode) Valid() bool { switch e { - case Forbidden: + case TodoCompletionBatchResponseSchemaResults1ErrorCodeForbidden: return true - case NotFound: + case TodoCompletionBatchResponseSchemaResults1ErrorCodeNotFound: return true default: return false @@ -1889,29 +1910,31 @@ type UnderscoreUnderscoreSchema0 struct { IsUstcVerified bool `json:"isUstcVerified"` Name *string `json:"name"` } `json:"author"` - AuthorHidden bool `json:"authorHidden"` - Body string `json:"body"` - CanDelete bool `json:"canDelete"` - CanEdit bool `json:"canEdit"` - CanModerate bool `json:"canModerate"` - CanReact bool `json:"canReact"` - CanReply bool `json:"canReply"` - CreatedAt time.Time `json:"createdAt"` - Id string `json:"id"` - IsAnonymous bool `json:"isAnonymous"` - IsAuthor bool `json:"isAuthor"` - ParentId *string `json:"parentId"` - Reactions []struct { + AuthorHidden bool `json:"authorHidden"` + Body string `json:"body"` + CanDelete bool `json:"canDelete"` + CanEdit bool `json:"canEdit"` + CanModerate bool `json:"canModerate"` + CanReact bool `json:"canReact"` + CanReply bool `json:"canReply"` + CreatedAt time.Time `json:"createdAt"` + Id string `json:"id"` + IsAncestryPlaceholder *bool `json:"isAncestryPlaceholder,omitempty"` + IsAnonymous bool `json:"isAnonymous"` + IsAuthor bool `json:"isAuthor"` + ParentId *string `json:"parentId"` + Reactions []struct { Count int `json:"count"` Type string `json:"type"` ViewerHasReacted bool `json:"viewerHasReacted"` } `json:"reactions"` - RenderedBody string `json:"renderedBody"` - Replies []UnderscoreUnderscoreSchema0 `json:"replies"` - RootId *string `json:"rootId"` - Status string `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` - Visibility string `json:"visibility"` + RenderedBody string `json:"renderedBody"` + Replies []UnderscoreUnderscoreSchema0 `json:"replies"` + RepliesNextCursor *string `json:"repliesNextCursor"` + RootId *string `json:"rootId"` + Status string `json:"status"` + UpdatedAt time.Time `json:"updatedAt"` + Visibility string `json:"visibility"` } // UnderscoreUnderscoreSchema1 defines model for __schema1. @@ -1932,29 +1955,31 @@ type UnderscoreUnderscoreSchema1 struct { IsUstcVerified bool `json:"isUstcVerified"` Name *string `json:"name"` } `json:"author"` - AuthorHidden bool `json:"authorHidden"` - Body string `json:"body"` - CanDelete bool `json:"canDelete"` - CanEdit bool `json:"canEdit"` - CanModerate bool `json:"canModerate"` - CanReact bool `json:"canReact"` - CanReply bool `json:"canReply"` - CreatedAt time.Time `json:"createdAt"` - Id string `json:"id"` - IsAnonymous bool `json:"isAnonymous"` - IsAuthor bool `json:"isAuthor"` - ParentId *string `json:"parentId"` - Reactions []struct { + AuthorHidden bool `json:"authorHidden"` + Body string `json:"body"` + CanDelete bool `json:"canDelete"` + CanEdit bool `json:"canEdit"` + CanModerate bool `json:"canModerate"` + CanReact bool `json:"canReact"` + CanReply bool `json:"canReply"` + CreatedAt time.Time `json:"createdAt"` + Id string `json:"id"` + IsAncestryPlaceholder *bool `json:"isAncestryPlaceholder,omitempty"` + IsAnonymous bool `json:"isAnonymous"` + IsAuthor bool `json:"isAuthor"` + ParentId *string `json:"parentId"` + Reactions []struct { Count int `json:"count"` Type string `json:"type"` ViewerHasReacted bool `json:"viewerHasReacted"` } `json:"reactions"` - RenderedBody string `json:"renderedBody"` - Replies []UnderscoreUnderscoreSchema1 `json:"replies"` - RootId *string `json:"rootId"` - Status string `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` - Visibility string `json:"visibility"` + RenderedBody string `json:"renderedBody"` + Replies []UnderscoreUnderscoreSchema1 `json:"replies"` + RepliesNextCursor *string `json:"repliesNextCursor"` + RootId *string `json:"rootId"` + Status string `json:"status"` + UpdatedAt time.Time `json:"updatedAt"` + Visibility string `json:"visibility"` } // AccountClientActivityResponseSchema defines model for accountClientActivityResponseSchema. @@ -4205,6 +4230,23 @@ type CommentReactionRequestSchema struct { // CommentReactionRequestSchemaType defines model for CommentReactionRequestSchema.Type. type CommentReactionRequestSchemaType string +// CommentRepliesResponseSchema defines model for commentRepliesResponseSchema. +type CommentRepliesResponseSchema struct { + NextCursor *string `json:"nextCursor"` + RootId string `json:"rootId"` + Thread []UnderscoreUnderscoreSchema1 `json:"thread"` + Viewer struct { + Image *string `json:"image"` + IsAdmin bool `json:"isAdmin"` + IsAuthenticated bool `json:"isAuthenticated"` + IsSuspended bool `json:"isSuspended"` + Name *string `json:"name"` + SuspensionExpiresAt *time.Time `json:"suspensionExpiresAt"` + SuspensionReason *string `json:"suspensionReason"` + UserId *string `json:"userId"` + } `json:"viewer"` +} + // CommentThreadResponseSchema defines model for commentThreadResponseSchema. type CommentThreadResponseSchema struct { FocusId string `json:"focusId"` @@ -5115,6 +5157,28 @@ type DescriptionsResponseSchema struct { } `json:"viewer"` } +// HomeworkAuditListResponseSchema defines model for homeworkAuditListResponseSchema. +type HomeworkAuditListResponseSchema struct { + AuditLogs []struct { + Action HomeworkAuditListResponseSchemaAuditLogsAction `json:"action"` + Actor *struct { + Id string `json:"id"` + Image *string `json:"image"` + Name *string `json:"name"` + Username *string `json:"username"` + } `json:"actor"` + ActorId *string `json:"actorId"` + CreatedAt time.Time `json:"createdAt"` + HomeworkId *string `json:"homeworkId"` + Id string `json:"id"` + SectionId int `json:"sectionId"` + TitleSnapshot *string `json:"titleSnapshot"` + } `json:"auditLogs"` +} + +// HomeworkAuditListResponseSchemaAuditLogsAction defines model for HomeworkAuditListResponseSchema.AuditLogs.Action. +type HomeworkAuditListResponseSchemaAuditLogsAction string + // HomeworkCompletionBatchRequestSchema defines model for homeworkCompletionBatchRequestSchema. type HomeworkCompletionBatchRequestSchema struct { Items []struct { @@ -5421,52 +5485,23 @@ type HomeworkCreateResponseSchema struct { Id string `json:"id"` } -// HomeworkUpdateRequestSchema defines model for homeworkUpdateRequestSchema. -type HomeworkUpdateRequestSchema struct { - Description *string `json:"description,omitempty"` - IsMajor *bool `json:"isMajor,omitempty"` - PublishedAt *HomeworkUpdateRequestSchema_PublishedAt `json:"publishedAt,omitempty"` - RequiresTeam *bool `json:"requiresTeam,omitempty"` - SubmissionDueAt *HomeworkUpdateRequestSchema_SubmissionDueAt `json:"submissionDueAt,omitempty"` - SubmissionStartAt *HomeworkUpdateRequestSchema_SubmissionStartAt `json:"submissionStartAt,omitempty"` - Title *string `json:"title,omitempty"` -} - -// HomeworkUpdateRequestSchemaPublishedAt0 defines model for . -type HomeworkUpdateRequestSchemaPublishedAt0 = string - -// HomeworkUpdateRequestSchemaPublishedAt1 defines model for HomeworkUpdateRequestSchema.PublishedAt.1. -type HomeworkUpdateRequestSchemaPublishedAt1 string - -// HomeworkUpdateRequestSchema_PublishedAt defines model for HomeworkUpdateRequestSchema.PublishedAt. -type HomeworkUpdateRequestSchema_PublishedAt struct { - union json.RawMessage -} - -// HomeworkUpdateRequestSchemaSubmissionDueAt0 defines model for . -type HomeworkUpdateRequestSchemaSubmissionDueAt0 = string - -// HomeworkUpdateRequestSchemaSubmissionDueAt1 defines model for HomeworkUpdateRequestSchema.SubmissionDueAt.1. -type HomeworkUpdateRequestSchemaSubmissionDueAt1 string - -// HomeworkUpdateRequestSchema_SubmissionDueAt defines model for HomeworkUpdateRequestSchema.SubmissionDueAt. -type HomeworkUpdateRequestSchema_SubmissionDueAt struct { - union json.RawMessage -} - -// HomeworkUpdateRequestSchemaSubmissionStartAt0 defines model for . -type HomeworkUpdateRequestSchemaSubmissionStartAt0 = string - -// HomeworkUpdateRequestSchemaSubmissionStartAt1 defines model for HomeworkUpdateRequestSchema.SubmissionStartAt.1. -type HomeworkUpdateRequestSchemaSubmissionStartAt1 string - -// HomeworkUpdateRequestSchema_SubmissionStartAt defines model for HomeworkUpdateRequestSchema.SubmissionStartAt. -type HomeworkUpdateRequestSchema_SubmissionStartAt struct { - union json.RawMessage -} - -// HomeworkUpdateResponseSchema defines model for homeworkUpdateResponseSchema. -type HomeworkUpdateResponseSchema struct { +// HomeworkDetailResponseSchema defines model for homeworkDetailResponseSchema. +type HomeworkDetailResponseSchema struct { + AuditLogs []struct { + Action HomeworkDetailResponseSchemaAuditLogsAction `json:"action"` + Actor *struct { + Id string `json:"id"` + Image *string `json:"image"` + Name *string `json:"name"` + Username *string `json:"username"` + } `json:"actor"` + ActorId *string `json:"actorId"` + CreatedAt time.Time `json:"createdAt"` + HomeworkId *string `json:"homeworkId"` + Id string `json:"id"` + SectionId int `json:"sectionId"` + TitleSnapshot *string `json:"titleSnapshot"` + } `json:"auditLogs"` Homework struct { CommentCount int `json:"commentCount"` Completion *struct { @@ -5570,27 +5605,58 @@ type HomeworkUpdateResponseSchema struct { } `json:"updatedBy"` UpdatedById *string `json:"updatedById"` } `json:"homework"` - Success bool `json:"success"` } -// HomeworksListResponseSchema defines model for homeworksListResponseSchema. -type HomeworksListResponseSchema struct { - AuditLogs []struct { - Action HomeworksListResponseSchemaAuditLogsAction `json:"action"` - Actor *struct { - Id string `json:"id"` - Image *string `json:"image"` - Name *string `json:"name"` - Username *string `json:"username"` - } `json:"actor"` - ActorId *string `json:"actorId"` - CreatedAt time.Time `json:"createdAt"` - HomeworkId *string `json:"homeworkId"` - Id string `json:"id"` - SectionId int `json:"sectionId"` - TitleSnapshot *string `json:"titleSnapshot"` - } `json:"auditLogs"` - Data []struct { +// HomeworkDetailResponseSchemaAuditLogsAction defines model for HomeworkDetailResponseSchema.AuditLogs.Action. +type HomeworkDetailResponseSchemaAuditLogsAction string + +// HomeworkUpdateRequestSchema defines model for homeworkUpdateRequestSchema. +type HomeworkUpdateRequestSchema struct { + Description *string `json:"description,omitempty"` + IsMajor *bool `json:"isMajor,omitempty"` + PublishedAt *HomeworkUpdateRequestSchema_PublishedAt `json:"publishedAt,omitempty"` + RequiresTeam *bool `json:"requiresTeam,omitempty"` + SubmissionDueAt *HomeworkUpdateRequestSchema_SubmissionDueAt `json:"submissionDueAt,omitempty"` + SubmissionStartAt *HomeworkUpdateRequestSchema_SubmissionStartAt `json:"submissionStartAt,omitempty"` + Title *string `json:"title,omitempty"` +} + +// HomeworkUpdateRequestSchemaPublishedAt0 defines model for . +type HomeworkUpdateRequestSchemaPublishedAt0 = string + +// HomeworkUpdateRequestSchemaPublishedAt1 defines model for HomeworkUpdateRequestSchema.PublishedAt.1. +type HomeworkUpdateRequestSchemaPublishedAt1 string + +// HomeworkUpdateRequestSchema_PublishedAt defines model for HomeworkUpdateRequestSchema.PublishedAt. +type HomeworkUpdateRequestSchema_PublishedAt struct { + union json.RawMessage +} + +// HomeworkUpdateRequestSchemaSubmissionDueAt0 defines model for . +type HomeworkUpdateRequestSchemaSubmissionDueAt0 = string + +// HomeworkUpdateRequestSchemaSubmissionDueAt1 defines model for HomeworkUpdateRequestSchema.SubmissionDueAt.1. +type HomeworkUpdateRequestSchemaSubmissionDueAt1 string + +// HomeworkUpdateRequestSchema_SubmissionDueAt defines model for HomeworkUpdateRequestSchema.SubmissionDueAt. +type HomeworkUpdateRequestSchema_SubmissionDueAt struct { + union json.RawMessage +} + +// HomeworkUpdateRequestSchemaSubmissionStartAt0 defines model for . +type HomeworkUpdateRequestSchemaSubmissionStartAt0 = string + +// HomeworkUpdateRequestSchemaSubmissionStartAt1 defines model for HomeworkUpdateRequestSchema.SubmissionStartAt.1. +type HomeworkUpdateRequestSchemaSubmissionStartAt1 string + +// HomeworkUpdateRequestSchema_SubmissionStartAt defines model for HomeworkUpdateRequestSchema.SubmissionStartAt. +type HomeworkUpdateRequestSchema_SubmissionStartAt struct { + union json.RawMessage +} + +// HomeworkUpdateResponseSchema defines model for homeworkUpdateResponseSchema. +type HomeworkUpdateResponseSchema struct { + Homework struct { CommentCount int `json:"commentCount"` Completion *struct { CompletedAt time.Time `json:"completedAt"` @@ -5692,6 +5758,31 @@ type HomeworksListResponseSchema struct { Username *string `json:"username"` } `json:"updatedBy"` UpdatedById *string `json:"updatedById"` + } `json:"homework"` + Success bool `json:"success"` +} + +// HomeworksListResponseSchema defines model for homeworksListResponseSchema. +type HomeworksListResponseSchema struct { + Data []struct { + CommentCount int `json:"commentCount"` + Completion *struct { + CompletedAt time.Time `json:"completedAt"` + } `json:"completion"` + CreatedAt time.Time `json:"createdAt"` + CreatedById *string `json:"createdById"` + DeletedAt *time.Time `json:"deletedAt"` + DeletedById *string `json:"deletedById"` + Id string `json:"id"` + IsMajor bool `json:"isMajor"` + PublishedAt *time.Time `json:"publishedAt"` + RequiresTeam bool `json:"requiresTeam"` + SectionId int `json:"sectionId"` + SubmissionDueAt *time.Time `json:"submissionDueAt"` + SubmissionStartAt *time.Time `json:"submissionStartAt"` + Title string `json:"title"` + UpdatedAt time.Time `json:"updatedAt"` + UpdatedById *string `json:"updatedById"` } `json:"data"` Pagination struct { Page int `json:"page"` @@ -5711,9 +5802,6 @@ type HomeworksListResponseSchema struct { } `json:"viewer"` } -// HomeworksListResponseSchemaAuditLogsAction defines model for HomeworksListResponseSchema.AuditLogs.Action. -type HomeworksListResponseSchemaAuditLogsAction string - // IdResponseSchema defines model for idResponseSchema. type IdResponseSchema struct { Id string `json:"id"` @@ -7715,6 +7803,14 @@ type RemoveCommentReactionParams struct { // RemoveCommentReactionParamsType defines parameters for RemoveCommentReaction. type RemoveCommentReactionParamsType string +// GetApiCommunityCommentsIdRepliesParams defines parameters for GetApiCommunityCommentsIdReplies. +type GetApiCommunityCommentsIdRepliesParams struct { + Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"` + + // PageSize Number of items per page. + PageSize *int64 `form:"pageSize,omitempty" json:"pageSize,omitempty"` +} + // GetDescriptionParams defines parameters for GetDescription. type GetDescriptionParams struct { TargetType GetDescriptionParamsTargetType `form:"targetType" json:"targetType"` @@ -7743,6 +7839,13 @@ type CommunitySectionHomeworkListParams struct { // CommunitySectionHomeworkListParamsIncludeDeleted defines parameters for CommunitySectionHomeworkList. type CommunitySectionHomeworkListParamsIncludeDeleted string +// GetApiCommunitySectionHomeworksAuditParams defines parameters for GetApiCommunitySectionHomeworksAudit. +type GetApiCommunitySectionHomeworksAuditParams struct { + SectionId *int64 `form:"sectionId,omitempty" json:"sectionId,omitempty"` + SectionIds *string `form:"sectionIds,omitempty" json:"sectionIds,omitempty"` + SectionJwId *int64 `form:"sectionJwId,omitempty" json:"sectionJwId,omitempty"` +} + // GetSubscribedHomeworksParams defines parameters for GetSubscribedHomeworks. type GetSubscribedHomeworksParams struct { Page *int64 `form:"page,omitempty" json:"page,omitempty"` @@ -10880,6 +10983,9 @@ type ClientInterface interface { AddCommentReaction(ctx context.Context, id string, body AddCommentReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiCommunityCommentsIdReplies request + GetApiCommunityCommentsIdReplies(ctx context.Context, id string, params *GetApiCommunityCommentsIdRepliesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetDescription request GetDescription(ctx context.Context, params *GetDescriptionParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -10896,9 +11002,15 @@ type ClientInterface interface { CommunitySectionHomeworkCreate(ctx context.Context, body CommunitySectionHomeworkCreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiCommunitySectionHomeworksAudit request + GetApiCommunitySectionHomeworksAudit(ctx context.Context, params *GetApiCommunitySectionHomeworksAuditParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // CommunitySectionHomeworkDelete request CommunitySectionHomeworkDelete(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiCommunitySectionHomeworksId request + GetApiCommunitySectionHomeworksId(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + // CommunitySectionHomeworkUpdateWithBody request with any body CommunitySectionHomeworkUpdateWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -11673,6 +11785,18 @@ func (c *Client) AddCommentReaction(ctx context.Context, id string, body AddComm return c.Client.Do(req) } +func (c *Client) GetApiCommunityCommentsIdReplies(ctx context.Context, id string, params *GetApiCommunityCommentsIdRepliesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiCommunityCommentsIdRepliesRequest(c.Server, id, params) + 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) GetDescription(ctx context.Context, params *GetDescriptionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDescriptionRequest(c.Server, params) if err != nil { @@ -11745,6 +11869,18 @@ func (c *Client) CommunitySectionHomeworkCreate(ctx context.Context, body Commun return c.Client.Do(req) } +func (c *Client) GetApiCommunitySectionHomeworksAudit(ctx context.Context, params *GetApiCommunitySectionHomeworksAuditParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiCommunitySectionHomeworksAuditRequest(c.Server, params) + 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) CommunitySectionHomeworkDelete(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCommunitySectionHomeworkDeleteRequest(c.Server, id) if err != nil { @@ -11757,6 +11893,18 @@ func (c *Client) CommunitySectionHomeworkDelete(ctx context.Context, id string, return c.Client.Do(req) } +func (c *Client) GetApiCommunitySectionHomeworksId(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiCommunitySectionHomeworksIdRequest(c.Server, id) + 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) CommunitySectionHomeworkUpdateWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCommunitySectionHomeworkUpdateRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -15579,17 +15727,89 @@ func NewAddCommentReactionRequestWithBody(server string, id string, contentType return req, nil } -// NewGetDescriptionRequest generates requests for GetDescription -func NewGetDescriptionRequest(server string, params *GetDescriptionParams) (*http.Request, error) { +// NewGetApiCommunityCommentsIdRepliesRequest generates requests for GetApiCommunityCommentsIdReplies +func NewGetApiCommunityCommentsIdRepliesRequest(server string, id string, params *GetApiCommunityCommentsIdRepliesParams) (*http.Request, error) { var err error - serverURL, err := url.Parse(server) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api/community/descriptions") - if operationPath[0] == '/' { + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/community/comments/%s/replies", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, 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.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); 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) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetDescriptionRequest generates requests for GetDescription +func NewGetDescriptionRequest(server string, params *GetDescriptionParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/community/descriptions") + if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -15913,6 +16133,87 @@ func NewCommunitySectionHomeworkCreateRequestWithBody(server string, contentType return req, nil } +// NewGetApiCommunitySectionHomeworksAuditRequest generates requests for GetApiCommunitySectionHomeworksAudit +func NewGetApiCommunitySectionHomeworksAuditRequest(server string, params *GetApiCommunitySectionHomeworksAuditParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/community/section-homeworks/audit") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.SectionId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionId", *params.SectionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); 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.SectionIds != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionIds", *params.SectionIds, 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.SectionJwId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sectionJwId", *params.SectionJwId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); 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) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewCommunitySectionHomeworkDeleteRequest generates requests for CommunitySectionHomeworkDelete func NewCommunitySectionHomeworkDeleteRequest(server string, id string) (*http.Request, error) { var err error @@ -15947,6 +16248,40 @@ func NewCommunitySectionHomeworkDeleteRequest(server string, id string) (*http.R return req, nil } +// NewGetApiCommunitySectionHomeworksIdRequest generates requests for GetApiCommunitySectionHomeworksId +func NewGetApiCommunitySectionHomeworksIdRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, 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/community/section-homeworks/%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 +} + // NewCommunitySectionHomeworkUpdateRequest calls the generic CommunitySectionHomeworkUpdate builder with application/json body func NewCommunitySectionHomeworkUpdateRequest(server string, id string, body CommunitySectionHomeworkUpdateJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -17687,6 +18022,9 @@ type ClientWithResponsesInterface interface { AddCommentReactionWithResponse(ctx context.Context, id string, body AddCommentReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*AddCommentReactionResponse, error) + // GetApiCommunityCommentsIdRepliesWithResponse request + GetApiCommunityCommentsIdRepliesWithResponse(ctx context.Context, id string, params *GetApiCommunityCommentsIdRepliesParams, reqEditors ...RequestEditorFn) (*GetApiCommunityCommentsIdRepliesResponse, error) + // GetDescriptionWithResponse request GetDescriptionWithResponse(ctx context.Context, params *GetDescriptionParams, reqEditors ...RequestEditorFn) (*GetDescriptionResponse, error) @@ -17703,9 +18041,15 @@ type ClientWithResponsesInterface interface { CommunitySectionHomeworkCreateWithResponse(ctx context.Context, body CommunitySectionHomeworkCreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CommunitySectionHomeworkCreateResponse, error) + // GetApiCommunitySectionHomeworksAuditWithResponse request + GetApiCommunitySectionHomeworksAuditWithResponse(ctx context.Context, params *GetApiCommunitySectionHomeworksAuditParams, reqEditors ...RequestEditorFn) (*GetApiCommunitySectionHomeworksAuditResponse, error) + // CommunitySectionHomeworkDeleteWithResponse request CommunitySectionHomeworkDeleteWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*CommunitySectionHomeworkDeleteResponse, error) + // GetApiCommunitySectionHomeworksIdWithResponse request + GetApiCommunitySectionHomeworksIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetApiCommunitySectionHomeworksIdResponse, error) + // CommunitySectionHomeworkUpdateWithBodyWithResponse request with any body CommunitySectionHomeworkUpdateWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CommunitySectionHomeworkUpdateResponse, error) @@ -18900,6 +19244,31 @@ func (r AddCommentReactionResponse) StatusCode() int { return 0 } +type GetApiCommunityCommentsIdRepliesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CommentRepliesResponseSchema + JSON400 *OpenApiErrorSchema + JSON403 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiCommunityCommentsIdRepliesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiCommunityCommentsIdRepliesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type GetDescriptionResponse struct { Body []byte HTTPResponse *http.Response @@ -19004,6 +19373,30 @@ func (r CommunitySectionHomeworkCreateResponse) StatusCode() int { return 0 } +type GetApiCommunitySectionHomeworksAuditResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *HomeworkAuditListResponseSchema + JSON400 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiCommunitySectionHomeworksAuditResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiCommunitySectionHomeworksAuditResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type CommunitySectionHomeworkDeleteResponse struct { Body []byte HTTPResponse *http.Response @@ -19031,6 +19424,30 @@ func (r CommunitySectionHomeworkDeleteResponse) StatusCode() int { return 0 } +type GetApiCommunitySectionHomeworksIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *HomeworkDetailResponseSchema + JSON400 *OpenApiErrorSchema + JSON404 *OpenApiErrorSchema +} + +// Status returns HTTPResponse.Status +func (r GetApiCommunitySectionHomeworksIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetApiCommunitySectionHomeworksIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type CommunitySectionHomeworkUpdateResponse struct { Body []byte HTTPResponse *http.Response @@ -20347,6 +20764,15 @@ func (c *ClientWithResponses) AddCommentReactionWithResponse(ctx context.Context return ParseAddCommentReactionResponse(rsp) } +// GetApiCommunityCommentsIdRepliesWithResponse request returning *GetApiCommunityCommentsIdRepliesResponse +func (c *ClientWithResponses) GetApiCommunityCommentsIdRepliesWithResponse(ctx context.Context, id string, params *GetApiCommunityCommentsIdRepliesParams, reqEditors ...RequestEditorFn) (*GetApiCommunityCommentsIdRepliesResponse, error) { + rsp, err := c.GetApiCommunityCommentsIdReplies(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiCommunityCommentsIdRepliesResponse(rsp) +} + // GetDescriptionWithResponse request returning *GetDescriptionResponse func (c *ClientWithResponses) GetDescriptionWithResponse(ctx context.Context, params *GetDescriptionParams, reqEditors ...RequestEditorFn) (*GetDescriptionResponse, error) { rsp, err := c.GetDescription(ctx, params, reqEditors...) @@ -20399,6 +20825,15 @@ func (c *ClientWithResponses) CommunitySectionHomeworkCreateWithResponse(ctx con return ParseCommunitySectionHomeworkCreateResponse(rsp) } +// GetApiCommunitySectionHomeworksAuditWithResponse request returning *GetApiCommunitySectionHomeworksAuditResponse +func (c *ClientWithResponses) GetApiCommunitySectionHomeworksAuditWithResponse(ctx context.Context, params *GetApiCommunitySectionHomeworksAuditParams, reqEditors ...RequestEditorFn) (*GetApiCommunitySectionHomeworksAuditResponse, error) { + rsp, err := c.GetApiCommunitySectionHomeworksAudit(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiCommunitySectionHomeworksAuditResponse(rsp) +} + // CommunitySectionHomeworkDeleteWithResponse request returning *CommunitySectionHomeworkDeleteResponse func (c *ClientWithResponses) CommunitySectionHomeworkDeleteWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*CommunitySectionHomeworkDeleteResponse, error) { rsp, err := c.CommunitySectionHomeworkDelete(ctx, id, reqEditors...) @@ -20408,6 +20843,15 @@ func (c *ClientWithResponses) CommunitySectionHomeworkDeleteWithResponse(ctx con return ParseCommunitySectionHomeworkDeleteResponse(rsp) } +// GetApiCommunitySectionHomeworksIdWithResponse request returning *GetApiCommunitySectionHomeworksIdResponse +func (c *ClientWithResponses) GetApiCommunitySectionHomeworksIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetApiCommunitySectionHomeworksIdResponse, error) { + rsp, err := c.GetApiCommunitySectionHomeworksId(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiCommunitySectionHomeworksIdResponse(rsp) +} + // CommunitySectionHomeworkUpdateWithBodyWithResponse request with arbitrary body returning *CommunitySectionHomeworkUpdateResponse func (c *ClientWithResponses) CommunitySectionHomeworkUpdateWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CommunitySectionHomeworkUpdateResponse, error) { rsp, err := c.CommunitySectionHomeworkUpdateWithBody(ctx, id, contentType, body, reqEditors...) @@ -22742,6 +23186,53 @@ func ParseAddCommentReactionResponse(rsp *http.Response) (*AddCommentReactionRes return response, nil } +// ParseGetApiCommunityCommentsIdRepliesResponse parses an HTTP response from a GetApiCommunityCommentsIdRepliesWithResponse call +func ParseGetApiCommunityCommentsIdRepliesResponse(rsp *http.Response) (*GetApiCommunityCommentsIdRepliesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetApiCommunityCommentsIdRepliesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CommentRepliesResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + 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 + + } + + return response, nil +} + // ParseGetDescriptionResponse parses an HTTP response from a GetDescriptionWithResponse call func ParseGetDescriptionResponse(rsp *http.Response) (*GetDescriptionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -22958,6 +23449,46 @@ func ParseCommunitySectionHomeworkCreateResponse(rsp *http.Response) (*Community return response, nil } +// ParseGetApiCommunitySectionHomeworksAuditResponse parses an HTTP response from a GetApiCommunitySectionHomeworksAuditWithResponse call +func ParseGetApiCommunitySectionHomeworksAuditResponse(rsp *http.Response) (*GetApiCommunitySectionHomeworksAuditResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetApiCommunitySectionHomeworksAuditResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HomeworkAuditListResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + 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 + + } + + return response, nil +} + // ParseCommunitySectionHomeworkDeleteResponse parses an HTTP response from a CommunitySectionHomeworkDeleteWithResponse call func ParseCommunitySectionHomeworkDeleteResponse(rsp *http.Response) (*CommunitySectionHomeworkDeleteResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -23019,6 +23550,46 @@ func ParseCommunitySectionHomeworkDeleteResponse(rsp *http.Response) (*Community return response, nil } +// ParseGetApiCommunitySectionHomeworksIdResponse parses an HTTP response from a GetApiCommunitySectionHomeworksIdWithResponse call +func ParseGetApiCommunitySectionHomeworksIdResponse(rsp *http.Response) (*GetApiCommunitySectionHomeworksIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetApiCommunitySectionHomeworksIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HomeworkDetailResponseSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest OpenApiErrorSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + 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 + + } + + return response, nil +} + // ParseCommunitySectionHomeworkUpdateResponse parses an HTTP response from a CommunitySectionHomeworkUpdateWithResponse call func ParseCommunitySectionHomeworkUpdateResponse(rsp *http.Response) (*CommunitySectionHomeworkUpdateResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body)