-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
577 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package apis | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
// 自动生成的文件, 生成方式: make api doc=微信文档地址url | ||
// 可自行修改生成的文件,以满足开发需求 | ||
|
||
// ReqProlongTryService 延长试用期请求 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91913#延长试用期 | ||
type ReqProlongTryService struct { | ||
// Appid 仅旧套件需要填此参数 | ||
Appid int `json:"appid,omitempty"` | ||
// BuyerCorpid 购买方corpid,必填 | ||
BuyerCorpid string `json:"buyer_corpid"` | ||
// ProlongDays 延长天数,必填 | ||
ProlongDays int `json:"prolong_days"` | ||
} | ||
|
||
var _ bodyer = ReqProlongTryService{} | ||
|
||
func (x ReqProlongTryService) intoBody() ([]byte, error) { | ||
result, err := json.Marshal(x) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return result, nil | ||
} | ||
|
||
// RespProlongTryService 延长试用期响应 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91913#延长试用期 | ||
type RespProlongTryService struct { | ||
CommonResp | ||
// TryEndTime 延长后的试用到期时间(UNIX时间戳) | ||
TryEndTime int `json:"try_end_time"` | ||
} | ||
|
||
var _ bodyer = RespProlongTryService{} | ||
|
||
func (x RespProlongTryService) intoBody() ([]byte, error) { | ||
result, err := json.Marshal(x) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return result, nil | ||
} | ||
|
||
// ExecProlongTryService 延长试用期 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91913#延长试用期 | ||
func (c *ApiClient) ExecProlongTryService(req ReqProlongTryService) (RespProlongTryService, error) { | ||
var resp RespProlongTryService | ||
err := c.executeWXApiPost("/cgi-bin/service/prolong_try", req, &resp, true) | ||
if err != nil { | ||
return RespProlongTryService{}, err | ||
} | ||
if bizErr := resp.TryIntoErr(); bizErr != nil { | ||
return RespProlongTryService{}, bizErr | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
package apis | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
// 自动生成的文件, 生成方式: make api doc=微信文档地址url | ||
// 可自行修改生成的文件,以满足开发需求 | ||
|
||
// ReqGetOrderListService 获取订单列表请求 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91910#获取订单列表 | ||
type ReqGetOrderListService struct { | ||
// EndTime 终止时间,UNIX时间戳,必填 | ||
EndTime int `json:"end_time"` | ||
// StartTime 起始时间,UNIX时间戳,必填 | ||
StartTime int `json:"start_time"` | ||
// TestMode 指定拉取正式或测试授权的订单。默认值为0,其中 0-正式授权,1-测试授权。 | ||
TestMode int `json:"test_mode,omitempty"` | ||
} | ||
|
||
var _ bodyer = ReqGetOrderListService{} | ||
|
||
func (x ReqGetOrderListService) intoBody() ([]byte, error) { | ||
result, err := json.Marshal(x) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return result, nil | ||
} | ||
|
||
// RespGetOrderListService 获取订单列表响应 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91910#获取订单列表 | ||
type RespGetOrderListService struct { | ||
CommonResp | ||
OrderList []struct { | ||
// Appid 套件应用id(仅旧套件有该字段) | ||
Appid int `json:"appid"` | ||
// BeginTime 购买生效期的开始时间(UNIX时间戳) | ||
BeginTime int `json:"begin_time"` | ||
DealerCorpInfo struct { | ||
// CorpName 代理商的企业简称 | ||
CorpName string `json:"corp_name"` | ||
// Corpid 代理商corpid | ||
Corpid string `json:"corpid"` | ||
} `json:"dealer_corp_info"` // 代理商信息(仅当有渠道商报备后才会有此字段) | ||
// DealerShareAmount 代理商分成金额,单位分 | ||
DealerShareAmount int `json:"dealer_share_amount"` | ||
// EditionID 购买版本ID | ||
EditionID string `json:"edition_id"` | ||
// EditionName 购买版本名字 | ||
EditionName string `json:"edition_name"` | ||
// EndTime 购买生效期的结束时间(UNIX时间戳) | ||
EndTime int `json:"end_time"` | ||
// OperatorCorpid 下单方corpid | ||
OperatorCorpid string `json:"operator_corpid"` | ||
// OperatorID 下单操作人员userid。如果是服务商代下单,没有该字段。 | ||
OperatorID string `json:"operator_id"` | ||
// OrderFrom 下单来源。0-企业下单;1-服务商代下单;2-代理商代下单 | ||
OrderFrom int `json:"order_from"` | ||
// OrderPeriod 购买的时长,单位天 | ||
OrderPeriod int `json:"order_period"` | ||
// OrderStatus 订单状态。订单状态。0-待支付,1-已支付,2-已取消, 3-支付过期, 4-申请退款中, 5-退款成功, 6-退款被拒绝 | ||
OrderStatus int `json:"order_status"` | ||
// OrderTime 下单时间(UNIX时间戳) | ||
OrderTime int `json:"order_time"` | ||
// OrderType 订单类型。0-新购应用,1-扩容应用人数,2-续期应用时间,3-变更版本 | ||
OrderType int `json:"order_type"` | ||
// Orderid 订单号 | ||
Orderid string `json:"orderid"` | ||
// PaidCorpid 客户企业的corpid | ||
PaidCorpid string `json:"paid_corpid"` | ||
// PaidTime 付款时间(UNIX时间戳) | ||
PaidTime int `json:"paid_time"` | ||
// PlatformShareAmount 平台分成金额,单位分 | ||
PlatformShareAmount int `json:"platform_share_amount"` | ||
// Price 应付价格,单位分 | ||
Price int `json:"price"` | ||
// ServiceShareAmount 服务商分成金额,单位分 | ||
ServiceShareAmount int `json:"service_share_amount"` | ||
// Suiteid 应用id | ||
Suiteid string `json:"suiteid"` | ||
// UserCount 购买的人数 | ||
UserCount int `json:"user_count"` | ||
} `json:"order_list"` // 订单列表 | ||
} | ||
|
||
var _ bodyer = RespGetOrderListService{} | ||
|
||
func (x RespGetOrderListService) intoBody() ([]byte, error) { | ||
result, err := json.Marshal(x) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return result, nil | ||
} | ||
|
||
// ExecGetOrderListService 获取订单列表 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91910#获取订单列表 | ||
func (c *ApiClient) ExecGetOrderListService(req ReqGetOrderListService) (RespGetOrderListService, error) { | ||
var resp RespGetOrderListService | ||
err := c.executeWXApiPost("/cgi-bin/service/get_order_list", req, &resp, true) | ||
if err != nil { | ||
return RespGetOrderListService{}, err | ||
} | ||
if bizErr := resp.TryIntoErr(); bizErr != nil { | ||
return RespGetOrderListService{}, bizErr | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
package apis | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
// 自动生成的文件, 生成方式: make api doc=微信文档地址url | ||
// 可自行修改生成的文件,以满足开发需求 | ||
|
||
// ReqGetOrderService 获取订单详情请求 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91909#获取订单详情 | ||
type ReqGetOrderService struct { | ||
// Orderid 订单号,必填 | ||
Orderid string `json:"orderid"` | ||
} | ||
|
||
var _ bodyer = ReqGetOrderService{} | ||
|
||
func (x ReqGetOrderService) intoBody() ([]byte, error) { | ||
result, err := json.Marshal(x) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return result, nil | ||
} | ||
|
||
// RespGetOrderService 获取订单详情响应 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91909#获取订单详情 | ||
type RespGetOrderService struct { | ||
// Appid 套件应用id(仅旧套件有该字段) | ||
Appid int `json:"appid"` | ||
// BeginTime 购买生效期的开始时间(UNIX时间戳) | ||
BeginTime int `json:"begin_time"` | ||
DealerCorpInfo struct { | ||
// CorpName 代理商的企业简称 | ||
CorpName string `json:"corp_name"` | ||
// Corpid 代理商corpid | ||
Corpid string `json:"corpid"` | ||
} `json:"dealer_corp_info"` // 渠道商信息(仅当有渠道商报备后才会有此字段) | ||
// DealerShareAmount 代理商分成金额,单位分 | ||
DealerShareAmount int `json:"dealer_share_amount"` | ||
// EditionID 购买版本ID | ||
EditionID string `json:"edition_id"` | ||
// EditionName 购买版本名字 | ||
EditionName string `json:"edition_name"` | ||
// EndTime 购买生效期的结束时间(UNIX时间戳) | ||
EndTime int `json:"end_time"` | ||
CommonResp | ||
// OperatorCorpid 下单方corpid | ||
OperatorCorpid string `json:"operator_corpid"` | ||
// OperatorID 下单操作人员userid。如果是服务商代下单,没有该字段。 | ||
OperatorID string `json:"operator_id"` | ||
// OrderFrom 下单来源。0-企业下单;1-服务商代下单;2-代理商代下单 | ||
OrderFrom int `json:"order_from"` | ||
// OrderPeriod 购买的时长,单位为天 | ||
OrderPeriod int `json:"order_period"` | ||
// OrderStatus 订单状态。0-待支付,1-已支付,2-已取消, 3-支付过期, 4-申请退款中, 5-退款成功, 6-退款被拒绝 | ||
OrderStatus int `json:"order_status"` | ||
// OrderTime 下单时间(UNIX时间戳) | ||
OrderTime int `json:"order_time"` | ||
// OrderType 订单类型。0-新购应用,1-扩容应用人数,2-续期应用时间,3-变更版本 | ||
OrderType int `json:"order_type"` | ||
// Orderid 订单号 | ||
Orderid string `json:"orderid"` | ||
// PaidCorpid 客户企业的corpid | ||
PaidCorpid string `json:"paid_corpid"` | ||
// PaidTime 付款时间(UNIX时间戳) | ||
PaidTime int `json:"paid_time"` | ||
// PlatformShareAmount 平台分成金额,单位分 | ||
PlatformShareAmount int `json:"platform_share_amount"` | ||
// Price 应付价格,单位分 | ||
Price int `json:"price"` | ||
// ServiceShareAmount 服务商分成金额,单位分 | ||
ServiceShareAmount int `json:"service_share_amount"` | ||
// Suiteid 应用id | ||
Suiteid string `json:"suiteid"` | ||
// UserCount 本次订单扩容之后的人数 | ||
UserCount int `json:"user_count"` | ||
} | ||
|
||
var _ bodyer = RespGetOrderService{} | ||
|
||
func (x RespGetOrderService) intoBody() ([]byte, error) { | ||
result, err := json.Marshal(x) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return result, nil | ||
} | ||
|
||
// ExecGetOrderService 获取订单详情 | ||
// 文档:https://developer.work.weixin.qq.com/document/path/91909#获取订单详情 | ||
func (c *ApiClient) ExecGetOrderService(req ReqGetOrderService) (RespGetOrderService, error) { | ||
var resp RespGetOrderService | ||
err := c.executeWXApiPost("/cgi-bin/service/get_order", req, &resp, true) | ||
if err != nil { | ||
return RespGetOrderService{}, err | ||
} | ||
if bizErr := resp.TryIntoErr(); bizErr != nil { | ||
return RespGetOrderService{}, bizErr | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.