Browse Source

first commit

master
张彭杰 2 years ago
commit
e8ad051a80
15 changed files with 618 additions and 0 deletions
  1. 33
      .gitignore
  2. 38
      dating-agency-mal-sdk/.gitignore
  3. 20
      dating-agency-mal-sdk/pom.xml
  4. 38
      dating-agency-mall-constant/.gitignore
  5. 20
      dating-agency-mall-constant/pom.xml
  6. 38
      dating-agency-mall-entity/.gitignore
  7. 20
      dating-agency-mall-entity/pom.xml
  8. 38
      dating-agency-mall-event/.gitignore
  9. 20
      dating-agency-mall-event/pom.xml
  10. 38
      dating-agency-mall-server/.gitignore
  11. 71
      dating-agency-mall-server/pom.xml
  12. 21
      dating-agency-mall-server/src/main/java/com/qniao/dam/server/MallServerApplication.java
  13. 93
      dating-agency-mall-server/src/main/resources/application.yml
  14. 66
      dating-agency-mall-server/src/main/resources/logback.xml
  15. 64
      pom.xml

33
.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
/logs
*.json

38
dating-agency-mal-sdk/.gitignore

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

20
dating-agency-mal-sdk/pom.xml

@ -0,0 +1,20 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qniao</groupId>
<artifactId>dating-agency-mall</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dating-agency-mal-sdk</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

38
dating-agency-mall-constant/.gitignore

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

20
dating-agency-mall-constant/pom.xml

@ -0,0 +1,20 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qniao</groupId>
<artifactId>dating-agency-mall</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dating-agency-mall-constant</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

38
dating-agency-mall-entity/.gitignore

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

20
dating-agency-mall-entity/pom.xml

@ -0,0 +1,20 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qniao</groupId>
<artifactId>dating-agency-mall</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dating-agency-mall-entity</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

38
dating-agency-mall-event/.gitignore

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

20
dating-agency-mall-event/pom.xml

@ -0,0 +1,20 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qniao</groupId>
<artifactId>dating-agency-mall</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dating-agency-mall-event</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

38
dating-agency-mall-server/.gitignore

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

71
dating-agency-mall-server/pom.xml

@ -0,0 +1,71 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qniao</groupId>
<artifactId>dating-agency-mall</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dating-agency-mall-server</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.qniao</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.qniao</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.qniao</groupId>
<artifactId>mybatis-plus-starter</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
</dependency>
<dependency>
<groupId>com.qniao</groupId>
<artifactId>common-utils</artifactId>
</dependency>
<dependency>
<groupId>com.qniao</groupId>
<artifactId>swagger-starter</artifactId>
</dependency>
<dependency>
<groupId>com.qniao</groupId>
<artifactId>redis-starter</artifactId>
</dependency>
</dependencies>
<build>
<finalName>dating-agency-mall-server</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<defaultGoal>compile</defaultGoal>
</build>
</project>

21
dating-agency-mall-server/src/main/java/com/qniao/dam/server/MallServerApplication.java

@ -0,0 +1,21 @@
package com.qniao.dam.server;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication(scanBasePackages = {"com.qniao"})
@EnableEurekaClient
@MapperScan("com.qniao.**.dao.**")
@EnableFeignClients(basePackages = {"com.qniao"})
@EnableApolloConfig
public class MallServerApplication {
public static void main(String[] args) {
SpringApplication.run(MallServerApplication.class, args);
}
}

93
dating-agency-mall-server/src/main/resources/application.yml

@ -0,0 +1,93 @@
server:
port: 6002
servlet:
context-path: /dating-agency-mall
spring:
application:
name: eureka-client-dating-agency-mall
description: 商城
api-doc-enabled: ${swagger-on:true}
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
name: ${mysql-database-name}
url: jdbc:mysql://${mysql-database-url}/${mysql-database-name}?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useTimezone=true&serverTimezone=GMT%2B8&useSSL=false&allowMultiQueries=true
username: ${mysql-user-name}
password: ${mysql-user-password}
hikari:
minimum-idle: 3
maximum-pool-size: 10
max-lifetime: 30000
connection-test-query: SELECT 1
redis:
database: ${redis-database-index:0}
host: ${redis-host}
port: ${redis-port:6379}
password: ${redis-password}
timeout: 3000
lettuce:
pool:
max-active: 200
max-idle: 20
min-idle: 10
max-wait: -1
servlet:
multipart:
enabled: true
max-file-size: 100MB
max-request-size: 105MB
mybatis:
mapper-locations: classpath:mapping/*Mapper.xml
type-aliases-package: com.qniao.**.entity
# mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus:
global-config:
db-config:
table-prefix: qn_
logic-delete-field: isDelete # 全局逻辑删除的实体字段名
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
type-enums-package: com.qniao.**.constant
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
eureka:
client:
register-with-eureka: true
fetch-registry: ${eureka-enable:true}
service-url:
defaultZone: http://${register-eureka-url}/eureka/
instance:
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port}
lease-expiration-duration-in-seconds: 15
lease-renewal-interval-in-seconds: 5
feign:
hystrix:
enabled: false
client:
config:
default:
connectTimeout: 10000
readTimeout: 60000
# DefaultClientConfigImpl
ribbon:
ConnectTimeout: 8000
ReadTimeout: 20000
# apollo
app:
id: dating-agency-mall
snow-flake:
datacenter-id: 1
machine-id: 1
ding-talk-alarm-robot-access-token: 1
logging:
config: classpath:logback.xml

66
dating-agency-mall-server/src/main/resources/logback.xml

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="system"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>./logs/log.log</file>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>./logs/log.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>3</maxHistory>
</rollingPolicy>
<encoder>
<pattern>[%d{yyyy-MM-dd HH:mm:ss:SSS}] %thread %level %logger{36} %L - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- ThresholdFilter:临界值过滤器,过滤掉 TRACE 和 DEBUG 级别的日志 -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>./logs/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>3</maxHistory><!--保存最近30天的日志-->
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %-5level %logger{36} : %msg%n</pattern>
</encoder>
</appender>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{yyyy-MM-dd HH:mm:ss:SSS}] %thread %level %logger{36} %L - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<logger name="com.qniao" level="info" additivity="false">
<appender-ref ref="stdout"/>
<appender-ref ref="system"/>
<appender-ref ref="errorFile"/>
</logger>
<logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="info"
additivity="false">
<appender-ref ref="stdout"/>
</logger>
<logger name="org.springframework.orm.jpa.JpaTransactionManager" level="debug"
additivity="false">
<appender-ref ref="stdout"/>
</logger>
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="trace"
additivity="false">
<appender-ref ref="stdout"/>
</logger>
<root level="info">
<appender-ref ref="stdout"/>
</root>
</configuration>

64
pom.xml

@ -0,0 +1,64 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qniao</groupId>
<artifactId>java-dependency</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dating-agency-mall</artifactId>
<packaging>pom</packaging>
<modules>
<module>dating-agency-mall-server</module>
<module>dating-agency-mall-entity</module>
<module>dating-agency-mall-event</module>
<module>dating-agency-mall-constant</module>
<module>dating-agency-mal-sdk</module>
</modules>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<repository>
<id>maven-releases</id>
<name>Nexus releases Repository</name>
<url>http://120.78.76.88:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshot</id>
<name>Nexus snapshot Repository</name>
<url>http://120.78.76.88:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<!-- 配置远程仓库 -->
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>nexus</id>
<name>qniao</name>
<url>http://120.78.76.88:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
</project>
Loading…
Cancel
Save