https://github.com/xuexiangjys/templateandserver
简化版的Android服务端模板,用于接口模拟测试。
https://github.com/xuexiangjys/templateandserver
server serverless-framework template x-templateproject
Last synced: 6 months ago
JSON representation
简化版的Android服务端模板,用于接口模拟测试。
- Host: GitHub
- URL: https://github.com/xuexiangjys/templateandserver
- Owner: xuexiangjys
- License: apache-2.0
- Created: 2020-08-30T16:00:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-14T21:23:28.000Z (about 1 year ago)
- Last Synced: 2024-08-14T23:52:33.459Z (about 1 year ago)
- Topics: server, serverless-framework, template, x-templateproject
- Language: Java
- Homepage:
- Size: 239 KB
- Stars: 49
- Watchers: 3
- Forks: 11
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TemplateAndServer
简化版的Android服务端模版,用于接口模拟测试。
## 关于我
[](https://github.com/xuexiangjys) [](http://blog.csdn.net/xuexiangjys) [](https://www.jianshu.com/u/6bf605575337) [](https://juejin.im/user/598feef55188257d592e56ed) [](https://www.zhihu.com/people/xuexiangjys)
## 演示(请star支持)
### 服务端演示

### 浏览器演示

### 写法对比
* AndServer


* SpringBoot

从上面的图片我们很容易看出,AndServer的写法和SpringBoot是非常相似的,就连项目工程的结构也是相似的。
---
## 功能介绍
> 本项目使用[AndServer](https://github.com/yanzhenjie/AndServer)提供的服务搭建。
* 统一的请求日志记录。
* 全局异常捕获处理,返回统一API结果。
* 增加全局权限验证拦截器。
* 文件上传。
* 后台管理界面。
* 接口测试界面。
## 返回Json格式
```
{
"code":0, //响应码,0为成功,否则失败
"msg":"", //请求失败的原因说明
"data":{} //返回的数据对象
}
```
## 使用方式
### 服务器配置
在`com.xuexiang.server.ServerConfig`进行配置的修改。
### 服务接口编写
1.在`com.xuexiang.server.controller`包下创建Controller类。
2.在Controller类上加上`@RestController`和`@RequestMapping`注解。
### 日志查看
在logcat上搜索关键词"AndServer"即可查看请求日志。