Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course
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
hqzhdj
course
Commits
de8843be
Commit
de8843be
authored
Oct 18, 2024
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置信息
parent
1ed1e0cc
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
28 deletions
+29
-28
cloud-course/pom.xml
+4
-0
cloud-course/src/main/java/com/yizhi/course/application/CourseApplication.java
+2
-1
cloud-course/src/main/java/com/yizhi/course/application/controller/CourseStudyController.java
+3
-4
cloud-course/src/main/java/com/yizhi/course/application/controller/OfflineRecordeController.java
+6
-8
cloud-course/src/main/java/com/yizhi/course/application/orm/generator/MybatisCodeGenerator.java
+1
-1
cloud-course/src/main/java/com/yizhi/course/application/service/impl/ScormServiceImpl.java
+5
-5
cloud-course/src/main/java/com/yizhi/course/application/task/CoursePointInitAsync.java
+3
-4
cloud-course/src/main/resources/bootstrap.properties
+3
-3
pom.xml
+2
-2
No files found.
cloud-course/pom.xml
View file @
de8843be
...
@@ -81,5 +81,9 @@
...
@@ -81,5 +81,9 @@
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
<properties>
<!-- 跳过测试 -->
<skipTests>
true
</skipTests>
</properties>
</project>
</project>
cloud-course/src/main/java/com/yizhi/course/application/CourseApplication.java
View file @
de8843be
...
@@ -2,6 +2,7 @@ package com.yizhi.course.application;
...
@@ -2,6 +2,7 @@ package com.yizhi.course.application;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
...
@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
...
@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* @Date: 2018/1/22 11:07
* @Date: 2018/1/22 11:07
*/
*/
@EnableTransactionManagement
@EnableTransactionManagement
@SpringBootApplication
@SpringBootApplication
(
exclude
=
{
RabbitAutoConfiguration
.
class
})
@EnableDiscoveryClient
@EnableDiscoveryClient
@EnableFeignClients
(
basePackages
=
{
"com.yizhi"
})
@EnableFeignClients
(
basePackages
=
{
"com.yizhi"
})
@ComponentScan
(
basePackages
=
{
"com.yizhi"
})
@ComponentScan
(
basePackages
=
{
"com.yizhi"
})
...
...
cloud-course/src/main/java/com/yizhi/course/application/controller/CourseStudyController.java
View file @
de8843be
...
@@ -28,7 +28,6 @@ import com.yizhi.util.application.event.TrainingProjectEvent;
...
@@ -28,7 +28,6 @@ import com.yizhi.util.application.event.TrainingProjectEvent;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -56,9 +55,9 @@ public class CourseStudyController {
...
@@ -56,9 +55,9 @@ public class CourseStudyController {
@Autowired
@Autowired
PointRedisFeignClients
pointRedisFeignClients
;
PointRedisFeignClients
pointRedisFeignClients
;
/*
@Autowired
@Autowired
AmqpTemplate
amqpTemplate
;
AmqpTemplate amqpTemplate;
*/
@Autowired
@Autowired
private
ICourseService
courseService
;
private
ICourseService
courseService
;
...
@@ -947,7 +946,7 @@ public class CourseStudyController {
...
@@ -947,7 +946,7 @@ public class CourseStudyController {
LOGGER
.
info
(
"准备发送积分,设置{}对象到redis,sitePointId={}"
,
pointParamVO
,
sitePointId
);
LOGGER
.
info
(
"准备发送积分,设置{}对象到redis,sitePointId={}"
,
pointParamVO
,
sitePointId
);
if
(
null
!=
sitePointId
)
{
if
(
null
!=
sitePointId
)
{
//发送积分获取消息
//发送积分获取消息
amqpTemplate
.
convertAndSend
(
mqKey
,
sitePointId
);
//web端 定义 MQqueuesEnum.COURSE.
//
amqpTemplate.convertAndSend(mqKey, sitePointId); //web端 定义 MQqueuesEnum.COURSE.
// 配合小伟的经验发放
// 配合小伟的经验发放
/*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO);
/*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO);
LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId);
LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId);
...
...
cloud-course/src/main/java/com/yizhi/course/application/controller/OfflineRecordeController.java
View file @
de8843be
...
@@ -43,8 +43,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
...
@@ -43,8 +43,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.usermodel.*
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -84,11 +82,11 @@ public class OfflineRecordeController {
...
@@ -84,11 +82,11 @@ public class OfflineRecordeController {
private
IdGenerator
idGenerator
;
private
IdGenerator
idGenerator
;
@Autowired
@Autowired
private
LogEventPublisher
logEventPublisher
;
private
LogEventPublisher
logEventPublisher
;
/*@Autowired
AmqpTemplate amqpTemplate;*/
/*
@Autowired
@Autowired
AmqpTemplate
amqpTemplate
;
RabbitTemplate rabbitTemplate;*/
@Autowired
RabbitTemplate
rabbitTemplate
;
@Autowired
@Autowired
private
TaskExecutor
taskExecutor
;
private
TaskExecutor
taskExecutor
;
...
@@ -512,7 +510,7 @@ public class OfflineRecordeController {
...
@@ -512,7 +510,7 @@ public class OfflineRecordeController {
}
}
// 错误的信息发送给任务详情表
// 错误的信息发送给任务详情表
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
failEvents
))
{
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
failEvents
))
{
rabbitTemplate
.
convertAndSend
(
LogQueue
.
BATCH_TASK_LOG_DETAIL_QUEUE
,
failEvents
);
//
rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
}
}
result
.
put
(
"success"
,
recordes
);
result
.
put
(
"success"
,
recordes
);
result
.
put
(
"error"
,
Collections
.
singletonList
(
"成功导入"
+
passCount
+
"条,失败"
+
failCount
+
"条"
));
result
.
put
(
"error"
,
Collections
.
singletonList
(
"成功导入"
+
passCount
+
"条,失败"
+
failCount
+
"条"
));
...
@@ -607,7 +605,7 @@ public class OfflineRecordeController {
...
@@ -607,7 +605,7 @@ public class OfflineRecordeController {
String
sitePointId
=
pointRedisFeignClients
.
addPointRedis
(
pointParamVO
);
String
sitePointId
=
pointRedisFeignClients
.
addPointRedis
(
pointParamVO
);
// 发送积分
// 发送积分
if
(
StringUtils
.
isNotBlank
(
sitePointId
))
{
if
(
StringUtils
.
isNotBlank
(
sitePointId
))
{
amqpTemplate
.
convertAndSend
(
"offlineCourse"
,
sitePointId
);
//
amqpTemplate.convertAndSend("offlineCourse", sitePointId);
}
}
}
}
...
...
cloud-course/src/main/java/com/yizhi/course/application/orm/generator/MybatisCodeGenerator.java
View file @
de8843be
...
@@ -53,7 +53,7 @@ public class MybatisCodeGenerator {
...
@@ -53,7 +53,7 @@ public class MybatisCodeGenerator {
return
super
.
processTypeConvert
(
fieldType
);
return
super
.
processTypeConvert
(
fieldType
);
}
}
});
});
dsc
.
setDriverName
(
"com.mysql.jdbc.Driver"
);
dsc
.
setDriverName
(
"com.mysql.
cj.
jdbc.Driver"
);
dsc
.
setUsername
(
"root"
);
dsc
.
setUsername
(
"root"
);
dsc
.
setPassword
(
"fulan123"
);
dsc
.
setPassword
(
"fulan123"
);
dsc
.
setUrl
(
"jdbc:mysql://180.169.149.5:11306/cloud_statistics?characterEncoding=utf8"
);
dsc
.
setUrl
(
"jdbc:mysql://180.169.149.5:11306/cloud_statistics?characterEncoding=utf8"
);
...
...
cloud-course/src/main/java/com/yizhi/course/application/service/impl/ScormServiceImpl.java
View file @
de8843be
...
@@ -25,7 +25,6 @@ import com.yizhi.util.application.date.DateUtil;
...
@@ -25,7 +25,6 @@ import com.yizhi.util.application.date.DateUtil;
import
com.yizhi.util.application.event.TrainingProjectEvent
;
import
com.yizhi.util.application.event.TrainingProjectEvent
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -33,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -33,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -57,8 +57,8 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
...
@@ -57,8 +57,8 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
private
CloudEventPublisher
cloudEventPublisher
;
private
CloudEventPublisher
cloudEventPublisher
;
@Autowired
@Autowired
private
PointRedisFeignClients
pointRedisFeignClients
;
private
PointRedisFeignClients
pointRedisFeignClients
;
@Autowired
/*
@Autowired
private
AmqpTemplate
amqpTemplate
;
private AmqpTemplate amqpTemplate;
*/
@Autowired
@Autowired
private
IRecordeService
recordeService
;
private
IRecordeService
recordeService
;
@Autowired
@Autowired
...
@@ -80,7 +80,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
...
@@ -80,7 +80,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
@Autowired
@Autowired
private
ICourseMqRecordService
courseMqRecordService
;
private
ICourseMqRecordService
courseMqRecordService
;
@
Autowired
@
Resource
private
ScormMapper
scormMapper
;
private
ScormMapper
scormMapper
;
@Autowired
@Autowired
...
@@ -905,7 +905,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
...
@@ -905,7 +905,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
String
sitePointId
=
pointRedisFeignClients
.
addPointRedis
(
pointParamVO
);
String
sitePointId
=
pointRedisFeignClients
.
addPointRedis
(
pointParamVO
);
if
(
null
!=
sitePointId
)
{
if
(
null
!=
sitePointId
)
{
//发送积分获取消息
//发送积分获取消息
amqpTemplate
.
convertAndSend
(
mqName
,
sitePointId
);
//
amqpTemplate.convertAndSend(mqName, sitePointId);
return
"ok"
;
return
"ok"
;
}
}
return
"sitePointId 为null"
;
return
"sitePointId 为null"
;
...
...
cloud-course/src/main/java/com/yizhi/course/application/task/CoursePointInitAsync.java
View file @
de8843be
...
@@ -17,7 +17,6 @@ import com.yizhi.point.application.feign.PointUserFeignClients;
...
@@ -17,7 +17,6 @@ import com.yizhi.point.application.feign.PointUserFeignClients;
import
com.yizhi.point.application.vo.PointParamVO
;
import
com.yizhi.point.application.vo.PointParamVO
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -51,8 +50,8 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String
...
@@ -51,8 +50,8 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String
@Autowired
@Autowired
PointUserFeignClients
pointUserFeignClients
;
PointUserFeignClients
pointUserFeignClients
;
@Autowired
/*
@Autowired
AmqpTemplate
amqpTemplate
;
AmqpTemplate amqpTemplate;
*/
// 课程积分发放的事件名称
// 课程积分发放的事件名称
private
static
final
String
EVENT_NAME
=
"pointCourse"
;
private
static
final
String
EVENT_NAME
=
"pointCourse"
;
...
@@ -320,7 +319,7 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String
...
@@ -320,7 +319,7 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String
logger
.
info
(
"准备发送积分,设置{}对象到redis,sitePointId={}"
,
pointParamVO
,
sitePointId
);
logger
.
info
(
"准备发送积分,设置{}对象到redis,sitePointId={}"
,
pointParamVO
,
sitePointId
);
if
(
null
!=
sitePointId
)
{
if
(
null
!=
sitePointId
)
{
//发送积分获取消息
//发送积分获取消息
amqpTemplate
.
convertAndSend
(
mqKey
,
sitePointId
);
//web端 定义 MQqueuesEnum.COURSE.
//
amqpTemplate.convertAndSend(mqKey, sitePointId); //web端 定义 MQqueuesEnum.COURSE.
// 配合小伟的经验发放
// 配合小伟的经验发放
/*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO);
/*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO);
LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId);
LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId);
...
...
cloud-course/src/main/resources/bootstrap.properties
View file @
de8843be
server.port
=
32000
server.port
=
32000
spring.application.name
=
course
spring.application.name
=
course
ACTIVE
=
${spring.profiles.active}
ACTIVE
=
${spring.profiles.active}
spring.profiles.active
=
dev
spring.profiles.active
=
prod
# nacos
# nacos
spring.cloud.nacos.config.shared-dataids
=
common-${spring.profiles.active}.properties
spring.cloud.nacos.config.shared-dataids
=
common-${spring.profiles.active}.properties
spring.cloud.nacos.config.namespace
=
${spring.profiles.active}
spring.cloud.nacos.config.namespace
=
${spring.profiles.active}
spring.cloud.nacos.config.prefix
=
${spring.application.name}
spring.cloud.nacos.config.prefix
=
${spring.application.name}
spring.cloud.nacos.config.file-extension
=
properties
spring.cloud.nacos.config.file-extension
=
properties
#spring.cloud.nacos.config.server-addr=92.168.1.13:3333,192.168.1.24:4444,192.168.1.38:5555
#spring.cloud.nacos.config.server-addr=92.168.1.13:3333,192.168.1.24:4444,192.168.1.38:5555
spring.cloud.nacos.config.server-addr
=
192.168.1.22:3333,192.168.1.22:4444,192.168.1.22:5555
spring.cloud.nacos.config.server-addr
=
10.23.1.183:8848
\ No newline at end of file
\ No newline at end of file
pom.xml
View file @
de8843be
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
<repositories>
<repositories>
<repository>
<repository>
<id>
learning
-data-group
</id>
<id>
hqzhdj
-data-group
</id>
<url>
http://192.168.0.15:8081/repository/
learning
-data-group/
</url>
<url>
http://192.168.0.15:8081/repository/
hqzhdj
-data-group/
</url>
<releases>
<releases>
<enabled>
true
</enabled>
<enabled>
true
</enabled>
</releases>
</releases>
...
...
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