features/working-on-scopes #13
4
api/domain/dto.go
Normal file
4
api/domain/dto.go
Normal file
@ -0,0 +1,4 @@
|
||||
package domain
|
||||
|
||||
type UserDto struct {
|
||||
}
|
21
api/domain/entities.go
Normal file
21
api/domain/entities.go
Normal file
@ -0,0 +1,21 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type UserEntity struct {
|
||||
Id int
|
||||
CreatedAt time.Time
|
||||
LastUpdated time.Time
|
||||
Name string
|
||||
Hash string
|
||||
Scopes string
|
||||
}
|
||||
|
||||
type RecipeEntity struct {
|
||||
Id int32
|
||||
CreatedAt time.Time
|
||||
LastUpdated time.Time
|
||||
Title string
|
||||
Thumbnail string
|
||||
Content string
|
||||
}
|
6
api/domain/models.go
Normal file
6
api/domain/models.go
Normal file
@ -0,0 +1,6 @@
|
||||
package domain
|
||||
|
||||
type EnvConfig struct {
|
||||
AdminToken string
|
||||
JwtSecret string
|
||||
}
|
5
api/domain/requests.go
Normal file
5
api/domain/requests.go
Normal file
@ -0,0 +1,5 @@
|
||||
package domain
|
||||
|
||||
type HelloBodyRequest struct {
|
||||
Name string `json:"name" validate:"required"`
|
||||
}
|
12
api/domain/responses.go
Normal file
12
api/domain/responses.go
Normal file
@ -0,0 +1,12 @@
|
||||
package domain
|
||||
|
||||
type ErrorResponse struct {
|
||||
HttpCode int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type HelloWhoResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Error string `json:"error"`
|
||||
Message string `json:"message"`
|
||||
}
|
8
api/domain/scopes.go
Normal file
8
api/domain/scopes.go
Normal file
@ -0,0 +1,8 @@
|
||||
package domain
|
||||
|
||||
const (
|
||||
ScopeAll = "all"
|
||||
ScopeRecipeRead = "recipe:read"
|
||||
ScopeRecipeCreate = "recipe:create"
|
||||
ScopeRecipeDelete = "recipe:delete"
|
||||
)
|
@ -1,12 +0,0 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type RecipeModel struct {
|
||||
Id int32
|
||||
Title string
|
||||
Thumbnail string
|
||||
Content string
|
||||
CreatedAt time.Time
|
||||
LastUpdated time.Time
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package models
|
||||
|
||||
type ErrorResponse struct {
|
||||
HttpCode int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type UserModel struct {
|
||||
Id int
|
||||
Name string
|
||||
Hash string
|
||||
CreatedAt time.Time
|
||||
LastUpdated time.Time
|
||||
}
|
||||
|
||||
type UserDto struct {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user