-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
528625b
commit 2ad883e
Showing
4 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package printers | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/eduardooliveira/stLib/core/models" | ||
"github.com/labstack/echo/v4" | ||
) | ||
|
||
func save(c echo.Context) error { | ||
|
||
pPrinter := &models.Printer{} | ||
err := c.Bind(pPrinter) | ||
|
||
if err != nil { | ||
return c.NoContent(http.StatusBadRequest) | ||
} | ||
|
||
if pPrinter.UUID != "" { | ||
|
||
} | ||
|
||
return c.NoContent(http.StatusInternalServerError) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package printers | ||
|
||
import "github.com/labstack/echo/v4" | ||
|
||
var group *echo.Group | ||
|
||
func Register(e *echo.Group) { | ||
|
||
group = e | ||
//group.GET("", index) | ||
group.POST("", save) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package models | ||
|
||
type Printer struct { | ||
UUID string `json:"uuid" toml:"uuid" form:"uuid" query:"uuid"` | ||
Name string `json:"name" toml:"name" form:"name" query:"name"` | ||
Type string `json:"type" toml:"type" form:"type" query:"type"` | ||
Address string `json:"address" toml:"address" form:"address" query:"address"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters