feat: add UserProfileService, UserMoodHistoryService, UserMessageService protos

Add profiles.proto with UserProfileService and UserMoodHistoryService for
managing Telegram user profiles, avatars, mood history, and memorable moments.
Add messages.proto with UserMessageService for storing and querying chat messages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Kaien 2026-03-20 22:57:58 +03:00
parent 44ed2ab876
commit e26dc84ccc
6 changed files with 4757 additions and 0 deletions

1305
messages.pb.go Normal file

File diff suppressed because it is too large Load Diff

135
messages.proto Normal file
View File

@ -0,0 +1,135 @@
syntax = "proto3";
package users;
option go_package = "git.be.kaien.ru/l-ai/l-ai-core-proto/proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
// UserMessageService manages stored user messages
service UserMessageService {
rpc SaveMessage(SaveMessageRequest) returns (google.protobuf.Empty);
rpc GetRecentMessages(GetRecentMessagesRequest) returns (GetMessagesResponse);
rpc GetAllUsersInChat(GetAllUsersInChatRequest) returns (GetAllUsersInChatResponse);
rpc GetRandomUser(GetRandomUserRequest) returns (GetRandomUserResponse);
rpc GetUsersByChat(GetUsersByChatRequest) returns (GetUsersByChatResponse);
rpc GetTotalMessageCount(google.protobuf.Empty) returns (GetMessageCountResponse);
rpc GetUserMessageCount(GetUserMessageCountRequest) returns (GetMessageCountResponse);
rpc GetMessagesInTimeRange(GetMessagesInTimeRangeRequest) returns (GetMessagesResponse);
rpc FindSimilarMessage(FindSimilarMessageRequest) returns (FindSimilarMessageResponse);
rpc GetMessageByTelegramID(GetMessageByTelegramIDRequest) returns (FindSimilarMessageResponse);
rpc GetRecentChatMessages(GetRecentChatMessagesRequest) returns (GetMessagesResponse);
rpc GetAllUserMessages(GetAllUserMessagesRequest) returns (GetMessagesResponse);
rpc GetRandomMessageFromChat(GetRandomMessageFromChatRequest) returns (FindSimilarMessageResponse);
}
// --- Messages ---
message ChatMessage {
int64 id = 1;
int64 user_id = 2;
int64 chat_id = 3;
string username = 4;
string text = 5;
int32 message_id = 6;
google.protobuf.Timestamp created_at = 7;
}
message ChatUserInfo {
int64 user_id = 1;
string username = 2;
}
// --- Request/Response messages ---
message SaveMessageRequest {
int64 user_id = 1;
int64 chat_id = 2;
string username = 3;
string text = 4;
int32 message_id = 5;
}
message GetRecentMessagesRequest {
int64 user_id = 1;
int64 chat_id = 2;
int32 limit = 3;
}
message GetMessagesResponse {
repeated ChatMessage messages = 1;
}
message GetAllUsersInChatRequest {
int64 chat_id = 1;
}
message GetAllUsersInChatResponse {
repeated int64 user_ids = 1;
}
message GetRandomUserRequest {
int64 chat_id = 1;
repeated int64 exclude_user_ids = 2;
}
message GetRandomUserResponse {
int64 user_id = 1;
string username = 2;
}
message GetUsersByChatRequest {
int64 chat_id = 1;
}
message GetUsersByChatResponse {
repeated ChatUserInfo users = 1;
}
message GetMessageCountResponse {
int64 count = 1;
}
message GetUserMessageCountRequest {
int64 user_id = 1;
int64 chat_id = 2;
}
message GetMessagesInTimeRangeRequest {
int64 user_id = 1;
int64 chat_id = 2;
google.protobuf.Timestamp from = 3;
google.protobuf.Timestamp to = 4;
}
message FindSimilarMessageRequest {
int64 user_id = 1;
int64 chat_id = 2;
string text = 3;
int32 within_days = 4;
}
message FindSimilarMessageResponse {
ChatMessage message = 1;
bool found = 2;
}
message GetMessageByTelegramIDRequest {
int64 chat_id = 1;
int32 message_id = 2;
}
message GetRecentChatMessagesRequest {
int64 chat_id = 1;
int32 limit = 2;
google.protobuf.Timestamp since = 3;
}
message GetAllUserMessagesRequest {
int64 user_id = 1;
}
message GetRandomMessageFromChatRequest {
int64 chat_id = 1;
}

582
messages_grpc.pb.go Normal file
View File

@ -0,0 +1,582 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc v7.34.0
// source: messages.proto
package proto
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
UserMessageService_SaveMessage_FullMethodName = "/users.UserMessageService/SaveMessage"
UserMessageService_GetRecentMessages_FullMethodName = "/users.UserMessageService/GetRecentMessages"
UserMessageService_GetAllUsersInChat_FullMethodName = "/users.UserMessageService/GetAllUsersInChat"
UserMessageService_GetRandomUser_FullMethodName = "/users.UserMessageService/GetRandomUser"
UserMessageService_GetUsersByChat_FullMethodName = "/users.UserMessageService/GetUsersByChat"
UserMessageService_GetTotalMessageCount_FullMethodName = "/users.UserMessageService/GetTotalMessageCount"
UserMessageService_GetUserMessageCount_FullMethodName = "/users.UserMessageService/GetUserMessageCount"
UserMessageService_GetMessagesInTimeRange_FullMethodName = "/users.UserMessageService/GetMessagesInTimeRange"
UserMessageService_FindSimilarMessage_FullMethodName = "/users.UserMessageService/FindSimilarMessage"
UserMessageService_GetMessageByTelegramID_FullMethodName = "/users.UserMessageService/GetMessageByTelegramID"
UserMessageService_GetRecentChatMessages_FullMethodName = "/users.UserMessageService/GetRecentChatMessages"
UserMessageService_GetAllUserMessages_FullMethodName = "/users.UserMessageService/GetAllUserMessages"
UserMessageService_GetRandomMessageFromChat_FullMethodName = "/users.UserMessageService/GetRandomMessageFromChat"
)
// UserMessageServiceClient is the client API for UserMessageService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// UserMessageService manages stored user messages
type UserMessageServiceClient interface {
SaveMessage(ctx context.Context, in *SaveMessageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
GetRecentMessages(ctx context.Context, in *GetRecentMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error)
GetAllUsersInChat(ctx context.Context, in *GetAllUsersInChatRequest, opts ...grpc.CallOption) (*GetAllUsersInChatResponse, error)
GetRandomUser(ctx context.Context, in *GetRandomUserRequest, opts ...grpc.CallOption) (*GetRandomUserResponse, error)
GetUsersByChat(ctx context.Context, in *GetUsersByChatRequest, opts ...grpc.CallOption) (*GetUsersByChatResponse, error)
GetTotalMessageCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetMessageCountResponse, error)
GetUserMessageCount(ctx context.Context, in *GetUserMessageCountRequest, opts ...grpc.CallOption) (*GetMessageCountResponse, error)
GetMessagesInTimeRange(ctx context.Context, in *GetMessagesInTimeRangeRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error)
FindSimilarMessage(ctx context.Context, in *FindSimilarMessageRequest, opts ...grpc.CallOption) (*FindSimilarMessageResponse, error)
GetMessageByTelegramID(ctx context.Context, in *GetMessageByTelegramIDRequest, opts ...grpc.CallOption) (*FindSimilarMessageResponse, error)
GetRecentChatMessages(ctx context.Context, in *GetRecentChatMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error)
GetAllUserMessages(ctx context.Context, in *GetAllUserMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error)
GetRandomMessageFromChat(ctx context.Context, in *GetRandomMessageFromChatRequest, opts ...grpc.CallOption) (*FindSimilarMessageResponse, error)
}
type userMessageServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUserMessageServiceClient(cc grpc.ClientConnInterface) UserMessageServiceClient {
return &userMessageServiceClient{cc}
}
func (c *userMessageServiceClient) SaveMessage(ctx context.Context, in *SaveMessageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserMessageService_SaveMessage_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetRecentMessages(ctx context.Context, in *GetRecentMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMessagesResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetRecentMessages_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetAllUsersInChat(ctx context.Context, in *GetAllUsersInChatRequest, opts ...grpc.CallOption) (*GetAllUsersInChatResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetAllUsersInChatResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetAllUsersInChat_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetRandomUser(ctx context.Context, in *GetRandomUserRequest, opts ...grpc.CallOption) (*GetRandomUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetRandomUserResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetRandomUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetUsersByChat(ctx context.Context, in *GetUsersByChatRequest, opts ...grpc.CallOption) (*GetUsersByChatResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUsersByChatResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetUsersByChat_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetTotalMessageCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetMessageCountResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMessageCountResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetTotalMessageCount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetUserMessageCount(ctx context.Context, in *GetUserMessageCountRequest, opts ...grpc.CallOption) (*GetMessageCountResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMessageCountResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetUserMessageCount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetMessagesInTimeRange(ctx context.Context, in *GetMessagesInTimeRangeRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMessagesResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetMessagesInTimeRange_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) FindSimilarMessage(ctx context.Context, in *FindSimilarMessageRequest, opts ...grpc.CallOption) (*FindSimilarMessageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FindSimilarMessageResponse)
err := c.cc.Invoke(ctx, UserMessageService_FindSimilarMessage_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetMessageByTelegramID(ctx context.Context, in *GetMessageByTelegramIDRequest, opts ...grpc.CallOption) (*FindSimilarMessageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FindSimilarMessageResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetMessageByTelegramID_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetRecentChatMessages(ctx context.Context, in *GetRecentChatMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMessagesResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetRecentChatMessages_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetAllUserMessages(ctx context.Context, in *GetAllUserMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMessagesResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetAllUserMessages_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMessageServiceClient) GetRandomMessageFromChat(ctx context.Context, in *GetRandomMessageFromChatRequest, opts ...grpc.CallOption) (*FindSimilarMessageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FindSimilarMessageResponse)
err := c.cc.Invoke(ctx, UserMessageService_GetRandomMessageFromChat_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserMessageServiceServer is the server API for UserMessageService service.
// All implementations must embed UnimplementedUserMessageServiceServer
// for forward compatibility.
//
// UserMessageService manages stored user messages
type UserMessageServiceServer interface {
SaveMessage(context.Context, *SaveMessageRequest) (*emptypb.Empty, error)
GetRecentMessages(context.Context, *GetRecentMessagesRequest) (*GetMessagesResponse, error)
GetAllUsersInChat(context.Context, *GetAllUsersInChatRequest) (*GetAllUsersInChatResponse, error)
GetRandomUser(context.Context, *GetRandomUserRequest) (*GetRandomUserResponse, error)
GetUsersByChat(context.Context, *GetUsersByChatRequest) (*GetUsersByChatResponse, error)
GetTotalMessageCount(context.Context, *emptypb.Empty) (*GetMessageCountResponse, error)
GetUserMessageCount(context.Context, *GetUserMessageCountRequest) (*GetMessageCountResponse, error)
GetMessagesInTimeRange(context.Context, *GetMessagesInTimeRangeRequest) (*GetMessagesResponse, error)
FindSimilarMessage(context.Context, *FindSimilarMessageRequest) (*FindSimilarMessageResponse, error)
GetMessageByTelegramID(context.Context, *GetMessageByTelegramIDRequest) (*FindSimilarMessageResponse, error)
GetRecentChatMessages(context.Context, *GetRecentChatMessagesRequest) (*GetMessagesResponse, error)
GetAllUserMessages(context.Context, *GetAllUserMessagesRequest) (*GetMessagesResponse, error)
GetRandomMessageFromChat(context.Context, *GetRandomMessageFromChatRequest) (*FindSimilarMessageResponse, error)
mustEmbedUnimplementedUserMessageServiceServer()
}
// UnimplementedUserMessageServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedUserMessageServiceServer struct{}
func (UnimplementedUserMessageServiceServer) SaveMessage(context.Context, *SaveMessageRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method SaveMessage not implemented")
}
func (UnimplementedUserMessageServiceServer) GetRecentMessages(context.Context, *GetRecentMessagesRequest) (*GetMessagesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetRecentMessages not implemented")
}
func (UnimplementedUserMessageServiceServer) GetAllUsersInChat(context.Context, *GetAllUsersInChatRequest) (*GetAllUsersInChatResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetAllUsersInChat not implemented")
}
func (UnimplementedUserMessageServiceServer) GetRandomUser(context.Context, *GetRandomUserRequest) (*GetRandomUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetRandomUser not implemented")
}
func (UnimplementedUserMessageServiceServer) GetUsersByChat(context.Context, *GetUsersByChatRequest) (*GetUsersByChatResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetUsersByChat not implemented")
}
func (UnimplementedUserMessageServiceServer) GetTotalMessageCount(context.Context, *emptypb.Empty) (*GetMessageCountResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetTotalMessageCount not implemented")
}
func (UnimplementedUserMessageServiceServer) GetUserMessageCount(context.Context, *GetUserMessageCountRequest) (*GetMessageCountResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetUserMessageCount not implemented")
}
func (UnimplementedUserMessageServiceServer) GetMessagesInTimeRange(context.Context, *GetMessagesInTimeRangeRequest) (*GetMessagesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetMessagesInTimeRange not implemented")
}
func (UnimplementedUserMessageServiceServer) FindSimilarMessage(context.Context, *FindSimilarMessageRequest) (*FindSimilarMessageResponse, error) {
return nil, status.Error(codes.Unimplemented, "method FindSimilarMessage not implemented")
}
func (UnimplementedUserMessageServiceServer) GetMessageByTelegramID(context.Context, *GetMessageByTelegramIDRequest) (*FindSimilarMessageResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetMessageByTelegramID not implemented")
}
func (UnimplementedUserMessageServiceServer) GetRecentChatMessages(context.Context, *GetRecentChatMessagesRequest) (*GetMessagesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetRecentChatMessages not implemented")
}
func (UnimplementedUserMessageServiceServer) GetAllUserMessages(context.Context, *GetAllUserMessagesRequest) (*GetMessagesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetAllUserMessages not implemented")
}
func (UnimplementedUserMessageServiceServer) GetRandomMessageFromChat(context.Context, *GetRandomMessageFromChatRequest) (*FindSimilarMessageResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetRandomMessageFromChat not implemented")
}
func (UnimplementedUserMessageServiceServer) mustEmbedUnimplementedUserMessageServiceServer() {}
func (UnimplementedUserMessageServiceServer) testEmbeddedByValue() {}
// UnsafeUserMessageServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserMessageServiceServer will
// result in compilation errors.
type UnsafeUserMessageServiceServer interface {
mustEmbedUnimplementedUserMessageServiceServer()
}
func RegisterUserMessageServiceServer(s grpc.ServiceRegistrar, srv UserMessageServiceServer) {
// If the following call panics, it indicates UnimplementedUserMessageServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&UserMessageService_ServiceDesc, srv)
}
func _UserMessageService_SaveMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SaveMessageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).SaveMessage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_SaveMessage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).SaveMessage(ctx, req.(*SaveMessageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetRecentMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRecentMessagesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetRecentMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetRecentMessages_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetRecentMessages(ctx, req.(*GetRecentMessagesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetAllUsersInChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetAllUsersInChatRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetAllUsersInChat(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetAllUsersInChat_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetAllUsersInChat(ctx, req.(*GetAllUsersInChatRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetRandomUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRandomUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetRandomUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetRandomUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetRandomUser(ctx, req.(*GetRandomUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetUsersByChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUsersByChatRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetUsersByChat(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetUsersByChat_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetUsersByChat(ctx, req.(*GetUsersByChatRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetTotalMessageCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetTotalMessageCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetTotalMessageCount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetTotalMessageCount(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetUserMessageCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserMessageCountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetUserMessageCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetUserMessageCount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetUserMessageCount(ctx, req.(*GetUserMessageCountRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetMessagesInTimeRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMessagesInTimeRangeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetMessagesInTimeRange(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetMessagesInTimeRange_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetMessagesInTimeRange(ctx, req.(*GetMessagesInTimeRangeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_FindSimilarMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindSimilarMessageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).FindSimilarMessage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_FindSimilarMessage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).FindSimilarMessage(ctx, req.(*FindSimilarMessageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetMessageByTelegramID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMessageByTelegramIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetMessageByTelegramID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetMessageByTelegramID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetMessageByTelegramID(ctx, req.(*GetMessageByTelegramIDRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetRecentChatMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRecentChatMessagesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetRecentChatMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetRecentChatMessages_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetRecentChatMessages(ctx, req.(*GetRecentChatMessagesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetAllUserMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetAllUserMessagesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetAllUserMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetAllUserMessages_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetAllUserMessages(ctx, req.(*GetAllUserMessagesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMessageService_GetRandomMessageFromChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRandomMessageFromChatRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMessageServiceServer).GetRandomMessageFromChat(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMessageService_GetRandomMessageFromChat_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMessageServiceServer).GetRandomMessageFromChat(ctx, req.(*GetRandomMessageFromChatRequest))
}
return interceptor(ctx, in, info, handler)
}
// UserMessageService_ServiceDesc is the grpc.ServiceDesc for UserMessageService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserMessageService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "users.UserMessageService",
HandlerType: (*UserMessageServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SaveMessage",
Handler: _UserMessageService_SaveMessage_Handler,
},
{
MethodName: "GetRecentMessages",
Handler: _UserMessageService_GetRecentMessages_Handler,
},
{
MethodName: "GetAllUsersInChat",
Handler: _UserMessageService_GetAllUsersInChat_Handler,
},
{
MethodName: "GetRandomUser",
Handler: _UserMessageService_GetRandomUser_Handler,
},
{
MethodName: "GetUsersByChat",
Handler: _UserMessageService_GetUsersByChat_Handler,
},
{
MethodName: "GetTotalMessageCount",
Handler: _UserMessageService_GetTotalMessageCount_Handler,
},
{
MethodName: "GetUserMessageCount",
Handler: _UserMessageService_GetUserMessageCount_Handler,
},
{
MethodName: "GetMessagesInTimeRange",
Handler: _UserMessageService_GetMessagesInTimeRange_Handler,
},
{
MethodName: "FindSimilarMessage",
Handler: _UserMessageService_FindSimilarMessage_Handler,
},
{
MethodName: "GetMessageByTelegramID",
Handler: _UserMessageService_GetMessageByTelegramID_Handler,
},
{
MethodName: "GetRecentChatMessages",
Handler: _UserMessageService_GetRecentChatMessages_Handler,
},
{
MethodName: "GetAllUserMessages",
Handler: _UserMessageService_GetAllUserMessages_Handler,
},
{
MethodName: "GetRandomMessageFromChat",
Handler: _UserMessageService_GetRandomMessageFromChat_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "messages.proto",
}

1888
profiles.pb.go Normal file

File diff suppressed because it is too large Load Diff

196
profiles.proto Normal file
View File

@ -0,0 +1,196 @@
syntax = "proto3";
package users;
option go_package = "git.be.kaien.ru/l-ai/l-ai-core-proto/proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
// UserProfileService manages Telegram user profiles, avatars, and mood history
service UserProfileService {
rpc GetOrCreateProfile(GetOrCreateProfileRequest) returns (UserProfile);
rpc GetProfile(GetProfileRequest) returns (UserProfile);
rpc GetAllProfilesWithMessages(google.protobuf.Empty) returns (GetAllProfilesResponse);
rpc AddMessageToStats(AddMessageToStatsRequest) returns (google.protobuf.Empty);
rpc UpdateReactionCount(UpdateReactionCountRequest) returns (google.protobuf.Empty);
rpc SetBotAttitude(SetBotAttitudeRequest) returns (google.protobuf.Empty);
rpc SaveMemorableMoment(SaveMemorableMomentRequest) returns (google.protobuf.Empty);
rpc GetMemorableMoments(GetMemorableMomentsRequest) returns (GetMemorableMomentsResponse);
rpc RecordMoodHistory(RecordMoodHistoryRequest) returns (google.protobuf.Empty);
}
// UserMoodHistoryService provides mood history queries
service UserMoodHistoryService {
rpc GetMoodHistoryByUser(GetMoodHistoryByUserRequest) returns (GetMoodHistoryResponse);
rpc GetMoodHistoryByTimeRange(GetMoodHistoryByTimeRangeRequest) returns (GetMoodHistoryResponse);
rpc GetRecentMoodHistory(GetRecentMoodHistoryRequest) returns (GetMoodHistoryResponse);
rpc GetLastMoodBeforeTime(GetLastMoodBeforeTimeRequest) returns (GetMoodHistoryResponse);
}
// --- Messages ---
message UserStats {
int64 total_messages = 1;
string favorite_topic = 2;
string most_active_day = 3;
string most_active_hour = 4;
string favorite_emoji = 5;
double anger_level = 6;
double humor_level = 7;
double sarcasm_level = 8;
map<string, int64> topic_frequency = 9;
map<string, int64> messages_by_hour = 10;
map<string, int64> messages_by_day = 11;
int64 reaction_count = 12;
int32 bot_attitude = 13;
string bot_attitude_reason = 14;
}
message UserFavorites {
string when_mad = 1;
string when_happy = 2;
string when_ask_help = 3;
string preferred_nick = 4;
}
message AvatarStats {
double strength = 1;
double agility = 2;
double wisdom = 3;
double charisma = 4;
double tilt = 5;
double humor_level = 6;
double sarcasm_lvl = 7;
}
message Skill {
string name = 1;
int32 level = 2;
double power = 3;
bool active = 4;
int64 unlocked_at = 5;
}
message Avatar {
int64 id = 1;
string name = 2;
string class = 3;
int32 level = 4;
int64 experience = 5;
AvatarStats stats = 6;
repeated Skill skills = 7;
google.protobuf.Timestamp created_at = 8;
google.protobuf.Timestamp updated_at = 9;
}
message UserProfile {
int64 id = 1;
int64 global_user_id = 2;
int64 user_id = 3;
string username = 4;
google.protobuf.Timestamp join_date = 5;
google.protobuf.Timestamp updated_at = 6;
Avatar avatar = 7;
UserStats stats = 8;
UserFavorites favorites = 9;
bytes catchphrases = 10;
}
message UserMoodHistory {
int64 id = 1;
int64 user_id = 2;
string username = 3;
int32 mood = 4;
google.protobuf.Timestamp timestamp = 5;
string reason = 6;
}
message MemorableMoment {
int64 id = 1;
int64 user_id = 2;
google.protobuf.Timestamp date = 3;
string text = 4;
string bot_response = 5;
int64 reaction_count = 6;
}
// --- Request/Response messages ---
message GetOrCreateProfileRequest {
int64 user_id = 1;
string username = 2;
}
message GetProfileRequest {
int64 user_id = 1;
}
message GetAllProfilesResponse {
repeated UserProfile profiles = 1;
}
message AddMessageToStatsRequest {
int64 user_id = 1;
string topic = 2;
string hour = 3;
string day = 4;
}
message UpdateReactionCountRequest {
int64 user_id = 1;
int64 increment = 2;
}
message SetBotAttitudeRequest {
int64 user_id = 1;
int32 value = 2;
string reason = 3;
bool is_delta = 4; // if true, value is a delta; if false, value is absolute
}
message SaveMemorableMomentRequest {
int64 user_id = 1;
string text = 2;
string bot_response = 3;
int64 reaction_count = 4;
}
message GetMemorableMomentsRequest {
int64 user_id = 1;
int32 limit = 2;
}
message GetMemorableMomentsResponse {
repeated MemorableMoment moments = 1;
}
message RecordMoodHistoryRequest {
int64 user_id = 1;
string username = 2;
int32 mood = 3;
string reason = 4;
}
message GetMoodHistoryByUserRequest {
int64 user_id = 1;
google.protobuf.Timestamp from = 2;
google.protobuf.Timestamp to = 3;
}
message GetMoodHistoryByTimeRangeRequest {
google.protobuf.Timestamp from = 1;
google.protobuf.Timestamp to = 2;
}
message GetRecentMoodHistoryRequest {
int32 limit = 1;
}
message GetLastMoodBeforeTimeRequest {
google.protobuf.Timestamp before = 1;
}
message GetMoodHistoryResponse {
repeated UserMoodHistory history = 1;
}

651
profiles_grpc.pb.go Normal file
View File

@ -0,0 +1,651 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc v7.34.0
// source: profiles.proto
package proto
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
UserProfileService_GetOrCreateProfile_FullMethodName = "/users.UserProfileService/GetOrCreateProfile"
UserProfileService_GetProfile_FullMethodName = "/users.UserProfileService/GetProfile"
UserProfileService_GetAllProfilesWithMessages_FullMethodName = "/users.UserProfileService/GetAllProfilesWithMessages"
UserProfileService_AddMessageToStats_FullMethodName = "/users.UserProfileService/AddMessageToStats"
UserProfileService_UpdateReactionCount_FullMethodName = "/users.UserProfileService/UpdateReactionCount"
UserProfileService_SetBotAttitude_FullMethodName = "/users.UserProfileService/SetBotAttitude"
UserProfileService_SaveMemorableMoment_FullMethodName = "/users.UserProfileService/SaveMemorableMoment"
UserProfileService_GetMemorableMoments_FullMethodName = "/users.UserProfileService/GetMemorableMoments"
UserProfileService_RecordMoodHistory_FullMethodName = "/users.UserProfileService/RecordMoodHistory"
)
// UserProfileServiceClient is the client API for UserProfileService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// UserProfileService manages Telegram user profiles, avatars, and mood history
type UserProfileServiceClient interface {
GetOrCreateProfile(ctx context.Context, in *GetOrCreateProfileRequest, opts ...grpc.CallOption) (*UserProfile, error)
GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*UserProfile, error)
GetAllProfilesWithMessages(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetAllProfilesResponse, error)
AddMessageToStats(ctx context.Context, in *AddMessageToStatsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
UpdateReactionCount(ctx context.Context, in *UpdateReactionCountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
SetBotAttitude(ctx context.Context, in *SetBotAttitudeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
SaveMemorableMoment(ctx context.Context, in *SaveMemorableMomentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
GetMemorableMoments(ctx context.Context, in *GetMemorableMomentsRequest, opts ...grpc.CallOption) (*GetMemorableMomentsResponse, error)
RecordMoodHistory(ctx context.Context, in *RecordMoodHistoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type userProfileServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUserProfileServiceClient(cc grpc.ClientConnInterface) UserProfileServiceClient {
return &userProfileServiceClient{cc}
}
func (c *userProfileServiceClient) GetOrCreateProfile(ctx context.Context, in *GetOrCreateProfileRequest, opts ...grpc.CallOption) (*UserProfile, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UserProfile)
err := c.cc.Invoke(ctx, UserProfileService_GetOrCreateProfile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*UserProfile, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UserProfile)
err := c.cc.Invoke(ctx, UserProfileService_GetProfile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) GetAllProfilesWithMessages(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetAllProfilesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetAllProfilesResponse)
err := c.cc.Invoke(ctx, UserProfileService_GetAllProfilesWithMessages_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) AddMessageToStats(ctx context.Context, in *AddMessageToStatsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserProfileService_AddMessageToStats_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) UpdateReactionCount(ctx context.Context, in *UpdateReactionCountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserProfileService_UpdateReactionCount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) SetBotAttitude(ctx context.Context, in *SetBotAttitudeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserProfileService_SetBotAttitude_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) SaveMemorableMoment(ctx context.Context, in *SaveMemorableMomentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserProfileService_SaveMemorableMoment_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) GetMemorableMoments(ctx context.Context, in *GetMemorableMomentsRequest, opts ...grpc.CallOption) (*GetMemorableMomentsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMemorableMomentsResponse)
err := c.cc.Invoke(ctx, UserProfileService_GetMemorableMoments_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProfileServiceClient) RecordMoodHistory(ctx context.Context, in *RecordMoodHistoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, UserProfileService_RecordMoodHistory_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserProfileServiceServer is the server API for UserProfileService service.
// All implementations must embed UnimplementedUserProfileServiceServer
// for forward compatibility.
//
// UserProfileService manages Telegram user profiles, avatars, and mood history
type UserProfileServiceServer interface {
GetOrCreateProfile(context.Context, *GetOrCreateProfileRequest) (*UserProfile, error)
GetProfile(context.Context, *GetProfileRequest) (*UserProfile, error)
GetAllProfilesWithMessages(context.Context, *emptypb.Empty) (*GetAllProfilesResponse, error)
AddMessageToStats(context.Context, *AddMessageToStatsRequest) (*emptypb.Empty, error)
UpdateReactionCount(context.Context, *UpdateReactionCountRequest) (*emptypb.Empty, error)
SetBotAttitude(context.Context, *SetBotAttitudeRequest) (*emptypb.Empty, error)
SaveMemorableMoment(context.Context, *SaveMemorableMomentRequest) (*emptypb.Empty, error)
GetMemorableMoments(context.Context, *GetMemorableMomentsRequest) (*GetMemorableMomentsResponse, error)
RecordMoodHistory(context.Context, *RecordMoodHistoryRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedUserProfileServiceServer()
}
// UnimplementedUserProfileServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedUserProfileServiceServer struct{}
func (UnimplementedUserProfileServiceServer) GetOrCreateProfile(context.Context, *GetOrCreateProfileRequest) (*UserProfile, error) {
return nil, status.Error(codes.Unimplemented, "method GetOrCreateProfile not implemented")
}
func (UnimplementedUserProfileServiceServer) GetProfile(context.Context, *GetProfileRequest) (*UserProfile, error) {
return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented")
}
func (UnimplementedUserProfileServiceServer) GetAllProfilesWithMessages(context.Context, *emptypb.Empty) (*GetAllProfilesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetAllProfilesWithMessages not implemented")
}
func (UnimplementedUserProfileServiceServer) AddMessageToStats(context.Context, *AddMessageToStatsRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method AddMessageToStats not implemented")
}
func (UnimplementedUserProfileServiceServer) UpdateReactionCount(context.Context, *UpdateReactionCountRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method UpdateReactionCount not implemented")
}
func (UnimplementedUserProfileServiceServer) SetBotAttitude(context.Context, *SetBotAttitudeRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method SetBotAttitude not implemented")
}
func (UnimplementedUserProfileServiceServer) SaveMemorableMoment(context.Context, *SaveMemorableMomentRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method SaveMemorableMoment not implemented")
}
func (UnimplementedUserProfileServiceServer) GetMemorableMoments(context.Context, *GetMemorableMomentsRequest) (*GetMemorableMomentsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetMemorableMoments not implemented")
}
func (UnimplementedUserProfileServiceServer) RecordMoodHistory(context.Context, *RecordMoodHistoryRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method RecordMoodHistory not implemented")
}
func (UnimplementedUserProfileServiceServer) mustEmbedUnimplementedUserProfileServiceServer() {}
func (UnimplementedUserProfileServiceServer) testEmbeddedByValue() {}
// UnsafeUserProfileServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserProfileServiceServer will
// result in compilation errors.
type UnsafeUserProfileServiceServer interface {
mustEmbedUnimplementedUserProfileServiceServer()
}
func RegisterUserProfileServiceServer(s grpc.ServiceRegistrar, srv UserProfileServiceServer) {
// If the following call panics, it indicates UnimplementedUserProfileServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&UserProfileService_ServiceDesc, srv)
}
func _UserProfileService_GetOrCreateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetOrCreateProfileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).GetOrCreateProfile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_GetOrCreateProfile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).GetOrCreateProfile(ctx, req.(*GetOrCreateProfileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetProfileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).GetProfile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_GetProfile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).GetProfile(ctx, req.(*GetProfileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_GetAllProfilesWithMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).GetAllProfilesWithMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_GetAllProfilesWithMessages_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).GetAllProfilesWithMessages(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_AddMessageToStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddMessageToStatsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).AddMessageToStats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_AddMessageToStats_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).AddMessageToStats(ctx, req.(*AddMessageToStatsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_UpdateReactionCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateReactionCountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).UpdateReactionCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_UpdateReactionCount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).UpdateReactionCount(ctx, req.(*UpdateReactionCountRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_SetBotAttitude_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetBotAttitudeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).SetBotAttitude(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_SetBotAttitude_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).SetBotAttitude(ctx, req.(*SetBotAttitudeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_SaveMemorableMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SaveMemorableMomentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).SaveMemorableMoment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_SaveMemorableMoment_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).SaveMemorableMoment(ctx, req.(*SaveMemorableMomentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_GetMemorableMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMemorableMomentsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).GetMemorableMoments(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_GetMemorableMoments_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).GetMemorableMoments(ctx, req.(*GetMemorableMomentsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProfileService_RecordMoodHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RecordMoodHistoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProfileServiceServer).RecordMoodHistory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProfileService_RecordMoodHistory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProfileServiceServer).RecordMoodHistory(ctx, req.(*RecordMoodHistoryRequest))
}
return interceptor(ctx, in, info, handler)
}
// UserProfileService_ServiceDesc is the grpc.ServiceDesc for UserProfileService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserProfileService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "users.UserProfileService",
HandlerType: (*UserProfileServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetOrCreateProfile",
Handler: _UserProfileService_GetOrCreateProfile_Handler,
},
{
MethodName: "GetProfile",
Handler: _UserProfileService_GetProfile_Handler,
},
{
MethodName: "GetAllProfilesWithMessages",
Handler: _UserProfileService_GetAllProfilesWithMessages_Handler,
},
{
MethodName: "AddMessageToStats",
Handler: _UserProfileService_AddMessageToStats_Handler,
},
{
MethodName: "UpdateReactionCount",
Handler: _UserProfileService_UpdateReactionCount_Handler,
},
{
MethodName: "SetBotAttitude",
Handler: _UserProfileService_SetBotAttitude_Handler,
},
{
MethodName: "SaveMemorableMoment",
Handler: _UserProfileService_SaveMemorableMoment_Handler,
},
{
MethodName: "GetMemorableMoments",
Handler: _UserProfileService_GetMemorableMoments_Handler,
},
{
MethodName: "RecordMoodHistory",
Handler: _UserProfileService_RecordMoodHistory_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "profiles.proto",
}
const (
UserMoodHistoryService_GetMoodHistoryByUser_FullMethodName = "/users.UserMoodHistoryService/GetMoodHistoryByUser"
UserMoodHistoryService_GetMoodHistoryByTimeRange_FullMethodName = "/users.UserMoodHistoryService/GetMoodHistoryByTimeRange"
UserMoodHistoryService_GetRecentMoodHistory_FullMethodName = "/users.UserMoodHistoryService/GetRecentMoodHistory"
UserMoodHistoryService_GetLastMoodBeforeTime_FullMethodName = "/users.UserMoodHistoryService/GetLastMoodBeforeTime"
)
// UserMoodHistoryServiceClient is the client API for UserMoodHistoryService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// UserMoodHistoryService provides mood history queries
type UserMoodHistoryServiceClient interface {
GetMoodHistoryByUser(ctx context.Context, in *GetMoodHistoryByUserRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error)
GetMoodHistoryByTimeRange(ctx context.Context, in *GetMoodHistoryByTimeRangeRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error)
GetRecentMoodHistory(ctx context.Context, in *GetRecentMoodHistoryRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error)
GetLastMoodBeforeTime(ctx context.Context, in *GetLastMoodBeforeTimeRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error)
}
type userMoodHistoryServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUserMoodHistoryServiceClient(cc grpc.ClientConnInterface) UserMoodHistoryServiceClient {
return &userMoodHistoryServiceClient{cc}
}
func (c *userMoodHistoryServiceClient) GetMoodHistoryByUser(ctx context.Context, in *GetMoodHistoryByUserRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMoodHistoryResponse)
err := c.cc.Invoke(ctx, UserMoodHistoryService_GetMoodHistoryByUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMoodHistoryServiceClient) GetMoodHistoryByTimeRange(ctx context.Context, in *GetMoodHistoryByTimeRangeRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMoodHistoryResponse)
err := c.cc.Invoke(ctx, UserMoodHistoryService_GetMoodHistoryByTimeRange_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMoodHistoryServiceClient) GetRecentMoodHistory(ctx context.Context, in *GetRecentMoodHistoryRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMoodHistoryResponse)
err := c.cc.Invoke(ctx, UserMoodHistoryService_GetRecentMoodHistory_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userMoodHistoryServiceClient) GetLastMoodBeforeTime(ctx context.Context, in *GetLastMoodBeforeTimeRequest, opts ...grpc.CallOption) (*GetMoodHistoryResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMoodHistoryResponse)
err := c.cc.Invoke(ctx, UserMoodHistoryService_GetLastMoodBeforeTime_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserMoodHistoryServiceServer is the server API for UserMoodHistoryService service.
// All implementations must embed UnimplementedUserMoodHistoryServiceServer
// for forward compatibility.
//
// UserMoodHistoryService provides mood history queries
type UserMoodHistoryServiceServer interface {
GetMoodHistoryByUser(context.Context, *GetMoodHistoryByUserRequest) (*GetMoodHistoryResponse, error)
GetMoodHistoryByTimeRange(context.Context, *GetMoodHistoryByTimeRangeRequest) (*GetMoodHistoryResponse, error)
GetRecentMoodHistory(context.Context, *GetRecentMoodHistoryRequest) (*GetMoodHistoryResponse, error)
GetLastMoodBeforeTime(context.Context, *GetLastMoodBeforeTimeRequest) (*GetMoodHistoryResponse, error)
mustEmbedUnimplementedUserMoodHistoryServiceServer()
}
// UnimplementedUserMoodHistoryServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedUserMoodHistoryServiceServer struct{}
func (UnimplementedUserMoodHistoryServiceServer) GetMoodHistoryByUser(context.Context, *GetMoodHistoryByUserRequest) (*GetMoodHistoryResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetMoodHistoryByUser not implemented")
}
func (UnimplementedUserMoodHistoryServiceServer) GetMoodHistoryByTimeRange(context.Context, *GetMoodHistoryByTimeRangeRequest) (*GetMoodHistoryResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetMoodHistoryByTimeRange not implemented")
}
func (UnimplementedUserMoodHistoryServiceServer) GetRecentMoodHistory(context.Context, *GetRecentMoodHistoryRequest) (*GetMoodHistoryResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetRecentMoodHistory not implemented")
}
func (UnimplementedUserMoodHistoryServiceServer) GetLastMoodBeforeTime(context.Context, *GetLastMoodBeforeTimeRequest) (*GetMoodHistoryResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetLastMoodBeforeTime not implemented")
}
func (UnimplementedUserMoodHistoryServiceServer) mustEmbedUnimplementedUserMoodHistoryServiceServer() {
}
func (UnimplementedUserMoodHistoryServiceServer) testEmbeddedByValue() {}
// UnsafeUserMoodHistoryServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserMoodHistoryServiceServer will
// result in compilation errors.
type UnsafeUserMoodHistoryServiceServer interface {
mustEmbedUnimplementedUserMoodHistoryServiceServer()
}
func RegisterUserMoodHistoryServiceServer(s grpc.ServiceRegistrar, srv UserMoodHistoryServiceServer) {
// If the following call panics, it indicates UnimplementedUserMoodHistoryServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&UserMoodHistoryService_ServiceDesc, srv)
}
func _UserMoodHistoryService_GetMoodHistoryByUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMoodHistoryByUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMoodHistoryServiceServer).GetMoodHistoryByUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMoodHistoryService_GetMoodHistoryByUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMoodHistoryServiceServer).GetMoodHistoryByUser(ctx, req.(*GetMoodHistoryByUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMoodHistoryService_GetMoodHistoryByTimeRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMoodHistoryByTimeRangeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMoodHistoryServiceServer).GetMoodHistoryByTimeRange(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMoodHistoryService_GetMoodHistoryByTimeRange_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMoodHistoryServiceServer).GetMoodHistoryByTimeRange(ctx, req.(*GetMoodHistoryByTimeRangeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMoodHistoryService_GetRecentMoodHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRecentMoodHistoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMoodHistoryServiceServer).GetRecentMoodHistory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMoodHistoryService_GetRecentMoodHistory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMoodHistoryServiceServer).GetRecentMoodHistory(ctx, req.(*GetRecentMoodHistoryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserMoodHistoryService_GetLastMoodBeforeTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetLastMoodBeforeTimeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserMoodHistoryServiceServer).GetLastMoodBeforeTime(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserMoodHistoryService_GetLastMoodBeforeTime_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserMoodHistoryServiceServer).GetLastMoodBeforeTime(ctx, req.(*GetLastMoodBeforeTimeRequest))
}
return interceptor(ctx, in, info, handler)
}
// UserMoodHistoryService_ServiceDesc is the grpc.ServiceDesc for UserMoodHistoryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserMoodHistoryService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "users.UserMoodHistoryService",
HandlerType: (*UserMoodHistoryServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetMoodHistoryByUser",
Handler: _UserMoodHistoryService_GetMoodHistoryByUser_Handler,
},
{
MethodName: "GetMoodHistoryByTimeRange",
Handler: _UserMoodHistoryService_GetMoodHistoryByTimeRange_Handler,
},
{
MethodName: "GetRecentMoodHistory",
Handler: _UserMoodHistoryService_GetRecentMoodHistory_Handler,
},
{
MethodName: "GetLastMoodBeforeTime",
Handler: _UserMoodHistoryService_GetLastMoodBeforeTime_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "profiles.proto",
}