diff --git a/src/idl/chat.proto b/src/idl/chat.proto index c62c46b..c359029 100644 --- a/src/idl/chat.proto +++ b/src/idl/chat.proto @@ -5,13 +5,13 @@ option go_package = "GuGoTik/src/rpc/chat"; message ChatRequest { uint32 actor_id = 1; uint32 user_id = 2; - uint32 pre_msg_time = 3; + uint64 pre_msg_time = 3; } message Message { uint32 id = 1; string content = 2; - uint32 create_time = 3; + uint64 create_time = 3; optional uint32 from_user_id = 4; optional uint32 to_user_id = 5; } diff --git a/src/rpc/chat/chat.pb.go b/src/rpc/chat/chat.pb.go index 4061623..43e2a1e 100644 --- a/src/rpc/chat/chat.pb.go +++ b/src/rpc/chat/chat.pb.go @@ -27,7 +27,7 @@ type ChatRequest struct { ActorId uint32 `protobuf:"varint,1,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` UserId uint32 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - PreMsgTime uint32 `protobuf:"varint,3,opt,name=pre_msg_time,json=preMsgTime,proto3" json:"pre_msg_time,omitempty"` + PreMsgTime uint64 `protobuf:"varint,3,opt,name=pre_msg_time,json=preMsgTime,proto3" json:"pre_msg_time,omitempty"` } func (x *ChatRequest) Reset() { @@ -76,7 +76,7 @@ func (x *ChatRequest) GetUserId() uint32 { return 0 } -func (x *ChatRequest) GetPreMsgTime() uint32 { +func (x *ChatRequest) GetPreMsgTime() uint64 { if x != nil { return x.PreMsgTime } @@ -90,7 +90,7 @@ type Message struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` - CreateTime uint32 `protobuf:"varint,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + CreateTime uint64 `protobuf:"varint,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` FromUserId *uint32 `protobuf:"varint,4,opt,name=from_user_id,json=fromUserId,proto3,oneof" json:"from_user_id,omitempty"` ToUserId *uint32 `protobuf:"varint,5,opt,name=to_user_id,json=toUserId,proto3,oneof" json:"to_user_id,omitempty"` } @@ -141,7 +141,7 @@ func (x *Message) GetContent() string { return "" } -func (x *Message) GetCreateTime() uint32 { +func (x *Message) GetCreateTime() uint64 { if x != nil { return x.CreateTime } @@ -360,13 +360,13 @@ var file_chat_proto_rawDesc = []byte{ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x72, 0x65, - 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x4d, 0x73, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, diff --git a/src/services/message/handler.go b/src/services/message/handler.go index 32313ad..20af58a 100644 --- a/src/services/message/handler.go +++ b/src/services/message/handler.go @@ -222,7 +222,7 @@ func (c MessageServiceImpl) Chat(ctx context.Context, request *chat.ChatRequest) rMessageList = append(rMessageList, &chat.Message{ Id: pMessage.ID, Content: pMessage.Content, - CreateTime: uint32(pMessage.CreatedAt.Unix()), + CreateTime: uint64(pMessage.CreatedAt.UnixMicro()), FromUserId: &pMessage.FromUserId, ToUserId: &pMessage.ToUserId, }) diff --git a/src/services/publish/main.go b/src/services/publish/main.go index 73b619e..9648fb9 100644 --- a/src/services/publish/main.go +++ b/src/services/publish/main.go @@ -35,7 +35,7 @@ func main() { // Configure Pyroscope profiling.InitPyroscope("GuGoTik.PublishService") - maxSize := 100 * 1024 * 1024 + maxSize := 500 * 1024 * 1024 s := grpc.NewServer( grpc.MaxRecvMsgSize(maxSize), grpc.MaxSendMsgSize(maxSize), diff --git a/src/web/models/Message.go b/src/web/models/Message.go index 1634794..dcea8f9 100644 --- a/src/web/models/Message.go +++ b/src/web/models/Message.go @@ -24,7 +24,7 @@ type SMessageRes struct { type ListMessageReq struct { ActorId uint32 `form:"actor_id" binding:"required"` ToUserId uint32 `form:"to_user_id" binding:"required"` - PreMsgTime uint32 `form:"pre_msg_time"` + PreMsgTime uint64 `form:"pre_msg_time"` } type ListMessageRes struct {