Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tws-stack/java8-jersey-spring-boot

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gaia

开发环境

  • 确保开发环境下有jdk8,以及mysql 5.5+
  • 使用下面的脚本,提前在mysql中建好数据库
DROP DATABASE IF EXISTS `gaia`; CREATE SCHEMA `gaia` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  • 使用./gradlew cleanIdea idea生成Intellij工程
  • 使用Intellij打开生成的gaia.ipr文件
  • 找到GaiaApplication这个类,运行main()方法启动服务器

测试服务器是否启动正常

  • 检查启动中有无异常log
  • 打开浏览器,访问http://localhost:8080/gaia/rest/application.wadl,看是否有API列表输出
  • 打开浏览器,访问http://localhost:8080/gaia/rest/product/1,看是否返回包含"errorCode":"RESOURCE_NOT_FOUND"这样的出错信息
  • 在数据库console中,使用后面的脚本在数据库中插入一条数据insert into gaia.PRODUCT (name, time_created) values ('product_name', NOW());
  • 在数据库console中,使用select * from gaia.PRODUCT,查看是否已插入数据成功,并记下数据的id
  • 加入上一步记下的id1,打开浏览器,访问http://localhost:8080/gaia/rest/product/1
  • 检查浏览器的返回是否是 {"id":1,"name":"product_name","timeCreated":1474615151000},其中timeCreated对应的数字可能会略有不同

查看所有API 地址及请求所需方式、参数

注意:更改localhost到你希望查看的服务器IP

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.