Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
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
lanbaoming
jiedao-api-boot-master
Commits
bdfc06c2
Commit
bdfc06c2
authored
Jul 24, 2024
by
zhaobiyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员积分模块
parent
659913ee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
39 deletions
+42
-39
SnowFlakeConfiguration.java
...ao/framework/snowflake/config/SnowFlakeConfiguration.java
+40
-0
spring.factories
...yudao-common/src/main/resources/META-INF/spring.factories
+2
-1
MemberUserScoreMapper.java
...mber/dal/mysql/memberUserScore/MemberUserScoreMapper.java
+0
-36
MemberUserScoreServiceImpl.java
...r/service/memberUserScore/MemberUserScoreServiceImpl.java
+0
-2
No files found.
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/snowflake/config/SnowFlakeConfiguration.java
0 → 100644
View file @
bdfc06c2
package
cn
.
iocoder
.
yudao
.
framework
.
snowflake
.
config
;
import
cn.hutool.core.lang.generator.SnowflakeGenerator
;
import
cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration
;
import
cn.iocoder.yudao.framework.redis.helper.RedisHelper
;
import
io.micrometer.core.instrument.util.StringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
javax.annotation.Resource
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
/**
* @author zhaobiyan
*/
@Slf4j
@Configuration
@AutoConfigureAfter
(
YudaoRedisAutoConfiguration
.
class
)
public
class
SnowFlakeConfiguration
{
@Resource
private
RedisHelper
redisHelper
;
@Bean
public
SnowflakeGenerator
snowflakeGenerator
()
throws
UnknownHostException
{
String
hostAddress
=
InetAddress
.
getLocalHost
().
getHostAddress
();
log
.
info
(
"snow flask configuration, host address:{}"
,
hostAddress
);
String
workId
=
redisHelper
.
get
(
"snowflake:work:id:"
+
hostAddress
);
if
(
StringUtils
.
isBlank
(
workId
))
{
Long
nextWorkId
=
redisHelper
.
incrBy
(
"incr:work:id"
,
1
);
redisHelper
.
set
(
"snowflake:work:id:"
+
hostAddress
,
String
.
valueOf
(
nextWorkId
));
workId
=
String
.
valueOf
(
nextWorkId
);
}
return
new
SnowflakeGenerator
(
Long
.
parseLong
(
workId
),
0
);
}
}
yudao-framework/yudao-common/src/main/resources/META-INF/spring.factories
View file @
bdfc06c2
...
...
@@ -25,4 +25,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.iocoder.yudao.framework.pay.config.YudaoPayAutoConfiguration,\
cn.iocoder.yudao.framework.customizer.CustomizationAutoConfiguration,\
cn.iocoder.yudao.framework.i18n.config.LocaleAutoConfiguration,\
cn.iocoder.yudao.framework.limiter.RedisLimiterConfiguration
cn.iocoder.yudao.framework.limiter.RedisLimiterConfiguration,\
cn.iocoder.yudao.framework.snowflake.config.SnowFlakeConfiguration
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/memberUserScore/MemberUserScoreMapper.java
View file @
bdfc06c2
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
mysql
.
memberUserScore
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserScore.MemberUserScoreDO
;
import
cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreQueryVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* 会员积分 Mapper
* @author 系统管理员
*/
@Mapper
public
interface
MemberUserScoreMapper
extends
AbstractMapper
<
MemberUserScoreDO
>
{
@Override
default
PageResult
<
MemberUserScoreDO
>
selectPage
(
PageVO
page
,
Object
object
)
{
if
(
object
instanceof
MemberUserScoreQueryVO
)
{
MemberUserScoreQueryVO
vo
=
(
MemberUserScoreQueryVO
)
object
;
return
selectPage
(
page
,
new
LambdaQuery
<
MemberUserScoreDO
>()
.
eqIfPresent
(
MemberUserScoreDO:
:
getMemberId
,
vo
.
getMemberId
())
.
eqIfPresent
(
MemberUserScoreDO:
:
getHoldScore
,
vo
.
getHoldScore
())
.
eqIfPresent
(
MemberUserScoreDO:
:
getUsedScore
,
vo
.
getUsedScore
())
.
eqIfPresent
(
MemberUserScoreDO:
:
getExpiredScore
,
vo
.
getExpiredScore
())
.
betweenIfPresent
(
MemberUserScoreDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
orderByDesc
(
MemberUserScoreDO:
:
getId
));
}
return
null
;
}
@Override
default
List
<
MemberUserScoreDO
>
selectList
(
Object
object
)
{
if
(
object
instanceof
MemberUserScoreQueryVO
)
{
MemberUserScoreQueryVO
vo
=
(
MemberUserScoreQueryVO
)
object
;
return
selectList
(
new
LambdaQuery
<
MemberUserScoreDO
>()
.
eqIfPresent
(
MemberUserScoreDO:
:
getMemberId
,
vo
.
getMemberId
())
.
eqIfPresent
(
MemberUserScoreDO:
:
getHoldScore
,
vo
.
getHoldScore
())
.
eqIfPresent
(
MemberUserScoreDO:
:
getUsedScore
,
vo
.
getUsedScore
())
.
eqIfPresent
(
MemberUserScoreDO:
:
getExpiredScore
,
vo
.
getExpiredScore
())
.
betweenIfPresent
(
MemberUserScoreDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
orderByDesc
(
MemberUserScoreDO:
:
getId
));
}
return
null
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/memberUserScore/MemberUserScoreServiceImpl.java
View file @
bdfc06c2
...
...
@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.member.service.memberUserScore;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.member.convert.memberUserScore.MemberUserScoreConvert
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserScore.MemberUserScoreDO
;
import
cn.iocoder.yudao.module.member.dal.mysql.memberUserScore.MemberUserScoreMapper
;
import
cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreBackVO
;
...
...
@@ -46,7 +45,6 @@ public class MemberUserScoreServiceImpl extends AbstractService<MemberUserScoreM
@Override
public
PageResult
<
MemberUserScoreBackVO
>
getUserScorePage
(
MemberUserScoreQueryVO
query
,
PageVO
page
)
{
PageResult
<
MemberUserScoreBackVO
>
pageResult
=
new
PageResult
<>();
pageResult
.
set
return
pageResult
;
}
...
...
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