Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
28
pkg/common/issue.go
Normal file
28
pkg/common/issue.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package common
|
||||
|
||||
import "time"
|
||||
|
||||
type AddIssueRequest struct {
|
||||
Issue
|
||||
Images [][]byte `json:"images"`
|
||||
}
|
||||
|
||||
type Issue struct {
|
||||
ID int `json:"id" pg:",pk"`
|
||||
VIN string `json:"vin" pg:"vin" validate:"required,vin"`
|
||||
Title string `json:"title" pg:"title" validate:"required,max=256"`
|
||||
Description string `json:"description" pg:"description" validate:"required,max=1024"`
|
||||
DriverID string `json:"driver_id,omitempty" pg:"driver_id"`
|
||||
Timestamp time.Time `json:"timestamp" validate:"required" pg:"created_at"`
|
||||
IssueImages []IssueImage `json:"images,omitempty" pg:"rel:has-many"`
|
||||
}
|
||||
|
||||
type IssueImage struct {
|
||||
ID int `json:"id" pg:",pk"`
|
||||
Image []byte `json:"image" pg:"image"`
|
||||
IssueID int `json:"issue_id" pg:"issue_id"`
|
||||
}
|
||||
|
||||
type IssueSearch struct {
|
||||
Search string `json:"search" validate:"max=1024"`
|
||||
}
|
||||
Reference in New Issue
Block a user