Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
有来技术
youlai-mall
提交
b9a9f539
Y
youlai-mall
项目概览
有来技术
/
youlai-mall
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
youlai-mall
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9a9f539
编写于
11月 14, 2022
作者:
H
haoxr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 广告营销代码优化,优化广告横幅列表接口
上级
9a955956
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
54 addition
and
11 deletion
+54
-11
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsAdvertMapper.java
...main/java/com/youlai/mall/sms/mapper/SmsAdvertMapper.java
+1
-1
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/pojo/entity/SmsAdvert.java
.../main/java/com/youlai/mall/sms/pojo/entity/SmsAdvert.java
+10
-1
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java
...in/java/com/youlai/mall/sms/service/SmsAdvertService.java
+7
-1
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java
...om/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java
+33
-5
mall-sms/sms-boot/src/main/resources/mapper/SmsAdvertMapper.xml
...ms/sms-boot/src/main/resources/mapper/SmsAdvertMapper.xml
+1
-1
youlai-auth/src/main/java/com/youlai/auth/extension/mobile/SmsCodeAuthenticationProvider.java
.../auth/extension/mobile/SmsCodeAuthenticationProvider.java
+2
-2
未找到文件。
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsAdvertMapper.java
浏览文件 @
b9a9f539
...
@@ -18,5 +18,5 @@ public interface SmsAdvertMapper extends BaseMapper<SmsAdvert> {
...
@@ -18,5 +18,5 @@ public interface SmsAdvertMapper extends BaseMapper<SmsAdvert> {
* @param queryParams
* @param queryParams
* @return
* @return
*/
*/
List
<
SmsAdvert
>
listAdvertsPage
(
Page
<
SmsAdvert
>
page
,
AdvertPageQuery
queryParams
);
Page
<
SmsAdvert
>
listAdvertPages
(
Page
<
SmsAdvert
>
page
,
AdvertPageQuery
queryParams
);
}
}
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/pojo/entity/SmsAdvert.java
浏览文件 @
b9a9f539
...
@@ -24,11 +24,20 @@ public class SmsAdvert extends BaseEntity {
...
@@ -24,11 +24,20 @@ public class SmsAdvert extends BaseEntity {
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
private
Date
endTime
;
/**
* 状态
*/
private
Integer
status
;
private
Integer
status
;
/**
* 排序
*/
private
Integer
sort
;
private
Integer
sort
;
private
String
url
;
/**
* 跳转URL
*/
private
String
redirectUrl
;
private
String
remark
;
private
String
remark
;
...
...
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java
浏览文件 @
b9a9f539
...
@@ -4,6 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -4,6 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.mall.sms.pojo.entity.SmsAdvert
;
import
com.youlai.mall.sms.pojo.entity.SmsAdvert
;
import
com.youlai.mall.sms.pojo.query.AdvertPageQuery
;
import
com.youlai.mall.sms.pojo.query.AdvertPageQuery
;
import
com.youlai.mall.sms.pojo.vo.AdBannerVO
;
import
com.youlai.mall.sms.pojo.vo.AdvertPageVO
;
import
java.util.List
;
public
interface
SmsAdvertService
extends
IService
<
SmsAdvert
>
{
public
interface
SmsAdvertService
extends
IService
<
SmsAdvert
>
{
...
@@ -13,5 +17,7 @@ public interface SmsAdvertService extends IService<SmsAdvert> {
...
@@ -13,5 +17,7 @@ public interface SmsAdvertService extends IService<SmsAdvert> {
* @param queryParams
* @param queryParams
* @return
* @return
*/
*/
Page
<
SmsAdvert
>
listAdvertsPage
(
AdvertPageQuery
queryParams
);
Page
<
AdvertPageVO
>
listAdvertPages
(
AdvertPageQuery
queryParams
);
List
<
AdBannerVO
>
listAdBanners
();
}
}
mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java
浏览文件 @
b9a9f539
package
com.youlai.mall.sms.service.impl
;
package
com.youlai.mall.sms.service.impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.common.enums.StatusEnum
;
import
com.youlai.mall.sms.converter.AdvertConverter
;
import
com.youlai.mall.sms.pojo.entity.SmsAdvert
;
import
com.youlai.mall.sms.pojo.entity.SmsAdvert
;
import
com.youlai.mall.sms.mapper.SmsAdvertMapper
;
import
com.youlai.mall.sms.mapper.SmsAdvertMapper
;
import
com.youlai.mall.sms.pojo.query.AdvertPageQuery
;
import
com.youlai.mall.sms.pojo.query.AdvertPageQuery
;
import
com.youlai.mall.sms.pojo.vo.AdBannerVO
;
import
com.youlai.mall.sms.pojo.vo.AdvertPageVO
;
import
com.youlai.mall.sms.service.SmsAdvertService
;
import
com.youlai.mall.sms.service.SmsAdvertService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
...
@@ -17,8 +23,11 @@ import java.util.List;
...
@@ -17,8 +23,11 @@ import java.util.List;
* @date 2022/5/28
* @date 2022/5/28
*/
*/
@Service
@Service
@RequiredArgsConstructor
public
class
SmsAdvertServiceImpl
extends
ServiceImpl
<
SmsAdvertMapper
,
SmsAdvert
>
implements
SmsAdvertService
{
public
class
SmsAdvertServiceImpl
extends
ServiceImpl
<
SmsAdvertMapper
,
SmsAdvert
>
implements
SmsAdvertService
{
private
final
AdvertConverter
advertConverter
;
/**
/**
* 广告分页列表
* 广告分页列表
*
*
...
@@ -26,10 +35,29 @@ public class SmsAdvertServiceImpl extends ServiceImpl<SmsAdvertMapper, SmsAdvert
...
@@ -26,10 +35,29 @@ public class SmsAdvertServiceImpl extends ServiceImpl<SmsAdvertMapper, SmsAdvert
* @return
* @return
*/
*/
@Override
@Override
public
Page
<
SmsAdvert
>
listAdvertsPage
(
AdvertPageQuery
queryParams
)
{
public
Page
<
AdvertPageVO
>
listAdvertPages
(
AdvertPageQuery
queryParams
)
{
Page
<
SmsAdvert
>
page
=
new
Page
<>(
queryParams
.
getPageNum
(),
queryParams
.
getPageSize
());
Page
<
SmsAdvert
>
entities
=
this
.
baseMapper
.
listAdvertPages
(
new
Page
<>(
queryParams
.
getPageNum
(),
List
<
SmsAdvert
>
list
=
this
.
baseMapper
.
listAdvertsPage
(
page
,
queryParams
);
queryParams
.
getPageSize
()),
page
.
setRecords
(
list
);
queryParams
);
return
page
;
Page
<
AdvertPageVO
>
advertVOPage
=
advertConverter
.
entity2PageVo
(
entities
);
return
advertVOPage
;
}
/**
* 广告横幅列表对象
*
* @return
*/
@Override
public
List
<
AdBannerVO
>
listAdBanners
()
{
List
<
SmsAdvert
>
entities
=
this
.
list
(
new
LambdaQueryWrapper
<
SmsAdvert
>().
eq
(
SmsAdvert:
:
getStatus
,
StatusEnum
.
ENABLE
.
getValue
())
.
select
(
SmsAdvert:
:
getTitle
)
);
List
<
AdBannerVO
>
list
=
advertConverter
.
entity2BannerVo
(
entities
);
return
list
;
}
}
}
}
mall-sms/sms-boot/src/main/resources/mapper/SmsAdvertMapper.xml
浏览文件 @
b9a9f539
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<mapper
namespace=
"com.youlai.mall.sms.mapper.SmsAdvertMapper"
>
<mapper
namespace=
"com.youlai.mall.sms.mapper.SmsAdvertMapper"
>
<!-- 广告分页列表 -->
<!-- 广告分页列表 -->
<select
id=
"listAdvert
sPage
"
resultType=
"com.youlai.mall.sms.pojo.entity.SmsAdvert"
>
<select
id=
"listAdvert
Pages
"
resultType=
"com.youlai.mall.sms.pojo.entity.SmsAdvert"
>
SELECT
SELECT
*
*
FROM
FROM
...
...
youlai-auth/src/main/java/com/youlai/auth/extension/mobile/SmsCodeAuthenticationProvider.java
浏览文件 @
b9a9f539
...
@@ -3,7 +3,7 @@ package com.youlai.auth.extension.mobile;
...
@@ -3,7 +3,7 @@ package com.youlai.auth.extension.mobile;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.youlai.auth.userdetails.member.MemberUserDetailsServiceImpl
;
import
com.youlai.auth.userdetails.member.MemberUserDetailsServiceImpl
;
import
com.youlai.common.constant.SecurityConstants
;
import
com.youlai.common.constant.SecurityConstants
;
import
com.youlai.common.web.exception.
Business
Exception
;
import
com.youlai.common.web.exception.
Api
Exception
;
import
com.youlai.mall.ums.api.MemberFeignClient
;
import
com.youlai.mall.ums.api.MemberFeignClient
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
@@ -39,7 +39,7 @@ public class SmsCodeAuthenticationProvider implements AuthenticationProvider {
...
@@ -39,7 +39,7 @@ public class SmsCodeAuthenticationProvider implements AuthenticationProvider {
String
correctCode
=
redisTemplate
.
opsForValue
().
get
(
codeKey
);
String
correctCode
=
redisTemplate
.
opsForValue
().
get
(
codeKey
);
// 验证码比对
// 验证码比对
if
(
StrUtil
.
isBlank
(
correctCode
)
||
!
code
.
equals
(
correctCode
))
{
if
(
StrUtil
.
isBlank
(
correctCode
)
||
!
code
.
equals
(
correctCode
))
{
throw
new
Business
Exception
(
"验证码不正确"
);
throw
new
Api
Exception
(
"验证码不正确"
);
}
}
// 比对成功删除缓存的验证码
// 比对成功删除缓存的验证码
redisTemplate
.
delete
(
codeKey
);
redisTemplate
.
delete
(
codeKey
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录