diff --git a/services/pay/client.go b/services/pay/client.go index db0a7c7..74ea938 100644 --- a/services/pay/client.go +++ b/services/pay/client.go @@ -62,3 +62,11 @@ func (c *Client) GetOrderState(req *GetOrderStateRequest) (response *GetOrderSta err = c.DoAction(req, response) return } + +// GetVipInfo +// 获取会员信息 +func (c *Client) GetVipInfo(req *GetVipInfoRequest) (response *GetVipInfoResponse, err error) { + response = CreateGetVipInfoResponse() + err = c.DoAction(req, response) + return +} diff --git a/services/pay/get_vip_info.go b/services/pay/get_vip_info.go new file mode 100644 index 0000000..c895022 --- /dev/null +++ b/services/pay/get_vip_info.go @@ -0,0 +1,42 @@ +package pay + +import ( + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +type GetVipInfoRequest struct { + *requests.RpcRequest + UserName string `position:"Body" field:"user_name" default:"" ` +} + +type GetVipInfoResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data struct { + UserName string `json:"user_name"` // 用户名 + Score float64 `json:"score"` + Level int `json:"level"` + AttainDate string `json:"attain_date"` + ExpiryDate string `json:"expiry_date"` + IsWindows int `json:"is_windows"` + } `json:"data"` +} + +func CreateGetVipInfoRequest(userName string) (req *GetVipInfoRequest) { + req = &GetVipInfoRequest{ + RpcRequest: &requests.RpcRequest{}, + UserName: userName, + } + req.InitWithApiInfo(HOST, VERSION, "/api/user/getVipInfo") + req.Method = requests.POST + return +} + +func CreateGetVipInfoResponse() (response *GetVipInfoResponse) { + response = &GetVipInfoResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/wx-work/client.go b/services/wx-work/client.go index d7d3906..4df5422 100644 --- a/services/wx-work/client.go +++ b/services/wx-work/client.go @@ -32,3 +32,13 @@ func (c *Client) GetVipQrCode(req *GetVipQrCodeReq) (resp *GetVipQrCodeResp, err } return } + +// IsUserBind 判断账号是否绑定跟进人 +func (c *Client) IsUserBind(req *IsUserBindReq) (resp *IsUserBindResp, err error) { + resp = CreateIsUserBindResp() + err = c.DoAction(req, resp) + if err != nil { + return + } + return +} diff --git a/services/wx-work/vip.go b/services/wx-work/vip.go index 28491fd..ec264a3 100644 --- a/services/wx-work/vip.go +++ b/services/wx-work/vip.go @@ -43,3 +43,40 @@ func CreateGetVipQrCodeResp() *GetVipQrCodeResp { BaseResponse: &responses.BaseResponse{}, } } + +type IsUserBindReq struct { + *requests.RpcRequest +} + +type IsUserBindResp struct { + *responses.BaseResponse + Code int `json:"status_code"` + Msg string `json:"status_msg"` + Data IsUserBind `json:"data"` +} + +type IsUserBind struct { + IsBind bool `json:"is_bind"` +} + +// CreateIsUserBindReq 获取判断用户是否绑定微信请求 +func CreateIsUserBindReq(data map[string]string) *IsUserBindReq { + req := &IsUserBindReq{ + &requests.RpcRequest{}, + } + + req.InitWithApiInfo(HOST, VERSION, "/v1/vip/is_user_bind") + req.Method = requests.POST + req.FormParams = data + if req.FormParams == nil { + req.FormParams = make(map[string]string) + } + return req +} + +// CreateIsUserBindResp 判断用户是否绑定微信请求 +func CreateIsUserBindResp() *IsUserBindResp { + return &IsUserBindResp{ + BaseResponse: &responses.BaseResponse{}, + } +}