Skip to content

Commit f8b7289

Browse files
committed
Server:优化注释,登录密码apijson123改为apijson;Client:调整获取Wallet的请求
1 parent 1a1195d commit f8b7289

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/res/layout/query_activity.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<Button
4545
android:id="@+id/btnQueryQuery"
46-
android:layout_width="90dp"
46+
android:layout_width="wrap_content"
4747
android:layout_height="match_parent"
4848
android:text="Query" />
4949
</LinearLayout>

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/src/apijson/demo/RequestUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ public static JSONObject newComplexRequest() {
9696
}
9797

9898
public static JSONObject newAccessErrorRequest(long id) {
99-
return new JSONRequest(new Wallet().setUserId(id <= 0 ? 38710 : id));
99+
return new JSONRequest(new Wallet().setUserId(id <= 0 ? 38710 : id)).setTag(Wallet.class.getSimpleName());
100100
}
101101

102102
public static JSONObject newAccessPermittedRequest(long id) {
103103
JSONRequest request = new JSONRequest();
104104
request.put(new Wallet().setUserId(id <= 0 ? 38710 : id));
105105
request.put("currentUserId", 38710);
106-
request.put("payPassword", "123456");
107-
return request;
106+
request.put("loginPassword", "apijson");
107+
return request.setTag(Wallet.class.getSimpleName());
108108
}
109109

110110
}

APIJSON(Android)/APIJSON(ADT)/APIJSONDemoApp/src/apijson/demo/ui/QueryActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public static Intent createIntent(Context context, int type, String url, long id
8888
public static final int TYPE_RELY = 12;
8989
public static final int TYPE_ARRAY = 13;
9090
public static final int TYPE_COMPLEX = 14;
91-
public static final int TYPE_ACCESS_ERROR = 15;
92-
public static final int TYPE_ACCESS_PERMITTED = 16;
91+
public static final int TYPE_ACCESS_ERROR = 5;
92+
public static final int TYPE_ACCESS_PERMITTED = 6;
9393

9494

9595

@@ -217,6 +217,9 @@ private String getMethod(int type) {
217217
return "put";
218218
case TYPE_DELETE:
219219
return "delete";
220+
case TYPE_ACCESS_ERROR:
221+
case TYPE_ACCESS_PERMITTED:
222+
return "post_get";
220223
default:
221224
return "get";
222225
}

APIJSON(Server)/APIJSON(Eclipse_JEE)/src/main/java/zuo/biao/apijson/server/sql/AccessVerifier.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ public class AccessVerifier {
3535

3636
private static Map<String, RequestMethod[]> accessMap;
3737

38+
/**初始化,建议在Applicaiton的onCreate方法中调用
39+
*/
3840
public static void init() {
3941
accessMap = new HashMap<String, RequestMethod[]>();
4042
accessMap.put("User", RequestMethod.values());
43+
accessMap.put("Work", RequestMethod.values());
4144
accessMap.put("Moment", RequestMethod.values());
4245
accessMap.put("Comment", RequestMethod.values());
4346
accessMap.put("Wallet", new RequestMethod[]{POST_GET, POST, PUT, DELETE});
@@ -184,7 +187,7 @@ public static int getAccessId(RequestMethod method, String table) {
184187
*/
185188
public static String getLoginPassword(long userId) {
186189
// TODO 查询并返回对应userId的登录密码
187-
return "apijson123";//仅测试用
190+
return "apijson";//仅测试用
188191
}
189192

190193
/**获取支付密码

0 commit comments

Comments
 (0)