Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
data-server
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
data-server
Commits
157f6fbf
Commit
157f6fbf
authored
Mar 06, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/licc/shop-mall
into master
parents
6479fcc1
7ef1bfae
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
296 additions
and
25 deletions
+296
-25
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+10
-3
User.java
...ergy-model/src/main/java/cn/wisenergy/model/app/User.java
+6
-0
AerialDeliveryVo.java
...src/main/java/cn/wisenergy/model/vo/AerialDeliveryVo.java
+29
-0
UserPoolVo.java
...model/src/main/java/cn/wisenergy/model/vo/UserPoolVo.java
+37
-0
UserService.java
...e/src/main/java/cn/wisenergy/service/app/UserService.java
+23
-4
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+64
-9
FileUploadController.java
...energy/web/admin/controller/app/FileUploadController.java
+87
-0
UserController.java
...cn/wisenergy/web/admin/controller/app/UserController.java
+40
-9
No files found.
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
157f6fbf
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"password"
property=
"password"
/>
<result
column=
"password"
property=
"password"
/>
<result
column=
"head_image"
property=
"headImage"
/>
<result
column=
"user_level"
property=
"userLevel"
/>
<result
column=
"user_level"
property=
"userLevel"
/>
<result
column=
"cross_border_line"
property=
"crossBorderLine"
/>
<result
column=
"cross_border_line"
property=
"crossBorderLine"
/>
<result
column=
"id_card_number"
property=
"idCardNumber"
/>
<result
column=
"id_card_number"
property=
"idCardNumber"
/>
...
@@ -27,18 +28,19 @@
...
@@ -27,18 +28,19 @@
</sql>
</sql>
<sql
id=
"cols_exclude_id"
>
<sql
id=
"cols_exclude_id"
>
user_id,password, user_level,cross_border_line,id_card_number,fans_nickname,fans_id, invite_code,
user_id,password,
head_image,
user_level,cross_border_line,id_card_number,fans_nickname,fans_id, invite_code,
be_invited_code,create_time,update_time
be_invited_code,create_time,update_time
</sql>
</sql>
<sql
id=
"vals"
>
<sql
id=
"vals"
>
#{userId},#{password},#{userLevel},#{crossBorderLine},#{idCardNumber},#{fansNickname},#{fansId},#{inviteCode},
#{userId},#{password},#{
headImage},#{
userLevel},#{crossBorderLine},#{idCardNumber},#{fansNickname},#{fansId},#{inviteCode},
#{beInvitedCode},now(),now()
#{beInvitedCode},now(),now()
</sql>
</sql>
<sql
id=
"updateCondition"
>
<sql
id=
"updateCondition"
>
<if
test=
"userId != null"
>
user_id = #{userId},
</if>
<if
test=
"userId != null"
>
user_id = #{userId},
</if>
<if
test=
"password != null"
>
password =#{password},
</if>
<if
test=
"password != null"
>
password =#{password},
</if>
<if
test=
"headImage != null"
>
head_image =#{headImage},
</if>
<if
test=
"userLevel != null"
>
user_level =#{userLevel},
</if>
<if
test=
"userLevel != null"
>
user_level =#{userLevel},
</if>
<if
test=
"crossBorderLine != null"
>
cross_border_line =#{crossBorderLine},
</if>
<if
test=
"crossBorderLine != null"
>
cross_border_line =#{crossBorderLine},
</if>
<if
test=
"idCardNumber != null"
>
id_card_number = #{idCardNumber},
</if>
<if
test=
"idCardNumber != null"
>
id_card_number = #{idCardNumber},
</if>
...
@@ -53,6 +55,7 @@
...
@@ -53,6 +55,7 @@
<if
test=
"id != null"
>
id = #{id}
</if>
<if
test=
"id != null"
>
id = #{id}
</if>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"password != null"
>
and password =#{password}
</if>
<if
test=
"password != null"
>
and password =#{password}
</if>
<if
test=
"headImage != null"
>
and head_image =#{headImage}
</if>
<if
test=
"userLevel != null"
>
and user_level =#{userLevel}
</if>
<if
test=
"userLevel != null"
>
and user_level =#{userLevel}
</if>
<if
test=
"crossBorderLine != null"
>
and cross_border_line =#{crossBorderLine}
</if>
<if
test=
"crossBorderLine != null"
>
and cross_border_line =#{crossBorderLine}
</if>
<if
test=
"idCardNumber != null"
>
and id_card_number = #{idCardNumber}
</if>
<if
test=
"idCardNumber != null"
>
and id_card_number = #{idCardNumber}
</if>
...
@@ -97,6 +100,10 @@
...
@@ -97,6 +100,10 @@
from
from
<include
refid=
"table"
/>
<include
refid=
"table"
/>
<where>
<where>
<if
test=
"createTime != null"
>
YEAR(create_time) = YEAR(#{createTime})
AND MONTH(create_time) = MONTH(#{createTime})
</if>
</where>
</where>
</select>
</select>
...
@@ -182,7 +189,7 @@
...
@@ -182,7 +189,7 @@
</where>
</where>
</select>
</select>
<!--根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID-->
<!--根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID-->
<select
id=
"
B
eInvitedCode1"
resultType=
"java.lang.Integer"
>
<select
id=
"
b
eInvitedCode1"
resultType=
"java.lang.Integer"
>
select
select
id
id
from
from
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/app/User.java
View file @
157f6fbf
...
@@ -38,6 +38,12 @@ public class User extends Model<User> implements Serializable{
...
@@ -38,6 +38,12 @@ public class User extends Model<User> implements Serializable{
@ApiModelProperty
(
name
=
"password"
,
value
=
"用户密码"
)
@ApiModelProperty
(
name
=
"password"
,
value
=
"用户密码"
)
private
String
password
;
private
String
password
;
/**
* 用户头像
*/
@ApiModelProperty
(
name
=
"用户头像"
,
value
=
"headImage"
)
private
String
headImage
;
/**
/**
* 用户会员等级
* 用户会员等级
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/vo/AerialDeliveryVo.java
0 → 100644
View file @
157f6fbf
package
cn
.
wisenergy
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
*@ Description: 空投池Vo
*@ Author : 86187
*@ Date : 2021/3/6 10:29
* @author 86187
*/
@Data
@ApiModel
(
"AerialDeliveryVo"
)
public
class
AerialDeliveryVo
{
/**
* 总数
*/
@ApiModelProperty
(
value
=
"总数"
,
name
=
"total"
)
private
Integer
total
;
/**
* 用户列表
*/
@ApiModelProperty
(
value
=
"用户列表"
,
name
=
"userPoolVos"
)
private
List
<
UserPoolVo
>
userPoolVos
;
}
wisenergy-model/src/main/java/cn/wisenergy/model/vo/UserPoolVo.java
0 → 100644
View file @
157f6fbf
package
cn
.
wisenergy
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author 86187
* @ Description: 用户空投Vo
* @ Author : 86187
* @ Date : 2021/3/6 10:32
*/
@Data
@ApiModel
(
"UserPoolVo"
)
public
class
UserPoolVo
{
/**
* 用户id
*/
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"userId"
)
private
String
userId
;
/**
* 进入空投池时间
*/
@ApiModelProperty
(
value
=
"进入空投池时间"
,
name
=
"intoTime"
)
private
Date
intoTime
;
/**
* 头像
*/
@ApiModelProperty
(
value
=
"头像"
,
name
=
"headImage"
)
private
String
headImage
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserService.java
View file @
157f6fbf
...
@@ -2,29 +2,32 @@ package cn.wisenergy.service.app;
...
@@ -2,29 +2,32 @@ package cn.wisenergy.service.app;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.vo.AerialDeliveryVo
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* @author 86187
* @ Description: 用户接口
* @ Description: 用户接口
* @ Author : 86187
* @ Author : 86187
* @ Date : 2021/1/6 16:08
* @ Date : 2021/1/6 16:08
* @author 86187
*/
*/
public
interface
UserService
{
public
interface
UserService
{
/**
/**
* 获取用户信息
* 获取用户信息
*
* @param userId 用户id
* @param userId 用户id
* @return 用户信息
* @return 用户信息
*/
*/
User
getById
(
String
userId
);
User
getById
(
String
userId
);
R
<
Integer
>
getById1
(
String
userId
);
R
<
Integer
>
getById1
(
String
userId
);
/**
/**
* 获取用户信息
* 获取用户信息
*
* @param userId 用户id
* @param userId 用户id
* @return 用户信息
* @return 用户信息
*/
*/
...
@@ -32,11 +35,12 @@ public interface UserService {
...
@@ -32,11 +35,12 @@ public interface UserService {
//根据手机号查询用户
//根据手机号查询用户
public
User
queryUsersByPhone
(
String
id
);
public
User
queryUsersByPhone
(
String
id
);
//根据OpenId查询用户
//根据OpenId查询用户
public
User
queryUsersByOpenId
(
String
openId
);
public
User
queryUsersByOpenId
(
String
openId
);
/**
/**
*用户注册
*
用户注册
*/
*/
Map
userByZx
(
String
userId
,
String
beInvitedCode
);
Map
userByZx
(
String
userId
,
String
beInvitedCode
);
...
@@ -44,4 +48,19 @@ public interface UserService {
...
@@ -44,4 +48,19 @@ public interface UserService {
//
//
Integer
getuserIdById
(
String
userId
);
Integer
getuserIdById
(
String
userId
);
/**
* 获取空投池列表
*
* @return 空投池列表
*/
R
<
AerialDeliveryVo
>
queryAerialDelivery
();
/**
* 设置用户头像
* @param userId 用户id
* @param headImage 头像地址
* @return true or false
*/
R
<
Boolean
>
setHeadImage
(
String
userId
,
String
headImage
);
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
157f6fbf
...
@@ -8,9 +8,12 @@ import cn.wisenergy.mapper.UsersMapper;
...
@@ -8,9 +8,12 @@ import cn.wisenergy.mapper.UsersMapper;
import
cn.wisenergy.model.app.RecommendUser
;
import
cn.wisenergy.model.app.RecommendUser
;
import
cn.wisenergy.model.app.TeamUserInfo
;
import
cn.wisenergy.model.app.TeamUserInfo
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.vo.AerialDeliveryVo
;
import
cn.wisenergy.model.vo.UserPoolVo
;
import
cn.wisenergy.service.app.UserService
;
import
cn.wisenergy.service.app.UserService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -47,7 +50,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -47,7 +50,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
@Override
@Override
public
R
<
Integer
>
getById1
(
String
userId
)
{
public
R
<
Integer
>
getById1
(
String
userId
)
{
return
R
.
ok
(
usersMapper
.
ByUserId
(
userId
));
return
R
.
ok
(
usersMapper
.
ByUserId
(
userId
));
}
}
@Override
@Override
...
@@ -58,10 +61,10 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -58,10 +61,10 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
@Override
@Override
public
User
queryUsersByPhone
(
String
phone
)
{
public
User
queryUsersByPhone
(
String
phone
)
{
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"phone"
,
phone
);
param
.
put
(
"phone"
,
phone
);
List
<
User
>
usersList
=
usersMapper
.
getUsersListByMap
(
param
);
List
<
User
>
usersList
=
usersMapper
.
getUsersListByMap
(
param
);
if
(!
CollectionUtils
.
isEmpty
(
usersList
))
{
if
(!
CollectionUtils
.
isEmpty
(
usersList
))
{
return
usersList
.
get
(
0
);
return
usersList
.
get
(
0
);
}
}
return
null
;
return
null
;
...
@@ -100,6 +103,10 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -100,6 +103,10 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
map
.
put
(
"msg:"
,
"注册失败!邀请码无效,请重新填写!"
);
map
.
put
(
"msg:"
,
"注册失败!邀请码无效,请重新填写!"
);
return
map
;
return
map
;
}
}
if
(
null
==
beInvitedCode
||
""
==
beInvitedCode
)
{
beInvitedCode
=
String
.
valueOf
(
1
);
}
}
}
//根据插入的用户手机号,查询用户唯一ID
//根据插入的用户手机号,查询用户唯一ID
...
@@ -153,10 +160,58 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -153,10 +160,58 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
return
null
;
return
null
;
}
}
@Override
public
R
<
AerialDeliveryVo
>
queryAerialDelivery
()
{
log
.
info
(
"shop-mall[]UserServiceImpl[]queryAerialDelivery[]input.method"
);
//获取本月新注册用户
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
4
);
map
.
put
(
"createTime"
,
new
Date
());
List
<
User
>
list
=
usersMapper
.
getList
(
map
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
R
.
ok
(
new
AerialDeliveryVo
());
}
AerialDeliveryVo
aerialDeliveryVo
=
new
AerialDeliveryVo
();
List
<
UserPoolVo
>
userPoolVoList
=
new
ArrayList
<>();
for
(
User
user
:
list
)
{
UserPoolVo
userPoolVo
=
new
UserPoolVo
();
userPoolVo
.
setUserId
(
user
.
getUserId
());
userPoolVo
.
setHeadImage
(
user
.
getHeadImage
());
userPoolVo
.
setIntoTime
(
user
.
getCreateTime
());
userPoolVoList
.
add
(
userPoolVo
);
}
aerialDeliveryVo
.
setTotal
(
list
.
size
());
aerialDeliveryVo
.
setUserPoolVos
(
userPoolVoList
);
return
R
.
ok
(
aerialDeliveryVo
);
}
@Override
public
R
<
Boolean
>
setHeadImage
(
String
userId
,
String
headImage
)
{
log
.
info
(
"shop-mall[]UserServiceImpl[]setHeadImage[]input.param.userId,headImage:"
+
userId
,
headImage
);
if
(
StringUtils
.
isBlank
(
userId
)
||
StringUtils
.
isBlank
(
headImage
))
{
return
R
.
error
(
"入参不能为空!"
);
}
//获取用户信息
User
user
=
usersMapper
.
getByUserId
(
userId
);
if
(
null
==
user
)
{
return
R
.
error
(
"用户信息不存在!"
);
}
//添加头像
user
.
setHeadImage
(
headImage
);
int
count
=
usersMapper
.
edit
(
user
);
if
(
count
==
0
)
{
return
R
.
error
(
"设置头像失败!"
);
}
return
R
.
ok
(
0
,
true
);
}
//私有构造方法-传入被邀请码
//私有构造方法-传入被邀请码
private
R
teamgg
(
String
beInvitedCode
)
{
private
R
teamgg
(
String
beInvitedCode
)
{
//用户的被邀请码,查询到推荐人用户,根据推荐人用户的邀请码查询/修改
//用户的被邀请码,查询到推荐人用户,根据推荐人用户的邀请码查询/修改
User
user
=
usersMapper
.
getByBeInvitedCode
(
beInvitedCode
);
User
user
=
usersMapper
.
getByBeInvitedCode
(
beInvitedCode
);
//根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID=userid
//根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID=userid
String
userid
=
String
.
valueOf
(
usersMapper
.
inviteCodeBeInvitedCode
(
Integer
.
valueOf
(
beInvitedCode
)));
String
userid
=
String
.
valueOf
(
usersMapper
.
inviteCodeBeInvitedCode
(
Integer
.
valueOf
(
beInvitedCode
)));
//根据用户推荐人的userid,查询数据库,看推荐人用户是否存在
//根据用户推荐人的userid,查询数据库,看推荐人用户是否存在
...
@@ -171,9 +226,9 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
...
@@ -171,9 +226,9 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
else
{
}
else
{
return
R
.
error
(
0
,
"验证码无效"
);
return
R
.
error
(
0
,
"验证码无效"
);
}
}
beInvitedCode
=
user
.
getBeInvitedCode
();
beInvitedCode
=
user
.
getBeInvitedCode
();
//递归向上修改团队用户信息表
//递归向上修改团队用户信息表
teamgg
(
beInvitedCode
);
teamgg
(
beInvitedCode
);
return
R
.
ok
(
"团队表普通用户数量+1成功!"
,
0
);
return
R
.
ok
(
"团队表普通用户数量+1成功!"
,
0
);
}
}
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/FileUploadController.java
0 → 100644
View file @
157f6fbf
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.UUID
;
/**
* @author 86187
* @ Description:
* @ Author : 86187
* @ Date : 2021/2/3 17:05
*/
@Api
(
tags
=
"图片上传"
)
@RestController
@RequestMapping
(
"/pic"
)
@Slf4j
public
class
FileUploadController
{
/**
* 请求 url 中的资源映射,不推荐写死在代码中,最好提供可配置,如 /upload_flowChart/**
*/
@Value
(
"${uploadFile.resourceHandler}"
)
private
String
resourceHandler
;
/**
* 上传文件保存的本地目录,使用@Value获取全局配置文件中配置的属性值,如 D:/java/upload_flowChart/
*/
@Value
(
"${uploadFile.location}"
)
private
String
uploadImagesLocation
;
/**
* 允许上传的格式
*/
private
static
final
String
[]
IMAGE_TYPE
=
new
String
[]{
".bmp"
,
".jpg"
,
".jpeg"
,
".gif"
,
".png"
};
@ApiOperation
(
value
=
"文件上传"
,
notes
=
"文件上传"
)
@PostMapping
(
value
=
"/upload"
,
headers
=
"content-type=multipart/form-data"
)
public
R
file
(
@ApiParam
(
required
=
true
,
value
=
"上传文件"
)
@RequestParam
(
"file"
)
MultipartFile
file
,
HttpServletRequest
request
)
{
boolean
isLegal
=
true
;
if
(
file
.
isEmpty
())
{
// 上传文件为空
return
R
.
error
(
"上传文件不能为空"
);
}
for
(
String
type
:
IMAGE_TYPE
)
{
if
(
StringUtils
.
endsWithIgnoreCase
(
file
.
getOriginalFilename
(),
type
))
{
isLegal
=
false
;
break
;
}
}
if
(
isLegal
)
{
return
R
.
error
(
"上传文件类型不符合"
);
}
File
folder
=
new
File
(
uploadImagesLocation
);
if
(!
folder
.
exists
())
{
folder
.
mkdirs
();
}
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
UUID
.
randomUUID
().
toString
().
substring
(
4
,
9
)
+
oldName
;
try
{
file
.
transferTo
(
new
File
(
folder
,
newName
));
String
url
=
"/upload_flowChart/"
+
newName
;
return
R
.
ok
(
200
,
url
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
R
.
error
(
"上传文件失败!"
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserController.java
View file @
157f6fbf
...
@@ -10,7 +10,10 @@ import cn.wisenergy.model.app.RecommendUser;
...
@@ -10,7 +10,10 @@ import cn.wisenergy.model.app.RecommendUser;
import
cn.wisenergy.model.app.TeamUserInfo
;
import
cn.wisenergy.model.app.TeamUserInfo
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.app.UsersDto
;
import
cn.wisenergy.model.app.UsersDto
;
import
cn.wisenergy.model.dto.WithdrawBankDto
;
import
cn.wisenergy.model.vo.AerialDeliveryVo
;
import
cn.wisenergy.model.vo.UserAndRecommendVo
;
import
cn.wisenergy.model.vo.UserAndRecommendVo
;
import
cn.wisenergy.model.vo.WithdrawalRecordVo
;
import
cn.wisenergy.service.app.RecommendUserService
;
import
cn.wisenergy.service.app.RecommendUserService
;
import
cn.wisenergy.service.app.TeamUserInfoService
;
import
cn.wisenergy.service.app.TeamUserInfoService
;
import
cn.wisenergy.service.app.UserForestStatusService
;
import
cn.wisenergy.service.app.UserForestStatusService
;
...
@@ -23,8 +26,10 @@ import com.alibaba.druid.sql.ast.statement.SQLIfStatement;
...
@@ -23,8 +26,10 @@ import com.alibaba.druid.sql.ast.statement.SQLIfStatement;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -71,7 +76,7 @@ public class UserController extends BaseController {
...
@@ -71,7 +76,7 @@ public class UserController extends BaseController {
@ApiOperation
(
value
=
"获取用户信息"
,
notes
=
"获取用户信息"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取用户信息"
,
notes
=
"获取用户信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"String"
)
@GetMapping
(
"/getByUserId"
)
@GetMapping
(
"/getByUserId"
)
public
User
getByUserId
(
String
userId
){
public
User
getByUserId
(
String
userId
)
{
return
userService
.
getById
(
userId
);
return
userService
.
getById
(
userId
);
}
}
...
@@ -99,8 +104,8 @@ public class UserController extends BaseController {
...
@@ -99,8 +104,8 @@ public class UserController extends BaseController {
@ApiOperation
(
value
=
"获取用户森林状态接口"
,
notes
=
"获取用户森林状态接口"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取用户森林状态接口"
,
notes
=
"获取用户森林状态接口"
,
httpMethod
=
"GET"
)
@GetMapping
(
"/forestStatus"
)
@GetMapping
(
"/forestStatus"
)
public
R
<
Map
>
forestStatus
(
String
userId
){
public
R
<
Map
>
forestStatus
(
String
userId
)
{
if
(
null
==
userId
){
if
(
null
==
userId
)
{
return
R
.
error
(
"入参为空"
);
return
R
.
error
(
"入参为空"
);
}
}
...
@@ -108,34 +113,60 @@ public class UserController extends BaseController {
...
@@ -108,34 +113,60 @@ public class UserController extends BaseController {
Map
userForestStatus
=
userForestStatusService
.
getUserForestStatus
(
userId
);
Map
userForestStatus
=
userForestStatusService
.
getUserForestStatus
(
userId
);
return
R
.
ok
(
userForestStatus
);
return
R
.
ok
(
userForestStatus
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
R
.
error
(
1
,
"请重新尝试"
);
return
R
.
error
(
1
,
"请重新尝试"
);
}
}
}
}
@ApiOperation
(
value
=
"获取用户我的直推信息"
,
notes
=
"获取用户我的直推信息"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取用户我的直推信息"
,
notes
=
"获取用户我的直推信息"
,
httpMethod
=
"GET"
)
@GetMapping
(
"/myRecommend"
)
@GetMapping
(
"/myRecommend"
)
public
R
<
Map
>
getMyRecommend
(
String
userId
){
public
R
<
Map
>
getMyRecommend
(
String
userId
)
{
int
userLevel
=
userService
.
getByUserId
(
userId
).
getUserLevel
();
int
userLevel
=
userService
.
getByUserId
(
userId
).
getUserLevel
();
RecommendUser
myRecommed
=
recommendUserService
.
getMyRecommed
(
userId
);
RecommendUser
myRecommed
=
recommendUserService
.
getMyRecommed
(
userId
);
Map
myRecommedMap
=
new
HashMap
();
Map
myRecommedMap
=
new
HashMap
();
myRecommedMap
.
put
(
"userlevel"
,
userLevel
);
myRecommedMap
.
put
(
"userlevel"
,
userLevel
);
myRecommedMap
.
put
(
"myRecommed"
,
myRecommed
);
myRecommedMap
.
put
(
"myRecommed"
,
myRecommed
);
return
R
.
ok
(
myRecommedMap
);
return
R
.
ok
(
myRecommedMap
);
}
}
@ApiOperation
(
value
=
"获取用户我的团队信息"
,
notes
=
"获取用户我的团队推信息"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取用户我的团队信息"
,
notes
=
"获取用户我的团队推信息"
,
httpMethod
=
"GET"
)
@GetMapping
(
"/myTeam"
)
@GetMapping
(
"/myTeam"
)
public
R
<
TeamUserInfo
>
getMyTeam
(
String
userId
){
public
R
<
TeamUserInfo
>
getMyTeam
(
String
userId
)
{
TeamUserInfo
myTeam
=
teamUserInfoService
.
getOneById
(
userId
);
TeamUserInfo
myTeam
=
teamUserInfoService
.
getOneById
(
userId
);
return
R
.
ok
(
myTeam
);
return
R
.
ok
(
myTeam
);
}
}
@ApiOperation
(
value
=
"获取用户我的直推信息详情"
,
notes
=
"获取用户我的直推信息详情"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取用户我的直推信息详情"
,
notes
=
"获取用户我的直推信息详情"
,
httpMethod
=
"GET"
)
@GetMapping
(
"/myRecommendInfo"
)
@GetMapping
(
"/myRecommendInfo"
)
public
R
<
List
<
UserAndRecommendVo
>>
getMyRecommendInfo
(
@RequestParam
(
"userid"
)
String
userid
,
@RequestParam
(
"userlevel"
)
int
userlevel
){
public
R
<
List
<
UserAndRecommendVo
>>
getMyRecommendInfo
(
@RequestParam
(
"userid"
)
String
userid
,
@RequestParam
(
"userlevel"
)
int
userlevel
)
{
List
<
UserAndRecommendVo
>
myRecommendInfo
=
recommendUserService
.
getMyRecommendInfo
(
userid
,
userlevel
);
List
<
UserAndRecommendVo
>
myRecommendInfo
=
recommendUserService
.
getMyRecommendInfo
(
userid
,
userlevel
);
return
R
.
ok
(
myRecommendInfo
);
return
R
.
ok
(
myRecommendInfo
);
}
}
@ApiOperation
(
value
=
"查询空投池信息"
,
notes
=
"查询空投池信息"
,
httpMethod
=
"GET"
)
@GetMapping
(
"/queryAerialDelivery"
)
public
R
<
AerialDeliveryVo
>
queryAerialDelivery
(
String
userId
,
String
yearMonth
)
{
log
.
info
(
"shop-mall[]UserController[]getWithdrawalRecord[]input.param.userId:{},yearMonth:"
+
userId
,
yearMonth
);
if
(
StringUtils
.
isBlank
(
yearMonth
))
{
return
R
.
error
(
"入参不能为空!"
);
}
return
userService
.
queryAerialDelivery
();
}
@ApiOperation
(
value
=
"设置头像"
,
notes
=
"设置头像"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"headImage"
,
value
=
"头像Url"
,
dataType
=
"String"
)
})
@PostMapping
(
"/setHeadImage"
)
public
R
<
Boolean
>
setHeadImage
(
String
userId
,
String
headImage
)
{
log
.
info
(
"shop-mall[]UserController[]setHeadImage[]input.param.userId,headImage:"
+
userId
,
headImage
);
if
(
StringUtils
.
isBlank
(
userId
)
||
StringUtils
.
isBlank
(
headImage
))
{
return
R
.
error
(
"入参不能为空!"
);
}
return
userService
.
setHeadImage
(
userId
,
headImage
);
}
}
}
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