Added completed user. Some fixes and more more more...

This commit is contained in:
KamilM1205 2026-01-02 22:56:25 +04:00
parent b96dd39795
commit ea8ab7c0ed
33 changed files with 576 additions and 212 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -29,16 +29,57 @@ definitions:
type: object
requests.CreateUserRequest:
properties:
avatar:
type: string
description:
maxLength: 500
minLength: 10
type: string
joinDate:
type: string
motto:
maxLength: 200
minLength: 2
type: string
name:
maxLength: 100
minLength: 2
type: string
password:
maxLength: 32
minLength: 6
type: string
projects:
items:
type: string
minItems: 1
type: array
role:
type: string
skills:
items:
type: string
minItems: 1
type: array
speciality:
maxLength: 100
minLength: 2
type: string
username:
maxLength: 32
minLength: 3
type: string
required:
- avatar
- description
- joinDate
- motto
- name
- password
- projects
- role
- skills
- speciality
- username
type: object
requests.LoginUserRequest:
@ -66,16 +107,54 @@ definitions:
type: object
requests.PutUserRequest:
properties:
avatar:
type: string
description:
maxLength: 500
minLength: 10
type: string
motto:
maxLength: 200
minLength: 2
type: string
name:
maxLength: 100
minLength: 2
type: string
password:
maxLength: 32
minLength: 6
type: string
projects:
items:
type: string
minItems: 1
type: array
role:
type: string
skills:
items:
type: string
minItems: 1
type: array
speciality:
maxLength: 100
minLength: 2
type: string
username:
maxLength: 32
minLength: 3
type: string
required:
- avatar
- description
- motto
- name
- password
- projects
- role
- skills
- speciality
- username
type: object
responses.ErrorResponse:
@ -85,6 +164,8 @@ definitions:
message:
type: string
type: object
responses.GetAllImagesList:
type: object
responses.GetListPostResponseItem:
properties:
category:
@ -140,8 +221,30 @@ definitions:
type: object
responses.UserResponse:
properties:
avatar:
type: string
description:
type: string
id:
type: string
joinDate:
type: string
motto:
type: string
name:
type: string
projects:
items:
type: string
type: array
role:
type: string
skills:
items:
type: string
type: array
speciality:
type: string
username:
type: string
type: object
@ -159,6 +262,38 @@ info:
title: 58team blog backend
version: "1.0"
paths:
/images:
get:
description: Delete image from server by given path
parameters:
- description: Path to image
in: path
name: filename
required: true
type: string
produces:
- image/png
- image/jpeg
responses:
"200":
description: OK
schema:
$ref: '#/definitions/responses.GetAllImagesList'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/responses.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Delete image by path
tags:
- images
/images/:
post:
description: Upload new image and returns uploaded image json object
@ -179,6 +314,8 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Upload new image
tags:
- images
@ -209,6 +346,8 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Delete image by path
tags:
- images
@ -291,9 +430,34 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Create new user
tags:
- user
/members/:
get:
description: Return all registered users
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/responses.UserResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Get all users
tags:
- user
/post:
get:
description: Return first 5 posts
@ -339,6 +503,8 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Create new post
tags:
- post
@ -368,6 +534,8 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Delete post
tags:
- post
@ -436,6 +604,8 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Update post content
tags:
- post
@ -468,29 +638,7 @@ paths:
summary: Get posts after offset
tags:
- post
/user/:
get:
description: Return all registered users
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/responses.UserResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
summary: Get all users
tags:
- user
/team/:
post:
consumes:
- application/json
@ -521,10 +669,12 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Create new user
tags:
- user
/user/{id}:
/team/{id}:
delete:
description: Delete user
parameters:
@ -550,6 +700,8 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Delete user
tags:
- user
@ -620,10 +772,12 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse'
security:
- BasicAuth: []
summary: Change user
tags:
- user
/user/name/{name}:
/team/name/{name}:
get:
consumes:
- application/json