From af3d49c3d397092e1219d0bb2ff628893b683613 Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Wed, 13 Dec 2023 01:15:24 +0000 Subject: [PATCH] upd: designed database --- backend/include/bs-utility.h | 21 +++++++++++++++++++++ backend/include/database.h | 13 +++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/backend/include/bs-utility.h b/backend/include/bs-utility.h index f42ef35..6598136 100644 --- a/backend/include/bs-utility.h +++ b/backend/include/bs-utility.h @@ -119,4 +119,25 @@ class UserItemClass { char user_id[31], password[31], user_name[31]; unsigned char privilege; }; + +class BookItemClass { + public: + char ISBN[21], name[61], author[61], keyword[61]; + double price; + int quantity_remain; +}; + +class FinanceItemClass { + public: + int book_id; + int quantity; + double total_price; +}; + +class OperationLogItemClass { + public: + char user_id[31]; + char command[256]; + int fid; +}; #endif // PROTECTOR_UTILITY_H \ No newline at end of file diff --git a/backend/include/database.h b/backend/include/database.h index 3253c1d..e1ca2aa 100644 --- a/backend/include/database.h +++ b/backend/include/database.h @@ -17,12 +17,13 @@ class UserDataBase { bool PAM(const std::string &user_id, const std::string &password); }; class BookDataBase { - ; + DriveArray full_book_data; + String2Index indexer; + String2Index keyword2index; }; -class FinanceDataBase { - ; -}; -class OperationLogDataBase { - ; +class LogDataBase { + DriveArray finance_data; + DriveArray operation_log_data; }; + #endif // PROTECTOR_DATABASE_HPP \ No newline at end of file