代码更新
This commit is contained in:
@@ -31,21 +31,6 @@
|
|||||||
<artifactId>mongo-java-driver</artifactId>
|
<artifactId>mongo-java-driver</artifactId>
|
||||||
<version>3.4.2</version>
|
<version>3.4.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--
|
|
||||||
<dependency>
|
|
||||||
<groupId>ch.qos.logback</groupId>
|
|
||||||
<artifactId>logback-core</artifactId>
|
|
||||||
<version>1.1.11</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>ch.qos.logback</groupId>
|
|
||||||
<artifactId>logback-classic</artifactId>
|
|
||||||
<version>1.1.11</version>
|
|
||||||
</dependency>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- JetCache Redis 依赖-->
|
<!-- JetCache Redis 依赖-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alicp.jetcache</groupId>
|
<groupId>com.alicp.jetcache</groupId>
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<?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>
|
|
||||||
<artifactId>llsh_acs</artifactId>
|
|
||||||
<groupId>org.nl</groupId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<version>2.6</version>
|
|
||||||
|
|
||||||
<artifactId>nladmin-test</artifactId>
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.nl</groupId>
|
|
||||||
<artifactId>nladmin-system</artifactId>
|
|
||||||
<version>2.6</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
|
||||||
<version>2.0.0.RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
|
||||||
<version>2.0.0.RELEASE</version>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package org.nl;
|
|
||||||
|
|
||||||
public class Cat implements IShout {
|
|
||||||
@Override
|
|
||||||
public void shout() {
|
|
||||||
System.out.println("miao miao111");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package org.nl;
|
|
||||||
|
|
||||||
public class Dog implements IShout {
|
|
||||||
@Override
|
|
||||||
public void shout() {
|
|
||||||
System.out.println("wang wang");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package org.nl;
|
|
||||||
|
|
||||||
public interface IShout {
|
|
||||||
void shout();
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package org.nl;
|
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.ServiceLoader;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Api(tags = "运维:应用管理")
|
|
||||||
@RequestMapping("/api/test")
|
|
||||||
public class Test111 {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
ServiceLoader<IShout> shouts = ServiceLoader.load(IShout.class);
|
|
||||||
for (IShout s : shouts) {
|
|
||||||
s.shout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@GetMapping(value = "/test")
|
|
||||||
public String getStr() {
|
|
||||||
return "hello";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package org.nl.starter;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
@ConfigurationProperties(prefix = "spring.tian")
|
|
||||||
@Data
|
|
||||||
public class TianProperties {
|
|
||||||
private String name;
|
|
||||||
private int age;
|
|
||||||
private String sex = "M";
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package org.nl.starter;
|
|
||||||
|
|
||||||
public class TianService {
|
|
||||||
private TianProperties properties;
|
|
||||||
public TianService() {
|
|
||||||
}
|
|
||||||
public TianService(TianProperties userProperties) {
|
|
||||||
this.properties = userProperties;
|
|
||||||
}
|
|
||||||
public void sayHello(){
|
|
||||||
System.out.println("hi, 我叫: " + properties.getName() +
|
|
||||||
", 今年" + properties.getAge() + "岁"
|
|
||||||
+ ", 性别: " + properties.getSex());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package org.nl.starter;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@EnableConfigurationProperties(TianProperties.class)
|
|
||||||
@ConditionalOnClass(TianService.class)
|
|
||||||
@ConditionalOnProperty(prefix = "spring.tian", value = "enabled", matchIfMissing = true)
|
|
||||||
public class TianServiceAutoConfiguration {
|
|
||||||
@Autowired
|
|
||||||
private TianProperties properties;
|
|
||||||
@Bean
|
|
||||||
@ConditionalOnMissingBean(TianService.class)
|
|
||||||
public TianService tianService() {
|
|
||||||
return new TianService(properties);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
org.nl.Cat
|
|
||||||
org.nl.Dog
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.nl.starter.TianServiceAutoConfiguration
|
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public class Test {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
JSONObject json=new JSONObject();
|
|
||||||
json.put("id","1493102834739187714");
|
|
||||||
System.out.println(json.getLong("id"));
|
|
||||||
System.out.println(json.getString("id"));
|
|
||||||
|
|
||||||
HashMap map=new HashMap();
|
|
||||||
map.put("a","1");
|
|
||||||
map.put("b","2");
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map));
|
|
||||||
System.out.println(jsonObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>nladmin-system</module>
|
<module>nladmin-system</module>
|
||||||
<module>nladmin-test</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user