feat: 删除已停用的同步店铺 (#197)

This commit is contained in:
chengma
2026-08-13 08:48:02 +08:00
parent 7cdfc6de99
commit 761058efc1
9 changed files with 120 additions and 3 deletions
+13
View File
@@ -60,6 +60,19 @@ func (h *Handler) SybAllowedShopStatus(c *gin.Context) {
redirectSybShops(c, message, "")
}
func (h *Handler) SybAllowedShopDelete(c *gin.Context) {
err := service.DeleteDisabledSybAllowedShop(h.db, currentUser(c), c.PostForm("shop_id"))
if err != nil {
if service.IsValidationError(err) {
redirectSybShops(c, "", err.Error())
return
}
fail(c, http.StatusInternalServerError, "删除同步店铺失败,已有配置和历史货运单没有被改动。")
return
}
redirectSybShops(c, "已删除停用店铺;历史货运单和同步记录保持不变", "")
}
func redirectSybShops(c *gin.Context, message, errorMessage string) {
values := url.Values{}
if message != "" {