修改分页返回数据结构体

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

@ -0,0 +1,32 @@
package model
import (
"next-terminal/server/utils"
)
type UserGroup struct {
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 `json:"assetCount"`
}
func (r *UserGroup) TableName() string {
return "user_groups"
}
type UserGroupMember struct {
ID string `gorm:"primary_key" json:"name"`
UserId string `gorm:"index" json:"userId"`
UserGroupId string `gorm:"index" json:"userGroupId"`
}
func (r *UserGroupMember) TableName() string {
return "user_group_members"
}