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
a7402e90
Commit
a7402e90
authored
Mar 02, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
本地启动
parent
d4d97cc7
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
164 additions
and
101 deletions
+164
-101
HttpContextUtils.java
...main/java/cn/wisenergy/common/utils/HttpContextUtils.java
+3
-0
MonthTotalRevenueVo.java
.../main/java/cn/wisenergy/model/vo/MonthTotalRevenueVo.java
+19
-1
AccountService.java
...rc/main/java/cn/wisenergy/service/app/AccountService.java
+1
-2
WalletService.java
...src/main/java/cn/wisenergy/service/app/WalletService.java
+19
-0
UserLevelServiceImlp.java
...a/cn/wisenergy/service/app/impl/UserLevelServiceImlp.java
+3
-3
WalletServiceImpl.java
...java/cn/wisenergy/service/app/impl/WalletServiceImpl.java
+25
-0
Application.java
...rgy-web-admin/src/main/java/cn/wisenergy/Application.java
+0
-4
IndexController.java
...n/wisenergy/web/admin/controller/app/IndexController.java
+5
-3
UserController.java
...cn/wisenergy/web/admin/controller/app/UserController.java
+45
-45
GlobalConversConfiguration.java
...a/cn/wisenergy/web/config/GlobalConversConfiguration.java
+43
-43
AuthFilter.java
...c/main/java/cn/wisenergy/web/shiro/filter/AuthFilter.java
+1
-0
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/HttpContextUtils.java
View file @
a7402e90
...
@@ -5,6 +5,9 @@ import org.springframework.web.context.request.ServletRequestAttributes;
...
@@ -5,6 +5,9 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author 86187
*/
public
class
HttpContextUtils
{
public
class
HttpContextUtils
{
public
static
HttpServletRequest
getHttpServletRequest
()
{
public
static
HttpServletRequest
getHttpServletRequest
()
{
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/vo/MonthTotalRevenueVo.java
View file @
a7402e90
...
@@ -3,6 +3,8 @@ package cn.wisenergy.model.vo;
...
@@ -3,6 +3,8 @@ package cn.wisenergy.model.vo;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
/**
* @author 86187
* @author 86187
* @ Description: 当月总收益Vo
* @ Description: 当月总收益Vo
...
@@ -12,7 +14,23 @@ import lombok.Data;
...
@@ -12,7 +14,23 @@ import lombok.Data;
@Data
@Data
@ApiModel
(
"MonthTotalRevenueVo"
)
@ApiModel
(
"MonthTotalRevenueVo"
)
public
class
MonthTotalRevenueVo
{
public
class
MonthTotalRevenueVo
{
/**
* 用户id
*/
private
String
userId
;
private
String
userId
;
private
Double
balance
;
/**
* 余额
*/
private
BigDecimal
balance
;
/**
* 待结算
*/
private
BigDecimal
waitMoney
;
/**
* 累计收益
*/
private
BigDecimal
accumulatedIncome
;
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/AccountService.java
View file @
a7402e90
...
@@ -5,6 +5,7 @@ import cn.wisenergy.common.utils.R;
...
@@ -5,6 +5,7 @@ import cn.wisenergy.common.utils.R;
import
cn.wisenergy.model.app.AccountInfo
;
import
cn.wisenergy.model.app.AccountInfo
;
import
cn.wisenergy.model.app.OrderInfo
;
import
cn.wisenergy.model.app.OrderInfo
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.vo.MonthTotalRevenueVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -52,6 +53,4 @@ public interface AccountService {
...
@@ -52,6 +53,4 @@ public interface AccountService {
* @return true or false
* @return true or false
*/
*/
R
<
Boolean
>
progressPrizeCount
();
R
<
Boolean
>
progressPrizeCount
();
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/WalletService.java
0 → 100644
View file @
a7402e90
package
cn
.
wisenergy
.
service
.
app
;
import
cn.wisenergy.model.vo.MonthTotalRevenueVo
;
/**
*@ Description: 钱包相关接口定义
*@ Author : 86187
*@ Date : 2021/3/2 14:33
* @author 86187
*/
public
interface
WalletService
{
/**
* 用户当月总收益
*
* @param userId 用户id
* @return 当月总收益
*/
MonthTotalRevenueVo
monthTotalRevenue
(
String
userId
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLevelServiceImlp.java
View file @
a7402e90
...
@@ -26,13 +26,13 @@ import java.math.BigDecimal;
...
@@ -26,13 +26,13 @@ import java.math.BigDecimal;
public
class
UserLevelServiceImlp
extends
ServiceImpl
<
UsersMapper
,
User
>
implements
UserLevelService
{
public
class
UserLevelServiceImlp
extends
ServiceImpl
<
UsersMapper
,
User
>
implements
UserLevelService
{
@Autowired
@Autowired
UsersMapper
usersMapper
;
private
UsersMapper
usersMapper
;
@Autowired
@Autowired
RecommendUserMapper
recommendUserMapper
;
private
RecommendUserMapper
recommendUserMapper
;
@Autowired
@Autowired
TeamUserInfoMapper
teamUserInfoMapper
;
private
TeamUserInfoMapper
teamUserInfoMapper
;
@Override
@Override
@Transactional
@Transactional
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/WalletServiceImpl.java
0 → 100644
View file @
a7402e90
package
cn
.
wisenergy
.
service
.
app
.
impl
;
import
cn.wisenergy.mapper.AccountMapper
;
import
cn.wisenergy.model.vo.MonthTotalRevenueVo
;
import
cn.wisenergy.service.app.WalletService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* @author 86187
*/
@Service
@Slf4j
public
class
WalletServiceImpl
implements
WalletService
{
@Autowired
private
AccountMapper
accountMapper
;
@Override
public
MonthTotalRevenueVo
monthTotalRevenue
(
String
userId
)
{
log
.
info
(
"shop-mall[]WalletServiceImpl[]monthTotalRevenue[]input.param.userId:"
+
userId
);
return
null
;
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/Application.java
View file @
a7402e90
...
@@ -12,7 +12,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
...
@@ -12,7 +12,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
* 配置netty启动
* 配置netty启动
*/
*/
@EnableCaching
@EnableCaching
//@SpringBootApplication(scanBasePackages = “com.mall”)
@SpringBootApplication
(
exclude
=
{
MultipartAutoConfiguration
.
class
})
@SpringBootApplication
(
exclude
=
{
MultipartAutoConfiguration
.
class
})
@MapperScan
(
@MapperScan
(
basePackages
=
"cn.wisenergy.mapper"
)
basePackages
=
"cn.wisenergy.mapper"
)
...
@@ -22,8 +21,5 @@ public class Application {
...
@@ -22,8 +21,5 @@ public class Application {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
Application
.
class
,
args
);
SpringApplication
.
run
(
Application
.
class
,
args
);
}
}
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/IndexController.java
View file @
a7402e90
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* Created by m1991 on 2021/2/27 0:43
* Created by m1991 on 2021/2/27 0:43
* @author 86187
*/
*/
@Controller
@
Rest
Controller
public
class
IndexController
{
public
class
IndexController
{
@GetMapping
(
"/"
)
@GetMapping
(
"/
index
"
)
public
String
index
()
{
public
String
index
()
{
return
"index"
;
return
"index"
;
}
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserController.java
View file @
a7402e90
...
@@ -79,49 +79,49 @@ public class UserController extends BaseController {
...
@@ -79,49 +79,49 @@ public class UserController extends BaseController {
return
R
.
ok
(
token
);
return
R
.
ok
(
token
);
}
}
/**
//
/**
* 手机号登录
//
* 手机号登录
* @param userId
//
* @param userId
* @param sms
//
* @param sms
* @return
//
* @return
* @throws Exception
//
* @throws Exception
*/
//
*/
@ApiOperation
(
value
=
"获取用户手机号登录接口"
,
notes
=
"获取用户手机号登录接口"
,
httpMethod
=
"POST"
)
//
@ApiOperation(value = "获取用户手机号登录接口", notes = "获取用户手机号登录接口", httpMethod = "POST")
@ApiImplicitParams
({
//
@ApiImplicitParams({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户手机号"
,
required
=
true
,
dataType
=
"String"
),
//
@ApiImplicitParam(name = "userId", value = "用户手机号", required = true, dataType = "String"),
@ApiImplicitParam
(
name
=
"sms"
,
value
=
"短信验证码"
,
required
=
true
,
dataType
=
"String"
)})
//
@ApiImplicitParam(name = "sms", value = "短信验证码", required = true, dataType = "String")})
@RequestMapping
(
"/login/sms"
)
//
@RequestMapping("/login/sms")
public
Result
loginBySms
(
String
userId
,
String
sms
)
throws
Exception
{
//
public Result loginBySms(String userId, String sms)throws Exception{
User
users
=
null
;
//
User users=null;
String
key
=
StringUtil
.
formatKeyWithPrefix
(
Constants
.
RedisKey
.
PROJECT_PRIFIX
,
Constants
.
RedisKey
.
SMS_PRIFIX
,
userId
,
Constants
.
Sms
.
CodeType
.
LOGIN_OR_REGISTER
+
""
);
//
String key= StringUtil.formatKeyWithPrefix(Constants.RedisKey.PROJECT_PRIFIX,Constants.RedisKey.SMS_PRIFIX,userId,Constants.Sms.CodeType.LOGIN_OR_REGISTER+"");
String
redisCode
=
redisUtils
.
getValue
(
key
);
//
String redisCode=redisUtils.getValue(key);
if
(
StringUtil
.
isBlank
(
redisCode
)
||
!
sms
.
equals
(
redisCode
)){
//
if(StringUtil.isBlank(redisCode) || !sms.equals(redisCode)){
throw
new
BaseException
(
ResultEnum
.
FAIL_VERIFY
);
//
throw new BaseException(ResultEnum.FAIL_VERIFY);
}
//
}
redisUtils
.
delete
(
key
);
//
redisUtils.delete(key);
//根据手机号判断用户是否存在
//
//根据手机号判断用户是否存在
//不存在则保存用户信息
//
//不存在则保存用户信息
users
=
userService
.
queryUsersByPhone
(
userId
);
//
users=userService.queryUsersByPhone(userId);
if
(
null
==
users
){
//
if(null==users){
users
=
new
User
();
//
users=new User();
// users.setAccount(phone);
//
//
users.setAccount(phone);
// users.setUserName(phone);
//
//
users.setUserName(phone);
// userService.qdtxAddUsers(users);
//
//
userService.qdtxAddUsers(users);
}
//
}
String
token
=
createToken
(
users
);
//
String token=createToken(users);
if
(!
StringUtil
.
isBlank
(
token
)){
//
if(!StringUtil.isBlank(token)){
return
ResultUtils
.
returnDataSuccess
(
StringUtil
.
createSimpleMap
(
"token"
,
token
));
//
return ResultUtils.returnDataSuccess(StringUtil.createSimpleMap("token",token));
}
//
}
return
ResultUtils
.
returnFail
();
//
return ResultUtils.returnFail();
}
//
}
//
public
String
createToken
(
User
users
)
throws
Exception
{
//
public String createToken(User users)throws Exception{
String
token
=
StringUtil
.
createToken
();
//
String token=StringUtil.createToken();
//保存token
//
//保存token
String
tokenKey
=
StringUtil
.
formatKeyWithPrefix
(
Constants
.
RedisKey
.
PROJECT_PRIFIX
,
Constants
.
RedisKey
.
TOKEN_PRIFIX
,
token
);
//
String tokenKey=StringUtil.formatKeyWithPrefix(Constants.RedisKey.PROJECT_PRIFIX,Constants.RedisKey.TOKEN_PRIFIX,token);
UsersDto
usersDto
=
new
UsersDto
();
//
UsersDto usersDto=new UsersDto();
BeanUtils
.
copyProperties
(
users
,
usersDto
);
//
BeanUtils.copyProperties(users,usersDto);
redisUtils
.
set
(
tokenKey
,
JSONObject
.
toJSONString
(
usersDto
),
Constants
.
Duration
.
HALF_HOUR_INT
);
//
redisUtils.set(tokenKey, JSONObject.toJSONString(usersDto),Constants.Duration.HALF_HOUR_INT);
return
token
;
//
return token;
}
//
}
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/config/GlobalConversConfiguration.java
View file @
a7402e90
package
cn
.
wisenergy
.
web
.
config
;
//
package cn.wisenergy.web.config;
//
//
//
import
org.springframework.context.annotation.Bean
;
//
import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
//
import org.springframework.context.annotation.Configuration;
import
org.springframework.http.converter.HttpMessageConverter
;
//
import org.springframework.http.converter.HttpMessageConverter;
import
org.springframework.http.converter.StringHttpMessageConverter
;
//
import org.springframework.http.converter.StringHttpMessageConverter;
import
org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer
;
//
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
;
//
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
import
java.nio.charset.Charset
;
//
import java.nio.charset.Charset;
import
java.util.List
;
//
import java.util.List;
//
/**
/
//
**
* 配置全局编码格式 utf-8
//
* 配置全局编码格式 utf-8
* Created by m1991 on 2021/3/1 4:15
//
* Created by m1991 on 2021/3/1 4:15
*/
//
*/
//
@Configuration
//
@Configuration
public
class
GlobalConversConfiguration
extends
WebMvcConfigurationSupport
{
//
public class GlobalConversConfiguration extends WebMvcConfigurationSupport {
//
@Bean
//
@Bean
public
HttpMessageConverter
<
String
>
responseBodyConverter
()
{
//
public HttpMessageConverter<String> responseBodyConverter() {
StringHttpMessageConverter
converter
=
new
StringHttpMessageConverter
(
//
StringHttpMessageConverter converter = new StringHttpMessageConverter(
Charset
.
forName
(
"UTF-8"
));
//
Charset.forName("UTF-8"));
return
converter
;
//
return converter;
}
//
}
//
@Override
//
@Override
public
void
configureMessageConverters
(
//
public void configureMessageConverters(
List
<
HttpMessageConverter
<?>>
converters
)
{
//
List<HttpMessageConverter<?>> converters) {
super
.
configureMessageConverters
(
converters
);
//
super.configureMessageConverters(converters);
converters
.
add
(
responseBodyConverter
());
//
converters.add(responseBodyConverter());
}
//
}
//
@Override
//
@Override
public
void
configureContentNegotiation
(
//
public void configureContentNegotiation(
ContentNegotiationConfigurer
configurer
)
{
//
ContentNegotiationConfigurer configurer) {
configurer
.
favorPathExtension
(
false
);
//
configurer.favorPathExtension(false);
}
//
}
}
//
}
//
wisenergy-web-admin/src/main/java/cn/wisenergy/web/shiro/filter/AuthFilter.java
View file @
a7402e90
...
@@ -21,6 +21,7 @@ import java.io.IOException;
...
@@ -21,6 +21,7 @@ import java.io.IOException;
/**
/**
* oauth2过滤器
* oauth2过滤器
* @author 86187
*/
*/
@Slf4j
@Slf4j
public
class
AuthFilter
extends
AuthenticatingFilter
{
public
class
AuthFilter
extends
AuthenticatingFilter
{
...
...
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