Fix swagger doc and rename references for time db fields

This commit is contained in:
Jamie Curnow 2023-05-29 08:50:27 +10:00
parent a2f192280b
commit 1ae247b2a6
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E
45 changed files with 236 additions and 316 deletions

View File

@ -4,8 +4,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"name", "name",
"acmesh_server", "acmesh_server",
"ca_bundle", "ca_bundle",
@ -18,13 +18,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"name": { "name": {
"type": "string", "type": "string",

View File

@ -4,8 +4,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"expires_on", "expires_on",
"type", "type",
"user_id", "user_id",
@ -21,13 +21,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"expires_on": { "expires_on": {
"type": "integer", "type": "integer",

View File

@ -4,8 +4,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"user_id", "user_id",
"name", "name",
"acmesh_name", "acmesh_name",
@ -17,13 +17,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"user_id": { "user_id": {
"type": "integer", "type": "integer",

View File

@ -4,8 +4,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"expires_on", "expires_on",
"user_id", "user_id",
"provider", "provider",
@ -17,13 +17,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"expires_on": { "expires_on": {
"type": "integer", "type": "integer",

View File

@ -4,8 +4,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"user_id", "user_id",
"name", "name",
"type", "type",
@ -16,13 +16,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"user_id": { "user_id": {
"type": "integer", "type": "integer",

View File

@ -2,19 +2,21 @@
"type": "object", "type": "object",
"description": "SettingObject", "description": "SettingObject",
"additionalProperties": false, "additionalProperties": false,
"required": ["id", "name", "value"], "required": ["id", "created_at", "updated_at", "name", "value"],
"properties": { "properties": {
"id": { "id": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"name": { "name": {
"type": "string", "type": "string",

View File

@ -4,8 +4,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"expires_on", "expires_on",
"user_id", "user_id",
"provider", "provider",
@ -17,13 +17,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"expires_on": { "expires_on": {
"type": "integer", "type": "integer",

View File

@ -4,8 +4,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"user_id", "user_id",
"name", "name",
"nginx_template_id", "nginx_template_id",
@ -25,13 +25,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"user_id": { "user_id": {
"type": "integer", "type": "integer",
@ -83,8 +85,8 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_on", "created_at",
"modified_on", "updated_at",
"upstream_id", "upstream_id",
"server", "server",
"weight", "weight",
@ -98,13 +100,15 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_on": { "created_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Created Unix time with milliseconds"
}, },
"modified_on": { "updated_at": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1,
"description": "Updated Unix time with milliseconds"
}, },
"upstream_id": { "upstream_id": {
"type": "integer", "type": "integer",

View File

@ -2,12 +2,22 @@
"type": "object", "type": "object",
"description": "UserAuthObject", "description": "UserAuthObject",
"additionalProperties": false, "additionalProperties": false,
"required": ["id", "user_id", "type", "created_on", "modified_on"], "required": ["id", "user_id", "type", "created_at", "updated_at"],
"properties": { "properties": {
"id": { "id": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"user_id": { "user_id": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
@ -15,14 +25,6 @@
"type": { "type": {
"type": "string", "type": "string",
"pattern": "^password$" "pattern": "^password$"
},
"created_on": {
"type": "integer",
"minimum": 1
},
"modified_on": {
"type": "integer",
"minimum": 1
} }
} }
} }

View File

@ -4,11 +4,11 @@
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"id", "id",
"created_at",
"updated_at",
"name", "name",
"nickname", "nickname",
"email", "email",
"created_on",
"modified_on",
"is_disabled" "is_disabled"
], ],
"properties": { "properties": {
@ -16,6 +16,16 @@
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
}, },
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"name": { "name": {
"type": "string", "type": "string",
"minLength": 2, "minLength": 2,
@ -31,14 +41,6 @@
"minLength": 5, "minLength": 5,
"maxLength": 150 "maxLength": 150
}, },
"created_on": {
"type": "integer",
"minimum": 1
},
"modified_on": {
"type": "integer",
"minimum": 1
},
"gravatar_url": { "gravatar_url": {
"type": "string" "type": "string"
}, },

View File

@ -33,8 +33,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1627531400, "created_at": 1627531400000,
"modified_on": 1627531400, "updated_at": 1627531400000,
"name": "ZeroSSL", "name": "ZeroSSL",
"acmesh_server": "zerossl", "acmesh_server": "zerossl",
"ca_bundle": "", "ca_bundle": "",

View File

@ -42,8 +42,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1627531400, "created_at": 1627531400000,
"modified_on": 1627531400, "updated_at": 1627531400000,
"name": "ZeroSSL", "name": "ZeroSSL",
"acmesh_server": "zerossl", "acmesh_server": "zerossl",
"ca_bundle": "", "ca_bundle": "",

View File

@ -60,8 +60,8 @@
"items": [ "items": [
{ {
"id": 1, "id": 1,
"created_on": 1627531400, "created_at": 1627531400000,
"modified_on": 1627531400, "updated_at": 1627531400000,
"name": "ZeroSSL", "name": "ZeroSSL",
"acmesh_server": "zerossl", "acmesh_server": "zerossl",
"ca_bundle": "", "ca_bundle": "",
@ -71,8 +71,8 @@
}, },
{ {
"id": 2, "id": 2,
"created_on": 1627531400, "created_at": 1627531400000,
"modified_on": 1627531400, "updated_at": 1627531400000,
"name": "Let's Encrypt", "name": "Let's Encrypt",
"acmesh_server": "https://acme-v02.api.letsencrypt.org/directory", "acmesh_server": "https://acme-v02.api.letsencrypt.org/directory",
"ca_bundle": "", "ca_bundle": "",

View File

@ -29,8 +29,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1627531400, "created_at": 1627531400000,
"modified_on": 1627531400, "updated_at": 1627531400000,
"name": "ZeroSSL", "name": "ZeroSSL",
"acmesh_server": "zerossl", "acmesh_server": "zerossl",
"ca_bundle": "", "ca_bundle": "",

View File

@ -1,9 +1,7 @@
{ {
"operationId": "getCertificate", "operationId": "getCertificate",
"summary": "Get a certificate object by ID", "summary": "Get a certificate object by ID",
"tags": [ "tags": ["Certificates"],
"Certificates"
],
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -23,9 +21,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/CertificateObject" "$ref": "#/components/schemas/CertificateObject"
@ -37,17 +33,15 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1604536109, "created_at": 1604536109000,
"modified_on": 1604536109, "updated_at": 1604536109000,
"expires_on": null, "expires_on": null,
"type": "dns", "type": "dns",
"user_id": 1, "user_id": 1,
"certificate_authority_id": 2, "certificate_authority_id": 2,
"dns_provider_id": 1, "dns_provider_id": 1,
"name": "test1.jc21.com.au", "name": "test1.jc21.com.au",
"domain_names": [ "domain_names": ["test1.jc21.com.au"],
"test1.jc21.com.au"
],
"is_ecc": 0, "is_ecc": 0,
"status": "ready" "status": "ready"
} }
@ -58,4 +52,4 @@
} }
} }
} }
} }

View File

@ -1,9 +1,7 @@
{ {
"operationId": "updateCertificate", "operationId": "updateCertificate",
"summary": "Update an existing Certificate", "summary": "Update an existing Certificate",
"tags": [ "tags": ["Certificates"],
"Certificates"
],
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -32,9 +30,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/CertificateObject" "$ref": "#/components/schemas/CertificateObject"
@ -46,17 +42,15 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1604536109, "created_at": 1604536109000,
"modified_on": 1604536109, "updated_at": 1604536109000,
"expires_on": null, "expires_on": null,
"type": "dns", "type": "dns",
"user_id": 1, "user_id": 1,
"certificate_authority_id": 2, "certificate_authority_id": 2,
"dns_provider_id": 1, "dns_provider_id": 1,
"name": "test1.jc21.com.au", "name": "test1.jc21.com.au",
"domain_names": [ "domain_names": ["test1.jc21.com.au"],
"test1.jc21.com.au"
],
"is_ecc": 0, "is_ecc": 0,
"status": "ready" "status": "ready"
} }
@ -67,4 +61,4 @@
} }
} }
} }
} }

View File

@ -1,9 +1,7 @@
{ {
"operationId": "getCertificates", "operationId": "getCertificates",
"summary": "Get a list of certificates", "summary": "Get a list of certificates",
"tags": [ "tags": ["Certificates"],
"Certificates"
],
"parameters": [ "parameters": [
{ {
"in": "query", "in": "query",
@ -39,9 +37,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/CertificateList" "$ref": "#/components/schemas/CertificateList"
@ -64,8 +60,8 @@
"items": [ "items": [
{ {
"id": 1, "id": 1,
"created_on": 1604536109, "created_at": 1604536109000,
"modified_on": 1604536109, "updated_at": 1604536109000,
"expires_on": null, "expires_on": null,
"type": "dns", "type": "dns",
"user_id": 1, "user_id": 1,
@ -87,4 +83,4 @@
} }
} }
} }
} }

View File

@ -1,9 +1,7 @@
{ {
"operationId": "createCertificate", "operationId": "createCertificate",
"summary": "Create a new Certificate", "summary": "Create a new Certificate",
"tags": [ "tags": ["Certificates"],
"Certificates"
],
"requestBody": { "requestBody": {
"description": "Certificate to create", "description": "Certificate to create",
"required": true, "required": true,
@ -19,9 +17,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/CertificateObject" "$ref": "#/components/schemas/CertificateObject"
@ -33,17 +29,15 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1604536109, "created_at": 1604536109000,
"modified_on": 1604536109, "updated_at": 1604536109000,
"expires_on": null, "expires_on": null,
"type": "dns", "type": "dns",
"user_id": 1, "user_id": 1,
"certificate_authority_id": 2, "certificate_authority_id": 2,
"dns_provider_id": 1, "dns_provider_id": 1,
"name": "test1.jc21.com.au", "name": "test1.jc21.com.au",
"domain_names": [ "domain_names": ["test1.jc21.com.au"],
"test1.jc21.com.au"
],
"is_ecc": 0, "is_ecc": 0,
"status": "ready" "status": "ready"
} }
@ -54,4 +48,4 @@
} }
} }
} }
} }

View File

@ -60,8 +60,8 @@
"items": [ "items": [
{ {
"id": 1, "id": 1,
"created_on": 1602593653, "created_at": 1602593653000,
"modified_on": 1602593653, "updated_at": 1602593653000,
"user_id": 1, "user_id": 1,
"name": "Route53", "name": "Route53",
"acmesh_name": "dns_aws", "acmesh_name": "dns_aws",

View File

@ -29,8 +29,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1602593653, "created_at": 1602593653000,
"modified_on": 1602593653, "updated_at": 1602593653000,
"user_id": 1, "user_id": 1,
"name": "Route53", "name": "Route53",
"acmesh_name": "dns_aws", "acmesh_name": "dns_aws",

View File

@ -33,8 +33,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1602593653, "created_at": 1602593653000,
"modified_on": 1602593653, "updated_at": 1602593653000,
"user_id": 1, "user_id": 1,
"name": "Route53", "name": "Route53",
"acmesh_name": "dns_aws", "acmesh_name": "dns_aws",

View File

@ -43,8 +43,8 @@
"result": { "result": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1602593653, "created_at": 1602593653000,
"modified_on": 1602593653, "updated_at": 1602593653000,
"user_id": 1, "user_id": 1,
"name": "Route53", "name": "Route53",
"acmesh_name": "dns_aws", "acmesh_name": "dns_aws",

View File

@ -60,8 +60,8 @@
"items": [ "items": [
{ {
"id": 1, "id": 1,
"created_on": 1646279455, "created_at": 1646279455000,
"modified_on": 1646279455, "updated_at": 1646279455000,
"user_id": 2, "user_id": 2,
"type": "proxy", "type": "proxy",
"nginx_template_id": 1, "nginx_template_id": 1,

View File

@ -33,8 +33,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1646279455, "created_at": 1646279455000,
"modified_on": 1646279455, "updated_at": 1646279455000,
"user_id": 2, "user_id": 2,
"type": "proxy", "type": "proxy",
"nginx_template_id": 1, "nginx_template_id": 1,

View File

@ -42,8 +42,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1646279455, "created_at": 1646279455000,
"modified_on": 1646279455, "updated_at": 1646279455000,
"user_id": 2, "user_id": 2,
"type": "proxy", "type": "proxy",
"nginx_template_id": 1, "nginx_template_id": 1,

View File

@ -29,8 +29,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1645700556, "created_at": 1645700556000,
"modified_on": 1645700556, "updated_at": 1645700556000,
"user_id": 2, "user_id": 2,
"type": "proxy", "type": "proxy",
"nginx_template_id": 1, "nginx_template_id": 1,

View File

@ -53,15 +53,15 @@
"limit": 10, "limit": 10,
"sort": [ "sort": [
{ {
"field": "created_on", "field": "created_at",
"direction": "ASC" "direction": "ASC"
} }
], ],
"items": [ "items": [
{ {
"id": 1, "id": 1,
"created_on": 1646218093, "created_at": 1646218093000,
"modified_on": 1646218093, "updated_at": 1646218093000,
"user_id": 1, "user_id": 1,
"name": "Default Proxy Template", "name": "Default Proxy Template",
"type": "proxy", "type": "proxy",

View File

@ -29,8 +29,8 @@
"value": { "value": {
"result": { "result": {
"id": 10, "id": 10,
"created_on": 1646218093, "created_at": 1646218093000,
"modified_on": 1646218093, "updated_at": 1646218093000,
"user_id": 1, "user_id": 1,
"name": "My proxy template", "name": "My proxy template",
"type": "proxy", "type": "proxy",

View File

@ -33,8 +33,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1646218093, "created_at": 1646218093000,
"modified_on": 1646218093, "updated_at": 1646218093000,
"user_id": 1, "user_id": 1,
"name": "Default Proxy Template", "name": "Default Proxy Template",
"type": "proxy", "type": "proxy",

View File

@ -42,8 +42,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1646218093, "created_at": 1646218093000,
"modified_on": 1646218093, "updated_at": 1646218093000,
"user_id": 1, "user_id": 1,
"name": "My renamed proxy template", "name": "My renamed proxy template",
"type": "proxy", "type": "proxy",

View File

@ -1,9 +1,7 @@
{ {
"operationId": "getSettings", "operationId": "getSettings",
"summary": "Get a list of settings", "summary": "Get a list of settings",
"tags": [ "tags": ["Settings"],
"Settings"
],
"parameters": [ "parameters": [
{ {
"in": "query", "in": "query",
@ -39,9 +37,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/SettingList" "$ref": "#/components/schemas/SettingList"
@ -64,8 +60,8 @@
"items": [ "items": [
{ {
"id": 1, "id": 1,
"created_on": 1578010090, "created_at": 1578010090000,
"modified_on": 1578010095, "updated_at": 1578010095000,
"name": "default-site", "name": "default-site",
"value": { "value": {
"html": "<p>not found</p>", "html": "<p>not found</p>",
@ -81,4 +77,4 @@
} }
} }
} }
} }

View File

@ -1,9 +1,7 @@
{ {
"operationId": "getSetting", "operationId": "getSetting",
"summary": "Get a setting object by name", "summary": "Get a setting object by name",
"tags": [ "tags": ["Settings"],
"Settings"
],
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -23,9 +21,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/SettingObject" "$ref": "#/components/schemas/SettingObject"
@ -37,8 +33,8 @@
"value": { "value": {
"result": { "result": {
"id": 2, "id": 2,
"created_on": 1578010090, "created_at": 1578010090000,
"modified_on": 1578010095, "updated_at": 1578010095000,
"name": "default-site", "name": "default-site",
"value": { "value": {
"html": "<p>not found</p>", "html": "<p>not found</p>",
@ -52,4 +48,4 @@
} }
} }
} }
} }

View File

@ -1,9 +1,7 @@
{ {
"operationId": "updateSetting", "operationId": "updateSetting",
"summary": "Update an existing Setting", "summary": "Update an existing Setting",
"tags": [ "tags": ["Settings"],
"Settings"
],
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -32,9 +30,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/SettingObject" "$ref": "#/components/schemas/SettingObject"
@ -46,8 +42,8 @@
"value": { "value": {
"result": { "result": {
"id": 2, "id": 2,
"created_on": 1578010090, "created_at": 1578010090000,
"modified_on": 1578010090, "updated_at": 1578010090000,
"name": "default-site", "name": "default-site",
"value": { "value": {
"html": "<p>not found</p>", "html": "<p>not found</p>",
@ -61,4 +57,4 @@
} }
} }
} }
} }

View File

@ -1,9 +1,7 @@
{ {
"operationId": "createSetting", "operationId": "createSetting",
"summary": "Create a new Setting", "summary": "Create a new Setting",
"tags": [ "tags": ["Settings"],
"Settings"
],
"requestBody": { "requestBody": {
"description": "Setting to Create", "description": "Setting to Create",
"required": true, "required": true,
@ -19,9 +17,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"required": [ "required": ["result"],
"result"
],
"properties": { "properties": {
"result": { "result": {
"$ref": "#/components/schemas/SettingObject" "$ref": "#/components/schemas/SettingObject"
@ -33,8 +29,8 @@
"value": { "value": {
"result": { "result": {
"id": 2, "id": 2,
"created_on": 1578010090, "created_at": 1578010090000,
"modified_on": 1578010090, "updated_at": 1578010090000,
"name": "default-site", "name": "default-site",
"value": { "value": {
"html": "<p>not found</p>", "html": "<p>not found</p>",
@ -48,4 +44,4 @@
} }
} }
} }
} }

View File

@ -60,8 +60,8 @@
"items": [ "items": [
{ {
"id": 1, "id": 1,
"created_on": 1672804124, "created_at": 1672804124000,
"modified_on": 1672804124, "updated_at": 1672804124000,
"user_id": 2, "user_id": 2,
"name": "API servers", "name": "API servers",
"nginx_template_id": 5, "nginx_template_id": 5,
@ -77,8 +77,8 @@
"servers": [ "servers": [
{ {
"id": 1, "id": 1,
"created_on": 1672804124, "created_at": 1672804124000,
"modified_on": 1672804124, "updated_at": 1672804124000,
"upstream_group_id": 1, "upstream_group_id": 1,
"server": "192.168.0.10:80", "server": "192.168.0.10:80",
"weight": 100, "weight": 100,
@ -89,8 +89,8 @@
}, },
{ {
"id": 2, "id": 2,
"created_on": 1672804124, "created_at": 1672804124000,
"modified_on": 1672804124, "updated_at": 1672804124000,
"upstream_group_id": 1, "upstream_group_id": 1,
"server": "192.168.0.11:80", "server": "192.168.0.11:80",
"weight": 50, "weight": 50,
@ -103,8 +103,8 @@
}, },
{ {
"id": 2, "id": 2,
"created_on": 1672804197, "created_at": 1672804197000,
"modified_on": 1672804197, "updated_at": 1672804197000,
"user_id": 2, "user_id": 2,
"name": "API servers 2", "name": "API servers 2",
"nginx_template_id": 5, "nginx_template_id": 5,
@ -120,8 +120,8 @@
"servers": [ "servers": [
{ {
"id": 3, "id": 3,
"created_on": 1672804197, "created_at": 1672804197000,
"modified_on": 1672804197, "updated_at": 1672804197000,
"upstream_group_id": 2, "upstream_group_id": 2,
"server": "192.168.0.10:80", "server": "192.168.0.10:80",
"weight": 100, "weight": 100,
@ -132,8 +132,8 @@
}, },
{ {
"id": 4, "id": 4,
"created_on": 1672804197, "created_at": 1672804197000,
"modified_on": 1672804197, "updated_at": 1672804197000,
"upstream_group_id": 2, "upstream_group_id": 2,
"server": "192.168.0.11:80", "server": "192.168.0.11:80",
"weight": 50, "weight": 50,
@ -146,8 +146,8 @@
}, },
{ {
"id": 3, "id": 3,
"created_on": 1672804200, "created_at": 1672804200000,
"modified_on": 1672804200, "updated_at": 1672804200000,
"user_id": 2, "user_id": 2,
"name": "API servers 2", "name": "API servers 2",
"nginx_template_id": 5, "nginx_template_id": 5,
@ -163,8 +163,8 @@
"servers": [ "servers": [
{ {
"id": 5, "id": 5,
"created_on": 1672804200, "created_at": 1672804200000,
"modified_on": 1672804200, "updated_at": 1672804200000,
"upstream_group_id": 3, "upstream_group_id": 3,
"server": "192.168.0.10:80", "server": "192.168.0.10:80",
"weight": 100, "weight": 100,
@ -175,8 +175,8 @@
}, },
{ {
"id": 6, "id": 6,
"created_on": 1672804200, "created_at": 1672804200000,
"modified_on": 1672804200, "updated_at": 1672804200000,
"upstream_group_id": 3, "upstream_group_id": 3,
"server": "192.168.0.11:80", "server": "192.168.0.11:80",
"weight": 50, "weight": 50,
@ -189,8 +189,8 @@
}, },
{ {
"id": 4, "id": 4,
"created_on": 1672804201, "created_at": 1672804201000,
"modified_on": 1672804201, "updated_at": 1672804201000,
"user_id": 2, "user_id": 2,
"name": "API servers 2", "name": "API servers 2",
"nginx_template_id": 5, "nginx_template_id": 5,
@ -206,8 +206,8 @@
"servers": [ "servers": [
{ {
"id": 7, "id": 7,
"created_on": 1672804201, "created_at": 1672804201000,
"modified_on": 1672804201, "updated_at": 1672804201000,
"upstream_group_id": 4, "upstream_group_id": 4,
"server": "192.168.0.10:80", "server": "192.168.0.10:80",
"weight": 100, "weight": 100,
@ -218,8 +218,8 @@
}, },
{ {
"id": 8, "id": 8,
"created_on": 1672804201, "created_at": 1672804201000,
"modified_on": 1672804201, "updated_at": 1672804201000,
"upstream_group_id": 4, "upstream_group_id": 4,
"server": "192.168.0.11:80", "server": "192.168.0.11:80",
"weight": 50, "weight": 50,
@ -232,8 +232,8 @@
}, },
{ {
"id": 5, "id": 5,
"created_on": 1672804201, "created_at": 1672804201000,
"modified_on": 1672804201, "updated_at": 1672804201000,
"user_id": 2, "user_id": 2,
"name": "API servers 2", "name": "API servers 2",
"nginx_template_id": 5, "nginx_template_id": 5,
@ -249,8 +249,8 @@
"servers": [ "servers": [
{ {
"id": 9, "id": 9,
"created_on": 1672804201, "created_at": 1672804201000,
"modified_on": 1672804201, "updated_at": 1672804201000,
"upstream_group_id": 5, "upstream_group_id": 5,
"server": "192.168.0.10:80", "server": "192.168.0.10:80",
"weight": 100, "weight": 100,
@ -261,8 +261,8 @@
}, },
{ {
"id": 10, "id": 10,
"created_on": 1672804201, "created_at": 1672804201000,
"modified_on": 1672804201, "updated_at": 1672804201000,
"upstream_group_id": 5, "upstream_group_id": 5,
"server": "192.168.0.11:80", "server": "192.168.0.11:80",
"weight": 50, "weight": 50,

View File

@ -29,8 +29,8 @@
"value": { "value": {
"result": { "result": {
"id": 6, "id": 6,
"created_on": 1672806857, "created_at": 1672806857000,
"modified_on": 1672806857, "updated_at": 1672806857000,
"user_id": 2, "user_id": 2,
"name": "API servers 2", "name": "API servers 2",
"nginx_template_id": 5, "nginx_template_id": 5,
@ -46,8 +46,8 @@
"servers": [ "servers": [
{ {
"id": 11, "id": 11,
"created_on": 1672806857, "created_at": 1672806857000,
"modified_on": 1672806857, "updated_at": 1672806857000,
"upstream_id": 6, "upstream_id": 6,
"server": "192.168.0.10:80", "server": "192.168.0.10:80",
"weight": 100, "weight": 100,
@ -58,8 +58,8 @@
}, },
{ {
"id": 12, "id": 12,
"created_on": 1672806857, "created_at": 1672806857000,
"modified_on": 1672806857, "updated_at": 1672806857000,
"upstream_id": 6, "upstream_id": 6,
"server": "192.168.0.11:80", "server": "192.168.0.11:80",
"weight": 50, "weight": 50,

View File

@ -33,8 +33,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1672786008, "created_at": 1672786008000,
"modified_on": 1672786008, "updated_at": 1672786008000,
"user_id": 2, "user_id": 2,
"name": "API servers 3", "name": "API servers 3",
"ip_hash": true, "ip_hash": true,
@ -47,8 +47,8 @@
"servers": [ "servers": [
{ {
"id": 1, "id": 1,
"created_on": 1672786009, "created_at": 1672786009000,
"modified_on": 1672786009, "updated_at": 1672786009000,
"upstream_id": 1, "upstream_id": 1,
"server": "api1.localhost:1234", "server": "api1.localhost:1234",
"weight": 100, "weight": 100,
@ -59,8 +59,8 @@
}, },
{ {
"id": 2, "id": 2,
"created_on": 1672786009, "created_at": 1672786009000,
"modified_on": 1672786009, "updated_at": 1672786009000,
"upstream_id": 1, "upstream_id": 1,
"server": "api2.localhost:1234", "server": "api2.localhost:1234",
"weight": 50, "weight": 50,

View File

@ -42,8 +42,8 @@
"value": { "value": {
"result": { "result": {
"id": 1, "id": 1,
"created_on": 1673234177, "created_at": 1673234177000,
"modified_on": 1673244559, "updated_at": 1673244559000,
"user_id": 2, "user_id": 2,
"name": "API servers 2", "name": "API servers 2",
"nginx_template_id": 5, "nginx_template_id": 5,
@ -59,8 +59,8 @@
"servers": [ "servers": [
{ {
"id": 1, "id": 1,
"created_on": 1673234177, "created_at": 1673234177000,
"modified_on": 1673244559, "updated_at": 1673244559000,
"upstream_id": 1, "upstream_id": 1,
"server": "192.168.0.10:80", "server": "192.168.0.10:80",
"weight": 100, "weight": 100,
@ -71,8 +71,8 @@
}, },
{ {
"id": 2, "id": 2,
"created_on": 1673234177, "created_at": 1673234177000,
"modified_on": 1673244559, "updated_at": 1673244559000,
"upstream_id": 1, "upstream_id": 1,
"server": "192.168.0.11:80", "server": "192.168.0.11:80",
"weight": 50, "weight": 50,

View File

@ -71,8 +71,8 @@
"name": "Jamie Curnow", "name": "Jamie Curnow",
"nickname": "James", "nickname": "James",
"email": "jc@jc21.com", "email": "jc@jc21.com",
"created_on": 1578010090, "created_at": 1578010090000,
"modified_on": 1578010095, "updated_at": 1578010095000,
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128", "gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
"is_disabled": false, "is_disabled": false,
"capabilities": ["full-admin"] "capabilities": ["full-admin"]
@ -82,8 +82,8 @@
"name": "John Doe", "name": "John Doe",
"nickname": "John", "nickname": "John",
"email": "johdoe@example.com", "email": "johdoe@example.com",
"created_on": 1578010100, "created_at": 1578010100000,
"modified_on": 1578010105, "updated_at": 1578010105000,
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128", "gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
"is_disabled": false, "is_disabled": false,
"capabilities": [ "capabilities": [
@ -96,8 +96,8 @@
"name": "Jane Doe", "name": "Jane Doe",
"nickname": "Jane", "nickname": "Jane",
"email": "janedoe@example.com", "email": "janedoe@example.com",
"created_on": 1578010110, "created_at": 1578010110000,
"modified_on": 1578010115, "updated_at": 1578010115000,
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128", "gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
"is_disabled": false, "is_disabled": false,
"capabilities": [ "capabilities": [

View File

@ -32,8 +32,8 @@
"name": "Jamie Curnow", "name": "Jamie Curnow",
"nickname": "James", "nickname": "James",
"email": "jc@jc21.com", "email": "jc@jc21.com",
"created_on": 1578010100, "created_at": 1578010100000,
"modified_on": 1578010100, "updated_at": 1578010100000,
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128", "gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
"is_disabled": false, "is_disabled": false,
"auth": { "auth": {

View File

@ -50,10 +50,10 @@
"value": { "value": {
"result": { "result": {
"id": 2, "id": 2,
"created_at": 1648422222000,
"updated_at": 1648423979000,
"user_id": 3, "user_id": 3,
"type": "password", "type": "password"
"created_on": 1648422222,
"modified_on": 1648423979
} }
} }
} }

View File

@ -44,8 +44,8 @@
"name": "Jamie Curnow", "name": "Jamie Curnow",
"nickname": "James", "nickname": "James",
"email": "jc@jc21.com", "email": "jc@jc21.com",
"created_on": 1578010100, "created_at": 1578010100000,
"modified_on": 1578010105, "updated_at": 1578010105000,
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128", "gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
"is_disabled": false, "is_disabled": false,
"capabilities": ["full-admin"] "capabilities": ["full-admin"]

View File

@ -53,8 +53,8 @@
"name": "Jamie Curnow", "name": "Jamie Curnow",
"nickname": "James", "nickname": "James",
"email": "jc@jc21.com", "email": "jc@jc21.com",
"created_on": 1578010100, "created_at": 1578010100000,
"modified_on": 1578010110, "updated_at": 1578010110000,
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128", "gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
"is_disabled": false, "is_disabled": false,
"capabilities": ["full-admin"] "capabilities": ["full-admin"]

View File

@ -21,67 +21,3 @@ func GetByUserIDType(userID uint, authType string) (Model, error) {
First(&auth) First(&auth)
return auth, result.Error return auth, result.Error
} }
/*
// Create will create a Auth from this model
func Create(auth *Model) (int, error) {
if auth.ID != 0 {
return 0, eris.New("Cannot create auth when model already has an ID")
}
auth.Touch(true)
db := database.GetInstance()
// nolint: gosec
result, err := db.NamedExec(`INSERT INTO `+fmt.Sprintf("`%s`", tableName)+` (
created_on,
modified_on,
user_id,
type,
secret,
is_deleted
) VALUES (
:created_on,
:modified_on,
:user_id,
:type,
:secret,
:is_deleted
)`, auth)
if err != nil {
return 0, err
}
last, lastErr := result.LastInsertId()
if lastErr != nil {
return 0, lastErr
}
return int(last), nil
}
*/
/*
// Update will Update a Auth from this model
func Update(auth *Model) error {
if auth.ID == 0 {
return eris.New("Cannot update auth when model doesn't have an ID")
}
auth.Touch(false)
db := database.GetInstance()
// nolint: gosec
_, err := db.NamedExec(`UPDATE `+fmt.Sprintf("`%s`", tableName)+` SET
created_on = :created_on,
modified_on = :modified_on,
user_id = :user_id,
type = :type,
secret = :secret,
is_deleted = :is_deleted
WHERE id = :id`, auth)
return err
}
*/

View File

@ -17,7 +17,7 @@ func List(pageInfo model.PageInfo, filters []model.Filter) (entity.ListResponse,
var result entity.ListResponse var result entity.ListResponse
defaultSort := model.Sort{ defaultSort := model.Sort{
Field: "created_on", Field: "created_at",
Direction: "ASC", Direction: "ASC",
} }