modified 增加结构体描述,完善自动化文档

This commit is contained in:
何秀钢
2021-05-11 17:26:06 +08:00
parent 9b758084bf
commit c3ad90dde5
7 changed files with 20 additions and 11 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ type PageInfo struct {
// Find by id structure
type GetById struct {
ID float64 `json:"id" form:"id"`
ID float64 `json:"id" form:"id"` // 主键ID
}
type IdsReq struct {
+1 -1
View File
@@ -8,5 +8,5 @@ type SysAuthorityResponse struct {
type SysAuthorityCopyResponse struct {
Authority model.SysAuthority `json:"authority"`
OldAuthorityId string `json:"oldAuthorityId"`
OldAuthorityId string `json:"oldAuthorityId"` // 旧角色ID
}
+4 -4
View File
@@ -5,12 +5,12 @@ import (
)
type SysAuthority struct {
CreatedAt time.Time
UpdatedAt time.Time
CreatedAt time.Time // 创建时间
UpdatedAt time.Time // 更新时间
DeletedAt *time.Time `sql:"index"`
AuthorityId string `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID
AuthorityName string `json:"authorityName" gorm:"comment:角色名"` // 角色名
ParentId string `json:"parentId" gorm:"comment:父角色ID"` // 父角色ID
AuthorityName string `json:"authorityName" gorm:"comment:角色名"` // 角色名
ParentId string `json:"parentId" gorm:"comment:父角色ID"` // 父角色ID
DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id"`
Children []SysAuthority `json:"children" gorm:"-"`
SysBaseMenus []SysBaseMenu `json:"menus" gorm:"many2many:sys_authority_menus;"`
+1 -1
View File
@@ -10,7 +10,7 @@ type SysUser struct {
UUID uuid.UUID `json:"uuid" gorm:"comment:用户UUID"` // 用户UUID
Username string `json:"userName" gorm:"comment:用户登录名"` // 用户登录名
Password string `json:"-" gorm:"comment:用户登录密码"` // 用户登录密码
NickName string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"` // 用户昵称"
NickName string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"` // 用户昵称
HeaderImg string `json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID