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
6233cbcd
Commit
6233cbcd
authored
Jan 21, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试用户相关接口
parent
167c5c1f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
36 deletions
+72
-36
ScoreInfo.java
...model/src/main/java/cn/wisenergy/model/app/ScoreInfo.java
+2
-0
UserCommitDto.java
...l/src/main/java/cn/wisenergy/model/dto/UserCommitDto.java
+8
-2
UserLoginService.java
.../main/java/cn/wisenergy/service/app/UserLoginService.java
+1
-0
SendSmsSerViceImpl.java
...ava/cn/wisenergy/service/app/impl/SendSmsSerViceImpl.java
+13
-12
UserLoginServiceImpl.java
...a/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
+4
-4
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+3
-2
UserController.java
...cn/wisenergy/web/admin/controller/app/UserController.java
+41
-16
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/app/ScoreInfo.java
View file @
6233cbcd
package
cn
.
wisenergy
.
model
.
app
;
package
cn
.
wisenergy
.
model
.
app
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -15,6 +16,7 @@ import java.util.Date;
...
@@ -15,6 +16,7 @@ import java.util.Date;
*/
*/
@Data
@Data
@ApiModel
(
value
=
"ScoreInfo"
)
@ApiModel
(
value
=
"ScoreInfo"
)
@TableName
(
"score"
)
public
class
ScoreInfo
implements
Serializable
{
public
class
ScoreInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8644045186424617919L
;
private
static
final
long
serialVersionUID
=
-
8644045186424617919L
;
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/UserCommitDto.java
View file @
6233cbcd
...
@@ -21,8 +21,8 @@ public class UserCommitDto implements Serializable {
...
@@ -21,8 +21,8 @@ public class UserCommitDto implements Serializable {
/**
/**
* 用户id
* 用户id
*/
*/
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"
i
d"
)
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"
userI
d"
)
private
Integer
i
d
;
private
Integer
userI
d
;
/**
/**
* 用户名称
* 用户名称
...
@@ -30,6 +30,12 @@ public class UserCommitDto implements Serializable {
...
@@ -30,6 +30,12 @@ public class UserCommitDto implements Serializable {
@ApiModelProperty
(
value
=
"用户名称"
,
name
=
"userName"
)
@ApiModelProperty
(
value
=
"用户名称"
,
name
=
"userName"
)
private
String
userName
;
private
String
userName
;
/**
* 用户头像
*/
@ApiModelProperty
(
value
=
"用户头像"
,
name
=
"headImage"
)
private
String
headImage
;
/**
/**
* 性别
* 性别
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserLoginService.java
View file @
6233cbcd
...
@@ -10,6 +10,7 @@ import cn.wisenergy.model.vo.UserRegisterVo;
...
@@ -10,6 +10,7 @@ import cn.wisenergy.model.vo.UserRegisterVo;
* @ Description: 用户登录
* @ Description: 用户登录
* @ Author : 86187
* @ Author : 86187
* @ Date : 2021/1/7 14:20
* @ Date : 2021/1/7 14:20
* @author 86187
*/
*/
public
interface
UserLoginService
{
public
interface
UserLoginService
{
/**
/**
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/SendSmsSerViceImpl.java
View file @
6233cbcd
...
@@ -12,10 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,10 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
* @author 86187
* @ Description: 短信验证码接口实现
* @ Description: 短信验证码接口实现
* @ Author : 86187
* @ Author : 86187
* @ Date : 2021/1/15 15:45
* @ Date : 2021/1/15 15:45
* @author 86187
*/
*/
@Service
@Service
@Slf4j
@Slf4j
...
@@ -31,7 +31,7 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
...
@@ -31,7 +31,7 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
}
}
return
null
;
return
R
.
ok
()
;
}
}
@Override
@Override
...
@@ -58,16 +58,17 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
...
@@ -58,16 +58,17 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
@Override
@Override
public
boolean
validCode
(
String
phone
,
String
code
,
Integer
type
)
{
public
boolean
validCode
(
String
phone
,
String
code
,
Integer
type
)
{
//获取短信验证码key
return
true
;
String
valCode
=
CachePrefix
.
SMS_CODE
.
getPrefix
()
+
type
+
"_"
+
phone
;
// //获取短信验证码key
//redis中获取验证码
// String valCode = CachePrefix.SMS_CODE.getPrefix() + type + "_" + phone;
Object
obj
=
cache
.
get
(
valCode
);
// //redis中获取验证码
if
(
obj
!=
null
&&
obj
.
equals
(
code
))
{
// Object obj = cache.get(valCode);
//验证码存在,校验通过,清除验证码缓存
// if (obj != null && obj.equals(code)) {
cache
.
remove
(
valCode
);
// //验证码存在,校验通过,清除验证码缓存
return
true
;
// cache.remove(valCode);
}
// return true;
return
false
;
// }
// return false;
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
View file @
6233cbcd
...
@@ -62,7 +62,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -62,7 +62,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
}
}
//2、给密码加密 加密规则,电话号码+明文密码
//2、给密码加密 加密规则,电话号码+明文密码
String
secret
=
Md5Util
.
digestMD5
(
p
hone
+
password
);
String
secret
=
Md5Util
.
digestMD5
(
p
assword
+
phone
);
//3、添加用户信息
//3、添加用户信息
User
userInfo
=
new
User
();
User
userInfo
=
new
User
();
...
@@ -102,7 +102,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -102,7 +102,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
QueryWrapper
<
User
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
User
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"phone"
,
userVo
.
getPhone
());
queryWrapper
.
eq
(
"phone"
,
userVo
.
getPhone
());
queryWrapper
.
eq
(
"is_delete"
,
0
);
queryWrapper
.
eq
(
"is_delete"
,
0
);
User
user
=
users
Mapper
.
selectOne
(
queryWrapper
);
User
user
=
base
Mapper
.
selectOne
(
queryWrapper
);
if
(
null
==
user
)
{
if
(
null
==
user
)
{
return
R
.
error
(
"该手机号未注册,请先注册!"
);
return
R
.
error
(
"该手机号未注册,请先注册!"
);
}
}
...
@@ -130,7 +130,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -130,7 +130,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
//2、判断密码是否正确
//2、判断密码是否正确
//MD5加密
//MD5加密
String
secret
=
Md5Util
.
digestMD5
(
userVo
.
getPhone
()
+
userVo
.
getPassword
());
String
secret
=
Md5Util
.
digestMD5
(
userVo
.
getPassword
()+
userVo
.
getPhone
());
if
(!
user
.
getPassword
().
equals
(
secret
))
{
if
(!
user
.
getPassword
().
equals
(
secret
))
{
return
R
.
error
(
"密码错误,请您输入正确密码!"
);
return
R
.
error
(
"密码错误,请您输入正确密码!"
);
...
@@ -190,7 +190,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -190,7 +190,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
}
}
//2、判断旧密码是否正确
//2、判断旧密码是否正确
String
password
=
Md5Util
.
digestMD5
(
updateVo
.
get
NewPassword
()
+
user
.
getPassword
());
String
password
=
Md5Util
.
digestMD5
(
updateVo
.
get
OldPassword
()
+
user
.
getPhone
());
if
(!
user
.
getPassword
().
equals
(
password
))
{
if
(!
user
.
getPassword
().
equals
(
password
))
{
return
R
.
error
(
"旧密码不正确,请从新输入!"
);
return
R
.
error
(
"旧密码不正确,请从新输入!"
);
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
6233cbcd
...
@@ -106,7 +106,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -106,7 +106,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
}
//1、根据用户id,获取用户信息
//1、根据用户id,获取用户信息
User
user
=
usersMapper
.
selectById
(
userInfo
.
getId
());
User
user
=
usersMapper
.
selectById
(
userInfo
.
get
User
Id
());
if
(
null
==
user
)
{
if
(
null
==
user
)
{
return
R
.
error
(
"用户信息不存在!"
);
return
R
.
error
(
"用户信息不存在!"
);
}
}
...
@@ -117,6 +117,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -117,6 +117,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
user
.
setExamType
(
userInfo
.
getStudentType
());
user
.
setExamType
(
userInfo
.
getStudentType
());
user
.
setUserName
(
userInfo
.
getUserName
());
user
.
setUserName
(
userInfo
.
getUserName
());
user
.
setIsDelete
(
0
);
user
.
setIsDelete
(
0
);
user
.
setSource
(
userInfo
.
getSource
());
//3、要提交的用户的成绩信息
//3、要提交的用户的成绩信息
ScoreInfo
scoreInfo
=
userInfo
.
getScoreInfo
();
ScoreInfo
scoreInfo
=
userInfo
.
getScoreInfo
();
...
@@ -129,7 +130,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -129,7 +130,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
//返回信息
//返回信息
UserInfoVo
userInfoVo
=
new
UserInfoVo
();
UserInfoVo
userInfoVo
=
new
UserInfoVo
();
userInfoVo
.
setUserId
(
userInfo
.
getId
());
userInfoVo
.
setUserId
(
userInfo
.
get
User
Id
());
userInfoVo
.
setUserName
(
userInfo
.
getUserName
());
userInfoVo
.
setUserName
(
userInfo
.
getUserName
());
userInfoVo
.
setPhone
(
user
.
getPhone
());
userInfoVo
.
setPhone
(
user
.
getPhone
());
userInfoVo
.
setSex
(
userInfo
.
getSex
());
userInfoVo
.
setSex
(
userInfo
.
getSex
());
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserController.java
View file @
6233cbcd
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.model.dto.UserCommitDto
;
import
cn.wisenergy.model.dto.UserInfoDto
;
import
cn.wisenergy.model.dto.UserInfoDto
;
import
cn.wisenergy.model.vo.UserInfoVo
;
import
cn.wisenergy.model.vo.UserQueryVo
;
import
cn.wisenergy.model.vo.UserQueryVo
;
import
cn.wisenergy.model.vo.UserShowVo
;
import
cn.wisenergy.service.app.UserService
;
import
cn.wisenergy.service.app.UserService
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -10,35 +13,57 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -10,35 +13,57 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.net.InetAddress
;
/**
/**
* @ Description: 用户管理模
* @ Description: 用户管理模
* @ Author : 86187
* @ Author : 86187
* @ Date : 2021/1/7 10:29
* @ Date : 2021/1/7 10:29
* @author 86187
*/
*/
@RestController
@RestController
@Api
(
tags
=
"用户管理"
)
@Api
(
tags
=
"
PC-
用户管理"
)
@RequestMapping
(
"/user"
)
@RequestMapping
(
"/user"
)
@Slf4j
@Slf4j
public
class
UserController
{
public
class
UserController
{
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
@ApiOperation
(
value
=
"用户管理"
,
notes
=
"用户管理"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"用户管理"
,
notes
=
"用户管理"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"queryVo"
,
value
=
"用户信息"
,
dataType
=
"UserQueryVo"
)
@ApiImplicitParam
(
name
=
"queryVo"
,
value
=
"用户信息"
,
dataType
=
"UserQueryVo"
)
@PostMapping
(
"/manage"
)
@PostMapping
(
"/manage"
)
public
R
manageUser
(
@RequestBody
UserQueryVo
queryVo
){
public
R
<
PageInfo
<
UserInfoDto
>>
manageUser
(
@RequestBody
UserQueryVo
queryVo
)
{
log
.
info
(
"UserController[].manageUser[].input.param:queryV0:{}"
+
queryVo
);
log
.
info
(
"UserController[]manageUser[]input.param:queryV0:"
+
queryVo
);
if
(
null
==
queryVo
||
null
==
queryVo
.
getPageSize
()
||
null
==
queryVo
.
getPageNo
())
{
return
R
.
error
(
"入参为空!"
);
}
//返回数据
return
userService
.
getUserList
(
queryVo
);
}
//返回数据
@ApiOperation
(
value
=
"提交个人信息"
,
notes
=
"提交个人信息"
,
httpMethod
=
"POST"
)
return
userService
.
getUserList
(
queryVo
);
@ApiImplicitParam
(
name
=
"userInfo"
,
value
=
"个人信息"
,
dataType
=
"UserCommitDto"
)
}
@PostMapping
(
"/commit"
)
public
R
<
UserInfoVo
>
commitUserInfo
(
@RequestBody
UserCommitDto
userInfo
)
{
log
.
info
(
"UserController[]commitUserInfo[]input.param:queryV0:"
+
userInfo
);
if
(
null
==
userInfo
)
{
return
R
.
error
(
"入参为空!"
);
}
//返回数据
return
userService
.
commitUserInfo
(
userInfo
);
}
@ApiOperation
(
value
=
"获取个人信息"
,
notes
=
"获取个人信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"int"
)
@GetMapping
(
"/getById"
)
public
R
<
UserShowVo
>
getById
(
Integer
userId
)
{
log
.
info
(
"UserController[]getById[]input.param:queryV0:"
+
userId
);
if
(
null
==
userId
)
{
return
R
.
error
(
"入参为空!"
);
}
//返回数据
return
userService
.
getById
(
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