Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
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
hewei
wecloud_im_server
Commits
865fe27a
Commit
865fe27a
authored
Mar 15, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
aa70eac5
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
59 additions
and
8 deletions
+59
-8
bootstrap/src/test/java/io/geekidea/springbootplus/test/SpiringPlusTest.java
+4
-0
bootstrap/src/test/java/io/geekidea/springbootplus/test/TimestampTest.java
+9
-0
common/src/main/java/com/sien/common/controller/DonationRecordController.java
+11
-0
common/src/main/java/com/sien/common/param/VipOpenParam.java
+2
-3
common/src/main/java/com/sien/common/service/DonationRecordService.java
+5
-0
common/src/main/java/com/sien/common/service/impl/AppSmsServiceImpl.java
+3
-3
common/src/main/java/com/sien/common/service/impl/AppUserApiServiceImpl.java
+1
-1
common/src/main/java/com/sien/common/service/impl/DonationRecordServiceImpl.java
+17
-0
common/src/main/java/com/sien/common/service/impl/VipRecordServiceImpl.java
+1
-1
config/src/main/resources/static/i18n/messages_zh_CN.properties
+1
-0
framework/src/main/java/io/geekidea/springbootplus/framework/common/api/ApiCode.java
+5
-0
No files found.
bootstrap/src/test/java/io/geekidea/springbootplus/test/SpiringPlusTest.java
View file @
865fe27a
...
@@ -65,4 +65,8 @@ public class SpiringPlusTest {
...
@@ -65,4 +65,8 @@ public class SpiringPlusTest {
};
};
}
}
bootstrap/src/test/java/io/geekidea/springbootplus/test/TimestampTest.java
View file @
865fe27a
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
package
io
.
geekidea
.
springbootplus
.
test
;
package
io
.
geekidea
.
springbootplus
.
test
;
import
cn.hutool.core.util.RandomUtil
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.time.Instant
;
import
java.time.Instant
;
...
@@ -24,10 +26,17 @@ import java.time.Instant;
...
@@ -24,10 +26,17 @@ import java.time.Instant;
* @date 2020/3/16
* @date 2020/3/16
**/
**/
public
class
TimestampTest
{
public
class
TimestampTest
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// 获取当前时间戳
// 获取当前时间戳
Timestamp
from
=
Timestamp
.
from
(
Instant
.
now
());
Timestamp
from
=
Timestamp
.
from
(
Instant
.
now
());
System
.
out
.
println
(
from
);
System
.
out
.
println
(
from
);
String
s1
=
RandomUtil
.
randomNumbers
(
6
);
// String s = RandomUtil.randomInts(6).toString();
System
.
out
.
println
(
s1
);
}
}
}
}
common/src/main/java/com/sien/common/controller/DonationRecordController.java
View file @
865fe27a
...
@@ -47,6 +47,17 @@ public class DonationRecordController extends BaseController {
...
@@ -47,6 +47,17 @@ public class DonationRecordController extends BaseController {
return
donationRecordService
.
add
(
donationRecordAdd
);
return
donationRecordService
.
add
(
donationRecordAdd
);
}
}
/**
* 我的捐款记录分页列表
*/
// @PostMapping("/getMyPageList")
// @OperationLog(name = "我的捐款记录分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "我的捐款记录分页列表")
// public ApiResult<List<DonationRecord>> getDonationRecordPageList() throws Exception {
// return donationRecordService.getDonationRecordAllList();
// }
/**
/**
* 我的捐款记录分页列表
* 我的捐款记录分页列表
*/
*/
...
...
common/src/main/java/com/sien/common/param/VipOpenParam.java
View file @
865fe27a
...
@@ -33,9 +33,8 @@ public class VipOpenParam implements Serializable {
...
@@ -33,9 +33,8 @@ public class VipOpenParam implements Serializable {
@ApiModelProperty
(
"会员等级id,传入由会员列表接口返回的id"
)
@ApiModelProperty
(
"会员等级id,传入由会员列表接口返回的id"
)
private
Long
vipLevelId
;
private
Long
vipLevelId
;
// @NotBlank(message = "不能为空")
@ApiModelProperty
(
"是否代替他人开通"
)
@ApiModelProperty
(
"是否代替他人开通"
)
private
Integer
isReplace
;
private
Boolean
isReplace
;
@ApiModelProperty
(
"捐款接收用户手机号,当isAgent=1为必填"
)
@ApiModelProperty
(
"捐款接收用户手机号,当isAgent=1为必填"
)
private
String
userPhone
;
private
String
userPhone
;
...
...
common/src/main/java/com/sien/common/service/DonationRecordService.java
View file @
865fe27a
...
@@ -10,6 +10,8 @@ import io.geekidea.springbootplus.framework.common.api.ApiResult;
...
@@ -10,6 +10,8 @@ import io.geekidea.springbootplus.framework.common.api.ApiResult;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
java.util.List
;
/**
/**
* 捐款记录 服务类
* 捐款记录 服务类
*
*
...
@@ -88,4 +90,7 @@ public interface DonationRecordService extends BaseService<DonationRecord> {
...
@@ -88,4 +90,7 @@ public interface DonationRecordService extends BaseService<DonationRecord> {
*/
*/
Paging
<
DonationRecordQueryVo
>
getDonationRecordPageList
(
DonationRecordPageParam
donationRecordPageParam
)
throws
Exception
;
Paging
<
DonationRecordQueryVo
>
getDonationRecordPageList
(
DonationRecordPageParam
donationRecordPageParam
)
throws
Exception
;
ApiResult
<
List
<
DonationRecord
>>
getDonationRecordAllList
()
throws
Exception
;
}
}
common/src/main/java/com/sien/common/service/impl/AppSmsServiceImpl.java
View file @
865fe27a
...
@@ -19,7 +19,6 @@ import org.springframework.data.redis.core.RedisTemplate;
...
@@ -19,7 +19,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.Duration
;
import
java.time.Duration
;
import
java.util.Arrays
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -154,11 +153,12 @@ public class AppSmsServiceImpl implements AppSmsService {
...
@@ -154,11 +153,12 @@ public class AppSmsServiceImpl implements AppSmsService {
smsCode
.
setSmsCode
(
randomCode
);
smsCode
.
setSmsCode
(
randomCode
);
log
.
info
(
area
+
","
+
number
+
":"
+
randomCode
);
log
.
info
(
area
+
","
+
number
+
":"
+
randomCode
);
// 调用短信平台发送短信代码
2020年09月30日09:48:42
// 调用短信平台发送短信代码
try
{
try
{
SendSms
.
send
(
"+"
+
area
+
number
,
randomCode
);
SendSms
.
send
(
"+"
+
area
+
number
,
randomCode
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
error
(
e
.
getMessage
());
return
ApiResult
.
fail
(
ApiCode
.
FAIL
,
null
);
return
ApiResult
.
fail
(
ApiCode
.
FAIL
,
null
);
}
}
...
@@ -214,7 +214,7 @@ public class AppSmsServiceImpl implements AppSmsService {
...
@@ -214,7 +214,7 @@ public class AppSmsServiceImpl implements AppSmsService {
if
(
profiles
.
equals
(
DEV_PROFILE
)
||
profiles
.
equals
(
"test"
))
{
if
(
profiles
.
equals
(
DEV_PROFILE
)
||
profiles
.
equals
(
"test"
))
{
return
DEFAULT_DEV_SMS_CODE
;
return
DEFAULT_DEV_SMS_CODE
;
}
else
{
}
else
{
return
Arrays
.
toString
(
RandomUtil
.
randomInts
(
6
)
);
return
RandomUtil
.
randomNumbers
(
6
);
}
}
}
}
...
...
common/src/main/java/com/sien/common/service/impl/AppUserApiServiceImpl.java
View file @
865fe27a
...
@@ -117,7 +117,7 @@ public class AppUserApiServiceImpl implements AppUserApiService {
...
@@ -117,7 +117,7 @@ public class AppUserApiServiceImpl implements AppUserApiService {
// 校验验证码
// 校验验证码
boolean
equalsRegisterCode
=
appSmsService
.
equalsRegisterCode
(
loginParam
.
getPhoneArea
(),
loginParam
.
getPhone
(),
loginParam
.
getSmsCode
());
boolean
equalsRegisterCode
=
appSmsService
.
equalsRegisterCode
(
loginParam
.
getPhoneArea
(),
loginParam
.
getPhone
(),
loginParam
.
getSmsCode
());
if
(!
equalsRegisterCode
)
{
if
(!
equalsRegisterCode
)
{
return
ApiResult
.
fail
(
ApiCode
.
SMS_CODE_ERROR
,
new
LoginAppUserTokenVo
());
return
ApiResult
.
fail
(
ApiCode
.
SMS_CODE_
REGIST_
ERROR
,
new
LoginAppUserTokenVo
());
}
}
// 删除已使用的验证码
// 删除已使用的验证码
appSmsService
.
deleteRegisterCode
(
loginParam
.
getPhoneArea
(),
loginParam
.
getPhone
());
appSmsService
.
deleteRegisterCode
(
loginParam
.
getPhoneArea
(),
loginParam
.
getPhone
());
...
...
common/src/main/java/com/sien/common/service/impl/DonationRecordServiceImpl.java
View file @
865fe27a
...
@@ -40,6 +40,7 @@ import javax.annotation.Resource;
...
@@ -40,6 +40,7 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* 捐款记录 服务实现类
* 捐款记录 服务实现类
...
@@ -238,9 +239,25 @@ public class DonationRecordServiceImpl extends BaseServiceImpl<DonationRecordMap
...
@@ -238,9 +239,25 @@ public class DonationRecordServiceImpl extends BaseServiceImpl<DonationRecordMap
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
donationRecordPageParam
.
setPageSize
(
100000L
);
Page
<
DonationRecordQueryVo
>
page
=
new
PageInfo
<>(
donationRecordPageParam
,
OrderItem
.
desc
(
getLambdaColumn
(
DonationRecord:
:
getCreateTime
)));
Page
<
DonationRecordQueryVo
>
page
=
new
PageInfo
<>(
donationRecordPageParam
,
OrderItem
.
desc
(
getLambdaColumn
(
DonationRecord:
:
getCreateTime
)));
IPage
<
DonationRecordQueryVo
>
iPage
=
donationRecordMapper
.
getDonationRecordPageList
(
page
,
donationRecordPageParam
,
jwtToken
.
getUserId
());
IPage
<
DonationRecordQueryVo
>
iPage
=
donationRecordMapper
.
getDonationRecordPageList
(
page
,
donationRecordPageParam
,
jwtToken
.
getUserId
());
return
new
Paging
<
DonationRecordQueryVo
>(
iPage
);
return
new
Paging
<
DonationRecordQueryVo
>(
iPage
);
}
}
@Override
public
ApiResult
<
List
<
DonationRecord
>>
getDonationRecordAllList
()
throws
Exception
{
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
List
<
DonationRecord
>
donationRecords
=
donationRecordMapper
.
selectList
(
new
QueryWrapper
<
DonationRecord
>().
lambda
()
.
eq
(
DonationRecord:
:
getFkUserId
,
jwtToken
.
getUserId
())
.
eq
(
DonationRecord:
:
getPayStatus
,
1L
));
return
ApiResult
.
ok
(
donationRecords
);
}
}
}
common/src/main/java/com/sien/common/service/impl/VipRecordServiceImpl.java
View file @
865fe27a
...
@@ -171,7 +171,7 @@ public class VipRecordServiceImpl extends BaseServiceImpl<VipRecordMapper, VipRe
...
@@ -171,7 +171,7 @@ public class VipRecordServiceImpl extends BaseServiceImpl<VipRecordMapper, VipRe
vipRecord
.
setWxMerPayId
(
outTradeNo
);
vipRecord
.
setWxMerPayId
(
outTradeNo
);
// // 判断是否为替他人
// // 判断是否为替他人
if
(
vipOpenParam
.
getIsReplace
())
{
if
(
vipOpenParam
.
getIsReplace
()
==
1
)
{
AppUser
user
=
appUserService
.
getOne
(
new
QueryWrapper
<
AppUser
>().
lambda
()
AppUser
user
=
appUserService
.
getOne
(
new
QueryWrapper
<
AppUser
>().
lambda
()
.
eq
(
AppUser:
:
getPhone
,
vipOpenParam
.
getUserPhone
())
.
eq
(
AppUser:
:
getPhone
,
vipOpenParam
.
getUserPhone
())
.
eq
(
AppUser:
:
getPhoneArea
,
vipOpenParam
.
getPhoneArea
()));
.
eq
(
AppUser:
:
getPhoneArea
,
vipOpenParam
.
getPhoneArea
()));
...
...
config/src/main/resources/static/i18n/messages_zh_CN.properties
View file @
865fe27a
...
@@ -77,6 +77,7 @@ api.response.code.JWTDECODE_EXCEPTION=Token解析异常
...
@@ -77,6 +77,7 @@ api.response.code.JWTDECODE_EXCEPTION=Token解析异常
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION
=
默认的异常处理
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION
=
默认的异常处理
api.response.code.user.PWD_OR_USERNAME_ERROR
=
账号或密码错误
api.response.code.user.PWD_OR_USERNAME_ERROR
=
账号或密码错误
api.response.code.user.SMS_CODE_ERROR
=
旧手机号验证码错误
api.response.code.user.SMS_CODE_ERROR
=
旧手机号验证码错误
api.response.code.user.SMS_CODE_REGIST_ERROR
=
验证码错误
api.response.code.user.USER_NOT_FOUND
=
用户不存在
api.response.code.user.USER_NOT_FOUND
=
用户不存在
api.response.code.user.USER_WECHAT_CODE
=
微信code错误
api.response.code.user.USER_WECHAT_CODE
=
微信code错误
api.response.code.user.SMS_CODE_ERROR_NEW
=
新手机号验证码错误
api.response.code.user.SMS_CODE_ERROR_NEW
=
新手机号验证码错误
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/common/api/ApiCode.java
View file @
865fe27a
...
@@ -114,6 +114,11 @@ public enum ApiCode {
...
@@ -114,6 +114,11 @@ public enum ApiCode {
*/
*/
SMS_CODE_ERROR
(
6005
,
"api.response.code.user.SMS_CODE_ERROR"
),
SMS_CODE_ERROR
(
6005
,
"api.response.code.user.SMS_CODE_ERROR"
),
/**
* 注册时验证码错误
*/
SMS_CODE_REGIST_ERROR
(
6007
,
"api.response.code.user.SMS_CODE_REGIST_ERROR"
),
/**
/**
* 新手机号验证码错误
* 新手机号验证码错误
...
...
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