feat: add Stow prototype iOS app and Gin backend
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package api
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type Response struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Data any `json:"data"`
|
||||
}
|
||||
|
||||
func success(c *gin.Context, status int, data any) {
|
||||
c.JSON(status, Response{Code: "ok", Message: "success", Data: data})
|
||||
}
|
||||
|
||||
func failure(c *gin.Context, status int, code, message string) {
|
||||
c.JSON(status, Response{Code: code, Message: message, Data: nil})
|
||||
}
|
||||
Reference in New Issue
Block a user