重构账户与商户服务模块
- 移除旧版 account.go 文件中的账户服务实现 - 新增聚合扫码关单、退款、撤销等接口实现 - 新增聚合被扫、主扫及加密接口实现 - 新增交易查询与支付宝吱口令申请接口 - 重构统一退货及退货查询接口,优化泛型使用 - 移除旧版商户进件相关接口实现 - 调整部分服务结构体命名与参数传递方式 - 统一请求时间格式并优化代码结构
This commit is contained in:
@@ -6,29 +6,21 @@ import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type MergeRefund[T any] struct {
|
||||
client *common.Client[T]
|
||||
type MergeRefund struct {
|
||||
client *common.Client[ResponseMergeRefund]
|
||||
}
|
||||
|
||||
func NewMergeRefund[T any](client *common.Client[T]) *MergeRefund[T] {
|
||||
return &MergeRefund[T]{
|
||||
func NewMergeRefund(client *common.Client[ResponseMergeRefund]) *MergeRefund {
|
||||
return &MergeRefund{
|
||||
client: client,
|
||||
}
|
||||
}
|
||||
func (t *MergeRefund[T]) MergeRefund(req *RequestDataMergeRefund) (*T, error) {
|
||||
// 构建请求参数
|
||||
url := consts.BASE_URL + consts.LKL_UNIFIED_RETURN_MERGE_REFUND_URL
|
||||
func (t *MergeRefund) MergeRefund(req *RequestDataMergeRefund) (*ResponseMergeRefund, error) {
|
||||
// 构建BaseModel请求
|
||||
baseReq := RequestMergeRefund{
|
||||
ReqTime: gtime.Now().Format("YmdHis"),
|
||||
Version: "3.0",
|
||||
ReqData: req,
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
respBody, err := t.client.DoRequest(url, baseReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return respBody, nil
|
||||
return t.client.DoRequest(consts.BASE_URL+consts.LKL_UNIFIED_RETURN_MERGE_REFUND_URL, baseReq)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user