golang-im聊天
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

room_service_test.go 632 B

2 years ago
12345678910111213141516171819202122232425262728293031323334
  1. package room
  2. import (
  3. "fmt"
  4. "gim/pkg/pb"
  5. "gim/pkg/util"
  6. "testing"
  7. "time"
  8. )
  9. func Test_roomService_DelExpireMessage(t *testing.T) {
  10. err := RoomService.DelExpireMessage(1)
  11. fmt.Println(err)
  12. }
  13. func Test_roomService_List(t *testing.T) {
  14. msgs, err := RoomMessageRepo.List(1, 1)
  15. fmt.Println(err)
  16. fmt.Println(msgs)
  17. }
  18. func Test_roomService_AddMessage(t *testing.T) {
  19. for i := 1; i <= 20; i++ {
  20. err := RoomService.AddMessage(1, &pb.Message{
  21. Seq: int64(i),
  22. SendTime: util.UnixMilliTime(time.Now()),
  23. })
  24. fmt.Println(i, err)
  25. time.Sleep(time.Second)
  26. }
  27. err := RoomService.DelExpireMessage(1)
  28. fmt.Println(err)
  29. }