用户信息传到service
This commit is contained in:
+10
-14
@@ -18,28 +18,24 @@ type Admin struct {
|
||||
FailNumber int `gorm:"column:fail_number;type:tinyint(2);default:0;comment:连续登录失败次数" json:"fail_number"`
|
||||
Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"`
|
||||
AdminId int `gorm:"column:admin_id;type:int(11);default:0;comment:操作人;NOT NULL" json:"admin_id"`
|
||||
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:NULL;comment:添加时间" json:"create_time"`
|
||||
UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"`
|
||||
}
|
||||
|
||||
// AdminPassword 修改管理员密码
|
||||
type AdminPassword struct {
|
||||
Id int `json:"id"`
|
||||
Password string `json:"password"`
|
||||
Salt string `json:"salt"`
|
||||
AdminId int `json:"admin_id"`
|
||||
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
|
||||
UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"`
|
||||
Id int `json:"id"`
|
||||
Password string `json:"password"`
|
||||
Salt string `json:"salt"`
|
||||
AdminId int `json:"admin_id"`
|
||||
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
|
||||
}
|
||||
|
||||
// AdminStatus 修改管理员状态
|
||||
type AdminStatus struct {
|
||||
Id int `json:"id"`
|
||||
Status uint8 `json:"status"`
|
||||
Reason string `json:"reason"`
|
||||
AdminId int `json:"admin_id"`
|
||||
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
|
||||
UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"`
|
||||
Id int `json:"id"`
|
||||
Status uint8 `json:"status"`
|
||||
Reason string `json:"reason"`
|
||||
AdminId int `json:"admin_id"`
|
||||
AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"`
|
||||
}
|
||||
|
||||
// AdminInfo 管理员详情
|
||||
|
||||
+14
-10
@@ -1,22 +1,26 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
"pkg.local/utils"
|
||||
)
|
||||
|
||||
type JwtInfo struct {
|
||||
Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||
Name string `gorm:"column:name;type:varchar(30);comment:真实姓名;NOT NULL" json:"name"`
|
||||
Phone string `gorm:"column:phone;type:char(12);comment:电话" json:"phone"`
|
||||
Email string `gorm:"column:email;type:varchar(255);comment:邮箱" json:"email"`
|
||||
Roles string `gorm:"column:roles;type:varchar(255);comment:角色" json:"roles"`
|
||||
LastTime utils.CustomTime `gorm:"column:last_time;type:datetime;comment:最后一次登录时间" json:"last_time"`
|
||||
Time int `json:"time"`
|
||||
jwt.RegisteredClaims
|
||||
Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||
Name string `gorm:"column:name;type:varchar(30);comment:真实姓名;NOT NULL" json:"name"`
|
||||
Phone string `gorm:"column:phone;type:char(12);comment:电话" json:"phone"`
|
||||
Email string `gorm:"column:email;type:varchar(255);comment:邮箱" json:"email"`
|
||||
LastTime utils.CustomTime `gorm:"column:last_time;type:datetime;comment:最后一次登录时间" json:"last_time"`
|
||||
Time int `json:"time"`
|
||||
Roles []JwtInfoServices `json:"roles"`
|
||||
}
|
||||
|
||||
type Token struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type JwtInfoServices struct {
|
||||
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||
Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"`
|
||||
Items map[string]string `json:"items"`
|
||||
}
|
||||
|
||||
@@ -33,5 +33,4 @@ type ServicesStatus struct {
|
||||
type ServicesNameItems struct {
|
||||
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||
Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"`
|
||||
Logo string `gorm:"column:logo;type:varchar(255);default:'';comment:logo;NOT NULL" json:"logo"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user