mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-07-26 15:38:57 +08:00
完善
This commit is contained in:
39
docker/dev/docker-compose.yaml
Normal file
39
docker/dev/docker-compose.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
services:
|
||||
pg:
|
||||
image: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_PASSWORD: 'abc@123'
|
||||
POSTGRES_USER: "postgres"
|
||||
POSTGRES_DB: "coal"
|
||||
networks:
|
||||
- dn
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- ./redis.conf:/etc/redis/redis.conf
|
||||
- redis_data:/data
|
||||
networks:
|
||||
- dn
|
||||
command:
|
||||
- redis-server
|
||||
- /etc/redis/redis.conf
|
||||
|
||||
|
||||
networks:
|
||||
dn:
|
||||
driver: bridge
|
||||
|
||||
|
||||
|
||||
volumes:
|
||||
pg_data:
|
||||
redis_data:
|
||||
|
||||
2276
docker/dev/redis.conf
Normal file
2276
docker/dev/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
27
pom.xml
27
pom.xml
@@ -53,14 +53,18 @@
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-quartz -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-quartz</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-redis</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
@@ -70,6 +74,17 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-core -->
|
||||
<dependency>
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.lihongjie.coal;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
@SpringBootApplication
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
package cn.lihongjie.coal.config;
|
||||
|
||||
import org.springframework.boot.autoconfigure.cache.RedisCacheManagerBuilderCustomizer;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@@ -20,4 +29,7 @@ public class CacheConfig {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
40
src/main/java/cn/lihongjie/coal/config/HibernateConfig.java
Normal file
40
src/main/java/cn/lihongjie/coal/config/HibernateConfig.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package cn.lihongjie.coal.config;
|
||||
|
||||
import org.hibernate.boot.ResourceStreamLocator;
|
||||
import org.hibernate.boot.spi.*;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.type.SqlTypes;
|
||||
import org.hibernate.type.descriptor.sql.internal.DdlTypeImpl;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.sql.SQLType;
|
||||
|
||||
@Configuration
|
||||
public class HibernateConfig {
|
||||
|
||||
|
||||
@Bean
|
||||
AdditionalMappingContributor metadataContributor(){
|
||||
|
||||
return new AdditionalMappingContributor() {
|
||||
@Override
|
||||
public void contribute(AdditionalMappingContributions contributions,
|
||||
InFlightMetadataCollector metadata,
|
||||
ResourceStreamLocator resourceStreamLocator,
|
||||
MetadataBuildingContext buildingContext) {
|
||||
|
||||
buildingContext
|
||||
.getBuildingOptions()
|
||||
.getTypeConfiguration()
|
||||
.getDdlTypeRegistry()
|
||||
.addDescriptor(SqlTypes.VARCHAR, new DdlTypeImpl(SqlTypes.VARCHAR, "text", new PostgreSQLDialect()));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/coalWashingDailyAnalysis")
|
||||
@RequestMapping("/dictionary")
|
||||
public class DictionaryController extends BaseController<DictionaryRepository, DictionaryService, DictionaryEntity> {
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/coalWashingDailyAnalysis")
|
||||
@RequestMapping("/organization")
|
||||
public class OrganizationController extends BaseController<OrganizationRepository, OrganizationService, OrganizationEntity> {
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DictionaryItemEntity extends CommonEntity {
|
||||
|
||||
@OneToMany(mappedBy = "parent")
|
||||
@JsonManagedReference
|
||||
private List<DictionaryEntity> children;
|
||||
private List<DictionaryItemEntity> children;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package cn.lihongjie.coal.job;
|
||||
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
public class DemoJob extends QuartzJobBean {
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
geolite2:
|
||||
url: 'https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=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&suffix=tar.gz'
|
||||
|
||||
server:
|
||||
port: 7456
|
||||
|
||||
spring:
|
||||
jpa:
|
||||
@@ -37,12 +39,7 @@ spring:
|
||||
password: 'abc@123'
|
||||
|
||||
cache:
|
||||
|
||||
type: redis
|
||||
redis:
|
||||
enable-statistics: true
|
||||
quartz:
|
||||
auto-startup: true
|
||||
job-store-type: jdbc
|
||||
overwrite-existing-jobs: true
|
||||
wait-for-jobs-to-complete-on-shutdown: true
|
||||
startup-delay: 5
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<configuration>
|
||||
<springProfile name="dev | test">
|
||||
<!-- configuration to be enabled when the "dev" or "staging" profiles are active -->
|
||||
<include ></include>
|
||||
</springProfile>
|
||||
|
||||
<springProfile name="production">
|
||||
<!-- configuration to be enabled when the "production" profile is not active -->
|
||||
</springProfile>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user