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
f69c8700
Commit
f69c8700
authored
Mar 12, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
44413526
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
16 deletions
+38
-16
UsersMapper.java
...mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
+6
-1
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+10
-0
UserService.java
...e/src/main/java/cn/wisenergy/service/app/UserService.java
+11
-5
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+5
-3
LoginController.java
...n/wisenergy/web/admin/controller/app/LoginController.java
+6
-7
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
View file @
f69c8700
...
...
@@ -40,7 +40,6 @@ public interface UsersMapper extends BaseMapper<User> {
*/
int
delById
(
@Param
(
"id"
)
Integer
id
);
List
<
User
>
getList
(
Map
<
String
,
Object
>
map
);
List
<
User
>
findAll
();
...
...
@@ -51,6 +50,12 @@ public interface UsersMapper extends BaseMapper<User> {
void
save
(
User
user
);
/**
* 获取用户信息
* @return 用户信息
*/
User
getUserById
(
@Param
(
"id"
)
Long
id
);
/**
* 获取用户信息
*
...
...
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
f69c8700
...
...
@@ -109,6 +109,16 @@
order by create_time desc
</select>
<select
id=
"getUserById"
resultType=
"cn.wisenergy.model.app.User"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"cols_all"
/>
from
<include
refid=
"table"
/>
<where>
id=#{id}
</where>
</select>
<select
id=
"getByUserId"
resultType=
"cn.wisenergy.model.app.User"
parameterType=
"string"
>
select
<include
refid=
"cols_all"
/>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserService.java
View file @
f69c8700
...
...
@@ -7,26 +7,30 @@ import cn.wisenergy.model.vo.AerialDeliveryVo;
import
java.util.Map
;
/**
* @author 86187
* @author 86187
* @ Description: 用户接口
* @ Author : 86187
* @ Date : 2021/1/6 16:08
* @author 86187
*/
public
interface
UserService
{
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
User
getById
(
String
userId
);
User
getById
(
String
userId
);
R
<
Integer
>
getById1
(
String
userId
);
R
<
Integer
>
getById1
(
String
userId
);
User
getUserById
(
Long
id
);
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
...
...
@@ -59,7 +63,8 @@ public interface UserService {
/**
* 设置用户头像
* @param userId 用户id
*
* @param userId 用户id
* @param headImage 头像图片地址
* @return true or false
*/
...
...
@@ -67,7 +72,8 @@ public interface UserService {
/**
* 设置页面 -邀请码填写
* @param userId 用户id
*
* @param userId 用户id
* @param inviteCode 邀请人邀请码
* @return true or false
*/
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
f69c8700
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
;
...
...
@@ -20,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
/**
...
...
@@ -53,6 +50,11 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
return
R
.
ok
(
usersMapper
.
ByUserId
(
userId
));
}
@Override
public
User
getUserById
(
Long
id
)
{
return
this
.
usersMapper
.
getUserById
(
id
);
}
@Override
public
User
getByUserId
(
String
userId
)
{
return
usersMapper
.
getByUserId
(
userId
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/LoginController.java
View file @
f69c8700
...
...
@@ -19,7 +19,7 @@ import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.
Pos
tMapping
;
import
org.springframework.web.bind.annotation.
Ge
tMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -29,7 +29,6 @@ import javax.servlet.http.HttpServletRequest;
import
java.awt.image.BufferedImage
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -130,16 +129,16 @@ public class LoginController {
return
(
Map
)
ResultUtils
.
returnDataSuccess
(
userDtoJson
);
}
@ApiOperation
(
value
=
"二维码邀请注册"
,
notes
=
"二维码邀请注册"
,
httpMethod
=
"
POS
T"
)
@ApiOperation
(
value
=
"二维码邀请注册"
,
notes
=
"二维码邀请注册"
,
httpMethod
=
"
GE
T"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户手机号"
,
required
=
true
,
dataType
=
"String"
)
})
@
Pos
tMapping
(
value
=
"/registerByQrCode"
)
public
ResponseEntity
<
byte
[]>
registerByQrCode
(
@RequestParam
(
"user
Id"
)
Stri
ng
userId
,
HttpServletRequest
request
)
throws
IOException
{
User
user
=
this
.
usersService
.
get
ByUser
Id
(
userId
);
@
Ge
tMapping
(
value
=
"/registerByQrCode"
)
public
ResponseEntity
<
byte
[]>
registerByQrCode
(
@RequestParam
(
"user
_id"
)
Lo
ng
userId
,
HttpServletRequest
request
)
throws
IOException
{
User
user
=
this
.
usersService
.
get
UserBy
Id
(
userId
);
if
(
user
!=
null
)
{
String
regFullUrl
=
request
.
getScheme
()
+
"://"
+
request
.
getServerName
()
+
":"
+
request
.
getServerPort
()
+
"/
regist
?beInvitedCode="
+
user
.
getInviteCode
();
+
"/
front/register
?beInvitedCode="
+
user
.
getInviteCode
();
final
InputStream
is
=
new
ClassPathResource
(
"templates/background.jpg"
).
getInputStream
();
BufferedImage
srcImage
=
ImageIO
.
read
(
is
);
...
...
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