add: chat service

This commit is contained in:
wwweww
2026-04-24 20:43:53 +08:00
parent 4cc4c96b21
commit 756ca20c6d
43 changed files with 3035 additions and 0 deletions
+282
View File
@@ -0,0 +1,282 @@
package pb
type ChatSessions struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
CreatorId int64 `protobuf:"varint,4,opt,name=creatorId,proto3" json:"creatorId,omitempty"`
Participants []int64 `protobuf:"varint,5,rep,packed,name=participants,proto3" json:"participants,omitempty"`
LastMessage string `protobuf:"bytes,6,opt,name=lastMessage,proto3" json:"lastMessage,omitempty"`
LastMessageAt int64 `protobuf:"varint,7,opt,name=lastMessageAt,proto3" json:"lastMessageAt,omitempty"`
CreatedAt int64 `protobuf:"varint,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
UpdatedAt int64 `protobuf:"varint,9,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
}
func (x *ChatSessions) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ChatSessions) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *ChatSessions) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ChatSessions) GetCreatorId() int64 {
if x != nil {
return x.CreatorId
}
return 0
}
func (x *ChatSessions) GetParticipants() []int64 {
if x != nil {
return x.Participants
}
return nil
}
func (x *ChatSessions) GetLastMessage() string {
if x != nil {
return x.LastMessage
}
return ""
}
func (x *ChatSessions) GetLastMessageAt() int64 {
if x != nil {
return x.LastMessageAt
}
return 0
}
func (x *ChatSessions) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *ChatSessions) GetUpdatedAt() int64 {
if x != nil {
return x.UpdatedAt
}
return 0
}
type AddChatSessionsReq struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
CreatorId int64 `protobuf:"varint,3,opt,name=creatorId,proto3" json:"creatorId,omitempty"`
Participants []int64 `protobuf:"varint,4,rep,packed,name=participants,proto3" json:"participants,omitempty"`
}
func (x *AddChatSessionsReq) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *AddChatSessionsReq) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *AddChatSessionsReq) GetCreatorId() int64 {
if x != nil {
return x.CreatorId
}
return 0
}
func (x *AddChatSessionsReq) GetParticipants() []int64 {
if x != nil {
return x.Participants
}
return nil
}
type AddChatSessionsResp struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *AddChatSessionsResp) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
type UpdateChatSessionsReq struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
LastMessage *string `protobuf:"bytes,3,opt,name=lastMessage,proto3,oneof" json:"lastMessage,omitempty"`
LastMessageAt *int64 `protobuf:"varint,4,opt,name=lastMessageAt,proto3,oneof" json:"lastMessageAt,omitempty"`
}
func (x *UpdateChatSessionsReq) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *UpdateChatSessionsReq) GetName() *string {
if x != nil {
return x.Name
}
return nil
}
func (x *UpdateChatSessionsReq) GetLastMessage() *string {
if x != nil {
return x.LastMessage
}
return nil
}
func (x *UpdateChatSessionsReq) GetLastMessageAt() *int64 {
if x != nil {
return x.LastMessageAt
}
return nil
}
type UpdateChatSessionsResp struct{}
type DelChatSessionsReq struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *DelChatSessionsReq) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
type DelChatSessionsResp struct{}
type GetChatSessionsByIdReq struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *GetChatSessionsByIdReq) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
type GetChatSessionsByIdResp struct {
ChatSessions *ChatSessions `protobuf:"bytes,1,opt,name=chatSessions,proto3" json:"chatSessions,omitempty"`
}
func (x *GetChatSessionsByIdResp) GetChatSessions() *ChatSessions {
if x != nil {
return x.ChatSessions
}
return nil
}
type SearchChatSessionsReq struct {
Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
UserId *int64 `protobuf:"varint,3,opt,name=userId,proto3,oneof" json:"userId,omitempty"`
Type *string `protobuf:"bytes,4,opt,name=type,proto3,oneof" json:"type,omitempty"`
}
func (x *SearchChatSessionsReq) GetPage() int64 {
if x != nil {
return x.Page
}
return 0
}
func (x *SearchChatSessionsReq) GetLimit() int64 {
if x != nil {
return x.Limit
}
return 0
}
func (x *SearchChatSessionsReq) GetUserId() *int64 {
if x != nil {
return x.UserId
}
return nil
}
func (x *SearchChatSessionsReq) GetType() *string {
if x != nil {
return x.Type
}
return nil
}
type SearchChatSessionsResp struct {
ChatSessions []*ChatSessions `protobuf:"bytes,1,rep,name=chatSessions,proto3" json:"chatSessions,omitempty"`
}
func (x *SearchChatSessionsResp) GetChatSessions() []*ChatSessions {
if x != nil {
return x.ChatSessions
}
return nil
}
type AddParticipantReq struct {
SessionId int64 `protobuf:"varint,1,opt,name=sessionId,proto3" json:"sessionId,omitempty"`
UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`
}
func (x *AddParticipantReq) GetSessionId() int64 {
if x != nil {
return x.SessionId
}
return 0
}
func (x *AddParticipantReq) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
type AddParticipantResp struct{}
type RemoveParticipantReq struct {
SessionId int64 `protobuf:"varint,1,opt,name=sessionId,proto3" json:"sessionId,omitempty"`
UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`
}
func (x *RemoveParticipantReq) GetSessionId() int64 {
if x != nil {
return x.SessionId
}
return 0
}
func (x *RemoveParticipantReq) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
type RemoveParticipantResp struct{}