feat(orders): 号主可从自己的列表隐藏已结束订单
只写入隐藏时间,订单和款项仍保留给租客与后台。详情按钮固定对齐,删除跟在后面。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user