🎨 Make JSON keys lowercase

This commit is contained in:
2024-02-28 11:03:53 +01:00
parent 4bdeb3a666
commit dd665d9443
2 changed files with 28 additions and 28 deletions

22
api.go
View File

@ -59,10 +59,10 @@ func handleGetPort(c *gin.Context) {
}
type CreatePortRequest struct {
Name string
Backend string
Channels uint8
Type string
Name string `json:"name"`
Backend string `json:"backend"`
Channels uint8 `json:"channels"`
Type string `json:"type"`
}
func handleCreatePort(c *gin.Context) {
@ -159,9 +159,9 @@ func handleGetState(c *gin.Context) {
}
type SetPortRequest struct {
Mute *bool
Volume *float32
Balance *float32
Mute *bool `json:"mute"`
Volume *float32 `json:"volume"`
Balance *float32 `json:"balance"`
}
func handleSetState(c *gin.Context) {
@ -203,7 +203,7 @@ func setState(id string, body SetPortRequest) (gin.H, gin.H) {
}
type CreateRouteRequest struct {
To string
To string `json:"to"`
}
func handleCreateRoute(c *gin.Context) {
@ -240,9 +240,9 @@ func createRoute(id string, body CreateRouteRequest) gin.H {
}
type SetRouteRequest struct {
Mute *bool
Volume *float32
Balance *float32
Mute *bool `json:"mute"`
Volume *float32 `json:"volume"`
Balance *float32 `json:"balance"`
}
func handleSetRoute(c *gin.Context) {