修改分页返回数据结构体

This commit is contained in:
dushixiang
2021-03-21 16:44:33 +08:00
parent 060363f5fe
commit a4296e3b1c
15 changed files with 28 additions and 22 deletions

View File

@ -23,7 +23,7 @@ type Asset struct {
Owner string `gorm:"index" json:"owner"`
}
type AssetVo struct {
type AssetForPage struct {
ID string `json:"id"`
Name string `json:"name"`
IP string `json:"ip"`

View File

@ -12,7 +12,7 @@ type Command struct {
Owner string `gorm:"index" json:"owner"`
}
type CommandVo struct {
type CommandForPage struct {
ID string `gorm:"primary_key" json:"id"`
Name string `json:"name"`
Content string `json:"content"`

View File

@ -20,7 +20,7 @@ func (r *Credential) TableName() string {
return "credentials"
}
type CredentialVo struct {
type CredentialForPage struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`

View File

@ -14,7 +14,7 @@ type LoginLog struct {
Remember bool `json:"remember"`
}
type LoginLogVo struct {
type LoginLogForPage struct {
ID string `json:"id"`
UserId string `json:"userId"`
UserName string `json:"userName"`

View File

@ -32,7 +32,7 @@ func (r *Session) TableName() string {
return "sessions"
}
type SessionVo struct {
type SessionForPage struct {
ID string `json:"id"`
Protocol string `json:"protocol"`
IP string `json:"ip"`

View File

@ -17,7 +17,7 @@ type User struct {
Mail string `json:"mail"`
}
type UserVo struct {
type UserForPage struct {
ID string `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`

View File

@ -5,10 +5,16 @@ import (
)
type UserGroup struct {
ID string `gorm:"primary_key" json:"id"`
ID string `gorm:"primary_key" json:"id"`
Name string `json:"name"`
Created utils.JsonTime `json:"created"`
}
type UserGroupForPage struct {
ID string `json:"id"`
Name string `json:"name"`
Created utils.JsonTime `json:"created"`
AssetCount int64 `gorm:"-" json:"assetCount"`
AssetCount int64 `json:"assetCount"`
}
func (r *UserGroup) TableName() string {