feat(orders): 号主可从自己的列表隐藏已结束订单

只写入隐藏时间,订单和款项仍保留给租客与后台。详情按钮固定对齐,删除跟在后面。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-10-01 16:22:55 +08:00
co-authored by Cursor
parent a1008f7e6a
commit e5cd7b5c34
15 changed files with 499 additions and 15 deletions
@@ -104,6 +104,23 @@ func (h *Handler) Cancel(c *gin.Context) {
response.OK(c, gin.H{"cancelled": true})
}
func (h *Handler) HideForOwner(c *gin.Context) {
userID, ok := currentUserID(c)
if !ok {
response.Unauthorized(c, "缺少用户上下文")
return
}
id, ok := parseID(c)
if !ok {
return
}
if err := h.service.HideForOwner(c.Request.Context(), userID, id); err != nil {
writeOrderError(c, err)
return
}
response.OK(c, gin.H{"hidden": true})
}
func (h *Handler) Pay(c *gin.Context) {
userID, ok := currentUserID(c)
if !ok {