Compare commits

..
3 Commits
Author SHA1 Message Date
maguodong 6f685ea087 Merge remote-tracking branch 'github.com/black1552/main' 2025-11-12 10:08:55 +08:00
maguodong b038c64873 refactor(common): 替换JSON处理库为gjson
- 使用gjson替代标准库encoding/json- 更新Unmarshal调用为gjson.Unmarshal
- 更新Marshal调用为gjson.Marshal- 移除未使用的json导入声明
2025-11-12 10:08:36 +08:00
gaoda 8eeee5cbe1 fix(merchant): 更新电子合同查询状态请求字段
- 将 OrgID 字段重命名为 OrgCode以匹配拉卡拉机构号定义- 保持 EcApplyID 字段定义不变
- 调整结构体字段注释格式以提高可读性
2025-11-10 09:52:15 +08:00
2 changed files with 7 additions and 6 deletions
+4 -3
View File
@@ -1,8 +1,9 @@
package common
import (
"encoding/json"
"reflect"
"github.com/gogf/gf/v2/encoding/gjson"
)
// CleanJSON 清理JSON字符串中的空值和0值字段
@@ -10,7 +11,7 @@ func CleanJSON(jsonStr string) ([]byte, error) {
var data interface{}
// 解析JSON字符串
if err := json.Unmarshal([]byte(jsonStr), &data); err != nil {
if err := gjson.Unmarshal([]byte(jsonStr), &data); err != nil {
return nil, err
}
@@ -18,7 +19,7 @@ func CleanJSON(jsonStr string) ([]byte, error) {
cleaned := cleanData(data)
// 转换回JSON字符串
result, err := json.Marshal(cleaned)
result, err := gjson.Marshal(cleaned)
if err != nil {
return nil, err
}
@@ -7,8 +7,8 @@ package querystatus
// 生产环境:https://s2.lakala.com/api/v3/mms/open_api/ec/q_status
type ECQueryStatusRequestData struct {
OrderNo string `json:"order_no" dc:"四方机构自定义订单编号 必选,建议:平台编号+14位年月日时(24小时制)分秒+8位的随机数(同一接入机构不重复)"` // 必选,建议:平台编号+14位年月日时(24小时制)分秒+8位的随机数(同一接入机构不重复)
OrgID int `json:"org_id" dc:"机构号 必选,签约方所属拉卡拉机构"` // 必选,签约方所属拉卡拉机构
EcApplyID int64 `json:"ec_apply_id" dc:"电子合同申请受理号 必选,申请接口反馈编号"` // 必选,申请接口反馈编号
OrgCode int `json:"org_code" dc:"机构号 必选,签约方所属拉卡拉机构"` // 必选,签约方所属拉卡拉机构
EcApplyID int64 `json:"ec_apply_id" dc:"电子合同申请受理号 必选,申请接口反馈编号"` // 必选,申请接口反馈编号
}
// ECQueryStatusRequest 电子合同查询状态请求