File tree 3 files changed +43
-3
lines changed
src/main/java/com/mengxiang/im/push
3 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
![ IM系统] ( https://raw.githubusercontent.com/baijiangLai/IM/master/images/IM%E7%B3%BB%E7%BB%9F.png )
6
6
7
+ [ 客户端部分] ( https://github.com/baijiangLai/ITalker )
7
8
## 软件
8
9
9
10
- AndroidStudio
Original file line number Diff line number Diff line change
1
+ package com .mengxiang .im .push .bean ;
2
+
3
+ /**
4
+ * @author lbj
5
+ */
6
+ public class User {
7
+ private String name ;
8
+ private int sex ;
9
+
10
+ public String getName () {
11
+ return name ;
12
+ }
13
+
14
+ public void setName (String name ) {
15
+ this .name = name ;
16
+ }
17
+
18
+ public int getSex () {
19
+ return sex ;
20
+ }
21
+
22
+ public void setSex (int sex ) {
23
+ this .sex = sex ;
24
+ }
25
+ }
Original file line number Diff line number Diff line change 1
1
package com .mengxiang .im .push .service ;
2
2
3
- import javax .ws .rs .GET ;
4
- import javax .ws .rs .Path ;
3
+ import com .mengxiang .im .push .bean .User ;
4
+
5
+ import javax .ws .rs .*;
6
+ import javax .ws .rs .core .MediaType ;
5
7
6
8
/**
7
9
* @author lbj
10
12
public class AccountService {
11
13
12
14
/**
13
- *请求实际地址(127.0.0.1/api/account/login)
15
+ *Get 请求实际地址(127.0.0.1/api/account/login)
14
16
*/
15
17
@ GET
16
18
@ Path ("/login" )
17
19
public String get (){
18
20
return "get login" ;
19
21
}
22
+
23
+ //POST 127.0.0.1/api/account/login
24
+ @ POST
25
+ @ Path ("/login" )
26
+ // 返回的相应体为JSON
27
+ @ Produces (MediaType .APPLICATION_JSON )
28
+ public User post () {
29
+ User user = new User ();
30
+ user .setName ("jack" );
31
+ user .setSex (2 );
32
+ return user ;
33
+ }
20
34
}
You can’t perform that action at this time.
0 commit comments