Giter Site home page Giter Site logo

chenzixue / templateandserver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuexiangjys/templateandserver

0.0 1.0 0.0 284 KB

简化版的Android服务端模板,用于接口模拟测试。

License: Apache License 2.0

Java 97.68% CSS 0.15% HTML 2.17%

templateandserver's Introduction

TemplateAndServer

简化版的Android服务端模版,用于接口模拟测试。

关于我

github csdn 简书 掘金 知乎

演示(请star支持)

服务端演示

浏览器演示

写法对比

  • AndServer

  • SpringBoot

从上面的图片我们很容易看出,AndServer的写法和SpringBoot是非常相似的,就连项目工程的结构也是相似的。


功能介绍

本项目使用AndServer提供的服务搭建。

  • 统一的请求日志记录。

  • 全局异常捕获处理,返回统一API结果。

  • 增加全局权限验证拦截器。

  • 文件上传。

  • 后台管理界面。

  • 接口测试界面。

返回Json格式

{
    "code":0, //响应码,0为成功,否则失败
    "msg":"", //请求失败的原因说明
    "data":{} //返回的数据对象
}

使用方式

服务器配置

com.xuexiang.server.ServerConfig进行配置的修改。

服务接口编写

1.在com.xuexiang.server.controller包下创建Controller类。

2.在Controller类上加上@RestController@RequestMapping注解。

日志查看

在logcat上搜索关键词"AndServer"即可查看请求日志。

templateandserver's People

Contributors

chenzixue avatar ktdynamic avatar xuexiangjys avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.