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
b8c8c8cd
Commit
b8c8c8cd
authored
Jan 15, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户控制层
parent
c04378a7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
6 deletions
+63
-6
UserRegisterVo.java
...l/src/main/java/cn/wisenergy/model/vo/UserRegisterVo.java
+37
-0
UserLoginService.java
.../main/java/cn/wisenergy/service/app/UserLoginService.java
+3
-3
UserLoginServiceImpl.java
...a/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
+8
-3
UserLongController.java
...isenergy/web/admin/controller/app/UserLongController.java
+15
-0
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/vo/UserRegisterVo.java
0 → 100644
View file @
b8c8c8cd
package
cn
.
wisenergy
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
*@ Description: 用户注册Vo
*@ Author : 86187
*@ Date : 2021/1/14 11:39
*/
@Data
@ApiModel
(
value
=
"UserRegisterVo"
)
public
class
UserRegisterVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1105034143432359192L
;
/**
* 手机号码
*/
@ApiModelProperty
(
value
=
"手机号码"
,
name
=
"phone"
)
private
String
phone
;
/**
* 密码
*/
@ApiModelProperty
(
value
=
"密码"
,
name
=
"password"
)
private
String
password
;
/**
* 验证码
*/
@ApiModelProperty
(
value
=
"验证码"
,
name
=
"smCode"
)
private
String
smCode
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserLoginService.java
View file @
b8c8c8cd
...
...
@@ -2,6 +2,7 @@ package cn.wisenergy.service.app;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.vo.UserInfoVo
;
import
cn.wisenergy.model.vo.UserRegisterVo
;
/**
* @ Description: 用户登录
...
...
@@ -12,11 +13,10 @@ public interface UserLoginService {
/**
* 用户注册接口
*
* @param phone 手机号
* @param password 密码
* @param userRegisterVo 用户信息
* @return true 成功 false 失败
*/
R
<
Boolean
>
register
(
String
phone
,
String
password
);
R
<
Boolean
>
register
(
UserRegisterVo
userRegisterVo
);
/**
* 手机验证码登录
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
View file @
b8c8c8cd
...
...
@@ -5,6 +5,7 @@ import cn.wisenergy.common.utils.R;
import
cn.wisenergy.mapper.UsersMapper
;
import
cn.wisenergy.model.app.UserInfo
;
import
cn.wisenergy.model.vo.UserInfoVo
;
import
cn.wisenergy.model.vo.UserRegisterVo
;
import
cn.wisenergy.service.app.UserLoginService
;
import
cn.wisenergy.service.common.Common
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -27,12 +28,16 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, UserInfo> imp
private
UsersMapper
usersMapper
;
@Override
public
R
<
Boolean
>
register
(
String
phone
,
String
password
)
{
log
.
info
(
"volunteer-service[]UserLoginServiceImpl[]register[]input.param.phone,password:"
+
phone
,
password
);
if
(
StringUtils
.
isBlank
(
phone
)
||
StringUtils
.
isBlank
(
password
))
{
public
R
<
Boolean
>
register
(
UserRegisterVo
userVo
)
{
log
.
info
(
"volunteer-service[]UserLoginServiceImpl[]register[]input.param.userVo:"
+
userVo
);
if
(
null
==
userVo
||
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getPassword
()))
{
return
R
.
error
(
"入参为空!"
);
}
String
phone
=
userVo
.
getPhone
();
String
password
=
userVo
.
getPassword
();
//1.检查号码是否重复
Integer
userId
=
null
;
Boolean
bool
=
checkPhone
(
phone
,
userId
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserLongController.java
View file @
b8c8c8cd
...
...
@@ -2,13 +2,16 @@ package cn.wisenergy.web.admin.controller.app;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.vo.UserRegisterVo
;
import
cn.wisenergy.service.app.UserLoginService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -26,6 +29,18 @@ public class UserLongController {
@Autowired
private
UserLoginService
userLoginService
;
@ApiOperation
(
value
=
"用户注册"
,
notes
=
"用户注册"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"userVo"
,
value
=
"用户信息"
,
dataType
=
"UserRegisterVo"
)
@PostMapping
(
"/register"
)
public
R
<
Boolean
>
resetPassword
(
@RequestBody
UserRegisterVo
userVo
)
{
log
.
info
(
"volunteer-service[]UserLongController[]resetPassword[]input.param.userVo:"
+
userVo
);
if
(
null
==
userVo
||
StringUtils
.
isBlank
(
userVo
.
getPhone
())
||
StringUtils
.
isBlank
(
userVo
.
getPassword
()))
{
return
R
.
error
(
"入参不能为空!"
);
}
return
userLoginService
.
register
(
userVo
);
}
@ApiOperation
(
value
=
"重置密码"
,
notes
=
"重置密码"
,
httpMethod
=
"POST"
)
@PostMapping
(
"/resetPassword"
)
public
R
<
Boolean
>
resetPassword
(
Integer
userId
)
{
...
...
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