diff --git a/api-docs/.openapi-generator/FILES b/api-docs/.openapi-generator/FILES index 9f0d0be5..d7a5f550 100644 --- a/api-docs/.openapi-generator/FILES +++ b/api-docs/.openapi-generator/FILES @@ -12,6 +12,7 @@ Models/AnswerDetails.md Models/AuthToken.md Models/CodeExecution.md Models/DifficultyLevel.md +Models/DifficultyLevelRequestDto.md Models/Error.md Models/ErrorResponseObject.md Models/ExecutionResult.md @@ -21,6 +22,7 @@ Models/NewQuestion.md Models/NewTag.md Models/Profile.md Models/QuestionDetails.md +Models/QuestionRateResponseDto.md Models/QuestionSummary.md Models/SuccessResponseObject.md Models/SuccessResponseObject_data.md @@ -39,10 +41,12 @@ Models/createAnswer_201_response.md Models/createQuestion_201_response.md Models/createTag_201_response.md Models/executeCode_200_response.md +Models/getBookmarkedQuestions_200_response.md Models/getQuestionAnswers_200_response.md Models/getQuestionAnswers_200_response_allOf_data.md Models/getUserFollowers_200_response.md Models/getUserProfile_200_response.md +Models/rateQuestion_200_response.md Models/resetPassword_request.md Models/searchQuestions_200_response.md Models/searchQuestions_200_response_allOf_data.md diff --git a/api-docs/Apis/QuestionsApi.md b/api-docs/Apis/QuestionsApi.md index 20fcf6a0..d25b5ebf 100644 --- a/api-docs/Apis/QuestionsApi.md +++ b/api-docs/Apis/QuestionsApi.md @@ -4,12 +4,14 @@ All URIs are relative to *http://localhost:5173/api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**bookmarkQuestion**](QuestionsApi.md#bookmarkQuestion) | **POST** /questions/{questionId}/bookmark | Bookmark a question | +| [**bookmarkQuestion**](QuestionsApi.md#bookmarkQuestion) | **POST** /questions/{questionId}/bookmarks | Bookmark a question | | [**createQuestion**](QuestionsApi.md#createQuestion) | **POST** /questions | Create a new question | | [**deleteQuestion**](QuestionsApi.md#deleteQuestion) | **DELETE** /questions/{questionId} | Delete a question | | [**downvoteQuestion**](QuestionsApi.md#downvoteQuestion) | **POST** /questions/{questionId}/downvote | Downvote a question | +| [**getBookmarkedQuestions**](QuestionsApi.md#getBookmarkedQuestions) | **GET** /questions/bookmarked | Get bookmarked questions | | [**getQuestionDetails**](QuestionsApi.md#getQuestionDetails) | **GET** /questions/{questionId} | Get question details | -| [**removeQuestionBookmark**](QuestionsApi.md#removeQuestionBookmark) | **DELETE** /questions/{questionId}/bookmark | Remove bookmark from a question | +| [**rateQuestion**](QuestionsApi.md#rateQuestion) | **POST** /questions/{id}/vote-difficulty | Rate a question's level of difficulty. | +| [**removeQuestionBookmark**](QuestionsApi.md#removeQuestionBookmark) | **DELETE** /questions/{questionId}/bookmarks | Remove bookmark from a question | | [**updateQuestion**](QuestionsApi.md#updateQuestion) | **PUT** /questions/{questionId} | Update a question | | [**upvoteQuestion**](QuestionsApi.md#upvoteQuestion) | **POST** /questions/{questionId}/upvote | Upvote a question | @@ -114,6 +116,28 @@ null (empty response body) - **Content-Type**: Not defined - **Accept**: application/json + +# **getBookmarkedQuestions** +> getBookmarkedQuestions_200_response getBookmarkedQuestions() + +Get bookmarked questions + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**getBookmarkedQuestions_200_response**](../Models/getBookmarkedQuestions_200_response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + # **getQuestionDetails** > createQuestion_201_response getQuestionDetails(questionId) @@ -139,6 +163,32 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json + +# **rateQuestion** +> rateQuestion_200_response rateQuestion(id, DifficultyLevelRequestDto) + +Rate a question's level of difficulty. + +### Parameters + +|Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **Long**| | [default to null] | +| **DifficultyLevelRequestDto** | [**DifficultyLevelRequestDto**](../Models/DifficultyLevelRequestDto.md)| | | + +### Return type + +[**rateQuestion_200_response**](../Models/rateQuestion_200_response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + # **removeQuestionBookmark** > removeQuestionBookmark(questionId) diff --git a/api-docs/Apis/SearchApi.md b/api-docs/Apis/SearchApi.md index 9901d6a4..7462cb0d 100644 --- a/api-docs/Apis/SearchApi.md +++ b/api-docs/Apis/SearchApi.md @@ -11,7 +11,7 @@ All URIs are relative to *http://localhost:5173/api/v1* # **searchQuestions** -> searchQuestions_200_response searchQuestions(q, tags, difficulty, page, pageSize) +> searchQuestions_200_response searchQuestions(q, tags, difficulty, page, pageSize, sortBy) Search questions @@ -24,6 +24,7 @@ Search questions | **difficulty** | [**DifficultyLevel**](../Models/.md)| Filter by difficulty level | [optional] [default to null] [enum: EASY, MEDIUM, HARD] | | **page** | **Integer**| Page number | [optional] [default to 1] | | **pageSize** | **Integer**| Number of items per page | [optional] [default to 20] | +| **sortBy** | **String**| Sorting type | [optional] [default to recommended] | ### Return type diff --git a/api-docs/Apis/TagsApi.md b/api-docs/Apis/TagsApi.md index 32db1fc6..d04931d6 100644 --- a/api-docs/Apis/TagsApi.md +++ b/api-docs/Apis/TagsApi.md @@ -45,7 +45,7 @@ Follow a tag |Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **tagId** | **String**| | [default to null] | +| **tagId** | **Integer**| | [default to null] | ### Return type @@ -70,7 +70,7 @@ Get tag details |Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **tagId** | **String**| | [default to null] | +| **tagId** | **Integer**| | [default to null] | ### Return type @@ -95,7 +95,7 @@ Unfollow a tag |Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **tagId** | **String**| | [default to null] | +| **tagId** | **Integer**| | [default to null] | ### Return type diff --git a/api-docs/Models/DifficultyLevelRequestDto.md b/api-docs/Models/DifficultyLevelRequestDto.md new file mode 100644 index 00000000..86f22e20 --- /dev/null +++ b/api-docs/Models/DifficultyLevelRequestDto.md @@ -0,0 +1,9 @@ +# DifficultyLevelRequestDto +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **difficulty** | **String** | | [optional] [default to null] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/api-docs/Models/NewQuestion.md b/api-docs/Models/NewQuestion.md index 31318eaf..e26447f4 100644 --- a/api-docs/Models/NewQuestion.md +++ b/api-docs/Models/NewQuestion.md @@ -6,7 +6,7 @@ | **title** | **String** | | [default to null] | | **content** | **String** | | [default to null] | | **tagIds** | **List** | | [optional] [default to null] | -| **difficultyLevel** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] | +| **difficulty** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/api-docs/Models/QuestionDetails.md b/api-docs/Models/QuestionDetails.md index 522a8136..d60ce415 100644 --- a/api-docs/Models/QuestionDetails.md +++ b/api-docs/Models/QuestionDetails.md @@ -12,10 +12,15 @@ | **tags** | [**List**](TagSummary.md) | | [default to null] | | **likeCount** | **Integer** | | [default to null] | | **dislikeCount** | **Integer** | | [default to null] | +| **difficulty** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] | | **commentCount** | **Integer** | | [default to null] | | **viewCount** | **Integer** | | [optional] [default to null] | -| **bookmarked** | **Boolean** | | [optional] [default to null] | -| **selfVoted** | **Integer** | | [optional] [default to null] | +| **bookmarked** | **Boolean** | | [default to null] | +| **selfVoted** | **Integer** | | [default to null] | +| **selfDifficultyVote** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] | +| **easyCount** | **Integer** | | [default to null] | +| **mediumCount** | **Integer** | | [default to null] | +| **hardCount** | **Integer** | | [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/api-docs/Models/QuestionRateResponseDto.md b/api-docs/Models/QuestionRateResponseDto.md new file mode 100644 index 00000000..c4df3acb --- /dev/null +++ b/api-docs/Models/QuestionRateResponseDto.md @@ -0,0 +1,13 @@ +# QuestionRateResponseDto +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **questionId** | **Long** | | [optional] [default to null] | +| **easyCount** | **Long** | | [optional] [default to null] | +| **mediumCount** | **Long** | | [optional] [default to null] | +| **hardCount** | **Long** | | [optional] [default to null] | +| **totalCount** | **Long** | | [optional] [default to null] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/api-docs/Models/QuestionSummary.md b/api-docs/Models/QuestionSummary.md index e235f557..705c3b0f 100644 --- a/api-docs/Models/QuestionSummary.md +++ b/api-docs/Models/QuestionSummary.md @@ -5,13 +5,14 @@ |------------ | ------------- | ------------- | -------------| | **id** | **Integer** | | [default to null] | | **title** | **String** | | [default to null] | -| **questionBody** | **String** | | [optional] [default to null] | +| **content** | **String** | | [optional] [default to null] | | **author** | [**UserSummary**](UserSummary.md) | | [optional] [default to null] | | **createdAt** | **Date** | | [default to null] | -| **difficultyLevel** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] | +| **difficulty** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] | | **tags** | [**List**](TagSummary.md) | | [default to null] | -| **likeCount** | **Integer** | | [default to null] | -| **commentCount** | **Integer** | | [default to null] | +| **upvoteCount** | **Integer** | | [default to null] | +| **downvoteCount** | **Integer** | | [default to null] | +| **answerCount** | **Integer** | | [default to null] | | **viewCount** | **Integer** | | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/api-docs/Models/TagDetails.md b/api-docs/Models/TagDetails.md index 071dfa9f..7f98e067 100644 --- a/api-docs/Models/TagDetails.md +++ b/api-docs/Models/TagDetails.md @@ -3,7 +3,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| **tagId** | **String** | | [default to null] | +| **tagId** | **Integer** | | [default to null] | | **name** | **String** | | [default to null] | | **tagType** | [**TagType**](TagType.md) | | [optional] [default to null] | | **description** | **String** | | [default to null] | diff --git a/api-docs/Models/TagSummary.md b/api-docs/Models/TagSummary.md index 50324417..bee584f1 100644 --- a/api-docs/Models/TagSummary.md +++ b/api-docs/Models/TagSummary.md @@ -5,6 +5,7 @@ |------------ | ------------- | ------------- | -------------| | **id** | **String** | | [optional] [default to null] | | **name** | **String** | | [optional] [default to null] | +| **tagType** | [**TagType**](TagType.md) | | [optional] [default to null] | | **questionCount** | **Integer** | | [optional] [default to null] | | **photo** | **String** | | [optional] [default to null] | diff --git a/api-docs/Models/UserProfile.md b/api-docs/Models/UserProfile.md index 6901036d..145c95f4 100644 --- a/api-docs/Models/UserProfile.md +++ b/api-docs/Models/UserProfile.md @@ -19,6 +19,7 @@ | **answerCount** | **Integer** | | [optional] [default to null] | | **answers** | [**List**](AnswerDetails.md) | | [optional] [default to null] | | **questions** | [**List**](QuestionSummary.md) | | [optional] [default to null] | +| **followedTags** | [**List**](TagSummary.md) | | [optional] [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/api-docs/Models/getBookmarkedQuestions_200_response.md b/api-docs/Models/getBookmarkedQuestions_200_response.md new file mode 100644 index 00000000..6d84de91 --- /dev/null +++ b/api-docs/Models/getBookmarkedQuestions_200_response.md @@ -0,0 +1,10 @@ +# getBookmarkedQuestions_200_response +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **status** | **Integer** | Internal status code of the response. An HTTP 200 response with an internal 500 status code is an error response. Prioritize the inner status over the HTTP status. | [default to null] | +| **data** | [**List**](QuestionSummary.md) | | [default to null] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/api-docs/Models/rateQuestion_200_response.md b/api-docs/Models/rateQuestion_200_response.md new file mode 100644 index 00000000..1057874f --- /dev/null +++ b/api-docs/Models/rateQuestion_200_response.md @@ -0,0 +1,10 @@ +# rateQuestion_200_response +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **status** | **Integer** | Internal status code of the response. An HTTP 200 response with an internal 500 status code is an error response. Prioritize the inner status over the HTTP status. | [default to null] | +| **data** | [**QuestionRateResponseDto**](QuestionRateResponseDto.md) | | [default to null] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/api-docs/README.md b/api-docs/README.md index 9f7d6913..3cba0da2 100644 --- a/api-docs/README.md +++ b/api-docs/README.md @@ -20,12 +20,14 @@ All URIs are relative to *http://localhost:5173/api/v1* *AuthApi* | [**verifyEmail**](Apis/AuthApi.md#verifyemail) | **POST** /auth/verify-email | Verify user's email | | *CodeExecutionApi* | [**executeCode**](Apis/CodeExecutionApi.md#executecode) | **POST** /execute-code | Execute a code snippet | | *FeedApi* | [**getUserFeed**](Apis/FeedApi.md#getuserfeed) | **GET** /feed | Get user feed | -| *QuestionsApi* | [**bookmarkQuestion**](Apis/QuestionsApi.md#bookmarkquestion) | **POST** /questions/{questionId}/bookmark | Bookmark a question | +| *QuestionsApi* | [**bookmarkQuestion**](Apis/QuestionsApi.md#bookmarkquestion) | **POST** /questions/{questionId}/bookmarks | Bookmark a question | *QuestionsApi* | [**createQuestion**](Apis/QuestionsApi.md#createquestion) | **POST** /questions | Create a new question | *QuestionsApi* | [**deleteQuestion**](Apis/QuestionsApi.md#deletequestion) | **DELETE** /questions/{questionId} | Delete a question | *QuestionsApi* | [**downvoteQuestion**](Apis/QuestionsApi.md#downvotequestion) | **POST** /questions/{questionId}/downvote | Downvote a question | +*QuestionsApi* | [**getBookmarkedQuestions**](Apis/QuestionsApi.md#getbookmarkedquestions) | **GET** /questions/bookmarked | Get bookmarked questions | *QuestionsApi* | [**getQuestionDetails**](Apis/QuestionsApi.md#getquestiondetails) | **GET** /questions/{questionId} | Get question details | -*QuestionsApi* | [**removeQuestionBookmark**](Apis/QuestionsApi.md#removequestionbookmark) | **DELETE** /questions/{questionId}/bookmark | Remove bookmark from a question | +*QuestionsApi* | [**rateQuestion**](Apis/QuestionsApi.md#ratequestion) | **POST** /questions/{id}/vote-difficulty | Rate a question's level of difficulty. | +*QuestionsApi* | [**removeQuestionBookmark**](Apis/QuestionsApi.md#removequestionbookmark) | **DELETE** /questions/{questionId}/bookmarks | Remove bookmark from a question | *QuestionsApi* | [**updateQuestion**](Apis/QuestionsApi.md#updatequestion) | **PUT** /questions/{questionId} | Update a question | *QuestionsApi* | [**upvoteQuestion**](Apis/QuestionsApi.md#upvotequestion) | **POST** /questions/{questionId}/upvote | Upvote a question | | *SearchApi* | [**searchQuestions**](Apis/SearchApi.md#searchquestions) | **GET** /search/questions | Search questions | @@ -51,6 +53,7 @@ All URIs are relative to *http://localhost:5173/api/v1* - [AuthToken](./Models/AuthToken.md) - [CodeExecution](./Models/CodeExecution.md) - [DifficultyLevel](./Models/DifficultyLevel.md) + - [DifficultyLevelRequestDto](./Models/DifficultyLevelRequestDto.md) - [Error](./Models/Error.md) - [ErrorResponseObject](./Models/ErrorResponseObject.md) - [ExecutionResult](./Models/ExecutionResult.md) @@ -60,6 +63,7 @@ All URIs are relative to *http://localhost:5173/api/v1* - [NewTag](./Models/NewTag.md) - [Profile](./Models/Profile.md) - [QuestionDetails](./Models/QuestionDetails.md) + - [QuestionRateResponseDto](./Models/QuestionRateResponseDto.md) - [QuestionSummary](./Models/QuestionSummary.md) - [SuccessResponseObject](./Models/SuccessResponseObject.md) - [SuccessResponseObject_data](./Models/SuccessResponseObject_data.md) @@ -78,10 +82,12 @@ All URIs are relative to *http://localhost:5173/api/v1* - [createQuestion_201_response](./Models/createQuestion_201_response.md) - [createTag_201_response](./Models/createTag_201_response.md) - [executeCode_200_response](./Models/executeCode_200_response.md) + - [getBookmarkedQuestions_200_response](./Models/getBookmarkedQuestions_200_response.md) - [getQuestionAnswers_200_response](./Models/getQuestionAnswers_200_response.md) - [getQuestionAnswers_200_response_allOf_data](./Models/getQuestionAnswers_200_response_allOf_data.md) - [getUserFollowers_200_response](./Models/getUserFollowers_200_response.md) - [getUserProfile_200_response](./Models/getUserProfile_200_response.md) + - [rateQuestion_200_response](./Models/rateQuestion_200_response.md) - [resetPassword_request](./Models/resetPassword_request.md) - [searchQuestions_200_response](./Models/searchQuestions_200_response.md) - [searchQuestions_200_response_allOf_data](./Models/searchQuestions_200_response_allOf_data.md) diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 00000000..f8d07ce1 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.10.0" + } +} diff --git a/swagger/openapi.yml b/swagger/openapi.yml index 3397eb5e..11295316 100644 --- a/swagger/openapi.yml +++ b/swagger/openapi.yml @@ -1772,7 +1772,6 @@ components: type: array items: $ref: "#/components/schemas/TagSummary" - examples: UpdateProfile: