Skip to content

Commit 86a6605

Browse files
committed
Server:完成充值/提现接口
1 parent 5d70d03 commit 86a6605

6 files changed

Lines changed: 227 additions & 82 deletions

File tree

APIJSON(Server)/APIJSON(Eclipse_JEE)/src/main/java/apijson/demo/server/model/Password.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
{
2727
"Password":{
2828
"disallow":"!",
29-
"necessary":"id,model"
29+
"necessary":"id,type"
3030
}
3131
}
3232
* </pre>
3333
* <br >PUT:put/loginPassword, put/payPassword<pre>
3434
{
3535
"Password":{
3636
"disallow":"!",
37-
"necessary":"id,password"
37+
"necessary":"id,type,password"
3838
},
3939
"necessary":"oldPassword"
4040
}
@@ -43,25 +43,26 @@
4343
@SuppressWarnings("serial")
4444
@APIJSONRequest(
4545
method = {RequestMethod.POST_HEAD, RequestMethod.PUT},
46-
POST_HEAD = "{\"disallow\": \"!\", \"necessary\": \"id,model\"}",
47-
PUT = "{\"Password\": {\"disallow\": \"!\", \"necessary\": \"id,password\"}, \"necessary\": \"oldPassword\"}"
46+
POST_HEAD = "{\"disallow\": \"!\", \"necessary\": \"id,type\"}",
47+
PUT = "{\"Password\": {\"disallow\": \"!\", \"necessary\": \"id,type,password\"}, \"necessary\": \"oldPassword\"}"
4848
)
4949
public class Password extends BaseModel {
5050

51-
private String model;//table是MySQL关键字不能用!
51+
public static final int TYPE_LOGIN = 0;
52+
public static final int TYPE_PAY = 1;
53+
5254
private Integer type;
5355
private String password;
5456

5557
public Password() {
5658
super();
5759
}
58-
public Password(String model, String phone) {
60+
public Password(String phone) {
5961
this();
60-
setModel(model);
6162
setPhone(phone);
6263
}
63-
public Password(String model, String phone, String password) {
64-
this(model, phone);
64+
public Password(String phone, String password) {
65+
this(phone);
6566
setPassword(password);
6667
}
6768

@@ -70,13 +71,6 @@ public Password setPhone(String phone) {
7071
return this;
7172
}
7273

73-
public String getModel() {
74-
return StringUtil.isNotEmpty(model, true) ? model : "User";
75-
}
76-
public Password setModel(String model) {
77-
this.model = model;
78-
return this;
79-
}
8074
public Integer getType() {
8175
return type;
8276
}

APIJSON(Server)/APIJSON(Eclipse_JEE)/src/main/java/apijson/demo/server/model/Wallet.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
{
2828
"Wallet":{
2929
"disallow":"!",
30-
"necessary":"userId"
30+
"necessary":"id"
3131
}
3232
}
3333
* </pre>
3434
* <br >POST:post/wallet<pre>
3535
{
3636
"Wallet":{
3737
"disallow":"!",
38-
"necessary":"userId"
38+
"necessary":"id"
3939
},
4040
"necessary":"payPassword"
4141
}
@@ -44,35 +44,33 @@
4444
{
4545
"Wallet":{
4646
"disallow":"!",
47-
"necessary":"userId,balance+"
47+
"necessary":"id,balance+"
4848
},
49-
"necessary":"payPassword,oldPassword"
49+
"necessary":"payPassword"
5050
}
5151
* </pre>
5252
* <br >DELETE:delete/wallet<pre>
5353
{
5454
"Wallet":{
5555
"disallow":"!",
56-
"necessary":"userId"
56+
"necessary":"id"
5757
},
5858
"necessary":"payPassword"
5959
}
6060
* </pre>
6161
*/
6262
@APIJSONRequest(
6363
method = {RequestMethod.POST_GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE},
64-
POST_GET = "{\"disallow\": \"!\", \"necessary\": \"userId\"}",
65-
POST = "{\"Wallet\": {\"disallow\": \"!\", \"necessary\": \"userId\"}, \"necessary\": \"payPassword\"}",
66-
PUT = "{\"Wallet\": {\"disallow\": \"!\", \"necessary\": \"userId,balance+\"}, \"necessary\": \"payPassword,oldPassword\"}",
67-
DELETE = "{\"Wallet\": {\"disallow\": \"!\", \"necessary\": \"userId\"}, \"necessary\": \"payPassword\"}"
64+
POST_GET = "{\"disallow\": \"!\", \"necessary\": \"id\"}",
65+
POST = "{\"Wallet\": {\"disallow\": \"!\", \"necessary\": \"id\"}, \"necessary\": \"payPassword\"}",
66+
PUT = "{\"Wallet\": {\"disallow\": \"!\", \"necessary\": \"id,balance+\"}, \"necessary\": \"payPassword\"}",
67+
DELETE = "{\"Wallet\": {\"disallow\": \"!\", \"necessary\": \"id\"}, \"necessary\": \"payPassword\"}"
6868
)
6969
public class Wallet extends BaseModel {
7070
private static final long serialVersionUID = 4298571449155754300L;
7171

7272
public BigDecimal balance;
7373

74-
private Long userId;
75-
7674
/**默认构造方法,JSON等解析时必须要有
7775
*/
7876
public Wallet() {
@@ -83,11 +81,9 @@ public Wallet(long id) {
8381
setId(id);
8482
}
8583

86-
public Long getUserId() {
87-
return userId;
88-
}
89-
public Wallet setUserId(Long userId) {
90-
this.userId = userId;
84+
85+
public Wallet setUserId(long userId) {
86+
setId(userId);
9187
return this;
9288
}
9389

0 commit comments

Comments
 (0)