This commit is contained in:
2025-12-09 18:55:28 +08:00
parent 8d00d67540
commit c23ab8338b
209 changed files with 5445 additions and 3963 deletions

View File

@@ -8,6 +8,7 @@ import (
"ycc-server/app/main/model"
"ycc-server/common/xerr"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -58,6 +59,7 @@ func (l *AdminCreateApiLogic) AdminCreateApi(req *types.AdminCreateApiReq) (resp
// 3. 创建API记录
apiData := &model.AdminApi{
Id: uuid.NewString(),
ApiName: req.ApiName,
ApiCode: req.ApiCode,
Method: req.Method,
@@ -71,8 +73,7 @@ func (l *AdminCreateApiLogic) AdminCreateApi(req *types.AdminCreateApiReq) (resp
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR),
"创建API失败, err: %v", err)
}
// 4. 返回结果
apiId, _ := result.LastInsertId()
return &types.AdminCreateApiResp{Id: apiId}, nil
_ = result
return &types.AdminCreateApiResp{Id: apiData.Id}, nil
}