-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
leeyh.lee
committed
Jul 24, 2018
1 parent
ec87e4c
commit ad6082f
Showing
12 changed files
with
240 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>com.smarthane</groupId> | ||
<artifactId>mudfrog-modules</artifactId> | ||
<version>1.0.0</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>mudfrog-upms-service</artifactId> | ||
<version>1.0.0</version> | ||
<name>mudfrog UPMS service</name> | ||
<description>User Permissions Management System</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-config</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<configuration> | ||
<finalName>${project.name}</finalName> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
22 changes: 22 additions & 0 deletions
22
...modules/mudfrog-upms-service/src/main/java/com/smarthane/upms/MudfrogUpmsApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.smarthane.upms; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
|
||
/** | ||
* Created with by smarthane-cloud-microservice. | ||
* | ||
* @author: smarthane | ||
* @Date: 2018/7/24 15:34 | ||
* @Description: | ||
*/ | ||
@SpringBootApplication | ||
@EnableDiscoveryClient | ||
public class MudfrogUpmsApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(MudfrogUpmsApplication.class, args); | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...ules/mudfrog-upms-service/src/main/java/com/smarthane/upms/controller/TestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.smarthane.upms.controller; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* Created with by smarthane-cloud-microservice. | ||
* | ||
* @author: smarthane | ||
* @Date: 2018/7/24 15:46 | ||
* @Description: | ||
*/ | ||
@RestController | ||
public class TestController { | ||
|
||
@Value("${test}") | ||
private String test; | ||
|
||
@GetMapping("/test") | ||
public String test() { | ||
return this.test; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
mudfrog-modules/mudfrog-upms-service/src/main/java/com/smarthane/upms/entity/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.smarthane.upms.entity; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* Created with by smarthane-cloud-microservice. | ||
* | ||
* @author: smarthane | ||
* @Date: 2018/7/24 15:55 | ||
* @Description: | ||
*/ | ||
@Entity | ||
@Table(name = "test") | ||
public class Test implements Serializable { | ||
|
||
private static final long serialVersionUID = -1756087696221171302L; | ||
|
||
@Id | ||
@Column(name = "code", length = 128) | ||
private String code; | ||
|
||
@Column(name = "name", length = 128) | ||
private String name; | ||
|
||
public String getCode() { | ||
return code; | ||
} | ||
|
||
public void setCode(String code) { | ||
this.code = code; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
mudfrog-modules/mudfrog-upms-service/src/main/resources/bootstrap.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
server: | ||
port: 20001 | ||
|
||
spring: | ||
application: | ||
name: mudfrog-upms-service | ||
profiles: | ||
active: dev | ||
cloud: | ||
config: | ||
fail-fast: true | ||
discovery: | ||
service-id: mudfrog-config-server | ||
enabled: true | ||
profile: ${spring.profiles.active} | ||
label: ${spring.profiles.active} | ||
|
||
--- | ||
spring: | ||
profiles: dev | ||
eureka: | ||
instance: | ||
prefer-ip-address: true | ||
lease-renewal-interval-in-seconds: 5 #定义服务续约任务的调用间隔默认为30秒 | ||
lease-expiration-duration-in-seconds: 20 #定义服务失效时间默认为90秒 | ||
client: | ||
# fetch-registry: false # 注册中心的职责就是维护服务实例,它并不需要云检索服务 | ||
# register-with-eureka: false # 不向注册中心注册自己 | ||
serviceUrl: | ||
defaultZone: http://mudfrog:mudfrog@localhost:1025/eureka/ #启用安全校验http://mudfrog:mudfrog@localhost:1025/eureka | ||
registry-fetch-interval-seconds: 10 #缓存服务地址清单的更新时间默认为30秒 |
47 changes: 47 additions & 0 deletions
47
mudfrog-modules/mudfrog-upms-service/src/main/resources/logback-spring.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration debug="false" scan="false"> | ||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue="pig"/> | ||
<property name="log.path" value="logs/${spring.application.name}" /> | ||
<!-- Console log output --> | ||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{MM-dd HH:mm:ss.SSS} %-5level [%logger{50}] - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<!-- Log file debug output --> | ||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>${log.path}/debug.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${log.path}/%d{yyyy-MM}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> | ||
<maxFileSize>50MB</maxFileSize> | ||
<maxHistory>30</maxHistory> | ||
</rollingPolicy> | ||
<encoder> | ||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<!-- Log file error output --> | ||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>${log.path}/error.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> | ||
<maxFileSize>50MB</maxFileSize> | ||
<maxHistory>30</maxHistory> | ||
</rollingPolicy> | ||
<encoder> | ||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern> | ||
</encoder> | ||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
<level>ERROR</level> | ||
</filter> | ||
</appender> | ||
|
||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 --> | ||
<root level="INFO"> | ||
<appender-ref ref="console" /> | ||
<appender-ref ref="debug" /> | ||
<appender-ref ref="error" /> | ||
</root> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
<artifactId>mudfrog</artifactId> | ||
<version>${mudfrog.version}</version> | ||
<packaging>pom</packaging> | ||
<inceptionYear>2018</inceptionYear> | ||
<name>mudfrog microservice</name> | ||
<description>A microservice framework base on springcloud components</description> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
|
@@ -15,6 +18,16 @@ | |
<relativePath/> <!-- lookup parent from repository --> | ||
</parent> | ||
|
||
<developers> | ||
<developer> | ||
<name>smarthane</name> | ||
<email>[email protected]</email> | ||
<roles> | ||
<role>Architect</role> | ||
</roles> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
|
@@ -60,7 +73,6 @@ | |
<module>mudfrog-bigdatas</module> | ||
</modules> | ||
|
||
|
||
<!--公共依赖--> | ||
<dependencies> | ||
<!--注册中心--> | ||
|