diff --git a/.gitignore b/.gitignore index 1912859..d6a7748 100755 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ build/ /han-note-note/han-note-note-biz/src/main/resources/application-dev.yml /han-note-user-relation/han-note-user-relation-biz/src/main/resources/application-dev.yml /han-note-user-relation/han-note-user-relation-biz/logs/ +/han-note-count/han-note-count-biz/src/main/resources/application-dev.yml diff --git a/.idea/encodings.xml b/.idea/encodings.xml index a79ed8e..530d611 100755 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -3,6 +3,12 @@ + + + + + + diff --git a/han-note-count/han-note-count-api/pom.xml b/han-note-count/han-note-count-api/pom.xml new file mode 100644 index 0000000..1d3a129 --- /dev/null +++ b/han-note-count/han-note-count-api/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + + com.hanserwei + han-note-count + ${revision} + + + + jar + + han-note-count-api + ${project.artifactId} + RPC层, 供其他服务调用 + + + + com.hanserwei + hanserwei-common + + + + diff --git a/han-note-count/han-note-count-biz/pom.xml b/han-note-count/han-note-count-biz/pom.xml new file mode 100644 index 0000000..0866c2a --- /dev/null +++ b/han-note-count/han-note-count-biz/pom.xml @@ -0,0 +1,103 @@ + + 4.0.0 + + + com.hanserwei + han-note-count + ${revision} + + + + jar + + han-note-count-biz + ${project.artifactId} + 计数服务业务模块 + + + + com.hanserwei + hanserwei-common + + + + + com.hanserwei + hanserwei-spring-boot-starter-biz-operationlog + + + + + com.hanserwei + hanserwei-spring-boot-starter-biz-context + + + + + com.hanserwei + hanserwei-spring-boot-starter-jackson + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.baomidou + mybatis-plus-spring-boot3-starter + + + + + com.mysql + mysql-connector-j + + + + + com.alibaba + druid-spring-boot-3-starter + + + + + org.apache.commons + commons-pool2 + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/HannoteCountBizApplication.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/HannoteCountBizApplication.java new file mode 100644 index 0000000..a2e4cc9 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/HannoteCountBizApplication.java @@ -0,0 +1,13 @@ +package com.hanserwei.hannote.count.biz.domain; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan("com.hanserwei.hannote.count.biz.domain.mapper") +public class HannoteCountBizApplication { + public static void main(String[] args) { + SpringApplication.run(HannoteCountBizApplication.class, args); + } +} diff --git a/han-note-count/han-note-count-biz/src/main/resources/application.yml b/han-note-count/han-note-count-biz/src/main/resources/application.yml new file mode 100644 index 0000000..02c3b36 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/resources/application.yml @@ -0,0 +1,34 @@ +server: + port: 8090 # 项目启动的端口 + +spring: + profiles: + active: dev # 默认激活 dev 本地开发环境 + servlet: + multipart: + max-file-size: 20MB # 单个文件最大大小 + max-request-size: 100MB # 单次请求最大大小(包含多个文件) + data: + redis: + database: 5 # Redis 数据库索引(默认为 0) + host: 127.0.0.1 # Redis 服务器地址 + port: 6379 # Redis 服务器连接端口 + password: redis # Redis 服务器连接密码(默认为空) + timeout: 5s # 读超时时间 + connect-timeout: 5s # 链接超时时间 + lettuce: + pool: + max-active: 200 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 10 # 连接池中的最大空闲连接 +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl + global-config: + banner: false + mapper-locations: classpath*:/mapperxml/*.xml +mq-consumer: # MQ 消费者 + follow-unfollow: # 关注、取关 + rate-limit: 5000 # 每秒限流阈值 \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/resources/bootstrap.yml b/han-note-count/han-note-count-biz/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..f59072c --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/resources/bootstrap.yml @@ -0,0 +1,19 @@ +spring: + application: + name: han-note-count # 应用名称 + profiles: + active: dev # 默认激活 dev 本地开发环境 + cloud: + nacos: + discovery: + enabled: true # 启用服务发现 + group: DEFAULT_GROUP # 所属组 + namespace: han-note # 命名空间 + server-addr: 127.0.0.1:8848 # 指定 Nacos 配置中心的服务器地址 + config: + server-addr: http://127.0.0.1:8848 # 指定 Nacos 配置中心的服务器地址 + prefix: ${spring.application.name} # 配置 Data Id 前缀,这里使用应用名称作为前缀 + group: DEFAULT_GROUP # 所属组 + namespace: han-note # 命名空间 + file-extension: yaml # 配置文件格式 + refresh-enabled: true # 是否开启动态刷新 \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/resources/logback-spring.xml b/han-note-count/han-note-count-biz/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..fa79dc6 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/resources/logback-spring.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + ${LOG_FILE}-%i.log + + 30 + + 10MB + + 0 + + false + + + ${LOG_PATTERN} + UTF-8 + + + + + + + 0 + + 256 + + + + + + + + + + + + + + + + + + + + + diff --git a/han-note-count/pom.xml b/han-note-count/pom.xml new file mode 100644 index 0000000..74822b2 --- /dev/null +++ b/han-note-count/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + + + com.hanserwei + han-note + ${revision} + + + + pom + + + + han-note-count-api + han-note-count-biz + + + han-note-count + + ${project.artifactId} + + 计数服务 + + diff --git a/pom.xml b/pom.xml index a9daa38..47f3af7 100755 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ han-note-note han-note-note/han-note-note-biz han-note-user-relation + han-note-count