You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/service/wikeyun/rest.power.del_card.go

41 lines
1.3 KiB

2 years ago
package wikeyun
import (
2 years ago
"context"
1 year ago
"github.com/dtapps/go-library/utils/gojson"
2 years ago
"github.com/dtapps/go-library/utils/gorequest"
)
type RestPowerDelCardResponse struct {
Data string `json:"data"`
Code string `json:"code"`
Msg string `json:"msg"`
Time string `json:"time"`
}
type RestPowerDelCardResult struct {
Result RestPowerDelCardResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
Err error // 错误
}
func newRestPowerDelCardResult(result RestPowerDelCardResponse, body []byte, http gorequest.Response, err error) *RestPowerDelCardResult {
return &RestPowerDelCardResult{Result: result, Body: body, Http: http, Err: err}
}
// RestPowerDelCard 删除电费充值卡
// https://open.wikeyun.cn/#/apiDocument/9/document/330
2 years ago
func (c *Client) RestPowerDelCard(ctx context.Context, cardId string) *RestPowerDelCardResult {
2 years ago
// 参数
param := gorequest.NewParams()
2 years ago
param.Set("card_id", cardId)
params := gorequest.NewParamsWith(param)
2 years ago
// 请求
2 years ago
request, err := c.request(ctx, apiUrl+"/rest/Power/delCard", params)
// 定义
var response RestPowerDelCardResponse
1 year ago
err = gojson.Unmarshal(request.ResponseBody, &response)
return newRestPowerDelCardResult(response, request.ResponseBody, request, err)
2 years ago
}