项目结构
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/920d0b8750434bfabf86b21b5dd75065.png)
前台界面
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>即时通信板</title>
<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.css" rel="stylesheet">
<style>
body {
background: linear-gradient(to right, #a8edea, #fed6e3);
color: #ffffff;
font-family: Arial, sans-serif;
}
.container {
background: rgba(255, 255, 255, 0.2);
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
#messages {
height: 400px;
overflow-y: auto;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 10px;
background-color: rgba(255, 255, 255, 0.1);
color: #000;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.message {
padding: 5px;
margin-bottom: 5px;
border-radius: 5px;
}
.message-sent {
background-color: #e9f7eb;
color: #28a745;
text-align: right;
}
.message-received {
background-color: #cce5ff;
color: #007bff;
text-align: left;
}
#messageInput {
border-color: #ced4da;
border-radius: 5px;
color: #000;
}
#messageInput:focus {
border-color: #80bdff;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.btn-send {
border-radius: 5px;
}
.input-group-text {
color: #007bff;
background-color: rgba(255, 255, 255, 0.2);
border-color: #ced4da;
border-radius: 5px;
}
.input-group-text::after {
color: #ffffff;
}
</style>
</head>
<body>
<div class="container mt-5">
<div><h3>即时通信板</h3></div>
<div id="messages" class