package pposRequest

import (
	"PPOSUtils/utils"
	"net/url"
)

func (that *PPOSClient) NewQuickNewBindUserVeinFingerRequest() *QuickNewBindUserVeinFingerRequest {
	return &QuickNewBindUserVeinFingerRequest{
		Request: Request{
			Client:     that,
			apiAddress: "/enterAdmin/quickNew/bindUserVeinFinger",
		},
	}
}

// QuickNewBindUserVeinFingerRequest 请求参数...
type QuickNewBindUserVeinFingerRequest struct {
	Request
	Appid       string `json:"appid"`        //商家授权key
	DeviceID    string `json:"deviceID"`     //设备编号
	UserType    string `json:"userType"`     //用户身份类型
	Uid         string `json:"uid"`     //用户编号
	CloudId     string `json:"cloudId"`     //验证云会员id
	Type        int64  `json:"type"`     //绑定类型
	Img         string `json:"img"`     //人脸信息
	NumCard     string `json:"numCard"`     //卡号
}

//SetAppid ...
func (that *QuickNewBindUserVeinFingerRequest) SetAppid(value string) *QuickNewBindUserVeinFingerRequest {
	that.Appid = value
	return that
}

//SetDeviceID ...
func (that *QuickNewBindUserVeinFingerRequest) SetDeviceID(value string) *QuickNewBindUserVeinFingerRequest {
	that.DeviceID = value
	return that
}

//SetUserType ...
func (that *QuickNewBindUserVeinFingerRequest) SetUserType(value string) *QuickNewBindUserVeinFingerRequest {
	that.UserType = value
	return that
}

//SetUid ...
func (that *QuickNewBindUserVeinFingerRequest) SetUid(value string) *QuickNewBindUserVeinFingerRequest {
	that.Uid = value
	return that
}

//SetCloudId ...
func (that *QuickNewBindUserVeinFingerRequest) SetCloudId(value string) *QuickNewBindUserVeinFingerRequest {
	that.CloudId = value
	return that
}

//SetType ...
func (that *QuickNewBindUserVeinFingerRequest) SetType(value int64) *QuickNewBindUserVeinFingerRequest {
	that.Type = value
	return that
}

//SetImg ...
func (that *QuickNewBindUserVeinFingerRequest) SetImg(value string) *QuickNewBindUserVeinFingerRequest {
	that.Img = value
	return that
}

//SetNumCard ...
func (that *QuickNewBindUserVeinFingerRequest) SetNumCard(value string) *QuickNewBindUserVeinFingerRequest {
	that.NumCard = value
	return that
}


//Params ...
func (that *QuickNewBindUserVeinFingerRequest) Params() (url.Values, error) {
	var m = make(url.Values)
	m.Set("appid", that.Appid)
	m.Set("deviceID", that.DeviceID)
	m.Set("userType", that.UserType)
	m.Set("uid", that.Uid)
	m.Set("cloudId", that.CloudId)
	m.Set("type", utils.ToString(that.Type))
	m.Set("Img", that.Img)
	m.Set("numCard", that.NumCard)
	return m, nil
}

//Do ...
func (that *QuickNewBindUserVeinFingerRequest) Do() (interface{}, error) {
	_responData, _err := that.Client.GetData(that.apiAddress, that)
	if _err != nil {
		return nil, _err
	}
	return _responData, nil
}
