Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fit-finance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fitness-server
fit-finance
Commits
103495cb
Commit
103495cb
authored
Feb 19, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:init
parent
432f9e97
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
180 additions
and
11 deletions
+180
-11
app/pom.xml
+12
-0
app/src/main/java/com/jiejing/fitness/finance/app/FitnessFinanceApplication.java
+46
-0
app/src/main/java/com/jiejing/fitness/finance/app/config/FinanceAsyncConfiguration.java
+31
-0
app/src/main/resources/application.yml
+1
-1
app/src/main/resources/bootstrap.yml
+1
-1
pom.xml
+5
-5
repository/pom.xml
+4
-4
repository/src/test/java/com/jiejing/fitness/finance/repository/GeneratorServiceEntity.java
+80
-0
No files found.
app/pom.xml
View file @
103495cb
...
@@ -13,9 +13,21 @@
...
@@ -13,9 +13,21 @@
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.jiejing.fitness.finance
</groupId>
<groupId>
com.jiejing.fitness.finance
</groupId>
<artifactId>
api
</artifactId>
</dependency>
<dependency>
<groupId>
com.jiejing.fitness.finance
</groupId>
<artifactId>
service
</artifactId>
<artifactId>
service
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
com.jiejing.common
</groupId>
<groupId>
com.jiejing.common
</groupId>
<artifactId>
ding-client
</artifactId>
<artifactId>
ding-client
</artifactId>
</dependency>
</dependency>
...
...
app/src/main/java/com/jiejing/fitness/finance/app/FitnessFinanceApplication.java
0 → 100644
View file @
103495cb
package
com
.
jiejing
.
fitness
.
finance
.
app
;
import
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
;
import
com.jiejing.common.config.idgen.EnableLeaseIdWorker
;
import
com.jiejing.filecenter.api.common.event.ResourceEvent
;
import
com.jiejing.paycenter.common.event.MerchantEvent
;
import
com.jiejing.paycenter.common.event.PayEvent
;
import
com.xiaomai.event.annotation.EnableEventBinding
;
import
lombok.extern.slf4j.Slf4j
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
/**
* @author chengyubing
* @since 2024/2/19 16:04
*/
@Slf4j
@EnableAsync
@EnableScheduling
@EnableLeaseIdWorker
@MapperScan
(
value
=
{
"com.jiejing.fitness.finance.repository.mapper"
})
@EnableEventBinding
(
listenerClass
=
{
PayEvent
.
class
,
MerchantEvent
.
class
,
ResourceEvent
.
class
})
@EnableFeignClients
(
basePackages
=
{
"com.jiejing.filecenter.api"
,
"com.jiejing.paycenter.api"
})
@SpringBootApplication
(
scanBasePackages
=
"com.jiejing"
,
exclude
=
{
DruidDataSourceAutoConfigure
.
class
})
public
class
FitnessFinanceApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
FitnessFinanceApplication
.
class
,
args
);
System
.
out
.
println
(
"FitnessFinanceApplication start success!"
);
log
.
info
(
"FitnessFinanceApplication start success!"
);
}
}
app/src/main/java/com/jiejing/fitness/finance/app/config/FinanceAsyncConfiguration.java
0 → 100644
View file @
103495cb
package
com
.
jiejing
.
fitness
.
finance
.
app
.
config
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.task.AsyncTaskExecutor
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
/**
* @author chengyubing
* @since 2024/2/18 17:04
*/
@Slf4j
@Configuration
public
class
FinanceAsyncConfiguration
{
@Bean
(
value
=
"financeAsyncConfiguration"
)
public
AsyncTaskExecutor
payCenterThreadPool
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setCorePoolSize
(
Runtime
.
getRuntime
().
availableProcessors
()
*
8
);
executor
.
setMaxPoolSize
(
Runtime
.
getRuntime
().
availableProcessors
()
*
16
);
executor
.
setQueueCapacity
(
120
);
executor
.
setKeepAliveSeconds
(
60
);
executor
.
setThreadNamePrefix
(
"financeThreadPool-"
);
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
executor
.
initialize
();
return
executor
;
}
}
app/src/main/resources/application.yml
View file @
103495cb
...
@@ -87,7 +87,7 @@ mybatis-plus:
...
@@ -87,7 +87,7 @@ mybatis-plus:
#实体扫描,多个package用逗号或者分号分隔
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage
:
com.jiejing.fitness.finance.repository.entity
typeAliasesPackage
:
com.jiejing.fitness.finance.repository.entity
# 支持统配符 * 或者 ; 分割,分别引入repository层,api层和common包的枚举值
# 支持统配符 * 或者 ; 分割,分别引入repository层,api层和common包的枚举值
typeEnumsPackage
:
com.jiejing.
paycenter.common.enums;com.jiejing.common.enums;com.jiejing.fitness.finance.api
.enums
typeEnumsPackage
:
com.jiejing.
fitness.finance.api.enums;com.jiejing.paycenter.common.enums;com.jiejing.common
.enums
globalConfig
:
globalConfig
:
dbConfig
:
dbConfig
:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
...
...
app/src/main/resources/bootstrap.yml
View file @
103495cb
spring
:
spring
:
application
:
application
:
name
:
paycenter
name
:
fit-finance
profiles
:
profiles
:
active
:
local
active
:
local
http
:
http
:
...
...
pom.xml
View file @
103495cb
...
@@ -76,6 +76,11 @@
...
@@ -76,6 +76,11 @@
<!-- ======================= jiejing tools start ======================= -->
<!-- ======================= jiejing tools start ======================= -->
<dependency>
<dependency>
<groupId>
com.jiejing.fitness
</groupId>
<artifactId>
fitness-share
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.jiejing.common
</groupId>
<groupId>
com.jiejing.common
</groupId>
<artifactId>
common-core
</artifactId>
<artifactId>
common-core
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<version>
0.0.1-SNAPSHOT
</version>
...
@@ -91,11 +96,6 @@
...
@@ -91,11 +96,6 @@
<version>
0.0.4-SNAPSHOT
</version>
<version>
0.0.4-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.jiejing.repo
</groupId>
<artifactId>
repo-core
</artifactId>
<version>
0.0.1-META-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.jiejing.cache
</groupId>
<groupId>
com.jiejing.cache
</groupId>
<artifactId>
redis-xcache
</artifactId>
<artifactId>
redis-xcache
</artifactId>
<version>
0.0.2-SNAPSHOT
</version>
<version>
0.0.2-SNAPSHOT
</version>
...
...
repository/pom.xml
View file @
103495cb
...
@@ -25,6 +25,10 @@
...
@@ -25,6 +25,10 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.jiejing.fitness
</groupId>
<artifactId>
fitness-share
</artifactId>
</dependency>
<dependency>
<groupId>
com.jiejing.common
</groupId>
<groupId>
com.jiejing.common
</groupId>
<artifactId>
common-core
</artifactId>
<artifactId>
common-core
</artifactId>
</dependency>
</dependency>
...
@@ -37,10 +41,6 @@
...
@@ -37,10 +41,6 @@
<artifactId>
common-config-mybatis
</artifactId>
<artifactId>
common-config-mybatis
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.jiejing.repo
</groupId>
<artifactId>
repo-core
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid-spring-boot-starter
</artifactId>
<artifactId>
druid-spring-boot-starter
</artifactId>
</dependency>
</dependency>
...
...
repository/src/test/java/com/jiejing/fitness/finance/repository/GeneratorServiceEntity.java
0 → 100755
View file @
103495cb
package
com
.
jiejing
.
fitness
.
finance
.
repository
;
import
static
com
.
jiejing
.
mbp
.
utils
.
CodeGenerateTypeEnum
.
ENTITY
;
import
static
com
.
jiejing
.
mbp
.
utils
.
CodeGenerateTypeEnum
.
MAPPER_INTERFACE
;
import
static
com
.
jiejing
.
mbp
.
utils
.
CodeGenerateTypeEnum
.
MAPPER_XML
;
import
static
com
.
jiejing
.
mbp
.
utils
.
CodeGenerateTypeEnum
.
SERVICE
;
import
com.google.common.collect.Sets
;
import
com.jiejing.mbp.utils.CodeGenerateTypeEnum
;
import
com.jiejing.mbp.utils.CodeGenerateUtil
;
import
java.util.Set
;
import
org.junit.Test
;
/**
* <p>
* 测试生成代码
* </p>
*
* @author K神
* @date 2017/12/18
*/
public
class
GeneratorServiceEntity
{
/**
* 数据库连接配置
* <p>
* 需要换成对应的数据库
*/
private
static
final
String
dbUrl
=
"jdbc:mysql://rm-bp1jio2v5y2msvh6jno.rwlb.rds.aliyuncs.com/"
+
"finance"
+
"?useUnicode=true&characterEncoding=utf-8&useSSL=false"
;
private
static
final
String
userName
=
"root"
;
private
static
final
String
password
=
"4rfv%TGB"
;
/**
* 需要换成对应包名
*/
private
static
final
String
packageName
=
"com.jiejing.fitness.finance.repository"
;
private
static
final
String
outPutDir
=
"../repository/src/main/java"
;
private
Set
<
CodeGenerateTypeEnum
>
generateAll
=
Sets
.
newHashSet
(
ENTITY
,
MAPPER_XML
,
MAPPER_INTERFACE
,
SERVICE
);
private
Set
<
CodeGenerateTypeEnum
>
generateEntity
=
Sets
.
newHashSet
(
MAPPER_XML
);
/**
* 是否覆盖原有代码文件,按需设置
*/
private
Boolean
fileOverride
=
true
;
/**
* 使用前请更改
*/
private
String
author
=
"chengyubing"
;
private
String
[]
tableNames
=
{
};
/**
* 使用前确认包含jar包
* <dependency>
* <groupId>com.baomidou</groupId>
* <artifactId>mybatis-plus-generator</artifactId>
* <version>3.1.0</version>
* <scope>test</scope>
* </dependency>
*/
@Test
public
void
generateAllCode
()
{
CodeGenerateUtil
.
generateByTableNames
(
dbUrl
,
userName
,
password
,
outPutDir
,
packageName
,
generateAll
,
fileOverride
,
author
,
tableNames
);
}
@Test
public
void
generateOnlyEntity
()
{
CodeGenerateUtil
.
generateByTableNames
(
dbUrl
,
userName
,
password
,
outPutDir
,
packageName
,
generateEntity
,
fileOverride
,
author
,
tableNames
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment