session.go 425 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. @Time : 2019-07-12 16:24
  3. @Author : zr
  4. */
  5. package model
  6. import (
  7. model2 "github.com/ZR233/session/model"
  8. "time"
  9. )
  10. type Session struct {
  11. Token string
  12. UserId string
  13. Channel string
  14. ExpireAt time.Time
  15. }
  16. func NewSession(s *model2.Session) *Session {
  17. //userId, err := strconv.Atoi(s.UserId)
  18. //if err != nil {
  19. // panic(err)
  20. //}
  21. s_ := &Session{
  22. s.Token,
  23. s.UserId,
  24. s.Channel,
  25. s.ExpireAt,
  26. }
  27. return s_
  28. }