diff --git a/GO_API/BowlinAPI - Gin Gonic/docs/docs.go b/GO_API/BowlinAPI - Gin Gonic/docs/docs.go new file mode 100644 index 0000000..8344a23 --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/docs/docs.go @@ -0,0 +1,211 @@ +// Package docs GENERATED BY SWAG; DO NOT EDIT +// This file was generated by swaggo/swag +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": { + "name": "VALIN Arthur", + "email": "arthur.valin@etu.uca.fr" + }, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/users": { + "get": { + "description": "Responds with the list of all users as JSON.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get users array", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.User" + } + } + } + } + }, + "post": { + "description": "Takes a user JSON and store in DB. Return saved JSON.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Store a new user", + "parameters": [ + { + "description": "User JSON", + "name": "user", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/model.User" + } + } + } + } + }, + "/users/:id": { + "get": { + "description": "responds with the user whose ID value matches the id as JSON.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user by id", + "parameters": [ + { + "type": "string", + "description": "search user by id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.User" + } + } + } + } + }, + "put": { + "description": "takes a user JSON and updates user whose ID value matches id.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update a user", + "parameters": [ + { + "type": "string", + "description": "search user by id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "User JSON", + "name": "user", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/model.User" + } + } + } + }, + "delete": { + "description": "delete user whose ID value matches id.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete a user", + "parameters": [ + { + "type": "string", + "description": "delete user by id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "User successfully deleted", + "schema": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "model.User": { + "type": "object", + "properties": { + "createdAt": { + "type": "string" + }, + "deletedAt": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "1.0", + Host: "localhost:8080", + BasePath: "/", + Schemes: []string{}, + Title: "Bowl'in API", + Description: "A bowling scorer API. More infos on [https://codefirst.iut.uca.fr/git/BowlDev/Bowl_in]", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/GO_API/BowlinAPI - Gin Gonic/docs/swagger.json b/GO_API/BowlinAPI - Gin Gonic/docs/swagger.json new file mode 100644 index 0000000..dcf7586 --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/docs/swagger.json @@ -0,0 +1,188 @@ +{ + "swagger": "2.0", + "info": { + "description": "A bowling scorer API. More infos on [https://codefirst.iut.uca.fr/git/BowlDev/Bowl_in]", + "title": "Bowl'in API", + "contact": { + "name": "VALIN Arthur", + "email": "arthur.valin@etu.uca.fr" + }, + "version": "1.0" + }, + "host": "localhost:8080", + "basePath": "/", + "paths": { + "/users": { + "get": { + "description": "Responds with the list of all users as JSON.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get users array", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.User" + } + } + } + } + }, + "post": { + "description": "Takes a user JSON and store in DB. Return saved JSON.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Store a new user", + "parameters": [ + { + "description": "User JSON", + "name": "user", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/model.User" + } + } + } + } + }, + "/users/:id": { + "get": { + "description": "responds with the user whose ID value matches the id as JSON.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user by id", + "parameters": [ + { + "type": "string", + "description": "search user by id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.User" + } + } + } + } + }, + "put": { + "description": "takes a user JSON and updates user whose ID value matches id.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update a user", + "parameters": [ + { + "type": "string", + "description": "search user by id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "User JSON", + "name": "user", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/model.User" + } + } + } + }, + "delete": { + "description": "delete user whose ID value matches id.", + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete a user", + "parameters": [ + { + "type": "string", + "description": "delete user by id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "User successfully deleted", + "schema": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "model.User": { + "type": "object", + "properties": { + "createdAt": { + "type": "string" + }, + "deletedAt": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/GO_API/BowlinAPI - Gin Gonic/docs/swagger.yaml b/GO_API/BowlinAPI - Gin Gonic/docs/swagger.yaml new file mode 100644 index 0000000..cebb3cf --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/docs/swagger.yaml @@ -0,0 +1,124 @@ +basePath: / +definitions: + model.User: + properties: + createdAt: + type: string + deletedAt: + type: string + id: + type: integer + name: + type: string + password: + type: string + updatedAt: + type: string + type: object +host: localhost:8080 +info: + contact: + email: arthur.valin@etu.uca.fr + name: VALIN Arthur + description: A bowling scorer API. More infos on [https://codefirst.iut.uca.fr/git/BowlDev/Bowl_in] + title: Bowl'in API + version: "1.0" +paths: + /users: + get: + description: Responds with the list of all users as JSON. + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/model.User' + type: array + summary: Get users array + tags: + - user + post: + description: Takes a user JSON and store in DB. Return saved JSON. + parameters: + - description: User JSON + in: body + name: user + required: true + schema: + $ref: '#/definitions/model.User' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/model.User' + summary: Store a new user + tags: + - user + /users/:id: + delete: + description: delete user whose ID value matches id. + parameters: + - description: delete user by id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: User successfully deleted + schema: + type: string + summary: Delete a user + tags: + - user + get: + description: responds with the user whose ID value matches the id as JSON. + parameters: + - description: search user by id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/model.User' + type: array + summary: Get user by id + tags: + - user + put: + description: takes a user JSON and updates user whose ID value matches id. + parameters: + - description: search user by id + in: path + name: id + required: true + type: string + - description: User JSON + in: body + name: user + required: true + schema: + $ref: '#/definitions/model.User' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/model.User' + summary: Update a user + tags: + - user +swagger: "2.0" diff --git a/GO_API/BowlinAPI - Gin Gonic/go.mod b/GO_API/BowlinAPI - Gin Gonic/go.mod new file mode 100644 index 0000000..5485d09 --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/go.mod @@ -0,0 +1,43 @@ +module awesomeProject + +go 1.19 + +require ( + github.com/gin-gonic/gin v1.7.7 + github.com/jinzhu/gorm v1.9.16 + github.com/santosh/gingo v0.0.0-20221207111602-0ef9ded9b180 + github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 + github.com/swaggo/gin-swagger v1.4.3 + github.com/swaggo/swag v1.8.9 +) + +require ( + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/spec v0.20.8 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.11.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/lib/pq v1.1.1 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + golang.org/x/crypto v0.5.0 // indirect + golang.org/x/net v0.5.0 // indirect + golang.org/x/sys v0.4.0 // indirect + golang.org/x/text v0.6.0 // indirect + golang.org/x/tools v0.5.0 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/GO_API/BowlinAPI - Gin Gonic/go.sum b/GO_API/BowlinAPI - Gin Gonic/go.sum new file mode 100644 index 0000000..787fcea --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/go.sum @@ -0,0 +1,224 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/gzip v0.0.5 h1:mhnVU32YnnBh2LPH2iqRqsA/eR7SAqRaD388jL2s/j0= +github.com/gin-contrib/gzip v0.0.5/go.mod h1:OPIK6HR0Um2vNmBUTlayD7qle4yVVRZT0PyhdUigrKk= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= +github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.11.0 h1:0W+xRM511GY47Yy3bZUbJVitCNg2BOGlCyvTqsp/xIw= +github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= +github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= +github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/mattn/go-sqlite3 v1.14.14 h1:qZgc/Rwetq+MtyE18WhzjokPD93dNqLGNT3QJuLvBGw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/santosh/gingo v0.0.0-20221207111602-0ef9ded9b180 h1:houhKtoTI0PBSiaSVCkIyavSo4sxf3FHo3HzQZAhJuc= +github.com/santosh/gingo v0.0.0-20221207111602-0ef9ded9b180/go.mod h1:vcljLtYRV+geYpIbqcw+yxDF8WgUNBg8queTd6Bm5mo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 h1:+iNTcqQJy0OZ5jk6a5NLib47eqXK8uYcPX+O4+cBpEM= +github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= +github.com/swaggo/gin-swagger v1.4.3 h1:mHJz+yzJne0udgYnC5qlDf4e7KuxUbVNX2dhD/cw2rU= +github.com/swaggo/gin-swagger v1.4.3/go.mod h1:hBg6tGeKJsUu/P79BH+WGUR8nq2LuGE0O160+s4iefo= +github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= +github.com/swaggo/swag v1.8.9 h1:kHtaBe/Ob9AZzAANfcn5c6RyCke9gG9QpH0jky0I/sA= +github.com/swaggo/swag v1.8.9/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4= +golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/GO_API/BowlinAPI - Gin Gonic/https/cert.pem b/GO_API/BowlinAPI - Gin Gonic/https/cert.pem new file mode 100644 index 0000000..b98b78d --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/https/cert.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIB2jCCAYECFBwIPBAUu6ZnjZfyz2fHOZDYruJOMAoGCCqGSM49BAMCMG8xCzAJ +BgNVBAYTAkZSMR4wHAYDVQQIDBVBdXZlcmduZS1SaMO0bmUtQWxwZXMxGTAXBgNV +BAcMEENsZXJtb250LUZlcnJhbmQxFDASBgNVBAoMC0Jvd2xpbiBUZWFtMQ8wDQYD +VQQDDAZib3dsaW4wIBcNMjMwMTI0MTY1OTAzWhgPMjA1MDA2MTAxNjU5MDNaMG8x +CzAJBgNVBAYTAkZSMR4wHAYDVQQIDBVBdXZlcmduZS1SaMO0bmUtQWxwZXMxGTAX +BgNVBAcMEENsZXJtb250LUZlcnJhbmQxFDASBgNVBAoMC0Jvd2xpbiBUZWFtMQ8w +DQYDVQQDDAZib3dsaW4wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASYZGCAPV1k +97fTG7ppTyNPn0pG6Ot3EOcxb+Ry2RVgK8LnBWwUDwEKYSqqUca0tunprNJ4grIz +q8FqbBvHaeA7MAoGCCqGSM49BAMCA0cAMEQCIClj9ou4+ZUbqK/CYIQSsWKGUKE4 +C8vo7dBePVRi8VBPAiBYnZvVIGzQgjrsQneYmn6TVeIGk1cp1QVQUORDz16EKw== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/GO_API/BowlinAPI - Gin Gonic/https/privkey.pem b/GO_API/BowlinAPI - Gin Gonic/https/privkey.pem new file mode 100644 index 0000000..8a12d5a --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/https/privkey.pem @@ -0,0 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BggqhkjOPQMBBw== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIGHElOTi79aG/KASlgz4FLkC7e/lHd9zsatRQNvH4uWJoAoGCCqGSM49 +AwEHoUQDQgAEmGRggD1dZPe30xu6aU8jT59KRujrdxDnMW/kctkVYCvC5wVsFA8B +CmEqqlHGtLbp6azSeIKyM6vBamwbx2ngOw== +-----END EC PRIVATE KEY----- \ No newline at end of file diff --git a/GO_API/BowlinAPI - Gin Gonic/https/pubkey.pem b/GO_API/BowlinAPI - Gin Gonic/https/pubkey.pem new file mode 100644 index 0000000..22f4ada --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/https/pubkey.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmGRggD1dZPe30xu6aU8jT59KRujr +dxDnMW/kctkVYCvC5wVsFA8BCmEqqlHGtLbp6azSeIKyM6vBamwbx2ngOw== +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/GO_API/BowlinAPI - Gin Gonic/main.go b/GO_API/BowlinAPI - Gin Gonic/main.go new file mode 100644 index 0000000..13f11fe --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/main.go @@ -0,0 +1,43 @@ +package main + +import ( + "awesomeProject/model" + "awesomeProject/routing" + "fmt" + _ "github.com/jinzhu/gorm/dialects/postgres" + _ "github.com/santosh/gingo/docs" + swaggerFiles "github.com/swaggo/files" + "github.com/swaggo/gin-swagger" +) + +// Model for our User + +// @title Bowl'in API +// @version 1.0 +// @description A bowling scorer API. More infos on [https://codefirst.iut.uca.fr/git/BowlDev/Bowl_in] + +// @contact.name VALIN Arthur +// @contact.email arthur.valin@etu.uca.fr + +// @host localhost:8080 +// @BasePath / +func main() { + + model.InitializeDatabase() + model.InitializeApp() + + var url = ginSwagger.URL("/docs") + model.App.GET("/swagger/*any", ginSwagger.WrapHandler( + swaggerFiles.Handler, url)) + model.App.StaticFile("/docs", "./docs/swagger.json") + + routing.SetUserRoutes() + + fmt.Println("Server running ! ") + model.Err = model.App.RunTLS("localhost:8080", "https/cert.pem", "https/privkey.pem") + if model.Err != nil { + return + } + defer model.Db.Close() + +} diff --git a/GO_API/BowlinAPI - Gin Gonic/model/app.go b/GO_API/BowlinAPI - Gin Gonic/model/app.go new file mode 100644 index 0000000..8f9faf1 --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/model/app.go @@ -0,0 +1,11 @@ +package model + +import ( + "github.com/gin-gonic/gin" +) + +var App *gin.Engine + +func InitializeApp() { + App = gin.Default() +} diff --git a/GO_API/BowlinAPI - Gin Gonic/model/database.go b/GO_API/BowlinAPI - Gin Gonic/model/database.go new file mode 100644 index 0000000..806ca04 --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/model/database.go @@ -0,0 +1,18 @@ +package model + +import ( + "github.com/jinzhu/gorm" + "log" +) + +var Db *gorm.DB +var Err error + +func InitializeDatabase() { + Db, Err = gorm.Open("postgres", "host=localhost port=5433 user=bowlin_team dbname=bowlin password=bowlin") + if Err != nil { + log.Fatal(Err) + } + // Automatically create the "users" table based on the User model + Db.AutoMigrate(&User{}) +} diff --git a/GO_API/BowlinAPI - Gin Gonic/model/userModel.go b/GO_API/BowlinAPI - Gin Gonic/model/userModel.go new file mode 100644 index 0000000..dcd05ba --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/model/userModel.go @@ -0,0 +1,9 @@ +package model + +import "github.com/jinzhu/gorm" + +type User struct { + gorm.Model + Name string + Password string +} diff --git a/GO_API/BowlinAPI - Gin Gonic/routing/userRoutes.go b/GO_API/BowlinAPI - Gin Gonic/routing/userRoutes.go new file mode 100644 index 0000000..d3bdc3b --- /dev/null +++ b/GO_API/BowlinAPI - Gin Gonic/routing/userRoutes.go @@ -0,0 +1,96 @@ +package routing + +import ( + "awesomeProject/model" + "github.com/gin-gonic/gin" + _ "github.com/santosh/gingo/docs" +) + +type User = model.User + +// getUsers responds with the list of all users as JSON. +// getUsers godoc +// @Summary Get users array +// @Description Responds with the list of all users as JSON. +// @Tags user +// @Produce json +// @Success 200 {array} model.User +// @Router /users [get] +func getUsers(c *gin.Context) { + var users []User + model.Db.Find(&users) + c.JSON(200, users) +} + +// getUser responds with the user whose ID value matches the id as JSON. +// getUser godoc +// @Summary Get user by id +// @Description responds with the user whose ID value matches the id as JSON. +// @Tags user +// @Produce json +// @Param id path string true "search user by id" +// @Success 200 {array} model.User +// @Router /users/:id [get] +func getUser(c *gin.Context) { + var user User + model.Db.First(&user, c.Param("id")) + c.JSON(200, user) +} + +// postUser takes a user JSON and store in DB. +// postUser godoc +// @Summary Store a new user +// @Description Takes a user JSON and store in DB. Return saved JSON. +// @Tags user +// @Produce json +// @Param user body model.User true "User JSON" +// @Success 201 {object} model.User +// @Router /users [post] +func postUser(c *gin.Context) { + var user User + c.BindJSON(&user) + model.Db.Create(&user) + c.JSON(201, user) +} + +// putUser takes a user JSON and updates user whose ID value matches id. +// putUser godoc +// @Summary Update a user +// @Description takes a user JSON and updates user whose ID value matches id. +// @Tags user +// @Produce json +// @Param id path string true "search user by id" +// @Param user body model.User true "User JSON" +// @Success 200 {object} model.User +// @Router /users/:id [put] +func putUser(c *gin.Context) { + var user User + model.Db.First(&user, c.Param("id")) + c.BindJSON(&user) + model.Db.Save(&user) + c.JSON(200, user) +} + +// deleteUser delete user whose ID value matches id. +// deleteUser godoc +// @Summary Delete a user +// @Description delete user whose ID value matches id. +// @Tags user +// @Produce json +// @Param id path string true "delete user by id" +// @Success 200 string "User successfully deleted" +// @Router /users/:id [delete] +func deleteUser(c *gin.Context) { + var user User + model.Db.First(&user, c.Param("id")) + model.Db.Delete(&user) + c.JSON(200, gin.H{"message": "User successfully deleted"}) +} + +func SetUserRoutes() { + model.App.GET("/users", getUsers) + model.App.GET("/users/:id", getUser) + model.App.POST("/users", postUser) + model.App.PUT("/users/:id", putUser) + model.App.DELETE("/users/:id", deleteUser) +} diff --git a/GO_API/BowlinAPI/docs/docs.go b/GO_API/BowlinAPI/docs/docs.go index 6457fe5..8344a23 100644 --- a/GO_API/BowlinAPI/docs/docs.go +++ b/GO_API/BowlinAPI/docs/docs.go @@ -177,15 +177,15 @@ const docTemplate = `{ "deletedAt": { "type": "string" }, - "email": { - "type": "string" - }, "id": { "type": "integer" }, "name": { "type": "string" }, + "password": { + "type": "string" + }, "updatedAt": { "type": "string" } diff --git a/GO_API/BowlinAPI/docs/swagger.json b/GO_API/BowlinAPI/docs/swagger.json index 2f91988..dcf7586 100644 --- a/GO_API/BowlinAPI/docs/swagger.json +++ b/GO_API/BowlinAPI/docs/swagger.json @@ -170,15 +170,15 @@ "deletedAt": { "type": "string" }, - "email": { - "type": "string" - }, "id": { "type": "integer" }, "name": { "type": "string" }, + "password": { + "type": "string" + }, "updatedAt": { "type": "string" } diff --git a/GO_API/BowlinAPI/docs/swagger.yaml b/GO_API/BowlinAPI/docs/swagger.yaml index ceb658d..cebb3cf 100644 --- a/GO_API/BowlinAPI/docs/swagger.yaml +++ b/GO_API/BowlinAPI/docs/swagger.yaml @@ -6,12 +6,12 @@ definitions: type: string deletedAt: type: string - email: - type: string id: type: integer name: type: string + password: + type: string updatedAt: type: string type: object diff --git a/GO_API/BowlinAPI/main.go b/GO_API/BowlinAPI/main.go index 3abd3c5..77b2626 100644 --- a/GO_API/BowlinAPI/main.go +++ b/GO_API/BowlinAPI/main.go @@ -23,7 +23,7 @@ import ( // @host localhost:8080 // @BasePath / func main() { - + model.InitializeDatabase() model.InitializeApp() @@ -42,5 +42,5 @@ func main() { if model.Err != nil { return } - + defer model.Db.Close() } diff --git a/GO_API/BowlinAPI/model/database.go b/GO_API/BowlinAPI/model/database.go index d5e91fc..806ca04 100644 --- a/GO_API/BowlinAPI/model/database.go +++ b/GO_API/BowlinAPI/model/database.go @@ -9,12 +9,10 @@ var Db *gorm.DB var Err error func InitializeDatabase() { - DB, Err := gorm.Open("postgres", "host=localhost port=5433 user=bowlin_team dbname=bowlin password=bowlin") + Db, Err = gorm.Open("postgres", "host=localhost port=5433 user=bowlin_team dbname=bowlin password=bowlin") if Err != nil { log.Fatal(Err) } - defer DB.Close() - // Automatically create the "users" table based on the User model - DB.AutoMigrate(&User{}) + Db.AutoMigrate(&User{}) } diff --git a/GO_API/BowlinAPI/model/userModel.go b/GO_API/BowlinAPI/model/userModel.go index 92bcfe4..dcd05ba 100644 --- a/GO_API/BowlinAPI/model/userModel.go +++ b/GO_API/BowlinAPI/model/userModel.go @@ -4,6 +4,6 @@ import "github.com/jinzhu/gorm" type User struct { gorm.Model - Name string - Email string + Name string + Password string }