Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: "2.0"
- info:
- version: "0.0.1"
- title: Happy clean Server
- # during dev, should point to your local machine
- host: localhost:10010
- # basePath prefixes all resource paths
- basePath: /_aVlM10DR
- #
- schemes:
- # tip: remove http to make production-grade
- - http
- - https
- # format of bodies a client can send (Content-Type)
- consumes:
- - application/json
- - text/html
- - text/plain; charset=UTF-8
- # format of the responses to the client (Accepts)
- produces:
- - application/json
- - text/plain; charset=UTF-8
- - text/html
- securityDefinitions:
- ApiKeyAuth:
- type: apiKey
- in: header
- name: X-API-Key
- OAuth2:
- type: oauth2
- flow: accessCode
- authorizationUrl: https://localhost/oauth/authorize
- tokenUrl: https://localhost/oauth/token
- scopes:
- read: Grants read access
- write: Grants write access
- admin: Grants read and write access to administrative information
- paths:
- /m/user:
- # our controller name
- x-swagger-router-controller: user
- get:
- tags:
- - "User"
- summary: "Get a user list"
- security:
- - OAuth2: [read]
- operationId: getAllUsers
- # define the type of response for Success "200" and Error
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/GetusersListResponse"
- default:
- description: Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- post:
- tags:
- - "User"
- summary: "Create a new user"
- security:
- - OAuth2: [read, write]
- operationId: saveUser
- # user info to be stored
- parameters:
- - name: body
- description: User information
- in: body
- required: true
- schema:
- $ref: "#/definitions/user"
- - name: password
- in: header
- type: string
- format: password
- required: true
- responses:
- 201:
- description: Created confirmation.
- schema:
- $ref: "#/definitions/GeneralResponse"
- 409:
- description: Must be sended when user_email already exist
- default:
- description: Unexpected Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- #/m/user/{id}/{email}:
- /m/user/{userId}:
- # our controller name
- x-swagger-router-controller: user
- get:
- tags:
- - "User"
- summary: "Get a existing user"
- security:
- - OAuth2: [read]
- operationId: getUserById
- # define the type of response for Success "200" and Error
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/GetuserResponse"
- default:
- description: Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- put:
- tags:
- - "User"
- summary: "Update a existing user"
- security:
- - OAuth2: [read, write]
- operationId: updateUser
- # define the type of response for Success "200" and Error
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- - name: body
- description: User information that needs to be updated
- in: body
- required: true
- schema:
- $ref: "#/definitions/user"
- responses:
- 400:
- description: "Invalid ID supplied"
- 404:
- description: "User not found"
- 405:
- description: "Validation exception"
- /m/user/{userId}/order:
- # our controller name
- x-swagger-router-controller: user
- get:
- tags:
- - "User"
- summary: "Get order list"
- security:
- - OAuth2: [read]
- operationId: getUserOrders
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/GetorderListResponse"
- default:
- description: Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- post:
- tags:
- - "User"
- summary: "Create a new order"
- security:
- - OAuth2: [read, write]
- operationId: createUserOrder
- # define the type of response for Success "200" and Error
- parameters:
- - name: body
- description: Necessary information to create a new order
- in: body
- required: true
- schema:
- $ref: "#/definitions/orders"
- responses:
- 201:
- description: Order created with success.
- schema:
- $ref: "#/definitions/GeneralResponse"
- default:
- description: Unexpected Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- /m/user/{userId}/order/{orderId}:
- # our controller name
- x-swagger-router-controller: user
- get:
- tags:
- - "User"
- summary: "Get a existing order"
- security:
- - OAuth2: [read]
- operationId: getUserOrder
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- - name: orderId
- type: string
- in: path
- required: true
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/GetorderResponse"
- default:
- description: Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- /user/{userId}/order/{range}:
- # our controller name
- x-swagger-router-controller: user
- get:
- tags:
- - "User"
- summary: "Get order list between date range"
- security:
- - OAuth2: [read]
- operationId: getUserOrderRange
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- - name: range
- type: array
- items:
- type: string
- format: dateTime
- in: path
- required: true
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/GetorderListResponse"
- default:
- description: Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- /user/{userId}/closet:
- # our controller name
- x-swagger-router-controller: user
- get:
- tags:
- - "User"
- summary: "Get all clothes from the user"
- security:
- - OAuth2: [read]
- operationId: getUserCloset
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/GetclothesListResponse"
- default:
- description: Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- post:
- tags:
- - "User"
- summary: "Creat a new clothes"
- security:
- - OAuth2: [read, write]
- operationId: saveUserClothes
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- - name: body
- description: Data to add a new clothes
- in: body
- required: true
- schema:
- $ref: "#/definitions/clothes"
- responses:
- 201:
- description: Clothes created with success.
- schema:
- $ref: "#/definitions/GeneralResponse"
- default:
- description: Unexpected Error
- schema:
- $ref: "#/definitions/ErrorResponse"
- /m/user/{userId}/closet/{clothingId}:
- put:
- tags:
- - "User"
- summary: "Update a clothing"
- security:
- - OAuth2: [read, write]
- operationId: updateUserClothing
- parameters:
- - name: userId
- type: string
- in: path
- required: true
- - name: clothingId
- type: string
- in: path
- required: true
- - name: body
- description: Data to update a clothing
- in: body
- required: true
- schema:
- $ref: "#/definitions/clothes"
- responses:
- 400:
- description: "Invalid ID supplied"
- 404:
- description: "Clothing not found"
- 405:
- description: "Validation exception"
- #/m/user/closet:
- #/m/user/orders:
- #/m/user/address:
- #/m/store:
- #/m/store/calc:
- #/m/orders:
- /swagger:
- x-swagger-pipe: swagger_raw
- # complex objects have schema definitions
- definitions:
- ErrorResponse:
- type: object
- required:
- - code
- - message
- - fields
- properties:
- code:
- type: integer
- format: int32
- message:
- type: string
- fields:
- type: string
- GetusersListResponse:
- required:
- - users
- properties:
- # The array of users
- users:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- email:
- type: string
- password:
- type: string
- GetorderListResponse:
- required:
- - orders
- properties:
- # The array of orders
- orders:
- type: array
- items:
- type: object
- properties:
- schema:
- $ref: "#/definitions/orders"
- GetorderResponse:
- required:
- - order
- properties:
- # The order
- order:
- properties:
- schema:
- $ref: "#/definitions/orders"
- GetclothesListResponse:
- required:
- - clothes
- properties:
- # The array of clothes
- clothes:
- type: array
- items:
- type: object
- properties:
- schema:
- $ref: "#/definitions/clothes"
- user:
- type: object
- properties:
- username:
- type: string
- description: Name of new user
- email:
- type: string
- description: email from the user
- pattern: '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]{2,64}$'
- required:
- - username
- - email
- GeneralResponse:
- type: object
- properties:
- success:
- type: number
- description: returns 1 if successful
- description:
- type: string
- description: a short comment
- required:
- - success
- - description
- GetuserResponse:
- required:
- - id
- - email
- - password
- properties:
- id:
- type: string
- email:
- type: string
- password:
- type: string
- status_pedido:
- type: object
- title: 'Estado do pedido'
- description: 'Relação de estados assumíveis para um pedido'
- enum: &STATUS
- - 'Entregue'
- - 'Finalizado'
- - 'Solicitado'
- - 'Em andamento'
- basic_services:
- type: object
- title: 'Serviços básicos'
- description: 'Relação de serviços básicos'
- enum: &BASIC_SERVICES
- - 'Completo'
- - 'Passadoria'
- - 'Recuperação'
- especial_service:
- type: object
- title: 'Serviço especial'
- description: 'Serviço especial oferecido pela lavanderia'
- properties:
- name:
- type: string
- description: 'Nome do serviço especial'
- price:
- type: number
- format: float
- description: 'Custo do serviço especial'
- description:
- type: string
- description: 'Descrição do serviço especial'
- icon:
- type: string
- format: byte
- description: 'Icone representativo do serviço especial'
- clothes:
- type: object
- title: 'Clothes'
- description: 'Peça de roupa'
- uniqueItems: true
- properties:
- enabled:
- type: boolean
- description: 'Status da peça (false, caso desabilitado/excluida)'
- version:
- type: number
- title: 'Versão do documento'
- description: 'Contador que deve ser incrementado sempre que uma alteração no documento for realizada. Um "cópia" do documento antigo deve ser gerado'
- pictures:
- type: array
- description: 'Fotos das peças de roupas. Deve ser limitada a trÊs fotos por peça'
- items:
- type: string
- format: byte
- description: 'Foto da peça'
- type:
- type: string
- description: 'Tipo da peça de roupa EX: Camisa, Calça, Meia'
- brand:
- type: string
- description: 'Marca da roupa'
- color:
- type: string
- description: 'Cor predominante da roupa'
- print:
- type: string
- description: 'Estampa da roupa'
- station:
- type: string
- description: 'Estação para uso da roupa'
- observations:
- type: array
- description: 'Observações individuais da peça de roupa'
- items:
- type: string
- whashes:
- type: integer
- description: 'Número de lavagens sofridas pela peça'
- register_date:
- type: string
- format: date
- description: 'Data de cadastro da peça'
- orders:
- type: object
- title: 'Order'
- description: 'Pedido realizado pelo usuário'
- properties:
- solicitation_time:
- type: string
- format: date-time
- description: 'Data de realização do pedido'
- finish_time:
- type: string
- format: date-time
- description: 'Data de finalização do pedido'
- removal_time:
- type: string
- format: date-time
- description: 'Data de retirada/entrega do pedido'
- status:
- $ref: '#definitions/status_pedido'
- cart_itens:
- type: object
- properties:
- clothes:
- type: array
- description: 'Itens do pedido'
- items:
- type: object
- properties:
- clothes:
- $ref: '#/definitions/clothes'
- whase_type:
- $ref: '#/definitions/basic_services'
- price:
- type: number
- title: 'Price'
- format: float
- services:
- type: array
- items:
- type: object
- properties:
- price:
- type: number
- title: 'Price'
- format: float
- service:
- $ref: '#/definitions/especial_service'
- agent:
- type: object
- title: 'Agent'
- description: 'Dados do representante da loja'
- properties:
- name:
- type: string
- description: 'Nome do representante da loja'
- email:
- type: string
- description: 'Email do representante da loja'
- pattern: '[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}'
- cpf:
- type: string
- description: 'CPF do representante da loja'
- password:
- type: string
- format: password
- description: 'Chave de acesso do usuário ao sistema'
- administrator:
- type: object
- title: 'Administrator'
- description: 'Usário administrador do sistema'
- properties:
- email:
- type: string
- description: 'Email de contato do administrator do sistema'
- password:
- type: string
- format: password
- store:
- type: object
- title: 'Store'
- description: 'Entidade que ofereçe os serviços e é selecionavel pelo usuário'
- properties:
- tipo:
- type: object
- description: 'Tipo de loja EX:. Franqueado, Autonoma'
- enum: &laundery_type
- - 'Franqueado'
- - 'Autonoma'
- name:
- type: string
- description: 'Nome fantasia da loja'
- social_reason:
- type: string
- description: 'Razão social da loja'
- cnpj:
- type: string
- description: 'CNPJ da loja'
- ie:
- type: 'string'
- description: 'Inscrição estadual'
- adrress:
- type: string
- description: 'Endereço da loja'
- agent:
- $ref: '#/definitions/agent'
- especial_services:
- type: array
- description: 'Relação de servicos especiais oferecidos'
- items:
- $ref: '#/definitions/especial_service'
- delivery_services:
- type: object
- properties:
- delivery:
- type: boolean
- description: 'Disponibilidade do serviço de delivery'
- checkin:
- type: boolean
- description: 'Disponibilidade do serviço de entrega e retirada na loja'
- washebles:
- type: array
- description: 'Lista de tipos aceitos pela loja'
- items:
- type: object
- properties:
- name:
- type: string
- description: 'Tipo de peça pré-autorizado pela loja'
- enabled:
- type: boolean
- description: 'Status de disponibilidade da peça'
- icon:
- type: string
- description: 'Icone default'
- services:
- type: object
- description: 'Serviço básicos oferecidos pela loja. Limitados a três'
- properties:
- complete:
- type: object
- description: 'Serviço básico 1'
- properties:
- price:
- type: number
- format: float
- enabled:
- type: boolean
- description: 'Disponibilidade do serviço básico'
- recovery:
- type: object
- description: 'Serviço básico 2'
- properties:
- price:
- type: number
- format: float
- enabled:
- type: boolean
- description: 'Disponibilidade do serviço básico'
- ironing:
- type: object
- description: 'Serviço básico 3'
- properties:
- price:
- type: number
- format: float
- enabled:
- type: boolean
- description: 'Disponibilidade do serviço básico'
- franchise:
- type: object
- title: 'Franchise'
- properties:
- name:
- type: string
- description: 'Nome fantasia da loja'
- social_reason:
- type: string
- description: 'Razão social da loja'
- cnpj:
- type: string
- description: 'CNPJ da loja'
- ie:
- type: 'string'
- description: 'Inscrição estadual'
- adrress:
- type: string
- description: 'Endereço da loja'
- agent:
- $ref: '#/definitions/agent'
- stores:
- type: array
- items:
- $ref: '#/definitions/store'
- client:
- type: object
- title: 'Client'
- properties:
- name:
- type: string
- description: 'Nome completo do usuário do sitema'
- email:
- type: string
- description: 'Email ativo do usuário'
- password:
- type: string
- format: password
- description: 'Chave de acesso do usuário ao sistema'
- contact:
- type: string
- description: 'Telefone do usuário'
- addresses:
- type: array
- description: 'Lista de endereços ativos do usuário'
- items:
- type: object
- properties:
- postal_code:
- type: string
- description: 'Código postal (CEP) do endereço'
- city:
- type: string
- description: 'Nome da Cidade'
- neighborhood:
- type: string
- description: 'Nome do bairro'
- place:
- type: string
- description: 'Logradouro do endereço'
- status:
- type: boolean
- description: 'Status do usuário'
- register_date:
- type: string
- format: date
- description: 'Data de registro do usuário'
- closet:
- type: array
- description: 'Conjunto de peças de roupas do usuário'
- items:
- $ref: '#/definitions/clothes'
- orders:
- type: array
- items:
- $ref: '#/definitions/orders'
- Error:
- type: object
- properties:
- code:
- type: integer
- format: int32
- message:
- type: string
- fields:
- type: string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement