初始化项目文件
This commit is contained in:
12
api_file/model/backgammon.go
Normal file
12
api_file/model/backgammon.go
Normal file
@ -0,0 +1,12 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type BackgammonRoom struct {
|
||||
RoomId int `json:"room_id"`
|
||||
Player string `json:"player"`
|
||||
Winner string `json:"winner"`
|
||||
Current string `json:"current"`
|
||||
PawnStatus string `json:"pawn_status"`
|
||||
gorm.Model
|
||||
}
|
19
api_file/model/balance.go
Normal file
19
api_file/model/balance.go
Normal file
@ -0,0 +1,19 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type Balances struct {
|
||||
Username string `json:"username"`
|
||||
Card string `json:"card"`
|
||||
Type bool `gorm:"default:false" json:"type"` //1:支出型;0:收入型
|
||||
Balance float64 `json:"balance"`
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
type BalanceLogs struct {
|
||||
Username string
|
||||
Card string
|
||||
Date string
|
||||
Balance float64
|
||||
gorm.Model
|
||||
}
|
28
api_file/model/chess.go
Normal file
28
api_file/model/chess.go
Normal file
@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ChessStatus struct {
|
||||
gorm.Model
|
||||
Players string `json:"players"`
|
||||
Current string `json:"current"`
|
||||
IsEnd bool `json:"is_end"`
|
||||
Status string `json:"status"`
|
||||
Winner string `json:"winner"`
|
||||
ChessId string `json:"chess_id"`
|
||||
}
|
||||
|
||||
type ChessStatusLog struct {
|
||||
gorm.Model
|
||||
RoomId uint `json:"roomId"`
|
||||
Current string `json:"current"`
|
||||
Players string `json:"players"`
|
||||
IsEnd bool `json:"is_end"`
|
||||
Status string `json:"status"`
|
||||
Winner string `json:"winner"`
|
||||
ChessId string `json:"chess_id"`
|
||||
Time time.Time `json:"time"`
|
||||
}
|
9
api_file/model/crontab.go
Normal file
9
api_file/model/crontab.go
Normal file
@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type RunningCrontab struct {
|
||||
Name string
|
||||
CronId int
|
||||
gorm.Model
|
||||
}
|
20
api_file/model/keys.go
Normal file
20
api_file/model/keys.go
Normal file
@ -0,0 +1,20 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// DayKeys 每天对应key表
|
||||
type DayKeys struct {
|
||||
Date string
|
||||
Key string
|
||||
AesKey string
|
||||
User string
|
||||
gorm.Model
|
||||
}
|
||||
type JwtKeys struct {
|
||||
Username string
|
||||
Date string
|
||||
Key string
|
||||
Token string
|
||||
Updated bool `gorm:"default:false"`
|
||||
gorm.Model
|
||||
}
|
31
api_file/model/logs.go
Normal file
31
api_file/model/logs.go
Normal file
@ -0,0 +1,31 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// Logs 日志表
|
||||
type Logs struct {
|
||||
Method string `json:"method,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
UserAgent string `json:"user_agent,omitempty"`
|
||||
Time string `json:"time,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Ip string `json:"ip,omitempty"`
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
type LogFileDealLog struct {
|
||||
Date string
|
||||
Success bool
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
// SysLogs 系统容器日志表
|
||||
type SysLogs struct {
|
||||
Time string `json:"time,omitempty"`
|
||||
ContainerName string `json:"container_name,omitempty"`
|
||||
ContainerImage string `json:"container_image,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Offset int `json:"offset,omitempty"`
|
||||
gorm.Model
|
||||
}
|
14
api_file/model/menus.go
Normal file
14
api_file/model/menus.go
Normal file
@ -0,0 +1,14 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type Menus struct {
|
||||
MenuId string `json:"menu_id"`
|
||||
Name string `json:"name"`
|
||||
Icon string `json:"icon"`
|
||||
Path string `json:"path"`
|
||||
RouteOnly bool `json:"route_only"`
|
||||
UserType string `json:"user_type"`
|
||||
WhiteList string `json:"white_list"`
|
||||
gorm.Model
|
||||
}
|
9
api_file/model/note.go
Normal file
9
api_file/model/note.go
Normal file
@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type UserNotes struct {
|
||||
Username string `json:"username"`
|
||||
Content string `json:"content"`
|
||||
gorm.Model
|
||||
}
|
18
api_file/model/sudoku.go
Normal file
18
api_file/model/sudoku.go
Normal file
@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type Sudoku struct {
|
||||
Sudoku string `json:"sudoku"`
|
||||
Username string `json:"username"`
|
||||
Result string `json:"result"`
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
type SudokuStatus struct {
|
||||
SudokuId uint `json:"sudoku_id"`
|
||||
Username string `json:"username"`
|
||||
Status string `json:"status"`
|
||||
Complete bool `json:"complete"`
|
||||
gorm.Model
|
||||
}
|
14
api_file/model/sysError.go
Normal file
14
api_file/model/sysError.go
Normal file
@ -0,0 +1,14 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SysError struct {
|
||||
Username string `json:"username"`
|
||||
Time time.Time `json:"time"`
|
||||
Function string `json:"function"`
|
||||
ErrorInfo string `json:"error_info"`
|
||||
gorm.Model
|
||||
}
|
17
api_file/model/sysSettings.go
Normal file
17
api_file/model/sysSettings.go
Normal file
@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// SysIcons 系统图标库
|
||||
type SysIcons struct {
|
||||
Icon string `json:"icon"`
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
type SysSettings struct {
|
||||
Name string `json:"name"`
|
||||
CnName string `json:"cn_name"`
|
||||
Value string `json:"value"`
|
||||
DType string `json:"d_type"`
|
||||
gorm.Model
|
||||
}
|
55
api_file/model/sysinfo.go
Normal file
55
api_file/model/sysinfo.go
Normal file
@ -0,0 +1,55 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type SysInfo struct {
|
||||
Date string `json:"date" gorm:"index:select_info"`
|
||||
Datetime string `json:"datetime" gorm:"index:datetime_index"`
|
||||
Username string `json:"username" gorm:"index:select_info"`
|
||||
Hostname string `json:"hostname"`
|
||||
Ip string `json:"ip" gorm:"index:select_info"`
|
||||
SysVersion string `json:"sysVersion"`
|
||||
PhysicalCount int `json:"physicalCount"`
|
||||
LogicalCount int `json:"logicalCount"`
|
||||
CpuPer float64 `json:"cpuPer"`
|
||||
MemTotal string `json:"memTotal"`
|
||||
MemUsed string `json:"memUsed"`
|
||||
MemPer float64 `json:"memPer"`
|
||||
DiskPoint string `json:"diskPoint"`
|
||||
DiskTotal string `json:"diskTotal"`
|
||||
DiskUsed string `json:"diskUsed"`
|
||||
DiskPer string `json:"diskPer"`
|
||||
NetSent int64 `json:"netSent"`
|
||||
NetRec int64 `json:"netRec"`
|
||||
SentSpeed string `json:"sentSpeed"`
|
||||
RecSpeed string `json:"recSpeed"`
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
type SysInfoOld struct {
|
||||
Datetime string `json:"datetime" gorm:"index:datetime_index"`
|
||||
Username string `json:"username"`
|
||||
Hostname string `json:"hostname"`
|
||||
Ip string `json:"ip"`
|
||||
SysVersion string `json:"sysVersion"`
|
||||
PhysicalCount int `json:"physicalCount"`
|
||||
LogicalCount int `json:"logicalCount"`
|
||||
CpuPer float64 `json:"cpuPer"`
|
||||
MemTotal string `json:"memTotal"`
|
||||
MemUsed string `json:"memUsed"`
|
||||
MemPer float64 `json:"memPer"`
|
||||
DiskPoint string `json:"diskPoint"`
|
||||
DiskTotal string `json:"diskTotal"`
|
||||
DiskUsed string `json:"diskUsed"`
|
||||
DiskPer string `json:"diskPer"`
|
||||
NetSent int64 `json:"netSent"`
|
||||
NetRec int64 `json:"netRec"`
|
||||
SentSpeed string `json:"sentSpeed"`
|
||||
RecSpeed string `json:"recSpeed"`
|
||||
}
|
||||
|
||||
type SysInfoUpdateLog struct {
|
||||
Datetime string `json:"datetime"`
|
||||
Update bool `json:"update"`
|
||||
gorm.Model
|
||||
}
|
38
api_file/model/user.go
Normal file
38
api_file/model/user.go
Normal file
@ -0,0 +1,38 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// User 用户登录信息表
|
||||
type User struct {
|
||||
Username string
|
||||
Password string
|
||||
Date string
|
||||
ConfirmCode string
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
// Userinfo 用户信息表
|
||||
type Userinfo struct {
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar"`
|
||||
Nickname string `json:"nickname"`
|
||||
Mobile string `json:"mobile"`
|
||||
Email string `json:"email"`
|
||||
Location string `json:"location"`
|
||||
Type string `json:"type"`
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
// UserAction 用户行为表
|
||||
type UserAction struct {
|
||||
Username string
|
||||
Action string
|
||||
gorm.Model
|
||||
}
|
||||
|
||||
type UserAutoLogin struct {
|
||||
Username string
|
||||
DeviceId string
|
||||
Location string
|
||||
gorm.Model
|
||||
}
|
10
api_file/model/utils.go
Normal file
10
api_file/model/utils.go
Normal file
@ -0,0 +1,10 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// IpsLocation ip转地址表
|
||||
type IpsLocation struct {
|
||||
Ip string
|
||||
Location string
|
||||
gorm.Model
|
||||
}
|
11
api_file/model/weather.go
Normal file
11
api_file/model/weather.go
Normal file
@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// Weather 每日天气表
|
||||
type Weather struct {
|
||||
Date string
|
||||
Location string
|
||||
Weather string
|
||||
gorm.Model
|
||||
}
|
Reference in New Issue
Block a user