Skip to content

Commit

Permalink
feat(backend): Add get league endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstojda committed Jul 24, 2023
1 parent 3b7302c commit 31632f0
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 41 deletions.
38 changes: 35 additions & 3 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,32 @@ paths:
$ref: "#/components/responses/forbidden"
tags:
- leagues
/leagues/{slug}:
get:
description: Retrieve a league by slug
parameters:
- in: path
name: slug
required: true
schema:
type: string
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/leagueResponse'
description: Successful response
"400":
$ref: "#/components/responses/badRequest"
"401":
$ref: "#/components/responses/unauthorized"
"403":
$ref: "#/components/responses/forbidden"
"404":
$ref: "#/components/responses/notFound"
tags:
- leagues

components:
responses:
Expand All @@ -168,6 +194,12 @@ components:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
notFound:
description: resource was not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
schemas:
###
# MODELS
Expand Down Expand Up @@ -387,15 +419,15 @@ components:
name:
type: string
x-oapi-codegen-extra-tags:
binding: required
binding: required
location:
type: string
x-oapi-codegen-extra-tags:
binding: required
binding: required
slug:
type: string
x-oapi-codegen-extra-tags:
binding: required
binding: required
type: object
required:
- name
Expand Down
43 changes: 28 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ go 1.19
require (
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/appleboy/gin-jwt/v2 v2.9.1
github.com/deepmap/oapi-codegen v1.13.0
github.com/gin-contrib/cors v1.4.0
github.com/gin-contrib/logger v0.0.2
github.com/gin-gonic/gin v1.8.1
github.com/google/uuid v1.1.2
github.com/gin-gonic/gin v1.9.1
github.com/google/uuid v1.3.0
github.com/mitchellh/mapstructure v1.5.0
github.com/onsi/ginkgo/v2 v2.6.1
github.com/onsi/gomega v1.24.2
github.com/rs/zerolog v1.20.0
github.com/spf13/viper v1.14.0
golang.org/x/crypto v0.4.0
golang.org/x/crypto v0.9.0
gorm.io/driver/postgres v1.4.5
gorm.io/gorm v1.24.1
)

require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand All @@ -38,30 +39,42 @@ require (
github.com/jinzhu/now v1.1.4 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/text v0.9.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)

require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // 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.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/labstack/echo/v4 v4.10.2 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // 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/sys v0.3.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/sys v0.8.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 31632f0

Please sign in to comment.