location endpoints

This commit is contained in:
Hayden 2022-08-30 21:22:01 -08:00
parent 9583847f94
commit c7cfb4335b
10 changed files with 395 additions and 51 deletions

View file

@ -261,6 +261,78 @@ const docTemplate = `{
}
}
},
"/v1/locations": {
"get": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Locations"
],
"summary": "Get All Locations",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/server.Results"
},
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/types.LocationOut"
}
}
}
}
]
}
}
}
},
"post": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Locations"
],
"summary": "Create a new location",
"parameters": [
{
"description": "Location Data",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types.LocationCreate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/types.LocationOut"
}
}
}
}
},
"/v1/users/login": {
"post": {
"consumes": [
@ -358,23 +430,8 @@ const docTemplate = `{
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/server.Result"
},
{
"type": "object",
"properties": {
"item": {
"$ref": "#/definitions/ent.User"
}
}
}
]
}
"204": {
"description": ""
}
}
}
@ -908,6 +965,14 @@ const docTemplate = `{
}
}
},
"server.Results": {
"type": "object",
"properties": {
"items": {
"type": "any"
}
}
},
"types.ApiSummary": {
"type": "object",
"properties": {
@ -928,6 +993,40 @@ const docTemplate = `{
}
}
},
"types.LocationCreate": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"types.LocationOut": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"description": {
"type": "string"
},
"groupId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"types.TokenResponse": {
"type": "object",
"properties": {

View file

@ -253,6 +253,78 @@
}
}
},
"/v1/locations": {
"get": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Locations"
],
"summary": "Get All Locations",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/server.Results"
},
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/types.LocationOut"
}
}
}
}
]
}
}
}
},
"post": {
"security": [
{
"Bearer": []
}
],
"produces": [
"application/json"
],
"tags": [
"Locations"
],
"summary": "Create a new location",
"parameters": [
{
"description": "Location Data",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/types.LocationCreate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/types.LocationOut"
}
}
}
}
},
"/v1/users/login": {
"post": {
"consumes": [
@ -350,23 +422,8 @@
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/server.Result"
},
{
"type": "object",
"properties": {
"item": {
"$ref": "#/definitions/ent.User"
}
}
}
]
}
"204": {
"description": ""
}
}
}
@ -900,6 +957,14 @@
}
}
},
"server.Results": {
"type": "object",
"properties": {
"items": {
"type": "any"
}
}
},
"types.ApiSummary": {
"type": "object",
"properties": {
@ -920,6 +985,40 @@
}
}
},
"types.LocationCreate": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"types.LocationOut": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"description": {
"type": "string"
},
"groupId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"types.TokenResponse": {
"type": "object",
"properties": {

View file

@ -320,6 +320,11 @@ definitions:
message:
type: string
type: object
server.Results:
properties:
items:
type: any
type: object
types.ApiSummary:
properties:
health:
@ -333,6 +338,28 @@ definitions:
type: string
type: array
type: object
types.LocationCreate:
properties:
description:
type: string
name:
type: string
type: object
types.LocationOut:
properties:
createdAt:
type: string
description:
type: string
groupId:
type: string
id:
type: string
name:
type: string
updatedAt:
type: string
type: object
types.TokenResponse:
properties:
expiresAt:
@ -522,6 +549,47 @@ paths:
summary: Update a User
tags:
- 'Admin: Users'
/v1/locations:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/server.Results'
- properties:
items:
items:
$ref: '#/definitions/types.LocationOut'
type: array
type: object
security:
- Bearer: []
summary: Get All Locations
tags:
- Locations
post:
parameters:
- description: Location Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.LocationCreate'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.LocationOut'
security:
- Bearer: []
summary: Create a new location
tags:
- Locations
/v1/users/login:
post:
consumes:
@ -583,15 +651,8 @@ paths:
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/server.Result'
- properties:
item:
$ref: '#/definitions/ent.User'
type: object
"204":
description: ""
summary: Get the current user
tags:
- User