新增pay项目微信工单图片上传接口、回复接口、完成接口
This commit is contained in:
parent
afb120c6f4
commit
de3c82cbff
56
services/pay/client.go
Normal file
56
services/pay/client.go
Normal file
@ -0,0 +1,56 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
)
|
||||
|
||||
const (
|
||||
VERSION = "2024-06-03"
|
||||
)
|
||||
|
||||
var HOST requests.Host = requests.Host{
|
||||
Default: "pay.gaore.com",
|
||||
Func: func(s string) string {
|
||||
var a = map[string]string{
|
||||
requests.RELEASE: "pay.gaore.com",
|
||||
requests.PRE: "pay.gaore.com",
|
||||
requests.TEST: "pay.gaore.com",
|
||||
}
|
||||
return a[s]
|
||||
},
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
sdk.Client
|
||||
}
|
||||
|
||||
func NewClientWithAccessKey(accesskey, secrect, source string) (client *Client, err error) {
|
||||
client = &Client{}
|
||||
err = client.InitWithAccessKey(accesskey, secrect, source)
|
||||
return
|
||||
}
|
||||
|
||||
func NewClientWithAliAppcode(accesskey, secrect string, env ...string) (client *Client, err error) {
|
||||
client = &Client{}
|
||||
err = client.InitWithAliAppcode(accesskey, secrect, env...)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Client) ComplaintReply(req *ComplaintReplyRequest) (response *ComplaintReplyResponse, err error) {
|
||||
response = CreateComplaintReplyResponse()
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Client) ComplaintComplete(req *ComplaintCompleteRequest) (response *ComplaintCompleteResponse, err error) {
|
||||
response = CreateComplaintCompleteResponse()
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Client) ComplaintUpload(req *ComplaintUploadRequest) (response *ComplaintUploadResponse, err error) {
|
||||
response = CreateComplaintUploadResponse()
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
}
|
27
services/pay/client_test.go
Normal file
27
services/pay/client_test.go
Normal file
@ -0,0 +1,27 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestClient_GetUserInfo(t *testing.T) {
|
||||
|
||||
c, err := NewClientWithAliAppcode("", "")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
req := CreateComplaintUploadRequest()
|
||||
|
||||
req.MchId = "3503"
|
||||
req.ImageUrl = "https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64"
|
||||
|
||||
resp, err := c.ComplaintUpload(req)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
fmt.Println(resp.GetHttpContentString())
|
||||
fmt.Println(resp.GetHttpHeaders())
|
||||
}
|
34
services/pay/complaint_complete.go
Normal file
34
services/pay/complaint_complete.go
Normal file
@ -0,0 +1,34 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type ComplaintCompleteRequest struct {
|
||||
*requests.RpcRequest
|
||||
MchId string `position:"Body" field:"mch_id" default:"" `
|
||||
ComplaintId string `position:"Body" field:"complaint_id" default:"" `
|
||||
}
|
||||
|
||||
type ComplaintCompleteResponse struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
}
|
||||
|
||||
func CreateComplaintCompleteRequest() (req *ComplaintCompleteRequest) {
|
||||
req = &ComplaintCompleteRequest{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/api/complaint/wxComplaintComplete")
|
||||
req.Method = requests.POST
|
||||
return
|
||||
}
|
||||
|
||||
func CreateComplaintCompleteResponse() (response *ComplaintCompleteResponse) {
|
||||
response = &ComplaintCompleteResponse{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
return
|
||||
}
|
36
services/pay/complaint_reply.go
Normal file
36
services/pay/complaint_reply.go
Normal file
@ -0,0 +1,36 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type ComplaintReplyRequest struct {
|
||||
*requests.RpcRequest
|
||||
MchId string `position:"Body" field:"mch_id" default:"" `
|
||||
ComplaintId string `position:"Body" field:"complaint_id" default:"" `
|
||||
Content string `position:"Body" field:"content" default:"" `
|
||||
Images string `position:"Body" field:"images" default:"" `
|
||||
}
|
||||
|
||||
type ComplaintReplyResponse struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
}
|
||||
|
||||
func CreateComplaintReplyRequest() (req *ComplaintReplyRequest) {
|
||||
req = &ComplaintReplyRequest{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/api/complaint/wxComplaintReply")
|
||||
req.Method = requests.POST
|
||||
return
|
||||
}
|
||||
|
||||
func CreateComplaintReplyResponse() (response *ComplaintReplyResponse) {
|
||||
response = &ComplaintReplyResponse{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
return
|
||||
}
|
35
services/pay/complaint_upload.go
Normal file
35
services/pay/complaint_upload.go
Normal file
@ -0,0 +1,35 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type ComplaintUploadRequest struct {
|
||||
*requests.RpcRequest
|
||||
MchId string `position:"Body" field:"mch_id" default:"" `
|
||||
ImageUrl string `position:"Body" field:"image_url" default:"" `
|
||||
}
|
||||
|
||||
type ComplaintUploadResponse struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data map[string]string `json:"data"`
|
||||
}
|
||||
|
||||
func CreateComplaintUploadRequest() (req *ComplaintUploadRequest) {
|
||||
req = &ComplaintUploadRequest{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/api/complaint/wxComplaintUpload")
|
||||
req.Method = requests.POST
|
||||
return
|
||||
}
|
||||
|
||||
func CreateComplaintUploadResponse() (response *ComplaintUploadResponse) {
|
||||
response = &ComplaintUploadResponse{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
return
|
||||
}
|
Loading…
Reference in New Issue
Block a user