Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
shop-Mall
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
shop-Mall
Commits
7ac9fa44
Commit
7ac9fa44
authored
Mar 08, 2021
by
licc
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
84dc2c63
e68a244d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
414 additions
and
406 deletions
+414
-406
PageRequest.java
.../src/main/java/cn/wisenergy/common/utils/PageRequest.java
+31
-0
PageResult.java
...n/src/main/java/cn/wisenergy/common/utils/PageResult.java
+63
-0
PageUtils.java
...on/src/main/java/cn/wisenergy/common/utils/PageUtils.java
+28
-0
pom.xml
wisenergy-mapper/pom.xml
+1
-0
ShopZxMapper.java
...apper/src/main/java/cn/wisenergy/mapper/ShopZxMapper.java
+8
-6
UsersMapper.java
...mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
+1
-1
ShopZxMapper.xml
wisenergy-mapper/src/main/resources/mapper/ShopZxMapper.xml
+8
-1
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+2
-2
UsersDto.java
...-model/src/main/java/cn/wisenergy/model/app/UsersDto.java
+127
-1
UploadService.java
...src/main/java/cn/wisenergy/service/app/UploadService.java
+11
-1
UserService.java
...e/src/main/java/cn/wisenergy/service/app/UserService.java
+4
-18
UploadServiceImpl.java
...java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
+25
-35
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+18
-15
Application.java
...rgy-web-admin/src/main/java/cn/wisenergy/Application.java
+0
-2
LoginController.java
...n/wisenergy/web/admin/controller/app/LoginController.java
+67
-68
SmsController.java
.../cn/wisenergy/web/admin/controller/app/SmsController.java
+0
-21
UploadController.java
.../wisenergy/web/admin/controller/app/UploadController.java
+5
-8
MyBatisPlusConfig.java
.../main/java/cn/wisenergy/web/config/MyBatisPlusConfig.java
+8
-6
LoginInterceptor.java
...va/cn/wisenergy/web/sms/interceptor/LoginInterceptor.java
+2
-2
application.yml
wisenergy-web-admin/src/main/resources/application.yml
+5
-3
wisenergy-web-admin.iml
wisenergy-web-admin/wisenergy-web-admin.iml
+0
-216
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/PageRequest.java
0 → 100644
View file @
7ac9fa44
package
cn
.
wisenergy
.
common
.
utils
;
/**
* 分页请求
* Created by m1991 on 2021/3/7 15:09
*/
public
class
PageRequest
{
/**
* 当前页码
*/
private
int
pageNum
;
/**
* 每页数量
*/
private
int
pageSize
;
public
int
getPageNum
()
{
return
pageNum
;
}
public
void
setPageNum
(
int
pageNum
)
{
this
.
pageNum
=
pageNum
;
}
public
int
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
int
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
}
wisenergy-common/src/main/java/cn/wisenergy/common/utils/PageResult.java
0 → 100644
View file @
7ac9fa44
package
cn
.
wisenergy
.
common
.
utils
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* Created by m1991 on 2021/3/7 15:11
*/
@Component
@EnableCaching
public
class
PageResult
{
/**
* 当前页码
*/
private
int
pageNum
;
/**
* 每页数量
*/
private
int
pageSize
;
/**
* 记录总数
*/
private
long
totalSize
;
/**
* 页码总数
*/
private
int
totalPages
;
/**
* 数据模型
*/
private
List
<?>
content
;
public
int
getPageNum
()
{
return
pageNum
;
}
public
void
setPageNum
(
int
pageNum
)
{
this
.
pageNum
=
pageNum
;
}
public
int
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
int
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
public
long
getTotalSize
()
{
return
totalSize
;
}
public
void
setTotalSize
(
long
totalSize
)
{
this
.
totalSize
=
totalSize
;
}
public
int
getTotalPages
()
{
return
totalPages
;
}
public
void
setTotalPages
(
int
totalPages
)
{
this
.
totalPages
=
totalPages
;
}
public
List
<?>
getContent
()
{
return
content
;
}
public
void
setContent
(
List
<?>
content
)
{
this
.
content
=
content
;
}
}
wisenergy-common/src/main/java/cn/wisenergy/common/utils/PageUtils.java
0 → 100644
View file @
7ac9fa44
package
cn
.
wisenergy
.
common
.
utils
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.stereotype.Component
;
/**
* Created by m1991 on 2021/3/7 15:12
*/
@Component
@EnableCaching
public
class
PageUtils
{
/**
* 将分页信息封装到统一的接口
* @param pageRequest
* @param
* @return
*/
public
static
PageResult
getPageResult
(
PageRequest
pageRequest
,
PageInfo
<?>
pageInfo
)
{
PageResult
pageResult
=
new
PageResult
();
pageResult
.
setPageNum
(
pageInfo
.
getPageNum
());
pageResult
.
setPageSize
(
pageInfo
.
getPageSize
());
pageResult
.
setTotalSize
(
pageInfo
.
getTotal
());
pageResult
.
setTotalPages
(
pageInfo
.
getPages
());
pageResult
.
setContent
(
pageInfo
.
getList
());
return
pageResult
;
}
}
wisenergy-mapper/pom.xml
View file @
7ac9fa44
...
...
@@ -21,6 +21,7 @@
<artifactId>
wisenergy-model
</artifactId>
<version>
${moduleVersion.wisenergy-model}
</version>
</dependency>
</dependencies>
<!-- MAVEN构建 -->
...
...
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/ShopZxMapper.java
View file @
7ac9fa44
...
...
@@ -27,12 +27,14 @@ public interface ShopZxMapper extends BaseMapper<shopZx> {
* @param
* @return
*/
List
<
shopZx
>
selectAll
(
@Param
(
"PageSize"
)
int
PageSize
,
@Param
(
"beginPos"
)
int
beginPos
);
// List selectAll( @Param("beginPos") int beginPos,@Param("PageSize") int PageSize
);
// /**查询方法
// * @param
// * @return
// */
// List<shopZx> selectAllNum(@Param("") int ,@Param("") int );
/**
* 分页查询资讯
* @return
*/
// List<shopZx> selectPage();
}
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
View file @
7ac9fa44
...
...
@@ -90,7 +90,7 @@ public interface UsersMapper extends BaseMapper<User> {
public
List
<
User
>
getUsersListByMap
(
Map
<
String
,
Object
>
param
);
//根据手机号查询用户Integer
Integ
er
queryUsersByPhone
(
@Param
(
"userId"
)
String
userId
);
Us
er
queryUsersByPhone
(
@Param
(
"userId"
)
String
userId
);
//根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID
Integer
inviteCodeBeInvitedCode
(
@Param
(
"beInvitedCode"
)
Integer
beInvitedCode
);
...
...
wisenergy-mapper/src/main/resources/mapper/ShopZxMapper.xml
View file @
7ac9fa44
...
...
@@ -48,7 +48,7 @@
<!--</insert>-->
<!--资讯内容倒叙查询-->
<select
id=
"selectAll"
parameterType=
"
cn.wisenergy.model.app.shopZx
"
resultType=
"cn.wisenergy.model.app.shopZx"
>
<select
id=
"selectAll"
parameterType=
"
java.lang.Integer
"
resultType=
"cn.wisenergy.model.app.shopZx"
>
select zxid as zxid,zxUrl as zxUrl,
zxLikes as zxLikes,userid as userid,zxName as zxName,
zxShenHe as zxShenHe,zxField as zxField,zxDate as zxDate,
...
...
@@ -60,6 +60,13 @@
select count (*) from shop_zx
</select>
<select
id=
"selectPage"
resultMap=
"zxMap"
>
select zxid as zxid,zxUrl as zxUrl,
zxLikes as zxLikes,userid as userid,zxName as zxName,
zxShenHe as zxShenHe,zxField as zxField,zxDate as zxDate,
imgUrl as imgUrl,zxAddress as zxAddress from shop_zx order by zxid desc limit #{beginPos},#{pageSize}
</select>
</mapper>
\ No newline at end of file
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
7ac9fa44
...
...
@@ -169,9 +169,9 @@
insert into user_info(user_id,be_invited_code) value (#{userId},#{beInvitedCode})
</insert>
<select
id=
"queryUsersByPhone"
resultType=
"
java.lang.Integ
er"
>
<select
id=
"queryUsersByPhone"
resultType=
"
cn.wisenergy.model.app.Us
er"
>
select
user_id
<include
refid=
"vals"
/>
from
<include
refid=
"table"
/>
<where>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/app/UsersDto.java
View file @
7ac9fa44
package
cn
.
wisenergy
.
model
.
app
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* Created by m1991 on 2021/3/1 14:00
*/
public
class
UsersDto
extends
User
{
public
class
UsersDto
extends
User
implements
Serializable
{
/**
* 主键id
*/
private
Integer
id
;
/**
* 手机号作为用户账号
*/
private
String
userId
;
/**
* 用户头像
*/
private
String
headImage
;
/**
* 用户会员等级
*/
private
int
userLevel
;
/**
* 跨境额度
*/
private
BigDecimal
crossBorderLine
;
/**
* 用户本人邀请码
*/
private
String
inviteCode
;
/**
* 推荐人邀请码
*/
private
String
beInvitedCode
;
/**
* 创建时间
*/
private
Date
createTime
;
//用户token
private
String
token
;
@Override
public
Integer
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
@Override
public
String
getUserId
()
{
return
userId
;
}
@Override
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
@Override
public
String
getHeadImage
()
{
return
headImage
;
}
@Override
public
void
setHeadImage
(
String
headImage
)
{
this
.
headImage
=
headImage
;
}
@Override
public
int
getUserLevel
()
{
return
userLevel
;
}
@Override
public
void
setUserLevel
(
int
userLevel
)
{
this
.
userLevel
=
userLevel
;
}
@Override
public
BigDecimal
getCrossBorderLine
()
{
return
crossBorderLine
;
}
@Override
public
void
setCrossBorderLine
(
BigDecimal
crossBorderLine
)
{
this
.
crossBorderLine
=
crossBorderLine
;
}
@Override
public
String
getInviteCode
()
{
return
inviteCode
;
}
@Override
public
void
setInviteCode
(
String
inviteCode
)
{
this
.
inviteCode
=
inviteCode
;
}
@Override
public
String
getBeInvitedCode
()
{
return
beInvitedCode
;
}
@Override
public
void
setBeInvitedCode
(
String
beInvitedCode
)
{
this
.
beInvitedCode
=
beInvitedCode
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getToken
()
{
return
token
;
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/UploadService.java
View file @
7ac9fa44
package
cn
.
wisenergy
.
service
.
app
;
import
cn.wisenergy.model.app.Page
;
import
cn.wisenergy.common.utils.PageRequest
;
import
cn.wisenergy.common.utils.PageResult
;
import
cn.wisenergy.model.app.shopZx
;
import
org.springframework.core.io.Resource
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -56,5 +57,14 @@ public interface UploadService {
// public Page<shopZx> find();
/**
* 分页查询接口
* 这里统一封装了分页请求和结果,避免直接引入具体框架的分页对象, 如MyBatis或JPA的分页对象
* 从而避免因为替换ORM框架而导致服务层、控制层的分页接口也需要变动的情况,替换ORM框架也不会
* 影响服务层以上的分页接口,起到了解耦的作用
* @param pageRequest 自定义,统一分页查询请求
* @return PageResult 自定义,统一分页查询结果
*/
// PageResult findPage(PageRequest pageRequest);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserService.java
View file @
7ac9fa44
...
...
@@ -11,13 +11,13 @@ import java.util.Map;
* @ Description: 用户接口
* @ Author : 86187
* @ Date : 2021/1/6 16:08
* @author 86187
*/
public
interface
UserService
{
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
...
...
@@ -27,7 +27,6 @@ public interface UserService {
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
...
...
@@ -38,7 +37,6 @@ public interface UserService {
//根据OpenId查询用户
public
User
queryUsersByOpenId
(
String
openId
);
/**
*用户注册
*/
...
...
@@ -48,19 +46,7 @@ public interface UserService {
//
Integer
getuserIdById
(
String
userId
);
/**
* 获取空投池列表
*
* @return 空投池列表
*/
R
<
AerialDeliveryVo
>
queryAerialDelivery
();
/**
* 设置用户头像
* @param userId 用户id
* @param headImage 头像地址
* @return true or false
*/
R
<
Boolean
>
setHeadImage
(
String
userId
,
String
headImage
);
R
<
Boolean
>
setHeadImage
(
String
userId
,
String
headImage
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
View file @
7ac9fa44
package
cn
.
wisenergy
.
service
.
app
.
impl
;
import
cn.wisenergy.common.utils.FileException
;
import
cn.wisenergy.common.utils.FileUtils
;
import
cn.wisenergy.common.utils.FrameGrabberKit
;
import
cn.wisenergy.common.utils.*
;
import
cn.wisenergy.common.utils.StringUtil
;
import
cn.wisenergy.model.app.Page
;
import
cn.wisenergy.model.app.shopZx
;
import
com.alibaba.fastjson.JSON
;
import
com.youzan.cloud.open.sdk.common.util.CheckUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.UrlResource
;
...
...
@@ -47,6 +44,7 @@ public class UploadServiceImpl implements UploadService {
@Autowired
private
ShopZxMapper
shopZxMapper
;
/**
* 视频文件上传
*/
...
...
@@ -324,38 +322,30 @@ public class UploadServiceImpl implements UploadService {
@Override
public
Map
getList
(
int
beginPos
,
int
pageSize
)
{
Map
map
=
new
HashMap
();
String
[]
ImgUrl
=
new
String
[
0
];
List
<
shopZx
>
date
=
shopZxMapper
.
selectAll
(
beginPos
,
pageSize
);
for
(
int
i
=
0
;
date
.
size
()>
0
;
i
++){
shopZx
s
=
(
shopZx
)
date
.
get
(
i
);
ImgUrl
=
s
.
getImgUrl
().
split
(
","
);
}
if
(
null
==
date
){
map
.
put
(
"code"
,
1
);
map
.
put
(
"msg"
,
"获取资讯分页数据失败!"
);
return
map
;
}
else
{
map
.
put
(
"date"
,
date
);
map
.
put
(
"ImgUrl"
,
ImgUrl
);
map
.
put
(
"code"
,
0
);
map
.
put
(
"msg"
,
"获取资讯分页数据成功!"
);
return
map
;
}
return
null
;
}
// @Override
// public Page<shopZx> find() {
// if (null == page) {
// page = 0;
// public Map getList(int beginPos, int pageSize) {
// Map map =new HashMap();
// String[] ImgUrl = new String[0];
// List date=shopZxMapper.selectAll(beginPos,pageSize);
// for(int i=0;date.size()>0;i++){
// shopZx s = (shopZx)date.get(i);
// ImgUrl=s.getImgUrl().split(",");
// }
// if (CheckUtils.isEmpty(size)) {
// size = 10;
// if(null==date){
// map.put("code",1);
// map.put("msg","获取资讯分页数据失败!");
// return (Map) map;
// }else {
// map.put("date",date);
// map.put("ImgUrl",ImgUrl);
// map.put("code",0);
// map.put("msg","获取资讯分页数据成功!");
// return map;
// }
// PageRequest pageable = PageRequest.of(page, size, Sort.Direction.DESC, "updateTime");
// Page<User> users = userRepository.findAll(pageable);
// return users;
// }
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
7ac9fa44
package
cn
.
wisenergy
.
service
.
app
.
impl
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.RedisUtils
;
import
cn.wisenergy.common.utils.ResultUtils
;
import
cn.wisenergy.common.utils.ShareCodeUtil
;
import
cn.wisenergy.mapper.RecommendUserMapper
;
import
cn.wisenergy.mapper.TeamUserInfoMapper
;
...
...
@@ -67,6 +69,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
if
(!
CollectionUtils
.
isEmpty
(
usersList
)){
return
usersList
.
get
(
0
);
}
// return ResultUtils.returnFail("","");
return
null
;
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/Application.java
View file @
7ac9fa44
...
...
@@ -13,8 +13,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
*/
@EnableCaching
@SpringBootApplication
(
exclude
=
{
MultipartAutoConfiguration
.
class
})
@MapperScan
(
basePackages
=
"cn.wisenergy.mapper"
)
@EnableSwagger2
@EnableScheduling
public
class
Application
{
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/LoginController.java
View file @
7ac9fa44
...
...
@@ -130,5 +130,4 @@ public class LoginController {
return
usersService
.
userByZx
(
userId
,
beInvitedCode
);
}
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/SmsController.java
View file @
7ac9fa44
...
...
@@ -37,27 +37,6 @@ public class SmsController {
@ApiImplicitParam
(
name
=
"codeType"
,
value
=
"验证码类型用途 0注册/登录验证 1修改密码 2订单通知信息"
,
dataType
=
"Integer"
)})
@RequestMapping
(
"/verifyCode"
)
public
Result
verifyCode
(
String
phone
,
Integer
codeType
)
throws
Exception
{
// //判断phone和codeType是否符合输入类型
// if(!phone.matches(Constants.RegConstant.PHONE_REGSTR)){
// throw new BaseException(ResultEnum.PHONE_ERROR);
// }
// if(codeType!=Constants.Sms.CodeType.LOGIN_OR_REGISTER && codeType!=Constants.Sms.CodeType.PASS_UPDATE && codeType!=Constants.Sms.CodeType.ORDER_NOTICE){
// throw new BaseException(ResultEnum.CODETYPE_ERROR);
// }
// String key= StringUtil.formatKeyWithPrefix(Constants.RedisKey.PROJECT_PRIFIX,Constants.RedisKey.SMS_PRIFIX,phone,codeType+"");
// //判断是否超过60S
// String oldCode=redisUtils.getValue(key);
// if(!StringUtils.isBlank(oldCode)){
// throw new BaseException(ResultEnum.CODESEND_ERROR);
// }
// //生成随机数
// String code= MathUtils.random();
// //保存至Redis
// redisUtils.set(key,code,Constants.Duration.MINUTE_INT);
//
//
// boolean flag=smsUtils.sendMessage(phone,Constants.Sms.TemplateCode.LOGIN_DL_REGISTER,code);
// return flag? ResultUtils.returnSuccess():ResultUtils.returnFail();
//判断phone和codeType是否符合输入类型
if
(!
phone
.
matches
(
Constants
.
RegConstant
.
PHONE_REGSTR
)){
throw
new
BaseException
(
ResultEnum
.
PHONE_ERROR
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UploadController.java
View file @
7ac9fa44
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.Result
;
import
cn.wisenergy.model.app.Page
;
import
cn.wisenergy.model.app.shopZx
;
import
cn.wisenergy.service.app.UploadService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -112,16 +110,15 @@ public class UploadController {
* @param pageSize
* @return
*/
@ApiOperation
(
value
=
"资讯信息
-文字/多图片上传接口"
,
notes
=
"上传图片,返回路径给前台"
,
httpMethod
=
"POS
T"
,
produces
=
"application/json; charset=UTF-8"
)
@ApiOperation
(
value
=
"资讯信息
接口"
,
notes
=
"资讯信息接口"
,
httpMethod
=
"GE
T"
,
produces
=
"application/json; charset=UTF-8"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"beginPos"
,
value
=
"从几开始"
,
required
=
true
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"展示数量(条数)"
,
required
=
true
,
dataType
=
"Integer"
)})
@ApiImplicitParam
(
name
=
"beginPos"
,
value
=
"从几开始"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"展示数量(条数)"
,
required
=
true
,
dataType
=
"int"
)})
@RequestMapping
(
value
=
"/shop"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
Result
find
(
Integer
beginPos
,
Integer
pageSize
)
{
Page
<
shopZx
>
shopZxPage
=
(
Page
<
shopZx
>)
uploadService
.
getList
(
beginPos
,
pageSize
);
Map
shopZxPage
=
uploadService
.
getList
(
beginPos
,
pageSize
);
return
new
Result
(
String
.
valueOf
(
0
)
,
"success"
,
shopZxPage
);
return
new
Result
(
"0"
,
"success"
,
shopZxPage
);
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/config/MyBatisPlusConfig.java
View file @
7ac9fa44
package
cn
.
wisenergy
.
web
.
config
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@MapperScan
(
basePackages
=
"cn.wisenergy.mapper*"
)
@EnableConfigurationProperties
(
MybatisPlusProperties
.
class
)
public
class
MyBatisPlusConfig
{
/**
* 分页插件
*
mybatis-plus
分页插件
*/
@Bean
public
PaginationInterceptor
paginationInterceptor
()
{
PaginationInterceptor
paginationInterceptor
=
new
PaginationInterceptor
();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
// paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
// paginationInterceptor.setLimit(500);
// 开启 count 的 join 优化,只针对部分 left join
paginationInterceptor
.
setDbType
(
DbType
.
MYSQL
);
paginationInterceptor
.
setCountSqlParser
(
new
JsqlParserCountOptimize
(
true
));
return
paginationInterceptor
;
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/sms/interceptor/LoginInterceptor.java
View file @
7ac9fa44
...
...
@@ -32,9 +32,9 @@ public class LoginInterceptor extends HandlerInterceptorAdapter {
* 直接放行的接口
*/
public
static
String
[]
EXCLUDE_URI
=
new
String
[]{
"
/api/user/login
"
,
"
shop-mall/api/*
"
,
"/pay/alipay/notify"
,
"/ZX/**"
,
"
shop-mall
/ZX/**"
,
"/pay/alipay/return"
,
"/user/wechat/callback"
};
...
...
wisenergy-web-admin/src/main/resources/application.yml
View file @
7ac9fa44
...
...
@@ -30,21 +30,23 @@ spring:
#mybatis
mybatis-plus
:
check-config-location
:
true
mapper-locations
:
classpath*:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
#typeAliasesPackage: cn.wisenergy.service.
*
type-aliases-package
:
cn.wisenergy.model.app.*
*
global-config
:
#数据库相关配置
db-config
:
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
id-type
:
AUTO
#驼峰下划线转换
column-underline
:
true
logic-delete-value
:
-1
logic-not-delete-value
:
0
banner
:
false
#原生配置
configuration
:
lazy-loading-enabled
:
true
aggressive-lazy-loading
:
false
map-underscore-to-camel-case
:
true
cache-enabled
:
false
call-setters-on-nulls
:
true
...
...
wisenergy-web-admin/wisenergy-web-admin.iml
View file @
7ac9fa44
This diff is collapsed.
Click to expand it.
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