package pposRequest

import (
	"net/url"
)

func (that *PPOSClient) NewQuickNewGetUserInfoRequest() *QuickNewGetUserInfoRequest {
	return &QuickNewGetUserInfoRequest{
		Request: Request{
			Client:     that,
			apiAddress: "/enterAdmin/quickNew/getUserInfo",
		},
	}
}

// QuickNewGetUserInfoRequest 请求参数...
type QuickNewGetUserInfoRequest struct {
	Request
	Appid       string `json:"appid"`        //商家授权key
	DeviceID    string `json:"deviceID"`     //设备编号
	CodeType    string `json:"codeType"`     //识别码类型
	UserCode    string `json:"userCode"`     //身份识别码
}

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

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

//SetCodeType ...
func (that *QuickNewGetUserInfoRequest) SetCodeType(value string) *QuickNewGetUserInfoRequest {
	that.CodeType = value
	return that
}

//SetUserCode ...
func (that *QuickNewGetUserInfoRequest) SetUserCode(value string) *QuickNewGetUserInfoRequest {
	that.UserCode = value
	return that
}


//Params ...
func (that *QuickNewGetUserInfoRequest) Params() (url.Values, error) {
	var m = make(url.Values)
	m.Set("appid", that.Appid)
	m.Set("deviceID", that.DeviceID)
	m.Set("codeType", that.CodeType)
	m.Set("userCode", that.UserCode)
	return m, nil
}

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