service.go 650 B

123456789101112131415161718192021222324252627282930
  1. package role
  2. import (
  3. "call_center/call/rpc/pb"
  4. db "call_center/db/rpc/pb"
  5. "log"
  6. "time"
  7. )
  8. type Service struct {
  9. /*
  10. 客服
  11. */
  12. baseRole
  13. HangUpList []*pb.IdInfo
  14. }
  15. func (sel *Service) Init(stopChan chan int32) {
  16. sel.connChan = stopChan
  17. sel.LoginTimeStamp = time.Now().Unix()
  18. sel.LastTalkTimeStamp = sel.LoginTimeStamp
  19. sel.logOutChan = make(chan interface{})
  20. }
  21. func (sel *Service) InitHandUpList(pbList []*db.DbChatRecord) {
  22. for _, data := range pbList {
  23. sel.HangUpList = append(sel.HangUpList, &pb.IdInfo{Id: data.PlayerId, GameId: data.GameId})
  24. }
  25. log.Println("<Service.InitHanUpList> len:", len(sel.HangUpList), " id:", sel.Id)
  26. }