-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.go
35 lines (29 loc) · 850 Bytes
/
db.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"time"
"gorm.io/datatypes"
"gorm.io/gorm"
)
type GormModel struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
} //@name models.gormModel
type Header struct {
Key string
Value string
}
type Tool struct {
GormModel `json:"gorm_model,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Schema datatypes.JSON `json:"schema,omitempty"`
ServerId uint `json:"server_id"`
Server Server `json:"server,omitempty"`
}
type Server struct {
GormModel
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
Variables datatypes.JSON `json:"variables,omitempty"`
}