This commit is contained in:
vipg
2025-11-17 18:11:57 +08:00
parent af33b34237
commit 53c4450d58

View File

@@ -12,9 +12,9 @@ import (
// UpdateRequest 更新请求参数结构
type UpdateRequest struct {
CountryID string `json:"currency_id" binding:"required"` // 国家ID必填
Name string `json:"name"` // 国家名称,可选
Code string `json:"code"` // 国家代码,可选
CountryID string `json:"currency_id" binding:"required"` // 货币ID必填
Name string `json:"name"` // 货币名称,可选
Code string `json:"code"` // 货币代码,可选
}
// UpdateResponse 更新响应结构
@@ -23,7 +23,7 @@ type UpdateResponse struct {
Message string `json:"message"` // 提示信息
}
// UpdateHandler 处理国家信息更新逻辑
// UpdateHandler 处理货币信息更新逻辑
func UpdateHandler(c *gin.Context) {
startTime := time.Now()
// 获取或生成请求ID
@@ -34,7 +34,7 @@ func UpdateHandler(c *gin.Context) {
}
// 记录请求接收日志
zap.L().Info("📥 收到国家更新请求",
zap.L().Info("📥 收到货币更新请求",
zap.String("req_id", reqID),
zap.String("path", c.Request.URL.Path),
zap.String("method", c.Request.Method),
@@ -170,7 +170,7 @@ func UpdateHandler(c *gin.Context) {
// 记录请求处理耗时
duration := time.Since(startTime)
zap.L().Info("✅ 国家更新请求处理完成",
zap.L().Info("✅ 货币更新请求处理完成",
zap.String("req_id", reqID),
zap.String("currency_id", req.CountryID),
zap.Duration("duration", duration),