4983 lines
166 KiB
Go
4983 lines
166 KiB
Go
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"termsOfService": "http://swagger.io/terms/",
|
|
"contact": {
|
|
"name": "API Support",
|
|
"url": "http://www.swagger.io/support",
|
|
"email": "support@swagger.io"
|
|
},
|
|
"license": {
|
|
"name": "Apache 2.0",
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/api/v1/admin": {
|
|
"get": {
|
|
"description": "Get all Admins",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Get all Admins",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Page number",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page size",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Create Admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Create Admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Create admin",
|
|
"name": "manger",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CreateAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/admin/{id}": {
|
|
"get": {
|
|
"description": "Get a single admin by id",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Get admin by id",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Update Admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Update Admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Update Admin",
|
|
"name": "admin",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/assessment/questions": {
|
|
"get": {
|
|
"description": "Returns all active assessment questions with their options or answers",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"assessment-question"
|
|
],
|
|
"summary": "List assessment questions",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.QuestionWithDetails"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Creates a new assessment question with options or short answer depending on question type",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"assessment-question"
|
|
],
|
|
"summary": "Create assessment question",
|
|
"parameters": [
|
|
{
|
|
"description": "Create question payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.CreateAssessmentQuestionInput"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/assessment/questions/{id}": {
|
|
"get": {
|
|
"description": "Returns a single assessment question with its options or answer",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"assessment-question"
|
|
],
|
|
"summary": "Get assessment question by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Question ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.QuestionWithDetails"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/google/android": {
|
|
"post": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Login via Google Android ID Token",
|
|
"parameters": [
|
|
{
|
|
"description": "Google ID Token from Android",
|
|
"name": "idToken",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/api/v1/auth/google/callback": {
|
|
"get": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Google login callback",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/api/v1/auth/google/login": {
|
|
"get": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Google login redirect",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/api/v1/auth/logout": {
|
|
"post": {
|
|
"description": "Logout user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Logout user",
|
|
"parameters": [
|
|
{
|
|
"description": "Logout user",
|
|
"name": "logout",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.logoutReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/refresh": {
|
|
"post": {
|
|
"description": "Refresh token",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Refresh token",
|
|
"parameters": [
|
|
{
|
|
"description": "tokens",
|
|
"name": "refresh",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.refreshToken"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.loginUserRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/categories": {
|
|
"get": {
|
|
"description": "Returns a paginated list of all course categories",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"course-categories"
|
|
],
|
|
"summary": "Get all course categories",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"default": 10,
|
|
"description": "Limit",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Offset",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Creates a new course category with the provided name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"course-categories"
|
|
],
|
|
"summary": "Create a new course category",
|
|
"parameters": [
|
|
{
|
|
"description": "Create category payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createCourseCategoryReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/categories/{categoryId}/courses": {
|
|
"get": {
|
|
"description": "Returns a paginated list of courses under a specific category",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"courses"
|
|
],
|
|
"summary": "Get courses by category",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Category ID",
|
|
"name": "categoryId",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 10,
|
|
"description": "Limit",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Offset",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/categories/{id}": {
|
|
"get": {
|
|
"description": "Returns a single course category by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"course-categories"
|
|
],
|
|
"summary": "Get course category by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Category ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Updates a course category's name and/or active status",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"course-categories"
|
|
],
|
|
"summary": "Update course category",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Category ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update category payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateCourseCategoryReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Deletes a course category by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"course-categories"
|
|
],
|
|
"summary": "Delete course category",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Category ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/courses": {
|
|
"post": {
|
|
"description": "Creates a new course under a specific category",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"courses"
|
|
],
|
|
"summary": "Create a new course",
|
|
"parameters": [
|
|
{
|
|
"description": "Create course payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createCourseReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/courses/{courseId}/programs": {
|
|
"get": {
|
|
"description": "Returns all programs under a specific course with total count",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "Get programs by course",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Course ID",
|
|
"name": "courseId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/courses/{courseId}/programs/list": {
|
|
"get": {
|
|
"description": "Returns a simple list of programs under a specific course",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "List programs by course",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Course ID",
|
|
"name": "courseId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/courses/{id}": {
|
|
"get": {
|
|
"description": "Returns a single course by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"courses"
|
|
],
|
|
"summary": "Get course by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Course ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Updates a course's title, description, and/or active status",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"courses"
|
|
],
|
|
"summary": "Update course",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Course ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update course payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateCourseReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Deletes a course by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"courses"
|
|
],
|
|
"summary": "Delete course",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Course ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/learning-tree": {
|
|
"get": {
|
|
"description": "Returns the complete learning tree structure with courses, programs, levels, and modules",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"learning-tree"
|
|
],
|
|
"summary": "Get full learning tree",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/levels": {
|
|
"post": {
|
|
"description": "Creates a new level under a specific program",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"levels"
|
|
],
|
|
"summary": "Create a new level",
|
|
"parameters": [
|
|
{
|
|
"description": "Create level payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createLevelReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/levels/{id}": {
|
|
"put": {
|
|
"description": "Updates a level's title, description, index, and/or active status",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"levels"
|
|
],
|
|
"summary": "Update level",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Level ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update level payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateLevelReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/levels/{levelId}": {
|
|
"delete": {
|
|
"description": "Deletes a level by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"levels"
|
|
],
|
|
"summary": "Delete level",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Level ID",
|
|
"name": "levelId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/levels/{levelId}/increment-module": {
|
|
"put": {
|
|
"description": "Increments the module count for a specific level",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"levels"
|
|
],
|
|
"summary": "Increment level module count",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Level ID",
|
|
"name": "levelId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/levels/{levelId}/increment-practice": {
|
|
"put": {
|
|
"description": "Increments the practice count for a specific level",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"levels"
|
|
],
|
|
"summary": "Increment level practice count",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Level ID",
|
|
"name": "levelId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/levels/{levelId}/increment-video": {
|
|
"put": {
|
|
"description": "Increments the video count for a specific level",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"levels"
|
|
],
|
|
"summary": "Increment level video count",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Level ID",
|
|
"name": "levelId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/levels/{levelId}/modules": {
|
|
"get": {
|
|
"description": "Returns a paginated list of modules under a specific level",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"modules"
|
|
],
|
|
"summary": "Get modules by level",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Level ID",
|
|
"name": "levelId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/modules": {
|
|
"post": {
|
|
"description": "Creates a new module under a specific level",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"modules"
|
|
],
|
|
"summary": "Create a new module",
|
|
"parameters": [
|
|
{
|
|
"description": "Create module payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createModuleReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/modules/{id}": {
|
|
"put": {
|
|
"description": "Updates a module's title, content, display order, and/or active status",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"modules"
|
|
],
|
|
"summary": "Update module",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Module ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update module payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateModuleReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Deletes a module by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"modules"
|
|
],
|
|
"summary": "Delete module",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Module ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/modules/{moduleId}/videos/published": {
|
|
"get": {
|
|
"description": "Returns all published videos under a specific module",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"module-videos"
|
|
],
|
|
"summary": "Get published videos by module",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Module ID",
|
|
"name": "moduleId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/owners/{ownerType}/{ownerId}/practices": {
|
|
"get": {
|
|
"description": "Returns all practices for a specific owner type and ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practices"
|
|
],
|
|
"summary": "Get practices by owner",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Owner Type",
|
|
"name": "ownerType",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Owner ID",
|
|
"name": "ownerId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/practices": {
|
|
"post": {
|
|
"description": "Creates a new practice for a specific owner (module or level)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practices"
|
|
],
|
|
"summary": "Create a new practice",
|
|
"parameters": [
|
|
{
|
|
"description": "Create practice payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createPracticeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/practices/{id}": {
|
|
"put": {
|
|
"description": "Updates a practice's fields",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practices"
|
|
],
|
|
"summary": "Update practice",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Practice ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update practice payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updatePracticeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Deletes a practice by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practices"
|
|
],
|
|
"summary": "Delete practice",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Practice ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/practices/{practiceId}/questions": {
|
|
"get": {
|
|
"description": "Returns all questions under a specific practice",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practice-questions"
|
|
],
|
|
"summary": "Get questions by practice",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Practice ID",
|
|
"name": "practiceId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/programs": {
|
|
"post": {
|
|
"description": "Creates a new program under a specific course",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "Create a new program",
|
|
"parameters": [
|
|
{
|
|
"description": "Create program payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createProgramReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/programs/active": {
|
|
"get": {
|
|
"description": "Returns all active programs across all courses",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "List active programs",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/programs/{id}": {
|
|
"get": {
|
|
"description": "Returns a single program by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "Get program by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Program ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Deletes a program by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "Delete program",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Program ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"description": "Updates selected fields of a program",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "Update program partially",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Program ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update program payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateProgramPartialReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/programs/{id}/deactivate": {
|
|
"put": {
|
|
"description": "Deactivates a program by setting is_active to false",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "Deactivate program",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Program ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/programs/{id}/full": {
|
|
"put": {
|
|
"description": "Updates all fields of a program",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"programs"
|
|
],
|
|
"summary": "Update program fully",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Program ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update program payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateProgramFullReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/programs/{programId}/levels": {
|
|
"get": {
|
|
"description": "Returns all levels under a specific program",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"levels"
|
|
],
|
|
"summary": "Get levels by program",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Program ID",
|
|
"name": "programId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/questions": {
|
|
"post": {
|
|
"description": "Creates a new question under a specific practice",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practice-questions"
|
|
],
|
|
"summary": "Create a new practice question",
|
|
"parameters": [
|
|
{
|
|
"description": "Create question payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createPracticeQuestionReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/questions/{id}": {
|
|
"put": {
|
|
"description": "Updates a practice question's fields",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practice-questions"
|
|
],
|
|
"summary": "Update practice question",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Question ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update question payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updatePracticeQuestionReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Deletes a practice question by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"practice-questions"
|
|
],
|
|
"summary": "Delete practice question",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Question ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/videos": {
|
|
"post": {
|
|
"description": "Creates a new video under a specific module",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"module-videos"
|
|
],
|
|
"summary": "Create a new module video",
|
|
"parameters": [
|
|
{
|
|
"description": "Create video payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.createModuleVideoReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/videos/{id}": {
|
|
"put": {
|
|
"description": "Updates a module video's fields",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"module-videos"
|
|
],
|
|
"summary": "Update module video",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Video ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update video payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateModuleVideoReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Deletes a module video by its ID",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"module-videos"
|
|
],
|
|
"summary": "Delete module video",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Video ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/course-management/videos/{videoId}/publish": {
|
|
"put": {
|
|
"description": "Publishes a module video by setting publish date",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"module-videos"
|
|
],
|
|
"summary": "Publish module video",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Video ID",
|
|
"name": "videoId",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/logs": {
|
|
"get": {
|
|
"description": "Fetches application logs from MongoDB with pagination, level filtering, and search",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Logs"
|
|
],
|
|
"summary": "Retrieve application logs with filtering and pagination",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Filter logs by level (debug, info, warn, error, dpanic, panic, fatal)",
|
|
"name": "level",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Search term to match against message or fields",
|
|
"name": "search",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 1,
|
|
"description": "Page number for pagination (default: 1)",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 50,
|
|
"description": "Number of items per page (default: 50, max: 100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Paginated list of application logs",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.LogResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/sendSMS": {
|
|
"post": {
|
|
"description": "Sends an SMS message to a single phone number using AfroMessage",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Send single SMS via AfroMessage",
|
|
"parameters": [
|
|
{
|
|
"description": "Send SMS request",
|
|
"name": "sendSMS",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.SendSingleAfroSMSReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/super-login": {
|
|
"post": {
|
|
"description": "Login super-admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Login super-admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Login super-admin",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.LoginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.LoginAdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/t-approver/{id}": {
|
|
"get": {
|
|
"description": "Get a single admin by id",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Get admin by id",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Update Admin",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"admin"
|
|
],
|
|
"summary": "Update Admin",
|
|
"parameters": [
|
|
{
|
|
"description": "Update Admin",
|
|
"name": "admin",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.updateAdminReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/tenant": {
|
|
"get": {
|
|
"description": "Check if phone number or email exist",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Check if phone number or email exist",
|
|
"parameters": [
|
|
{
|
|
"description": "Check phone number or email exist",
|
|
"name": "checkPhoneEmailExist",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user": {
|
|
"put": {
|
|
"description": "Updates user profile information (partial updates supported)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Update user profile",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Update user payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.UpdateUserReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/delete/{id}": {
|
|
"delete": {
|
|
"description": "Delete a user by their ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Delete user by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/resetPassword": {
|
|
"post": {
|
|
"description": "Reset password",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Reset password",
|
|
"parameters": [
|
|
{
|
|
"description": "Reset password",
|
|
"name": "resetPassword",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetPasswordReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/search": {
|
|
"post": {
|
|
"description": "Search for user using name or phone",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Search for user using name or phone",
|
|
"parameters": [
|
|
{
|
|
"description": "Search for using his name or phone",
|
|
"name": "searchUserByNameOrPhone",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.SearchUserByNameOrPhoneReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.UserProfileResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/sendResetCode": {
|
|
"post": {
|
|
"description": "Send reset code",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Send reset code",
|
|
"parameters": [
|
|
{
|
|
"description": "Send reset code",
|
|
"name": "resetCode",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetCodeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/single/{id}": {
|
|
"get": {
|
|
"description": "Get a single user by id",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Get user by id",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.UserProfileResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/verify-otp": {
|
|
"post": {
|
|
"description": "Verify OTP for registration or other actions",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Verify OTP",
|
|
"parameters": [
|
|
{
|
|
"description": "Verify OTP",
|
|
"name": "verifyOtp",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.VerifyOtpReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/{user_id}/is-pending": {
|
|
"get": {
|
|
"description": "Returns whether the specified user has a status of \"pending\"",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Check if user status is pending",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/user/{user_id}/is-profile-completed": {
|
|
"get": {
|
|
"description": "Returns whether the specified user's profile is completed",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Check if user profile is completed",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/users": {
|
|
"get": {
|
|
"description": "Get users with optional filters",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Get all users",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Role filter",
|
|
"name": "role",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Search query",
|
|
"name": "query",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page number",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page size",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Created before (RFC3339)",
|
|
"name": "created_before",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Created after (RFC3339)",
|
|
"name": "created_after",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/admin-login": {
|
|
"post": {
|
|
"description": "Login user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Login user",
|
|
"parameters": [
|
|
{
|
|
"description": "Login admin",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.LoginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.LoginAdminRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/otp/resend": {
|
|
"post": {
|
|
"description": "Resend OTP if the previous one is expired",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"otp"
|
|
],
|
|
"summary": "Resend OTP",
|
|
"parameters": [
|
|
{
|
|
"description": "Resend OTP",
|
|
"name": "resendOtp",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ResendOtpReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user-login": {
|
|
"post": {
|
|
"description": "Login user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Login user",
|
|
"parameters": [
|
|
{
|
|
"description": "Login user",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.LoginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.loginUserRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/admin-profile": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "Get user profile",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Get user profile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.AdminProfileRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/checkPhoneEmailExist": {
|
|
"post": {
|
|
"description": "Check if phone number or email exist",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Check if phone number or email exist",
|
|
"parameters": [
|
|
{
|
|
"description": "Check phone number or email exist",
|
|
"name": "checkPhoneEmailExist",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.CheckPhoneEmailExistRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/knowledge-level": {
|
|
"put": {
|
|
"description": "Updates the knowledge level of the specified user after initial assessment",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Update user's knowledge level",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "User ID",
|
|
"name": "user_id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Knowledge level",
|
|
"name": "knowledge_level",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.UpdateKnowledgeLevelReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/register": {
|
|
"post": {
|
|
"description": "Register user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Register user",
|
|
"parameters": [
|
|
{
|
|
"description": "Register user",
|
|
"name": "registerUser",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.RegisterUserReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/resetPassword": {
|
|
"post": {
|
|
"description": "Reset tenant password",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Reset tenant password",
|
|
"parameters": [
|
|
{
|
|
"description": "Reset password",
|
|
"name": "resetPassword",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetPasswordReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/sendRegisterCode": {
|
|
"post": {
|
|
"description": "Send register code",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Send register code",
|
|
"parameters": [
|
|
{
|
|
"description": "Send register code",
|
|
"name": "registerCode",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.RegisterCodeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/sendResetCode": {
|
|
"post": {
|
|
"description": "Send reset code",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Send reset code",
|
|
"parameters": [
|
|
{
|
|
"description": "Send reset code",
|
|
"name": "resetCode",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.ResetCodeReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/{tenant_slug}/user/user-profile": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "Get user profile",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"user"
|
|
],
|
|
"summary": "Get user profile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.UserProfileResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"domain.AgeGroup": {
|
|
"type": "string",
|
|
"enum": [
|
|
"UNDER_13",
|
|
"13_17",
|
|
"18_24",
|
|
"25_34",
|
|
"35_44",
|
|
"45_54",
|
|
"55_PLUS"
|
|
],
|
|
"x-enum-varnames": [
|
|
"AgeUnder13",
|
|
"Age13To17",
|
|
"Age18To24",
|
|
"Age25To34",
|
|
"Age35To44",
|
|
"Age45To54",
|
|
"Age55Plus"
|
|
]
|
|
},
|
|
"domain.AssessmentQuestion": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"difficulty_level": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"points": {
|
|
"type": "integer"
|
|
},
|
|
"question_type": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.CreateAssessmentQuestionInput": {
|
|
"type": "object",
|
|
"properties": {
|
|
"correctAnswer": {
|
|
"description": "Short Answer only",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"difficultyLevel": {
|
|
"type": "string"
|
|
},
|
|
"isActive": {
|
|
"type": "boolean"
|
|
},
|
|
"options": {
|
|
"description": "Multiple Choice only",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.CreateQuestionOptionInput"
|
|
}
|
|
},
|
|
"points": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"questionType": {
|
|
"$ref": "#/definitions/domain.QuestionType"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.CreateQuestionOptionInput": {
|
|
"type": "object",
|
|
"properties": {
|
|
"isCorrect": {
|
|
"type": "boolean"
|
|
},
|
|
"order": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"text": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.ErrorResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.LogEntry": {
|
|
"type": "object",
|
|
"properties": {
|
|
"caller": {
|
|
"type": "string"
|
|
},
|
|
"env": {
|
|
"type": "string"
|
|
},
|
|
"fields": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
},
|
|
"level": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"service": {
|
|
"type": "string"
|
|
},
|
|
"stacktrace": {
|
|
"type": "string"
|
|
},
|
|
"timestamp": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.LogResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.LogEntry"
|
|
}
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"pagination": {
|
|
"$ref": "#/definitions/domain.Pagination"
|
|
}
|
|
}
|
|
},
|
|
"domain.LoginRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"otp_code": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.OtpMedium": {
|
|
"type": "string",
|
|
"enum": [
|
|
"email",
|
|
"sms"
|
|
],
|
|
"x-enum-varnames": [
|
|
"OtpMediumEmail",
|
|
"OtpMediumSms"
|
|
]
|
|
},
|
|
"domain.Pagination": {
|
|
"type": "object",
|
|
"properties": {
|
|
"current_page": {
|
|
"type": "integer"
|
|
},
|
|
"limit": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
},
|
|
"total_pages": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.QuestionOption": {
|
|
"type": "object",
|
|
"properties": {
|
|
"option_text": {
|
|
"type": "string"
|
|
},
|
|
"question_id": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.QuestionType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"MULTIPLE_CHOICE",
|
|
"TRUE_FALSE",
|
|
"SHORT_ANSWER"
|
|
],
|
|
"x-enum-varnames": [
|
|
"MultipleChoice",
|
|
"TrueFalse",
|
|
"ShortAnswer"
|
|
]
|
|
},
|
|
"domain.QuestionWithDetails": {
|
|
"type": "object",
|
|
"properties": {
|
|
"options": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.QuestionOption"
|
|
}
|
|
},
|
|
"question": {
|
|
"$ref": "#/definitions/domain.AssessmentQuestion"
|
|
}
|
|
}
|
|
},
|
|
"domain.RegisterUserReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"otp_medium": {
|
|
"$ref": "#/definitions/domain.OtpMedium"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.ResendOtpReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.Response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"metadata": {},
|
|
"status_code": {
|
|
"type": "integer"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"domain.Role": {
|
|
"type": "string",
|
|
"enum": [
|
|
"super_admin",
|
|
"admin",
|
|
"student",
|
|
"instructor",
|
|
"support"
|
|
],
|
|
"x-enum-varnames": [
|
|
"RoleSuperAdmin",
|
|
"RoleAdmin",
|
|
"RoleStudent",
|
|
"RoleInstructor",
|
|
"RoleSupport"
|
|
]
|
|
},
|
|
"domain.UpdateKnowledgeLevelReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"knowledge_level": {
|
|
"description": "BEGINNER, INTERMEDIATE, ADVANCED",
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.UpdateUserReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"age_group": {
|
|
"$ref": "#/definitions/domain.AgeGroup"
|
|
},
|
|
"birth_day": {
|
|
"description": "YYYY-MM-DD",
|
|
"type": "string"
|
|
},
|
|
"country": {
|
|
"type": "string"
|
|
},
|
|
"education_level": {
|
|
"type": "string"
|
|
},
|
|
"favourite_topic": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"gender": {
|
|
"type": "string"
|
|
},
|
|
"initial_assessment_completed": {
|
|
"type": "boolean"
|
|
},
|
|
"knowledge_level": {
|
|
"type": "string"
|
|
},
|
|
"language_challange": {
|
|
"type": "string"
|
|
},
|
|
"language_goal": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"learning_goal": {
|
|
"type": "string"
|
|
},
|
|
"nick_name": {
|
|
"type": "string"
|
|
},
|
|
"occupation": {
|
|
"type": "string"
|
|
},
|
|
"preferred_language": {
|
|
"type": "string"
|
|
},
|
|
"profile_completed": {
|
|
"type": "boolean"
|
|
},
|
|
"profile_picture_url": {
|
|
"type": "string"
|
|
},
|
|
"region": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.UserProfileResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"age_group": {
|
|
"type": "string"
|
|
},
|
|
"birth_day": {
|
|
"type": "string"
|
|
},
|
|
"country": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"education_level": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"description": "UserName string ` + "`" + `json:\"user_name,omitempty\"` + "`" + `",
|
|
"type": "string"
|
|
},
|
|
"email_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"favoutite_topic": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"gender": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"initial_assessment_completed": {
|
|
"description": "Profile fields",
|
|
"type": "boolean"
|
|
},
|
|
"language_challange": {
|
|
"type": "string"
|
|
},
|
|
"language_goal": {
|
|
"type": "string"
|
|
},
|
|
"last_login": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"learning_goal": {
|
|
"type": "string"
|
|
},
|
|
"nick_name": {
|
|
"type": "string"
|
|
},
|
|
"occupation": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"phone_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"preferred_language": {
|
|
"type": "string"
|
|
},
|
|
"profile_completed": {
|
|
"type": "boolean"
|
|
},
|
|
"profile_picture_url": {
|
|
"type": "string"
|
|
},
|
|
"region": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/domain.UserStatus"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.UserStatus": {
|
|
"type": "string",
|
|
"enum": [
|
|
"PENDING",
|
|
"ACTIVE",
|
|
"SUSPENDED",
|
|
"DEACTIVATED"
|
|
],
|
|
"x-enum-varnames": [
|
|
"UserStatusPending",
|
|
"UserStatusActive",
|
|
"UserStatusSuspended",
|
|
"UserStatusDeactivated"
|
|
]
|
|
},
|
|
"domain.VerifyOtpReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"otp"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"otp": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.AdminProfileRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"email_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_login": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"phone_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean"
|
|
},
|
|
"suspended_at": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.AdminRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"email_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_login": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"phone_number": {
|
|
"type": "string"
|
|
},
|
|
"phone_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean"
|
|
},
|
|
"suspended_at": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.CheckPhoneEmailExistReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.CheckPhoneEmailExistRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email_exist": {
|
|
"type": "boolean"
|
|
},
|
|
"phone_number_exist": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"handlers.CreateAdminReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "John"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Doe"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"example": "password123"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.LoginAdminRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.RegisterCodeReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.ResetCodeReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string",
|
|
"example": "john.doe@example.com"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "1234567890"
|
|
}
|
|
}
|
|
},
|
|
"handlers.ResetPasswordReq": {
|
|
"type": "object"
|
|
},
|
|
"handlers.SearchUserByNameOrPhoneReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"query": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"$ref": "#/definitions/domain.Role"
|
|
}
|
|
}
|
|
},
|
|
"handlers.SendSingleAfroSMSReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"message",
|
|
"recipient"
|
|
],
|
|
"properties": {
|
|
"message": {
|
|
"type": "string",
|
|
"example": "Hello world"
|
|
},
|
|
"recipient": {
|
|
"type": "string",
|
|
"example": "+251912345678"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createCourseCategoryReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createCourseReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"category_id",
|
|
"title"
|
|
],
|
|
"properties": {
|
|
"category_id": {
|
|
"type": "integer"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createLevelReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"level_index",
|
|
"program_id",
|
|
"title"
|
|
],
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"level_index": {
|
|
"type": "integer"
|
|
},
|
|
"program_id": {
|
|
"type": "integer"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createModuleReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"level_id",
|
|
"title"
|
|
],
|
|
"properties": {
|
|
"content": {
|
|
"type": "string"
|
|
},
|
|
"display_order": {
|
|
"type": "integer"
|
|
},
|
|
"level_id": {
|
|
"type": "integer"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createModuleVideoReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"duration",
|
|
"module_id",
|
|
"title",
|
|
"video_url"
|
|
],
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"duration": {
|
|
"type": "integer"
|
|
},
|
|
"instructor_id": {
|
|
"type": "string"
|
|
},
|
|
"module_id": {
|
|
"type": "integer"
|
|
},
|
|
"resolution": {
|
|
"type": "string"
|
|
},
|
|
"thumbnail": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"video_url": {
|
|
"type": "string"
|
|
},
|
|
"visibility": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createPracticeQuestionReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"practice_id",
|
|
"q_type",
|
|
"question"
|
|
],
|
|
"properties": {
|
|
"practice_id": {
|
|
"type": "integer"
|
|
},
|
|
"q_type": {
|
|
"type": "string"
|
|
},
|
|
"question": {
|
|
"type": "string"
|
|
},
|
|
"question_voice_prompt": {
|
|
"type": "string"
|
|
},
|
|
"sample_answer": {
|
|
"type": "string"
|
|
},
|
|
"sample_answer_voice_prompt": {
|
|
"type": "string"
|
|
},
|
|
"tips": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createPracticeReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"owner_id",
|
|
"owner_type",
|
|
"title"
|
|
],
|
|
"properties": {
|
|
"banner_image": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"owner_id": {
|
|
"type": "integer"
|
|
},
|
|
"owner_type": {
|
|
"type": "string"
|
|
},
|
|
"persona": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.createProgramReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"course_id",
|
|
"title"
|
|
],
|
|
"properties": {
|
|
"course_id": {
|
|
"type": "integer"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"display_order": {
|
|
"type": "integer"
|
|
},
|
|
"thumbnail": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.loginUserRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handlers.logoutReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"refresh_token"
|
|
],
|
|
"properties": {
|
|
"refresh_token": {
|
|
"type": "string",
|
|
"example": "\u003crefresh-token\u003e"
|
|
}
|
|
}
|
|
},
|
|
"handlers.refreshToken": {
|
|
"type": "object",
|
|
"required": [
|
|
"access_token",
|
|
"refresh_token"
|
|
],
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string",
|
|
"example": "\u003cjwt-token\u003e"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string",
|
|
"example": "\u003crefresh-token\u003e"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateAdminReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "John"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Doe"
|
|
},
|
|
"suspended": {
|
|
"type": "boolean",
|
|
"example": false
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateCourseCategoryReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateCourseReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateLevelReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"level_index": {
|
|
"type": "integer"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateModuleReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"content": {
|
|
"type": "string"
|
|
},
|
|
"display_order": {
|
|
"type": "integer"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateModuleVideoReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"duration": {
|
|
"type": "integer"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"resolution": {
|
|
"type": "string"
|
|
},
|
|
"thumbnail": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"video_url": {
|
|
"type": "string"
|
|
},
|
|
"visibility": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updatePracticeQuestionReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"q_type": {
|
|
"type": "string"
|
|
},
|
|
"question": {
|
|
"type": "string"
|
|
},
|
|
"sample_answer": {
|
|
"type": "string"
|
|
},
|
|
"tips": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updatePracticeReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"banner_image": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"persona": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateProgramFullReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"course_id",
|
|
"title"
|
|
],
|
|
"properties": {
|
|
"course_id": {
|
|
"type": "integer"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"display_order": {
|
|
"type": "integer"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"thumbnail": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"handlers.updateProgramPartialReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"display_order": {
|
|
"type": "integer"
|
|
},
|
|
"is_active": {
|
|
"type": "boolean"
|
|
},
|
|
"thumbnail": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"response.APIResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"metadata": {},
|
|
"page": {
|
|
"type": "integer"
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/response.Status"
|
|
},
|
|
"timestamp": {
|
|
"type": "string"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"response.Status": {
|
|
"type": "string",
|
|
"enum": [
|
|
"error",
|
|
"success"
|
|
],
|
|
"x-enum-varnames": [
|
|
"Error",
|
|
"Success"
|
|
]
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"Bearer": {
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0.1",
|
|
Host: "",
|
|
BasePath: "",
|
|
Schemes: []string{},
|
|
Title: "Yimaru API",
|
|
Description: "This is server for Yimaru.",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
LeftDelim: "{{",
|
|
RightDelim: "}}",
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|