Initial chaos

This commit is contained in:
2022-09-23 21:37:00 +02:00
parent 510dc87cb3
commit 4f8d553923
22 changed files with 772 additions and 1 deletions

11
pkg/models/claim.go Normal file
View File

@@ -0,0 +1,11 @@
package models
import (
jwt "github.com/dgrijalva/jwt-go"
)
type Claim struct {
ID int64 `json:"id,omitempty"`
jwt.StandardClaims
}

5
pkg/models/errors.go Normal file
View File

@@ -0,0 +1,5 @@
package models
type BaseError struct {
Message string `json:"msg"`
}

16
pkg/models/users.go Normal file
View File

@@ -0,0 +1,16 @@
package models
import (
"time"
)
type User struct {
ID int64 `json:"id,omitempty" gorm:"primaryKey"`
Username string `json:"name,omitempty" gorm:"unique"`
Email string `json:"email"`
Password string `json:"password,omitempty"`
Avatar string `json:"avatar,omitempty"`
CreatedAt time.Time
UpdatedAt time.Time
}

5
pkg/models/validator.go Normal file
View File

@@ -0,0 +1,5 @@
package models
import "github.com/go-playground/validator/v10"
var Validate = validator.New()