diff --git a/JOBot.Backend/DAL/Models/User.cs b/JOBot.Backend/DAL/Models/User.cs index 429a47c..7d8e786 100644 --- a/JOBot.Backend/DAL/Models/User.cs +++ b/JOBot.Backend/DAL/Models/User.cs @@ -13,4 +13,6 @@ public class User [MaxLength(50)] public string? Username { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; + + public string? HeadHunterResumeUrl { get; set; } } \ No newline at end of file diff --git a/JOBot.Backend/Services/gRPC/UserService.cs b/JOBot.Backend/Services/gRPC/UserService.cs index 369ff25..b2b18e4 100644 --- a/JOBot.Backend/Services/gRPC/UserService.cs +++ b/JOBot.Backend/Services/gRPC/UserService.cs @@ -33,4 +33,11 @@ public class UserService(AppDbContext dbContext) : User.UserBase Success = false }); } + + public override Task GetUser( + GetUserRequest request, + ServerCallContext context) + { + return null; + } } \ No newline at end of file diff --git a/JOBot.TClient/Commands/StartCommand.cs b/JOBot.TClient/Commands/StartCommand.cs index f528be1..9d59b07 100644 --- a/JOBot.TClient/Commands/StartCommand.cs +++ b/JOBot.TClient/Commands/StartCommand.cs @@ -6,13 +6,17 @@ namespace JOBot.TClient.Commands; public class StartCommand(ITelegramBotClient bot, UserService userService) : ITelegramCommand { + private const string ReturnMessage = "Привет! Я JOBot, помощник по поиску работы в IT."; public async Task ExecuteAsync(Update update, CancellationToken ct) { - var isRegistered = await userService.RegisterAsync( - update.Message?.Chat.Id ?? throw new Exception("Chat id is null"), + await userService.RegisterAsync( + update.Message!.Chat.Id, update.Message.Chat.Username); await bot.SendMessage(chatId: update.Message.Chat.Id, - isRegistered ? "You registered" : "Not registered", cancellationToken: ct); + "Продолжая, вы принимаете политику конфиденциальности и правила сервиса" + + "\nhttps://hh.ru/article/personal_data?backurl=%2F&role=applicant" + + "\nhttps://hh.ru/account/agreement?backurl=%2Faccount%2Fsignup%3Fbackurl%3D%252F%26role%3Dapplicant&role=applicant", + cancellationToken: ct); } } \ No newline at end of file diff --git a/JOBot.TClient/JOBot.TClient.csproj b/JOBot.TClient/JOBot.TClient.csproj index 0beb30a..f6feafd 100644 --- a/JOBot.TClient/JOBot.TClient.csproj +++ b/JOBot.TClient/JOBot.TClient.csproj @@ -26,10 +26,7 @@ - - Always - - + Always diff --git a/JOBot.TClient/appsettings.Development.json b/JOBot.TClient/appsettings.Development.json deleted file mode 100644 index 2377161..0000000 --- a/JOBot.TClient/appsettings.Development.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "TelegramToken": "7372524570:AAGLW5dXhW5Jd78i9Zguyga-5gfeSF9KU4I", - "BackendHost": "http://localhost:5001" -} \ No newline at end of file diff --git a/JOBot.TClient/appsettings.Example.json b/JOBot.TClient/appsettings.Example.json new file mode 100644 index 0000000..a32bbce --- /dev/null +++ b/JOBot.TClient/appsettings.Example.json @@ -0,0 +1,4 @@ +{ + "TelegramToken": "TOKEN:HERE", + "BackendHost": "http://localhost:5001" +} \ No newline at end of file diff --git a/JOBot.TClient/appsettings.json b/JOBot.TClient/appsettings.json deleted file mode 100644 index 083047e..0000000 --- a/JOBot.TClient/appsettings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "TelegramToken": "7372524570:AAGLW5dXhW5Jd78i9Zguyga-5gfeSF9KU4I", - "BackendHost": "http://localhost:5001" -} \ No newline at end of file diff --git a/Proto/user.proto b/Proto/user.proto index 815c5c1..600e9ec 100644 --- a/Proto/user.proto +++ b/Proto/user.proto @@ -3,6 +3,7 @@ option csharp_namespace = "JOBot.Proto"; service User { rpc Register (RegisterRequest) returns (RegisterResponse); + rpc GetUser (GetUserRequest) returns (GetUserResponse); } import "google/protobuf/wrappers.proto"; @@ -14,4 +15,12 @@ message RegisterRequest{ message RegisterResponse{ bool success = 1; +} + +message GetUserRequest { + int64 user_id = 1; +} + +message GetUserResponse { + bool logged_to_hh = 1; } \ No newline at end of file