feat(rock): 未扫码绑定的使用中链接可释放回库存
历史残留绑定不再占住提货链接,退款后可以把还没扫上的库存分给下一单。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -123,3 +123,17 @@ func (h *RockHandler) ResetToken(c *gin.Context) {
|
||||
}
|
||||
response.OK(c, gin.H{"message": "重置成功,Token 已重新释放至可用库存"})
|
||||
}
|
||||
|
||||
// ReleaseToken 把尚未扫码绑定的使用中链接释放回可用库存
|
||||
func (h *RockHandler) ReleaseToken(c *gin.Context) {
|
||||
idUint, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
if err != nil {
|
||||
response.BadRequest(c, "无效的 Token ID")
|
||||
return
|
||||
}
|
||||
if err := h.rockSvc.ReleaseUnboundUsingToken(c.Request.Context(), uint(idUint)); err != nil {
|
||||
response.BadRequest(c, err.Error())
|
||||
return
|
||||
}
|
||||
response.OK(c, gin.H{"message": "已释放回可用库存,该提货链接可以再次分配"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user