fix Category

add flxg5b2e
add flxg8a3f
add ivyz1c9d
add ivyz4e8b
add ivyz7f2a
This commit is contained in:
2025-08-02 22:27:59 +08:00
parent 14c3a23752
commit 7b433e703a
9 changed files with 310 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"log"
"net/http"
"strconv"
"time"
@@ -101,6 +102,7 @@ func (w *WestDexService) CallAPI(code string, reqData map[string]interface{}) (r
// 手动调用 json.Unmarshal 触发自定义的 UnmarshalJSON 方法
var westDexResp WestResp
log.Println("westDexResp.ID", westDexResp.ID)
UnmarshalErr := json.Unmarshal(bodyBytes, &westDexResp)
if UnmarshalErr != nil {
return nil, UnmarshalErr

View File

@@ -190,7 +190,9 @@ func (h *ProductAdminHandler) CreateCategory(c *gin.Context) {
// @Router /api/v1/admin/product-categories/{id} [put]
func (h *ProductAdminHandler) UpdateCategory(c *gin.Context) {
var cmd commands.UpdateCategoryCommand
if err := h.validator.ValidateParam(c, &cmd); err != nil {
cmd.ID = c.Param("id")
if cmd.ID == "" {
h.responseBuilder.BadRequest(c, "分类ID不能为空")
return
}
if err := h.validator.BindAndValidate(c, &cmd); err != nil {