/**
*
*/
package com.photoshare.service.login;
import android.os.Bundle;
import com.photoshare.common.RequestParam;
import com.photoshare.exception.NetworkException;
import com.photoshare.service.users.UserInfo;
/**
* @author Aron
*
*/
public class UserLoginRequestParam extends RequestParam {
@Deprecated
public static final String METHOD = "userLogin.do";
public static final String KEY_PWD = "pwd";
private String name;
private String pwd;
private LoginType type;
private static final String ACTION = "/LoginAction_";
public String getAction() {
return ACTION + type.getTag();
}
@Deprecated
public String getMethod() {
return METHOD + "?method=" + "signIn";
}
public static final String FIELD_DEFAULT = UserInfo.KEY_NAME + ","
+ KEY_PWD;
private String fields = FIELD_DEFAULT;
public UserLoginRequestParam(String fields) {
this.fields = fields;
}
public UserLoginRequestParam(String name, String pwd) {
this.name = name;
this.pwd = pwd;
}
/*
* (non-Javadoc)
*
* @see com.cgema.common.RequestParam#getParams()
*/
@Override
public Bundle getParams() throws NetworkException {
// TODO Auto-generated method stub
Bundle parameters = new Bundle();
parameters.putString("method", METHOD);
if (fields != null) {
parameters.putString("fields", fields);
}
if (name != null) {
parameters.putString(UserInfo.KEY_NAME, name);
}
if (pwd != null) {
parameters.putString(KEY_PWD, pwd);
}
return parameters;
}
}