server.address=192.168.1.241
server.port=8080
sip.peerHostPort=192.168.1.112:5060
sip.localHost=192.168.126.100
sip.localPort=5060
sip.expiresTime=31536000
sip.optionInterval=30000
sip.domain=nvscu
smsgw.pushUrl=http\://192.168.126.100\:8082/SMSGW/PushServer
# 监听端口
server.port=80
# 绑定的地址
server.address=127.0.0.1
#session有效时长
server.session-timeout=30000
#默认为/
server.context-path=/uas
#ssl相关配置 server.ssl.*
#spring.thymeleaf.cache=false
#server.tomcat.basedir=/tmp
#spring.devtools.restart.exclude=static/**,public/**
#spring.devtools.restart.additional-exclude
#spring.devtools.restart.additional-paths
# LOGGING
#logging.path=d:\allcam\logs
#logging.file=uas.log
#logging.config=classpath:log4j2.xml
spring.profiles.active=dev
#spring.view.prefix=/WEB-INF/views/
#spring.view.suffix=.jsp
#application.message=Hello xiaobudian
#THYMELEAF (ThymeleafAutoConfiguration)
#spring.thymeleaf.check-template-location=true
#spring.thymeleaf.prefix=classpath:/templates/
#spring.thymeleaf.excluded-view-names=
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=false
#用户名 密码配置
security.user.name=admin
security.user.password=123456
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.allcam.smartuas</groupId>
<artifactId>uas</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>uas Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- spring boot基本环境 -->
<!-- Inherit defaults from Spring Boot -->
<properties>
<log4j-core.version>2.6.1</log4j-core.version>
<java.version>1.8</java.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.6.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<!--不兼容,待解决 -->
<!-- <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId>
<version>${log4j-core.version}</version> </dependency> -->
<!--web应用基本环境配置 -->
<!-- Add typical dependencies for a web application -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!--排除tomcat,使用jetty服务器 1 -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
<!--使用log4j2替代slf4j 1 -->
<!-- <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId>
</exclusion> -->
<!-- <exclusion> <artifactId>log4j-over-slf4j</artifactId> <groupId>org.slf4j</groupId>
</exclusion> -->
</exclusions>
</dependency>
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId>
</dependency> -->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-log4j2 -->
<!--使用log4j2替代slf4j 2 -->
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId>
</dependency> -->
<!--排除tomcat,使用jetty服务器 2 -->
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId>
</dependency> -->
<!--spring boot 开发环境的热部署工具 -->
<!-- thymeleaf 替代Jsp -->
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId>
<exclusions> <exclusion> <artifactId>slf4j-api</artifactId> <groupId>org.slf4j</groupId>
</exclusion> </exclusions> </dependency> -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- devtools可以实现页面热部署(即页面修改后会立即生效,这个可以直接在application.properties文件中配置spring.thymeleaf.cache=false来实现),
实现类文件热部署(类文件修改后不会立即生效),实现对属性文件的热部署。 即devtools会监听classpath下的文件变动,并且会立即重启应用(发生在保存时机),注意:因为其采用的虚拟机机制,该项重启是很快的 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional><!-- optional=true,依赖不会传递,该项目依赖devtools;之后依赖myboot项目的项目如果想要使用devtools,需要重新引入 -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-annotations -->
<!-- Swagger -->
<!--springfox -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.13</version>
</dependency>
</dependencies>
<build>
<finalName>uas</finalName>
<!-- Package as an executable jar -->
<plugins>
<!-- 用于将应用打成可直接运行的jar(该jar就是用于生产环境中的jar) 值得注意的是,如果没有引用spring-boot-starter-parent做parent,
2 且采用了上述的第二种方式,这里也要做出相应的改动 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
</configuration>
</plugin>
</plugins>
</build>
<!-- -->
<repositories>
<!--由于devtools仅在 Spring milestone repository. 仓库中提供,而默认的仓库版本是1.2.5.RELEASE -->
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
</project>
代码路径: https://git.oschina.net/yizhichao/SPB.git
使用内置容器
http://localhost/swagger-ui.html#/
使用外部tomcat访问的
http://localhost:8080/uas/api/user/get
http://localhost:8080/uas/swagger-ui.html#/
restful 接口设计
-----------------------------------
创建:create
查询:get
详情:info
删除:delete
修改:update
-----------------------------------
http://IP:Port/v1/uas/api/plat/info
http://IP:Port/v1/uas/api/user/info
http://IP:Port/v1/uas/api/dev/query