feat(listing): 编辑已发布账号需先下架, 编号保持不变
Update 增加前置校验, 仅 draft/offline 状态可编辑, published 必须 先主动下架; 编辑后由 initialPublishState 推进到待审核, 审核通过 才重新展示. ListingNo 仅在 Create 时生成, 全程同行更新不变
This commit is contained in:
@@ -211,6 +211,10 @@ func (r *Repository) Update(ctx context.Context, ownerID uint64, listingID uint6
|
||||
if listingLockedForOwnerMutation(listing) {
|
||||
return ErrListingLocked
|
||||
}
|
||||
// 仅允许草稿/已下架状态编辑;已上架的必须先主动下架,避免在线编辑影响正在出租的账号
|
||||
if listing.Status != "draft" && listing.Status != "offline" {
|
||||
return ErrListingMustOfflineToEdit
|
||||
}
|
||||
|
||||
account.Title = req.Title
|
||||
account.Description = req.Description
|
||||
|
||||
Reference in New Issue
Block a user