You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.lostfound.model.Item" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>我的发布</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<h2>我的发布</h2>
<%
String msg = request.getParameter("msg");
if (msg != null) out.println("<p style='color:green;'>✅ " + msg + "</p>");
%>
<p><a href="post">+ 发布新信息</a></p>
<%
List<Item> items = (List<Item>) request.getAttribute("items");
if (items != null && !items.isEmpty()) {
for (Item item : items) {
%>
<div class="item-card">
<p><strong><%= item.getType().equals("lost") ? "【我丢的】" : "【我捡的】" %></strong> <%= item.getCategory() %></p>
<p>描述:<%= item.getDescription() %></p>
<p>状态:<%= item.isMatched() ? "✅ 已认领" : "⏳ 未匹配" %></p>
</div>
<%
}
} else {
out.println("<p>您还没有发布任何信息。</p>");
}
%>
</div>
</body>
</html>