feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间
This commit is contained in:
@@ -459,15 +459,17 @@ type UserVO struct {
|
||||
Name string `json:"name"`
|
||||
RoleId int `json:"roleId"`
|
||||
Status string `json:"status"`
|
||||
CanLoginWorkstation bool `json:"canLoginWorkstation"`
|
||||
Stations []int `json:"stations"` // 允许登录/操作的工位号(空=全部工位)
|
||||
LastLoginAt *int64 `json:"lastLoginAt"` // 最近登录时间(unix秒),null=从未登录
|
||||
CanLoginWorkstation bool `json:"canLoginWorkstation"`
|
||||
Stations []int `json:"stations"` // 允许登录/操作的工位号(空=全部工位)
|
||||
LastLoginAt *int64 `json:"lastLoginAt"` // 最近登录时间(unix秒),null=从未登录
|
||||
CreatedAt *time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt *time.Time `json:"updatedAt"` // 更新时间
|
||||
}
|
||||
|
||||
func (s *Service) ListUsers(ctx context.Context) ([]UserVO, error) {
|
||||
usrs, err := s.ctx.EntClient.User.Query().Order(ent.Desc(user.FieldCreatedAt)).All(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, err
|
||||
}
|
||||
out := make([]UserVO, 0, len(usrs))
|
||||
for _, u := range usrs {
|
||||
@@ -480,6 +482,8 @@ func (s *Service) ListUsers(ctx context.Context) ([]UserVO, error) {
|
||||
CanLoginWorkstation: u.CanLoginWorkstation,
|
||||
Stations: s.UserStations(ctx, u.ID),
|
||||
LastLoginAt: u.LastLoginAt,
|
||||
CreatedAt: &u.CreatedAt,
|
||||
UpdatedAt: u.UpdatedAt,
|
||||
})
|
||||
}
|
||||
return out, nil
|
||||
|
||||
Reference in New Issue
Block a user