diff --git a/danke/api/review.go b/danke/api/review.go index be0c788..602a67f 100644 --- a/danke/api/review.go +++ b/danke/api/review.go @@ -444,7 +444,7 @@ func GetRandomReviewV1(c *fiber.Ctx) (err error) { // @Summary List sensitive reviews, admin only // @Tags Review // @Produce application/json -// @Router /reviews/_sensitive [get] +// @Router /v3/reviews/_sensitive [get] // @Param object query schema.SensitiveReviewRequest false "query" // @Success 200 {array} schema.SensitiveReviewResponse // @Failure 404 {object} common.HttpBaseError @@ -507,8 +507,8 @@ func ListSensitiveReviews(c *fiber.Ctx) (err error) { // @Summary Modify A Review's actual_sensitive, admin only // @Tags Review // @Produce application/json -// @Router /reviews/{id}/_sensitive [put] -// @Router /reviews/{id}/_sensitive [patch] +// @Router /v3/reviews/{id}/_sensitive [put] +// @Router /v3/reviews/{id}/_sensitive [patch] // @Param id path int true "id" // @Param json body schema.ModifySensitiveReviewRequest true "json" // @Success 200 {object} schema.SensitiveReviewResponse diff --git a/danke/docs/docs.go b/danke/docs/docs.go index e3aa929..6966afa 100644 --- a/danke/docs/docs.go +++ b/danke/docs/docs.go @@ -374,58 +374,6 @@ const docTemplate = `{ } } }, - "/reviews/_sensitive": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Review" - ], - "summary": "List sensitive reviews, admin only", - "parameters": [ - { - "type": "boolean", - "name": "all", - "in": "query" - }, - { - "type": "string", - "name": "offset", - "in": "query" - }, - { - "type": "boolean", - "name": "open", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "default": 10, - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/schema.SensitiveReviewResponse" - } - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/common.HttpBaseError" - } - } - } - } - }, "/reviews/me": { "get": { "description": "list my reviews, old version. load history and achievements, no ` + "`" + `is_me` + "`" + ` field", @@ -537,90 +485,6 @@ const docTemplate = `{ } } }, - "/reviews/{id}/_sensitive": { - "put": { - "produces": [ - "application/json" - ], - "tags": [ - "Review" - ], - "summary": "Modify A Review's actual_sensitive, admin only", - "parameters": [ - { - "type": "integer", - "description": "id", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "json", - "name": "json", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/schema.SensitiveReviewResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/common.HttpBaseError" - } - } - } - }, - "patch": { - "produces": [ - "application/json" - ], - "tags": [ - "Review" - ], - "summary": "Modify A Review's actual_sensitive, admin only", - "parameters": [ - { - "type": "integer", - "description": "id", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "json", - "name": "json", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/schema.SensitiveReviewResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/common.HttpBaseError" - } - } - } - } - }, "/reviews/{review_id}": { "put": { "description": "modify a review, admin or owner can modify", @@ -937,6 +801,142 @@ const docTemplate = `{ } } } + }, + "/v3/reviews/_sensitive": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "List sensitive reviews, admin only", + "parameters": [ + { + "type": "boolean", + "name": "all", + "in": "query" + }, + { + "type": "string", + "name": "offset", + "in": "query" + }, + { + "type": "boolean", + "name": "open", + "in": "query" + }, + { + "maximum": 10, + "type": "integer", + "default": 10, + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.SensitiveReviewResponse" + } + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.HttpBaseError" + } + } + } + } + }, + "/v3/reviews/{id}/_sensitive": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "Modify A Review's actual_sensitive, admin only", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "json", + "name": "json", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/schema.SensitiveReviewResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.HttpBaseError" + } + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "Modify A Review's actual_sensitive, admin only", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "json", + "name": "json", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/schema.SensitiveReviewResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.HttpBaseError" + } + } + } + } } }, "definitions": { diff --git a/danke/docs/swagger.json b/danke/docs/swagger.json index fce6714..728b725 100644 --- a/danke/docs/swagger.json +++ b/danke/docs/swagger.json @@ -367,58 +367,6 @@ } } }, - "/reviews/_sensitive": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Review" - ], - "summary": "List sensitive reviews, admin only", - "parameters": [ - { - "type": "boolean", - "name": "all", - "in": "query" - }, - { - "type": "string", - "name": "offset", - "in": "query" - }, - { - "type": "boolean", - "name": "open", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "default": 10, - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/schema.SensitiveReviewResponse" - } - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/common.HttpBaseError" - } - } - } - } - }, "/reviews/me": { "get": { "description": "list my reviews, old version. load history and achievements, no `is_me` field", @@ -530,90 +478,6 @@ } } }, - "/reviews/{id}/_sensitive": { - "put": { - "produces": [ - "application/json" - ], - "tags": [ - "Review" - ], - "summary": "Modify A Review's actual_sensitive, admin only", - "parameters": [ - { - "type": "integer", - "description": "id", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "json", - "name": "json", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/schema.SensitiveReviewResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/common.HttpBaseError" - } - } - } - }, - "patch": { - "produces": [ - "application/json" - ], - "tags": [ - "Review" - ], - "summary": "Modify A Review's actual_sensitive, admin only", - "parameters": [ - { - "type": "integer", - "description": "id", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "json", - "name": "json", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/schema.SensitiveReviewResponse" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/common.HttpBaseError" - } - } - } - } - }, "/reviews/{review_id}": { "put": { "description": "modify a review, admin or owner can modify", @@ -930,6 +794,142 @@ } } } + }, + "/v3/reviews/_sensitive": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "List sensitive reviews, admin only", + "parameters": [ + { + "type": "boolean", + "name": "all", + "in": "query" + }, + { + "type": "string", + "name": "offset", + "in": "query" + }, + { + "type": "boolean", + "name": "open", + "in": "query" + }, + { + "maximum": 10, + "type": "integer", + "default": 10, + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.SensitiveReviewResponse" + } + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.HttpBaseError" + } + } + } + } + }, + "/v3/reviews/{id}/_sensitive": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "Modify A Review's actual_sensitive, admin only", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "json", + "name": "json", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/schema.SensitiveReviewResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.HttpBaseError" + } + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "Modify A Review's actual_sensitive, admin only", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "json", + "name": "json", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.ModifySensitiveReviewRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/schema.SensitiveReviewResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.HttpBaseError" + } + } + } + } } }, "definitions": { diff --git a/danke/docs/swagger.yaml b/danke/docs/swagger.yaml index bd404b1..e57920f 100644 --- a/danke/docs/swagger.yaml +++ b/danke/docs/swagger.yaml @@ -716,39 +716,6 @@ paths: summary: /group/{group_id} tags: - CourseGroup - /reviews/_sensitive: - get: - parameters: - - in: query - name: all - type: boolean - - in: query - name: offset - type: string - - in: query - name: open - type: boolean - - default: 10 - in: query - maximum: 10 - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/schema.SensitiveReviewResponse' - type: array - "404": - description: Not Found - schema: - $ref: '#/definitions/common.HttpBaseError' - summary: List sensitive reviews, admin only - tags: - - Review /reviews/{id}: get: consumes: @@ -774,61 +741,6 @@ paths: summary: get a review tags: - Review - /reviews/{id}/_sensitive: - patch: - parameters: - - description: id - in: path - name: id - required: true - type: integer - - description: json - in: body - name: json - required: true - schema: - $ref: '#/definitions/schema.ModifySensitiveReviewRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/schema.SensitiveReviewResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/common.HttpBaseError' - summary: Modify A Review's actual_sensitive, admin only - tags: - - Review - put: - parameters: - - description: id - in: path - name: id - required: true - type: integer - - description: json - in: body - name: json - required: true - schema: - $ref: '#/definitions/schema.ModifySensitiveReviewRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/schema.SensitiveReviewResponse' - "404": - description: Not Found - schema: - $ref: '#/definitions/common.HttpBaseError' - summary: Modify A Review's actual_sensitive, admin only - tags: - - Review /reviews/{review_id}: delete: consumes: @@ -1089,4 +1001,92 @@ paths: summary: search course group tags: - CourseGroup + /v3/reviews/_sensitive: + get: + parameters: + - in: query + name: all + type: boolean + - in: query + name: offset + type: string + - in: query + name: open + type: boolean + - default: 10 + in: query + maximum: 10 + name: size + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/schema.SensitiveReviewResponse' + type: array + "404": + description: Not Found + schema: + $ref: '#/definitions/common.HttpBaseError' + summary: List sensitive reviews, admin only + tags: + - Review + /v3/reviews/{id}/_sensitive: + patch: + parameters: + - description: id + in: path + name: id + required: true + type: integer + - description: json + in: body + name: json + required: true + schema: + $ref: '#/definitions/schema.ModifySensitiveReviewRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/schema.SensitiveReviewResponse' + "404": + description: Not Found + schema: + $ref: '#/definitions/common.HttpBaseError' + summary: Modify A Review's actual_sensitive, admin only + tags: + - Review + put: + parameters: + - description: id + in: path + name: id + required: true + type: integer + - description: json + in: body + name: json + required: true + schema: + $ref: '#/definitions/schema.ModifySensitiveReviewRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/schema.SensitiveReviewResponse' + "404": + description: Not Found + schema: + $ref: '#/definitions/common.HttpBaseError' + summary: Modify A Review's actual_sensitive, admin only + tags: + - Review swagger: "2.0"