Server:优化注释,登录密码apijson123改为apijson;Client:调整获取Wallet的请求

This commit is contained in:
TommyLemon 2017-03-01 11:43:18 +08:00
parent 1a1195da4e
commit f8b72890dc
4 changed files with 13 additions and 7 deletions

View File

@ -43,7 +43,7 @@
<Button
android:id="@+id/btnQueryQuery"
android:layout_width="90dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Query" />
</LinearLayout>

View File

@ -96,15 +96,15 @@ public class RequestUtil {
}
public static JSONObject newAccessErrorRequest(long id) {
return new JSONRequest(new Wallet().setUserId(id <= 0 ? 38710 : id));
return new JSONRequest(new Wallet().setUserId(id <= 0 ? 38710 : id)).setTag(Wallet.class.getSimpleName());
}
public static JSONObject newAccessPermittedRequest(long id) {
JSONRequest request = new JSONRequest();
request.put(new Wallet().setUserId(id <= 0 ? 38710 : id));
request.put("currentUserId", 38710);
request.put("payPassword", "123456");
return request;
request.put("loginPassword", "apijson");
return request.setTag(Wallet.class.getSimpleName());
}
}

View File

@ -88,8 +88,8 @@ public class QueryActivity extends Activity implements OnHttpResponseListener {
public static final int TYPE_RELY = 12;
public static final int TYPE_ARRAY = 13;
public static final int TYPE_COMPLEX = 14;
public static final int TYPE_ACCESS_ERROR = 15;
public static final int TYPE_ACCESS_PERMITTED = 16;
public static final int TYPE_ACCESS_ERROR = 5;
public static final int TYPE_ACCESS_PERMITTED = 6;
@ -217,6 +217,9 @@ public class QueryActivity extends Activity implements OnHttpResponseListener {
return "put";
case TYPE_DELETE:
return "delete";
case TYPE_ACCESS_ERROR:
case TYPE_ACCESS_PERMITTED:
return "post_get";
default:
return "get";
}

View File

@ -35,9 +35,12 @@ public class AccessVerifier {
private static Map<String, RequestMethod[]> accessMap;
/**初始化建议在Applicaiton的onCreate方法中调用
*/
public static void init() {
accessMap = new HashMap<String, RequestMethod[]>();
accessMap.put("User", RequestMethod.values());
accessMap.put("Work", RequestMethod.values());
accessMap.put("Moment", RequestMethod.values());
accessMap.put("Comment", RequestMethod.values());
accessMap.put("Wallet", new RequestMethod[]{POST_GET, POST, PUT, DELETE});
@ -184,7 +187,7 @@ public class AccessVerifier {
*/
public static String getLoginPassword(long userId) {
// TODO 查询并返回对应userId的登录密码
return "apijson123";//仅测试用
return "apijson";//仅测试用
}
/**获取支付密码