Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
safe-campus-bbs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万成波
safe-campus-bbs
Commits
84996912
Commit
84996912
authored
Aug 29, 2025
by
万成波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分模块
parent
78afd66a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
31 deletions
+4
-31
safe-campus-admin/src/main/resources/application-dev.yml
safe-campus-admin/src/main/resources/application-dev.yml
+1
-1
safe-campus-points/src/main/java/com/tangguo/service/IBbsUserPointsDetailService.java
...java/com/tangguo/service/IBbsUserPointsDetailService.java
+0
-8
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsUserPointsDetailServiceImpl.java
.../tangguo/service/impl/BbsUserPointsDetailServiceImpl.java
+0
-20
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsUserPointsServiceImpl.java
...va/com/tangguo/service/impl/BbsUserPointsServiceImpl.java
+3
-2
No files found.
safe-campus-admin/src/main/resources/application-dev.yml
View file @
84996912
...
...
@@ -33,7 +33,7 @@ spring:
# 配置网络超时时间
socketTimeout
:
60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis
:
6
0000
timeBetweenEvictionRunsMillis
:
1
0000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis
:
300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
...
...
safe-campus-points/src/main/java/com/tangguo/service/IBbsUserPointsDetailService.java
View file @
84996912
...
...
@@ -22,12 +22,4 @@ public interface IBbsUserPointsDetailService extends IService<BbsUserPointsDetai
*/
List
<
BbsUserPointsDetail
>
getUserPointsDetail
(
String
userName
);
/**
* 添加用户积分明细
*
* @param detail 积分明细
*/
void
addUsrePointsDetail
(
BbsUserPointsDetail
detail
);
}
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsUserPointsDetailServiceImpl.java
View file @
84996912
...
...
@@ -38,24 +38,4 @@ public class BbsUserPointsDetailServiceImpl extends ServiceImpl<BbsUserPointsDet
);
}
/**
* 添加用户积分明细
*
* @param detail 积分明细
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
addUsrePointsDetail
(
BbsUserPointsDetail
detail
)
{
BbsUserPointsDetail
addDetail
=
new
BbsUserPointsDetail
();
addDetail
.
setUserName
(
detail
.
getUserName
());
addDetail
.
setDetailName
(
detail
.
getDetailName
());
addDetail
.
setDetailCode
(
detail
.
getDetailCode
());
addDetail
.
setDetailPoints
(
detail
.
getDetailPoints
());
addDetail
.
setBeforePoints
(
detail
.
getBeforePoints
());
addDetail
.
setAfterPoints
(
detail
.
getAfterPoints
());
addDetail
.
setDescription
(
detail
.
getDescription
());
this
.
save
(
addDetail
);
}
}
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsUserPointsServiceImpl.java
View file @
84996912
...
...
@@ -11,6 +11,7 @@ import com.tangguo.mapper.BbsUserPointsMapper;
import
com.tangguo.service.IBbsUserPointsDetailService
;
import
com.tangguo.service.IBbsUserPointsService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.TransactionManager
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -148,7 +149,7 @@ public class BbsUserPointsServiceImpl extends ServiceImpl<BbsUserPointsMapper, B
}
// 更新用户积分
BbsUserPoints
userPoints
=
this
.
getUserPoints
(
userName
);
BbsUserPoints
userPoints
=
this
.
userPointsServiceImpl
.
getUserPoints
(
userName
);
Integer
currentPoints
=
userPoints
.
getCurrentPoints
();
int
incrCurrentPoints
=
currentPoints
+
points
;
userPoints
.
setCurrentPoints
(
incrCurrentPoints
);
...
...
@@ -182,7 +183,7 @@ public class BbsUserPointsServiceImpl extends ServiceImpl<BbsUserPointsMapper, B
}
// 更新用户积分
BbsUserPoints
userPoints
=
this
.
getUserPoints
(
userName
);
BbsUserPoints
userPoints
=
this
.
userPointsServiceImpl
.
getUserPoints
(
userName
);
Integer
currentPoints
=
userPoints
.
getCurrentPoints
();
if
(
points
>
currentPoints
)
{
throw
new
ServiceException
(
"扣减用户积分失败,当前用户可用积分不足。"
);
...
...
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