From fc4c9918befb2fe4c2077f6a4cc87f50ebd22807 Mon Sep 17 00:00:00 2001 From: baishou <2710684311@qq.com> Date: Thu, 11 Jul 2019 09:27:59 +0800 Subject: [PATCH] 增加服务注册功能 --- springboot/pom.xml | 18 ++++++++++++++++++ springboot/src/main/java/com/sincre/springboot/ApiModel/UserInfo.java | 2 +- springboot/src/main/java/com/sincre/springboot/SpringbootApplication.java | 4 +++- springboot/src/main/resources/application.properties | 22 +++++++++++++--------- 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/springboot/pom.xml b/springboot/pom.xml index ec311b3..c61ed20 100644 --- a/springboot/pom.xml +++ b/springboot/pom.xml @@ -17,6 +17,7 @@ 1.8 + Greenwich.SR1 @@ -124,8 +125,25 @@ commons-lang3 3.1 + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-server + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + springboot-sincere diff --git a/springboot/src/main/java/com/sincre/springboot/ApiModel/UserInfo.java b/springboot/src/main/java/com/sincre/springboot/ApiModel/UserInfo.java index 1ee664e..f21e8d7 100644 --- a/springboot/src/main/java/com/sincre/springboot/ApiModel/UserInfo.java +++ b/springboot/src/main/java/com/sincre/springboot/ApiModel/UserInfo.java @@ -10,7 +10,7 @@ public class UserInfo { * */ private String country_code; /** - * 用户名,业务方md5加密 是 + * 用户名 当用户名类型=1,用户名=mobile,当用户类型 = 2,用户名=email,当用户类型=3,用户名=username, 默认:3 */ private String username; /** diff --git a/springboot/src/main/java/com/sincre/springboot/SpringbootApplication.java b/springboot/src/main/java/com/sincre/springboot/SpringbootApplication.java index 9fd95cc..5b80270 100644 --- a/springboot/src/main/java/com/sincre/springboot/SpringbootApplication.java +++ b/springboot/src/main/java/com/sincre/springboot/SpringbootApplication.java @@ -7,6 +7,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import javax.swing.*; import java.awt.*; @@ -15,12 +16,13 @@ import java.util.Date; @MapperScan("com.sincre.springboot.mapper") @SpringBootApplication +@EnableDiscoveryClient public class SpringbootApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(SpringbootApplication.class, args); - new YinShiController().GetYinShiToken();//获取萤石云token + //new YinShiController().GetYinShiToken();//获取萤石云token } } diff --git a/springboot/src/main/resources/application.properties b/springboot/src/main/resources/application.properties index 3c8b046..f355cd6 100644 --- a/springboot/src/main/resources/application.properties +++ b/springboot/src/main/resources/application.properties @@ -1,9 +1,13 @@ -server.port=1111 -# ݿ -spring.datasource.username=thd -spring.datasource.password=pmd19930415A -spring.datasource.url=jdbc:sqlserver://60.190.202.57:14333;database=test -spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver -mybatis.config-location=classpath:mybatis-config.xml -mybatis.mapper-locations=classpath:/mapper/*.xml -mybatis.type-aliases-package=com.sincre.springboot.model \ No newline at end of file +spring.application.name=iot-api +#server.port=8088 +# ݿ +spring.datasource.username=thd +spring.datasource.password=pmd19930415A +spring.datasource.url=jdbc:sqlserver://60.190.202.57:14333;database=test +spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver +mybatis.config-location=classpath:mybatis-config.xml +mybatis.mapper-locations=classpath:/mapper/*.xml +mybatis.type-aliases-package=com.sincre.springboot.model + +#Ӧעĵݣָעĵλá +eureka.client.serviceUrl.defaultZone=http://localhost:8001/eureka/ \ No newline at end of file -- libgit2 0.21.0