niki/docs/swagger.yaml

257 lines
5.7 KiB
YAML
Raw Normal View History

2024-05-14 13:07:09 +00:00
definitions:
addressparam.BenefactorAddAddressRequest:
properties:
address:
example: tehran
type: string
benefactor_id:
example: 1
type: integer
city_id:
example: 1
type: integer
lat:
example: 22.23
type: number
lon:
example: 22.22
type: number
postal_code:
example: "1234567890"
type: string
province_id:
example: 1
type: integer
type: object
addressparam.BenefactorAddAddressResponse:
properties:
address:
$ref: '#/definitions/entity.Address'
type: object
addressparam.GetAllCitiesResponse:
properties:
cities:
items:
$ref: '#/definitions/entity.City'
type: array
type: object
addressparam.GetAllProvincesResponse:
properties:
provinces:
items:
$ref: '#/definitions/entity.Province'
type: array
type: object
benefactoreparam.BenefactroInfo:
properties:
first_name:
example: mehdi
type: string
id:
example: 1
type: integer
last_name:
example: rez
type: string
role:
example: benefactor
type: string
type: object
benefactoreparam.LoginOrRegisterRequest:
properties:
phone_number:
example: "09198829528"
type: string
verification_code:
example: "123456"
type: string
type: object
benefactoreparam.LoginOrRegisterResponse:
properties:
benefactore_info:
$ref: '#/definitions/benefactoreparam.BenefactroInfo'
tokens:
$ref: '#/definitions/benefactoreparam.Tokens'
type: object
benefactoreparam.SendOtpRequest:
properties:
phone_number:
example: "09198829528"
type: string
type: object
benefactoreparam.SendOtpResponse:
properties:
code:
description: "this just use in test .env\n\t\tTODO - remove it after test"
type: string
phone_number:
example: "09198829528"
type: string
type: object
benefactoreparam.Tokens:
properties:
access_token:
type: string
refresh_token:
type: string
type: object
entity.Address:
properties:
address:
type: string
benefactorID:
type: integer
cityID:
type: integer
id:
type: integer
isMain:
type: boolean
lat:
type: number
lon:
type: number
postalCode:
type: string
provinceID:
type: integer
type: object
entity.City:
properties:
id:
type: integer
name:
type: string
provinceID:
type: integer
type: object
entity.Province:
properties:
id:
type: integer
name:
type: string
type: object
info:
contact: {}
paths:
/address/:
post:
consumes:
- application/json
parameters:
- description: Add Address benefactor
in: body
name: Request
required: true
schema:
$ref: '#/definitions/addressparam.BenefactorAddAddressRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/addressparam.BenefactorAddAddressResponse'
"400":
description: Bad request
schema:
type: string
security:
- AuthBearer: []
summary: Add Address benefactor
tags:
- benefactor
/address/cities:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/addressparam.GetAllCitiesResponse'
"400":
description: Bad request
schema:
type: string
summary: get all cities
tags:
- benefactor
/address/provinces:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/addressparam.GetAllProvincesResponse'
"400":
description: Bad request
schema:
type: string
summary: get all provinces
tags:
- benefactor
/benefactor/login-register:
post:
consumes:
- application/json
parameters:
- description: login Or Register benefactor
in: body
name: Request
required: true
schema:
$ref: '#/definitions/benefactoreparam.LoginOrRegisterRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactoreparam.LoginOrRegisterResponse'
"400":
description: Bad request
schema:
type: string
summary: login Or Register benefactor
tags:
- benefactor
/benefactor/send-otp:
post:
consumes:
- application/json
parameters:
- description: send otp benefactor
in: body
name: Request
required: true
schema:
$ref: '#/definitions/benefactoreparam.SendOtpRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/benefactoreparam.SendOtpResponse'
"400":
description: Bad request
schema:
type: string
summary: send otp benefactor
tags:
- benefactor
securityDefinitions:
AuthBearer:
in: header
name: Authorization
type: apiKey
swagger: "2.0"