From 78a4473b4ceaef157c3e232765cc6b05d09c2db4 Mon Sep 17 00:00:00 2001 From: Victor-692 <3612332801@qq.com> Date: Sun, 6 Sep 2026 21:57:48 +0800 Subject: [PATCH 1/2] hw-HMTL&CSS --- .gitignore | 2 ++ frontend/public/about-me.html | 61 ++++++++++++++++++++++++++++++++++ frontend/public/index.css | 62 +++++++++++++++++++++++++++++++++++ frontend/public/index.html | 2 ++ 4 files changed, 127 insertions(+) create mode 100644 frontend/public/about-me.html diff --git a/.gitignore b/.gitignore index 5d8e194..5fd955a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ build electron .local.env + +.vs/ diff --git a/frontend/public/about-me.html b/frontend/public/about-me.html new file mode 100644 index 0000000..81b3fca --- /dev/null +++ b/frontend/public/about-me.html @@ -0,0 +1,61 @@ + + + + + + 关于我 + + + +
+
+
+

关于我

+
+ +
+
+

基本信息

+ + + + + + + + + +
姓名赵奕然
班级无56
+ +
+ +

我的爱好

+
    +
  • 弹琴
  • +
  • 打游戏
  • +
  • 视频
  • +
+
+ +
+

一些趣事

+
    +
  1. 你被骗了
  2. +
+
永不放弃你
+ +
+ +

联系方式

+

+ 邮箱: + zhaoyr25@mails.tsinghua.edu.cn +

+

+ 返回首页 +

+
+
+
+ + diff --git a/frontend/public/index.css b/frontend/public/index.css index b73a3c3..683e77a 100644 --- a/frontend/public/index.css +++ b/frontend/public/index.css @@ -62,3 +62,65 @@ .styled-list li { line-height: 2em; } + +/* ===== 关于我页面 ===== */ +#about-me-frame { + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 16px; + padding: 32px 16px; + box-sizing: border-box; + background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); +} + +.about-me-card { + background-color: rgba(255, 255, 255, 0.35); +} + +#about-me-header { + width: min(640px, 92vw); + text-align: center; +} + +#about-me-avatar { + width: 88px; + height: 88px; + margin: 0 auto; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + font-size: 40px; + color: #ffffff; + background: linear-gradient(135deg, #6a82fb 0%, #fc5c7d 100%); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); +} + +.about-me-subtitle { + color: rgba(0, 0, 0, 0.65); +} + +#about-me-grid { + width: min(920px, 94vw); + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 16px; +} + +.about-me-col { + flex: 1 1 320px; + max-width: 460px; +} + +.about-me-quote { + margin: 12px 0; + padding: 8px 16px; + border-left: 4px solid #6a82fb; + border-radius: 4px; + background-color: rgba(255, 255, 255, 0.35); + color: rgba(0, 0, 0, 0.75); +} diff --git a/frontend/public/index.html b/frontend/public/index.html index 41ea6e5..60805e8 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -24,6 +24,8 @@

这是一个趣味会议软件

进入主页      关于这个工程 +      + 关于我 From a42069bb2c9bec192e4b2435c3a6779720dc1165 Mon Sep 17 00:00:00 2001 From: Victor-692 <3612332801@qq.com> Date: Sun, 6 Sep 2026 23:18:19 +0800 Subject: [PATCH 2/2] hw-database --- database/graphql/homework_reply.graphql | 74 +++++++++++++++++++++++++ database/sql/homework_reply.sql | 14 +++++ database/sql/message.sql | 1 + 3 files changed, 89 insertions(+) create mode 100644 database/graphql/homework_reply.graphql create mode 100644 database/sql/homework_reply.sql diff --git a/database/graphql/homework_reply.graphql b/database/graphql/homework_reply.graphql new file mode 100644 index 0000000..8ebe315 --- /dev/null +++ b/database/graphql/homework_reply.graphql @@ -0,0 +1,74 @@ +# 作业三:聊天室消息的单层回复 + +# 1. 发一条回复消息:reply_to 指向被回复的消息 +mutation replyMessage( + $user_uuid: uuid!, + $room_uuid: uuid!, + $content: String!, + $reply_to: uuid! +) { + insert_message_one(object: { + user_uuid: $user_uuid, + room_uuid: $room_uuid, + content: $content, + reply_to: $reply_to + }) { + uuid + content + # 自引用外键的对象关系名:Hasura 中为目标表名 message + message { + uuid + content + } + } +} + +# 2. 查询某个会议的消息,并带出每条消息回复的目标(单层) +query messagesWithReply($room_uuid: uuid!) { + message( + where: { room_uuid: { _eq: $room_uuid } }, + order_by: { created_at: asc } + ) { + uuid + content + created_at + user { + username + } + # 回复目标(通过 message.reply_to 外键的对象关系) + message { + uuid + content + user { + username + } + } + } +} + +# 3. 查询某条消息收到了哪些回复 +query messageReplies($uuid: uuid!) { + message(where: { reply_to: { _eq: $uuid } }) { + uuid + content + user { + username + } + message { + uuid + content + } + } +} + +# 4. 订阅某个会议的新消息(含回复关系),方便聊天室实时更新 +subscription messagesByRoomWithReply($room_uuid: uuid!) { + message(where: { room_uuid: { _eq: $room_uuid } }) { + uuid + content + message { + uuid + content + } + } +} diff --git a/database/sql/homework_reply.sql b/database/sql/homework_reply.sql new file mode 100644 index 0000000..c94ee8d --- /dev/null +++ b/database/sql/homework_reply.sql @@ -0,0 +1,14 @@ +-- 作业三:聊天室消息支持回复之前的某条消息(单层回复) +-- 设计:给 message 增加可空的 reply_to 列,自引用 message.uuid。 +-- 被回复的消息删除时 reply_to 置空,避免出现悬空引用。 + +alter table public.message + add column if not exists reply_to uuid; + +alter table public.message + drop constraint if exists message_reply_to_fkey; + +alter table public.message + add constraint message_reply_to_fkey + foreign key (reply_to) references public.message (uuid) + on delete set null; diff --git a/database/sql/message.sql b/database/sql/message.sql index 51c8108..2639f9b 100644 --- a/database/sql/message.sql +++ b/database/sql/message.sql @@ -42,3 +42,4 @@ insert into public.message (user_uuid, room_uuid, content) values ('00000000-0000-0000-0000-000000000004', '00000000-0000-0000-0000-100000000003', '好了,今天就到这里吧'); update public.message set created_at = '2021-01-01 00:00:00' where room_uuid = '00000000-0000-0000-0000-100000000002'; +-- 信息由AI生成 \ No newline at end of file