MSP-8974 review fixes
This commit is contained in:
1 parent
1ea3ef186c
commit
7bac2e403f
20 files changed
+189
-466
No files matched your search
@@ -4,6 +4,17 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
SessionStatusAllowed = "ALLOWED"
|
||||
SessionStatusAllowedRus = "Активная"
|
||||
|
||||
SessionStatusExpired = "EXPIRED"
|
||||
SessionStatusExpiredRus = "Истекшая"
|
||||
|
||||
SessionStatusRevoked = "REVOKED"
|
||||
SessionStatusRevokedRus = "Отмененная"
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
Id int // Идентификатор сессии
|
||||
UserId int // Идентификатор пользоватеккля
|
||||
@@ -35,3 +46,15 @@ type SessionResponse struct {
|
||||
type RevokeRequest struct {
|
||||
Id int `validate:"required"` // Идентификатор сессии
|
||||
}
|
||||
|
||||
func (s Session) StatusRus() string {
|
||||
switch s.Status {
|
||||
case SessionStatusAllowed:
|
||||
return SessionStatusAllowedRus
|
||||
case SessionStatusExpired:
|
||||
return SessionStatusExpiredRus
|
||||
case SessionStatusRevoked:
|
||||
return SessionStatusRevokedRus
|
||||
}
|
||||
return ""
|
||||
}
|
||||
Reference in new issue
Block a user