Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
V
volunteer_service
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
volunteer_service
Commits
a00582a3
Commit
a00582a3
authored
Jan 27, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信相关接口
parent
356aa7a9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
214 deletions
+56
-214
UserLoginVo.java
...odel/src/main/java/cn/wisenergy/model/vo/UserLoginVo.java
+2
-2
UserRegisterVo.java
...l/src/main/java/cn/wisenergy/model/vo/UserRegisterVo.java
+20
-7
SendSmsSerVice.java
...rc/main/java/cn/wisenergy/service/app/SendSmsSerVice.java
+6
-14
SendSmsSerViceImpl.java
...ava/cn/wisenergy/service/app/impl/SendSmsSerViceImpl.java
+5
-27
UserLoginServiceImpl.java
...a/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
+10
-7
Cache.java
...rvice/src/main/java/cn/wisenergy/service/cache/Cache.java
+0
-62
RedisCacheImpl.java
.../main/java/cn/wisenergy/service/cache/RedisCacheImpl.java
+0
-82
SendSmsController.java
...wisenergy/web/admin/controller/app/SendSmsController.java
+7
-6
UserLoginController.java
...senergy/web/admin/controller/app/UserLoginController.java
+6
-7
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/vo/UserLoginVo.java
View file @
a00582a3
...
@@ -44,6 +44,6 @@ public class UserLoginVo implements Serializable {
...
@@ -44,6 +44,6 @@ public class UserLoginVo implements Serializable {
/**
/**
* 来源: PC/APP
* 来源: PC/APP
*/
*/
@ApiModelProperty
(
value
=
"来源: PC/APP"
,
name
=
"
typ
e"
)
@ApiModelProperty
(
value
=
"来源: PC/APP"
,
name
=
"
sourc
e"
)
private
String
typ
e
;
private
String
sourc
e
;
}
}
wisenergy-model/src/main/java/cn/wisenergy/model/vo/UserRegisterVo.java
View file @
a00582a3
...
@@ -7,10 +7,11 @@ import lombok.Data;
...
@@ -7,10 +7,11 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
*@ Description: 用户注册Vo
* @author 86187
*@ Author : 86187
* @ Description: 用户注册Vo
*@ Date : 2021/1/14 11:39
* @ Author : 86187
*/
* @ Date : 2021/1/14 11:39
*/
@Data
@Data
@ApiModel
(
value
=
"UserRegisterVo"
)
@ApiModel
(
value
=
"UserRegisterVo"
)
public
class
UserRegisterVo
implements
Serializable
{
public
class
UserRegisterVo
implements
Serializable
{
...
@@ -20,18 +21,30 @@ public class UserRegisterVo implements Serializable {
...
@@ -20,18 +21,30 @@ public class UserRegisterVo implements Serializable {
/**
/**
* 手机号码
* 手机号码
*/
*/
@ApiModelProperty
(
value
=
"手机号码"
,
name
=
"phone"
)
@ApiModelProperty
(
value
=
"手机号码"
,
name
=
"phone"
)
private
String
phone
;
private
String
phone
;
/**
/**
* 密码
* 密码
*/
*/
@ApiModelProperty
(
value
=
"密码"
,
name
=
"password"
)
@ApiModelProperty
(
value
=
"密码"
,
name
=
"password"
)
private
String
password
;
private
String
password
;
/**
/**
* 验证码
* 验证码
*/
*/
@ApiModelProperty
(
value
=
"验证码"
,
name
=
"smCode"
)
@ApiModelProperty
(
value
=
"验证码"
,
name
=
"smCode"
)
private
String
smCode
;
private
String
smCode
;
/**
* 来源 PC/APP
*/
@ApiModelProperty
(
value
=
"来源 PC/APP"
,
name
=
"source"
)
private
String
source
;
/**
* 场景 1:登录 2:注册 3:修改密码 4:找回密码 5:重置密码
*/
@ApiModelProperty
(
value
=
"场景 1:登录 2:注册 3:修改密码 4:找回密码 5:重置密码"
,
name
=
"scene"
)
private
Integer
scene
;
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/SendSmsSerVice.java
View file @
a00582a3
...
@@ -13,6 +13,7 @@ public interface SendSmsSerVice {
...
@@ -13,6 +13,7 @@ public interface SendSmsSerVice {
/**
/**
* 发送短信验证码
* 发送短信验证码
*
* @param sendSmsVo 入参信息
* @param sendSmsVo 入参信息
* @return true 成功 false 失败
* @return true 成功 false 失败
* @throws Exception 异常
* @throws Exception 异常
...
@@ -22,20 +23,11 @@ public interface SendSmsSerVice {
...
@@ -22,20 +23,11 @@ public interface SendSmsSerVice {
/**
/**
* 验证手机验证码:外部调用
* 验证手机验证码:外部调用
*
*
* @param phone 手机号码
* @param phone 手机号码
* @param code 手机验证码
* @param code 手机验证码
* @param type 场景类型 1:验证码登录 2:手机注册 3:修改密码 4:找回密码
* @param type 场景类型 1:验证码登录 2:手机注册 3:修改密码 4:找回密码
* @return 是否通过校验 true通过,false不通过
* @param source 来源 PC/APP
*/
R
<
Boolean
>
valid
(
String
phone
,
String
code
,
Integer
type
);
/**
* 验证手机验证码 :内部调用
*
* @param phone 手机号码
* @param code 手机验证码
* @param type 场景类型 1:验证码登录 2:手机注册 3:修改密码 4:找回密码
* @return 是否通过校验 true通过,false不通过
* @return 是否通过校验 true通过,false不通过
*/
*/
boolean
validCode
(
String
phone
,
String
code
,
Integer
typ
e
);
R
<
Boolean
>
valid
(
String
phone
,
String
code
,
Integer
type
,
String
sourc
e
);
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/SendSmsSerViceImpl.java
View file @
a00582a3
...
@@ -4,7 +4,6 @@ import cn.wisenergy.common.utils.R;
...
@@ -4,7 +4,6 @@ import cn.wisenergy.common.utils.R;
import
cn.wisenergy.model.enums.SceneType
;
import
cn.wisenergy.model.enums.SceneType
;
import
cn.wisenergy.model.vo.SendSmsVo
;
import
cn.wisenergy.model.vo.SendSmsVo
;
import
cn.wisenergy.service.app.SendSmsSerVice
;
import
cn.wisenergy.service.app.SendSmsSerVice
;
import
cn.wisenergy.service.cache.Cache
;
import
cn.wisenergy.service.cache.RedisService
;
import
cn.wisenergy.service.cache.RedisService
;
import
cn.wisenergy.service.common.CachePrefix
;
import
cn.wisenergy.service.common.CachePrefix
;
import
cn.wisenergy.service.common.Common
;
import
cn.wisenergy.service.common.Common
;
...
@@ -22,11 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -22,11 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.logging.SimpleFormatter
;
/**
/**
* @author 86187
* @author 86187
...
@@ -37,8 +33,6 @@ import java.util.logging.SimpleFormatter;
...
@@ -37,8 +33,6 @@ import java.util.logging.SimpleFormatter;
@Service
@Service
@Slf4j
@Slf4j
public
class
SendSmsSerViceImpl
implements
SendSmsSerVice
{
public
class
SendSmsSerViceImpl
implements
SendSmsSerVice
{
@Autowired
private
Cache
cache
;
@Autowired
@Autowired
private
RedisService
redisService
;
private
RedisService
redisService
;
...
@@ -82,18 +76,17 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
...
@@ -82,18 +76,17 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
}
}
//保存验证到缓存,以便做验证
//保存验证到缓存,以便做验证
String
value
=
SceneType
.
getNameByCode
(
sendSmsVo
.
getScene
());
String
scene
=
SceneType
.
getNameByCode
(
sendSmsVo
.
getScene
());
boolean
bool
=
redisService
.
set
(
CachePrefix
.
SMS_CODE
.
getPrefix
()
+
value
+
"_"
+
sendSmsVo
.
getPhone
(),
code
,
Common
.
SMS_TIMEOUT
);
boolean
bool
=
redisService
.
set
(
CachePrefix
.
SMS_CODE
.
getPrefix
()
+
scene
+
"_"
+
log
.
info
(
"短信缓存前缀:"
+
CachePrefix
.
SMS_CODE
.
getPrefix
());
sendSmsVo
.
getSource
()
+
"_"
+
sendSmsVo
.
getPhone
(),
code
,
Common
.
SMS_TIMEOUT
);
log
.
info
(
"场景名字:"
+
value
);
return
R
.
ok
(
bool
);
return
R
.
ok
(
bool
);
}
}
@Override
@Override
public
R
<
Boolean
>
valid
(
String
phone
,
String
code
,
Integer
type
)
{
public
R
<
Boolean
>
valid
(
String
phone
,
String
code
,
Integer
type
,
String
source
)
{
String
value
=
SceneType
.
getNameByCode
(
type
);
String
value
=
SceneType
.
getNameByCode
(
type
);
//获取短信验证码key
//获取短信验证码key
String
key
=
CachePrefix
.
SMS_CODE
.
getPrefix
()
+
value
+
"_"
+
phone
;
String
key
=
CachePrefix
.
SMS_CODE
.
getPrefix
()
+
value
+
"_"
+
source
+
"_"
+
phone
;
//判断缓存是否过期
//判断缓存是否过期
long
time
=
redisService
.
getExpire
(
key
);
long
time
=
redisService
.
getExpire
(
key
);
...
@@ -113,19 +106,4 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
...
@@ -113,19 +106,4 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
}
}
return
R
.
ok
(
1
,
false
);
return
R
.
ok
(
1
,
false
);
}
}
@Override
public
boolean
validCode
(
String
phone
,
String
code
,
Integer
type
)
{
return
true
;
// //获取短信验证码key
// String valCode = CachePrefix.SMS_CODE.getPrefix() + type + "_" + phone;
// //redis中获取验证码
// Object obj = cache.get(valCode);
// if (obj != null && obj.equals(code)) {
// //验证码存在,校验通过,清除验证码缓存
// cache.remove(valCode);
// return true;
// }
// return false;
}
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
View file @
a00582a3
...
@@ -13,7 +13,6 @@ import cn.wisenergy.model.vo.UserLoginVo;
...
@@ -13,7 +13,6 @@ import cn.wisenergy.model.vo.UserLoginVo;
import
cn.wisenergy.model.vo.UserRegisterVo
;
import
cn.wisenergy.model.vo.UserRegisterVo
;
import
cn.wisenergy.service.app.SendSmsSerVice
;
import
cn.wisenergy.service.app.SendSmsSerVice
;
import
cn.wisenergy.service.app.UserLoginService
;
import
cn.wisenergy.service.app.UserLoginService
;
import
cn.wisenergy.service.cache.Cache
;
import
cn.wisenergy.service.common.Common
;
import
cn.wisenergy.service.common.Common
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -41,8 +40,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -41,8 +40,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
@Autowired
@Autowired
private
SendSmsSerVice
sendSmsSerVice
;
private
SendSmsSerVice
sendSmsSerVice
;
@Autowired
private
static
final
int
ERROR_CODE
=
500
;
private
Cache
cache
;
@Override
@Override
public
R
<
UserInfoVo
>
register
(
UserRegisterVo
userVo
)
{
public
R
<
UserInfoVo
>
register
(
UserRegisterVo
userVo
)
{
...
@@ -96,7 +94,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -96,7 +94,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
public
R
<
UserInfoVo
>
loginCode
(
UserLoginVo
userVo
)
{
public
R
<
UserInfoVo
>
loginCode
(
UserLoginVo
userVo
)
{
log
.
info
(
"volunteer-service[]UserLoginServiceImpl[]loginCode[]input.param.userVo:"
+
userVo
);
log
.
info
(
"volunteer-service[]UserLoginServiceImpl[]loginCode[]input.param.userVo:"
+
userVo
);
if
(
null
==
userVo
||
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getCode
())
||
if
(
null
==
userVo
||
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getCode
())
||
StringUtils
.
isBlank
(
userVo
.
get
Typ
e
())
||
null
==
userVo
.
getScene
())
{
StringUtils
.
isBlank
(
userVo
.
get
Sourc
e
())
||
null
==
userVo
.
getScene
())
{
return
R
.
error
(
"入参为空!"
);
return
R
.
error
(
"入参为空!"
);
}
}
...
@@ -110,7 +108,12 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -110,7 +108,12 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
}
}
//2、判断验证码是否正确
//2、判断验证码是否正确
boolean
bool
=
sendSmsSerVice
.
validCode
(
userVo
.
getPhone
(),
userVo
.
getCode
(),
userVo
.
getScene
());
R
<
Boolean
>
result
=
sendSmsSerVice
.
valid
(
userVo
.
getPhone
(),
userVo
.
getCode
(),
userVo
.
getScene
(),
userVo
.
getSource
());
if
(
null
!=
result
&&
result
.
getCode
()
==
ERROR_CODE
)
{
return
R
.
error
(
result
.
getMessage
());
}
UserInfoVo
userInfoVo
=
new
UserInfoVo
();
UserInfoVo
userInfoVo
=
new
UserInfoVo
();
userInfoVo
.
setUserId
(
user
.
getId
());
userInfoVo
.
setUserId
(
user
.
getId
());
userInfoVo
.
setUserName
(
user
.
getUserName
());
userInfoVo
.
setUserName
(
user
.
getUserName
());
...
@@ -250,8 +253,8 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -250,8 +253,8 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
}
}
//验证验证码
//验证验证码
boolean
bool
=
sendSmsSerVice
.
validCode
(
userVo
.
getPhone
(),
userVo
.
getCode
(),
userVo
.
getScen
e
());
R
<
Boolean
>
bool
=
sendSmsSerVice
.
valid
(
userVo
.
getPhone
(),
userVo
.
getCode
(),
userVo
.
getScene
(),
userVo
.
getSourc
e
());
if
(
!
bool
)
{
if
(
null
!=
bool
&&
bool
.
getCode
()
==
ERROR_CODE
)
{
return
R
.
ok
(
1
,
false
);
return
R
.
ok
(
1
,
false
);
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/cache/Cache.java
deleted
100644 → 0
View file @
356aa7a9
package
cn
.
wisenergy
.
service
.
cache
;
import
java.util.Collection
;
import
java.util.Map
;
/**
* @author 86187
*/
public
interface
Cache
<
T
>
{
/**
* Get an item from the cache, nontransactionally
* @param key
* @return the cached object or <tt>null</tt>
*/
Object
get
(
Object
key
);
/**
* 批量set
* @param map
*/
void
multiSet
(
Map
map
);
/**
* 批量删除
* @param keys 要删除的key集合
*/
void
multiDel
(
Collection
keys
);
/**
* Add an item to the cache, nontransactionally, with
* failfast semantics
* @param key
* @param value
*/
void
put
(
Object
key
,
T
value
);
/**
* 往缓存中写入内容
* @param key
* @param value
* @param exp 超时时间,单位为秒
*/
void
put
(
Object
key
,
T
value
,
long
exp
);
/**
* 删除
* @param key
*/
void
remove
(
Object
key
);
/**
* 删除
* @param key
*/
void
vagueDel
(
Object
key
);
/**
* Clear the cache
*/
void
clear
();
}
wisenergy-service/src/main/java/cn/wisenergy/service/cache/RedisCacheImpl.java
deleted
100644 → 0
View file @
356aa7a9
package
cn
.
wisenergy
.
service
.
cache
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
/**
* @author 86187
* @ Description: redis的cache实现
* @ Author : 86187
* @ Date : 2021/1/18 11:03
*/
@Component
public
class
RedisCacheImpl
implements
Cache
<
T
>
{
@Autowired
private
RedisTemplate
redisTemplate
;
public
RedisCacheImpl
()
{
}
@Override
public
Object
get
(
Object
key
)
{
return
redisTemplate
.
opsForValue
().
get
(
key
);
}
@Override
public
void
multiSet
(
Map
map
)
{
redisTemplate
.
opsForValue
().
multiSet
(
map
);
}
@Override
public
void
multiDel
(
Collection
keys
)
{
redisTemplate
.
delete
(
keys
);
}
@Override
public
void
put
(
Object
key
,
T
value
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
}
@Override
public
void
put
(
Object
key
,
T
value
,
long
exp
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
exp
,
TimeUnit
.
SECONDS
);
}
@Override
public
void
remove
(
Object
key
)
{
redisTemplate
.
delete
(
key
);
}
/**
* 删除
*
* @param key
*/
@Override
public
void
vagueDel
(
Object
key
)
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
key
+
"*"
);
redisTemplate
.
delete
(
keys
);
}
@Override
public
void
clear
()
{
Set
keys
=
redisTemplate
.
keys
(
"*"
);
redisTemplate
.
delete
(
keys
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/SendSmsController.java
View file @
a00582a3
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.StringUtil
;
import
cn.wisenergy.model.vo.SendSmsVo
;
import
cn.wisenergy.model.vo.SendSmsVo
;
import
cn.wisenergy.service.app.SendSmsSerVice
;
import
cn.wisenergy.service.app.SendSmsSerVice
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -14,10 +13,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,10 +13,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
/**
/**
* @author 86187
* @ Description: 短信管理
* @ Description: 短信管理
* @ Author : 86187
* @ Author : 86187
* @ Date : 2021/1/15 15:40
* @ Date : 2021/1/15 15:40
* @author 86187
*/
*/
@RestController
@RestController
@Api
(
tags
=
"短信管理"
)
@Api
(
tags
=
"短信管理"
)
...
@@ -44,15 +43,17 @@ public class SendSmsController {
...
@@ -44,15 +43,17 @@ public class SendSmsController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"phone"
,
value
=
"手机号码"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"phone"
,
value
=
"手机号码"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"code"
,
value
=
"短信验证码"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"code"
,
value
=
"短信验证码"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"scene"
,
value
=
"场景类型 1:验证码登录 2:手机注册 3:修改密码 4:找回密码"
,
dataType
=
"int"
,
required
=
true
)
@ApiImplicitParam
(
name
=
"scene"
,
value
=
"场景类型 1:验证码登录 2:手机注册 3:修改密码 4:找回密码"
,
dataType
=
"int"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"source"
,
value
=
"来源 PC/APP"
,
dataType
=
"String"
,
required
=
true
)
})
})
@GetMapping
(
"/valid"
)
@GetMapping
(
"/valid"
)
public
R
<
Boolean
>
valid
(
String
phone
,
String
code
,
Integer
scene
)
{
public
R
<
Boolean
>
valid
(
String
phone
,
String
code
,
Integer
scene
,
String
source
)
{
log
.
info
(
"SendSmsController[]valid[]input.param:phone,code,type"
+
phone
,
code
,
scene
);
log
.
info
(
"SendSmsController[]valid[]input.param:phone,code,type"
+
phone
,
code
,
scene
);
if
(
StringUtils
.
isBlank
(
phone
)
||
StringUtils
.
isBlank
(
code
)
||
null
==
scene
)
{
if
(
StringUtils
.
isBlank
(
phone
)
||
StringUtils
.
isBlank
(
code
)
||
StringUtils
.
isBlank
(
source
)
||
null
==
scene
)
{
return
R
.
error
(
"入参为空!"
);
return
R
.
error
(
"入参为空!"
);
}
}
return
sendSmsSerVice
.
valid
(
phone
,
code
,
scene
);
return
sendSmsSerVice
.
valid
(
phone
,
code
,
scene
,
source
);
}
}
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserLoginController.java
View file @
a00582a3
...
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* @author 86187
* @ Description: PC-用户登录
* @ Description: PC-用户登录
* @ Author : 86187
* @ Author : 86187
* @ Date : 2021/1/14 10:50
* @ Date : 2021/1/14 10:50
...
@@ -36,17 +37,15 @@ public class UserLoginController {
...
@@ -36,17 +37,15 @@ public class UserLoginController {
@ApiOperation
(
value
=
"用户注册"
,
notes
=
"用户注册"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"用户注册"
,
notes
=
"用户注册"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"userVo"
,
value
=
"用户信息"
,
dataType
=
"UserRegisterVo"
)
@ApiImplicitParam
(
name
=
"userVo"
,
value
=
"用户信息"
,
dataType
=
"UserRegisterVo"
)
@PostMapping
(
"/register"
)
@PostMapping
(
"/register"
)
public
R
<
UserInfoVo
>
re
setPassword
(
@RequestBody
UserRegisterVo
userVo
)
{
public
R
<
UserInfoVo
>
re
gister
(
@RequestBody
UserRegisterVo
userVo
)
{
log
.
info
(
"volunteer-service[]UserLongController[]resetPassword[]input.param.userVo:"
+
userVo
);
log
.
info
(
"volunteer-service[]UserLongController[]resetPassword[]input.param.userVo:"
+
userVo
);
if
(
null
==
userVo
)
{
if
(
null
==
userVo
||
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getPassword
())
||
StringUtils
.
isBlank
(
userVo
.
getSmCode
())
||
StringUtils
.
isBlank
(
userVo
.
getSource
())
||
null
==
userVo
.
getScene
())
{
return
R
.
error
(
"入参为空!"
);
return
R
.
error
(
"入参为空!"
);
}
}
if
(
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getPassword
()))
{
return
R
.
error
(
"入参不能为空!"
);
}
return
userLoginService
.
register
(
userVo
);
return
userLoginService
.
register
(
userVo
);
}
}
...
@@ -57,7 +56,7 @@ public class UserLoginController {
...
@@ -57,7 +56,7 @@ public class UserLoginController {
log
.
info
(
"volunteer-service[]UserLongController[]loginCode[]input.param.userVo:"
+
userVo
);
log
.
info
(
"volunteer-service[]UserLongController[]loginCode[]input.param.userVo:"
+
userVo
);
if
(
null
==
userVo
||
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getCode
())
||
if
(
null
==
userVo
||
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getCode
())
||
StringUtils
.
isBlank
(
userVo
.
get
Typ
e
())
||
null
==
userVo
.
getScene
())
{
StringUtils
.
isBlank
(
userVo
.
get
Sourc
e
())
||
null
==
userVo
.
getScene
())
{
return
R
.
error
(
"入参为空!"
);
return
R
.
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