Add change books

This commit is contained in:
2025-02-08 23:39:37 +03:00
parent be6d0ce68f
commit 49b31ae5d4
7 changed files with 205 additions and 6 deletions
+1
View File
@@ -35,3 +35,4 @@ out/
### VS Code ###
.vscode/
.aider*
+195
View File
@@ -1037,3 +1037,198 @@ create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
@@ -10,4 +10,6 @@ public interface BookEditingService {
void updateBookTitle(BotUser user, String newTitle);
void updateBookAuthor(BotUser user, String newAuthor);
void updateBookRating(BotUser user, String newRating);
void handleRestartMessage(BotUser botUser);
}
@@ -10,7 +10,5 @@ public interface BookManageService {
void handleStartMessage(BotUser botUser) throws ServiceException;
void handleRestartMessage(BotUser botUser);
void processBookQuery(BotUser user, String text);
}
@@ -3,10 +3,12 @@ package ru.cathub.telegabot.service.impl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import ru.cathub.telegabot.model.Book;
import ru.cathub.telegabot.model.BookCreationCache;
import ru.cathub.telegabot.repository.BookRepository;
import ru.cathub.telegabot.model.BotUser;
import ru.cathub.telegabot.service.BookCacheService;
import ru.cathub.telegabot.service.BookCreationService;
import ru.cathub.telegabot.service.BookManageService;
import ru.cathub.telegabot.service.TelegramClientService;
import static ru.cathub.telegabot.utils.Constants.ADD_BOOK;
@@ -3,8 +3,10 @@ package ru.cathub.telegabot.service.impl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import ru.cathub.telegabot.model.Book;
import ru.cathub.telegabot.model.BookEditStateCache;
import ru.cathub.telegabot.model.BookListCache;
import ru.cathub.telegabot.repository.BookRepository;
import static ru.cathub.telegabot.bot.KeyboardHelper.getBookListKeyboard;
@@ -16,10 +18,12 @@ import ru.cathub.telegabot.service.TelegramClientService;
@Service
@RequiredArgsConstructor
@Slf4j
public class BookListingServiceImpl implements BookListingService {
private final BookCacheService bookCacheService;
private final TelegramClientService telegramClientService;
private final BookRepository bookRepository;
private static final String FULL_STAR = ""; // Эмодзи U+2B50
private static final String EMPTY_STAR = ""; // Символ U+2606
@@ -6,6 +6,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import ru.cathub.telegabot.bot.KeyboardHelper;
import ru.cathub.telegabot.model.BookEditStateCache;
import ru.cathub.telegabot.model.BookCreationCache;
import ru.cathub.telegabot.model.*;
@@ -122,10 +123,6 @@ public class BookManageServiceImpl implements BookManageService {
telegramClientService.sendMessageWithMarkdown(botUser, getWelcomeMessage(), KeyboardHelper.getBookMenuKeyboard());
}
@Override
public void handleRestartMessage(BotUser botUser) {
telegramClientService.sendMessageWithMarkdown(botUser, "Выберите действие \uD83D\uDCCB", KeyboardHelper.getBookMenuKeyboard());
}
@Override
public void processBookQuery(BotUser user, String text) {