It uses Spring Boot framework to realize HTTP connection and database connection.
POST
URL example: http://server_ip/signin
Name | Type | Description |
---|---|---|
User | parameter | necessary |
status | return | 0 "can't find phone number" |
status | return | 1 "wrong password" |
status | return | 2 "login succeed" |
POST
URL example: http://server_ip/signup
Name | Type | Description |
---|---|---|
user | parameter | necessary |
status | return | 0 "register succeed" |
POST
URL example: http://server_ip/before-register
Name | Type | Description |
---|---|---|
user | parameter | necessary |
status | return | 0 "phone number is null" |
status | return | 1 "phone number already exists" |
status | return | 2 "phone number doesn't exist" |
GET
URL example: http://server_ip/list/feeds
Name | Type | Description |
---|---|---|
token | parameter | check the user |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "succeed" |
GET
URL example: http://server_ip/list/all/feeds
Name | Type | Description |
---|---|---|
List | return | list of rssfeed |
GET
URL example: http://server_ip/list/feed/{id}/articles
Name | Type | Description |
---|---|---|
token | parameter | check the user |
id | parameter | channel id |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "feed not find" |
status | return | 3 "succeed" |
GET
URL example: http://server_ip/list/user/all/articles
Name | Type | Description |
---|---|---|
token | parameter | check the user |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "succeed" |
GET
URL example: http://server_ip/list/feed/all/articles
Name | Type | Description |
---|---|---|
status | return | ArticlesResponse |
GET
URL example: http://server_ip/list/article/{id}
Name | Type | Description |
---|---|---|
token | parameter | check the user |
id | parameter | article id |
status | return | 0 "wrong token" |
status | return | 1 "article not find" |
status | return | 2 "article find succeed" |
GET
URL example: http://server_ip/addChannel
Name | Type | Description |
---|---|---|
token | parameter | check the user |
url | parameter | url of the channel |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "add failed" |
status | return | 3 "add succeed" |
GET
URL example: http://server_ip/deleteChannel/
Name | Type | Description |
---|---|---|
token | parameter | check the user |
url | parameter | url of the channel |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "delete failed" |
status | return | 2 "delete succeed" |
GET
URL example: http://server_ip/list/like/articles/
Name | Type | Description |
---|---|---|
token | parameter | check the user |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "succeed" |
GET
URL example: http://server_ip/like/article/{id}
Name | Type | Description |
---|---|---|
token | parameter | check the user |
id | parameter | article id |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "succeed" |
GET
URL example: http://server_ip/unlike/article/{id}
Name | Type | Description |
---|---|---|
token | parameter | check the user |
id | parameter | article id |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "succeed" |
GET
URL example: http://server_ip/freshRecords
Name | Type | Description |
---|---|---|
status | return | 0 "succeed" |
GET
URL example: http://server_ip/list/record_mp3/{id}
Name | Type | Description |
---|---|---|
response | parameter | HttpServletResponse |
id | parameter | article id |
GET
URL example: http://server_ip/list/record_info/{id}
Name | Type | Description |
---|---|---|
response | parameter | HttpServletResponse |
id | parameter | article id |
GET
URL example: http://server_ip/checkToken
Name | Type | Description |
---|---|---|
token | parameter | check the user |
status | return | 0 "wrong token" |
status | return | 1 "user not find" |
status | return | 2 "valid" |
POST
URL example: http://server_ip/freshChannels
Name | Type | Description |
---|---|---|
token | parameter | check the user |
status | return | 0 "wrong token" |
status | return | 1 "update succeed" |
POST
URL example: http://server_ip/freshChannel
Name | Type | Description |
---|---|---|
token | parameter | check the user |
rssFeed | parameter | the channel to fresh |
status | return | 0 "wrong token" |
status | return | 1 "update succeed" |
inside test/com/icecream/server/controller
I write tests for each public method in UserServiceImpl, RssFeedServiceImpl
ArticleServiceImpl, UserController, RssController and JwtTokenProvider.
Since methods in rss folder is from open source, which is used to parse rss source,
so I don't write tests for code in it.
-
Use token to keep login state
-
Design api returns in a systematic way (maybe use a Json format)
-
Use post and encryption to increase security
-
Write junit test for rss part
-
Some weird logic about update a channel and subscirbe channel
- determine if the sources are given by the app and user can't add a customized rss feed
-
Make crawling articles an automatic task
-
MP3 record storage / reading handling
-
Classify the channels