记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
c07ef2f7
Commit
c07ef2f7
authored
Jun 07, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+参数校验:用户中心相关
parent
62806cc1
Changes
20
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
309 additions
and
133 deletions
+309
-133
AdamAddressesParam.java
...va/com/liquidnet/service/adam/dto/AdamAddressesParam.java
+13
-1
AdamEntersParam.java
.../java/com/liquidnet/service/adam/dto/AdamEntersParam.java
+9
-1
AdamThirdPartParam.java
...va/com/liquidnet/service/adam/dto/AdamThirdPartParam.java
+7
-0
AdamUserInfoParam.java
...ava/com/liquidnet/service/adam/dto/AdamUserInfoParam.java
+13
-0
AdamTagVo.java
...ain/java/com/liquidnet/service/adam/dto/vo/AdamTagVo.java
+1
-0
IAdamRdmService.java
...a/com/liquidnet/service/adam/service/IAdamRdmService.java
+8
-0
LnsRegex.java
...in/java/com/liquidnet/commons/lang/constant/LnsRegex.java
+19
-0
RestControllerAdviceHandler.java
...quidnet/common/exception/RestControllerAdviceHandler.java
+21
-6
liquidnet-service-adam-dev.yml
...us-config/liquidnet-config/liquidnet-service-adam-dev.yml
+1
-1
liquidnet-service-adam-test.yml
...s-config/liquidnet-config/liquidnet-service-adam-test.yml
+1
-1
liquidnet-service-adam.yml
...et-bus-config/liquidnet-config/liquidnet-service-adam.yml
+1
-2
AdamRedisConst.java
...a/com/liquidnet/service/adam/constant/AdamRedisConst.java
+2
-0
AdamAddressesController.java
...dnet/service/adam/controller/AdamAddressesController.java
+13
-10
AdamCollectionController.java
...net/service/adam/controller/AdamCollectionController.java
+25
-16
AdamDisposedController.java
...idnet/service/adam/controller/AdamDisposedController.java
+29
-17
AdamEntersController.java
...quidnet/service/adam/controller/AdamEntersController.java
+14
-12
AdamLoginController.java
...iquidnet/service/adam/controller/AdamLoginController.java
+28
-19
AdamUserController.java
...liquidnet/service/adam/controller/AdamUserController.java
+76
-47
AdamRdmServiceImpl.java
...quidnet/service/adam/service/impl/AdamRdmServiceImpl.java
+20
-0
errors.properties
...et-service-adam-impl/src/main/resources/errors.properties
+8
-0
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/AdamAddressesParam.java
View file @
c07ef2f7
package
com
.
liquidnet
.
service
.
adam
.
dto
;
import
com.liquidnet.commons.lang.constant.LnsRegex
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
@ApiModel
(
value
=
"AdamAddressesParam"
,
description
=
"添加/编辑收获地址入参"
)
@Data
public
class
AdamAddressesParam
implements
java
.
io
.
Serializable
{
private
static
final
long
serialVersionUID
=
-
2626425843975309892L
;
@ApiModelProperty
(
position
=
10
,
required
=
false
,
value
=
"收获地址ID,编辑时必传[64]"
)
private
String
addressesId
;
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"入场人名称[50]"
,
example
=
"Swagger"
)
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"姓名[50]"
,
example
=
"Swagger"
)
@Size
(
min
=
1
,
max
=
30
,
message
=
"姓名长度限制1~30位字符"
)
private
String
name
;
@ApiModelProperty
(
position
=
12
,
required
=
true
,
value
=
"手机号[11]"
,
example
=
"13111111111"
)
@Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
private
String
phone
;
@ApiModelProperty
(
position
=
13
,
required
=
true
,
value
=
"省份[30]"
,
example
=
"北京"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
CHINESE_PCD
,
message
=
"省份必须为2~30位汉字"
)
private
String
province
;
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"城市[30]"
,
example
=
"北京城区"
)
@NotNull
(
message
=
"城市不能为空"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
CHINESE_PCD
,
message
=
"城市必须为2~30位汉字"
)
private
String
city
;
@ApiModelProperty
(
position
=
15
,
required
=
true
,
value
=
"区县[30]"
,
example
=
"朝阳区"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
CHINESE_PCD
,
message
=
"区县必须为2~30位汉字"
)
private
String
county
;
@ApiModelProperty
(
position
=
16
,
required
=
true
,
value
=
"详细地址[100]"
,
example
=
"广渠路1号创1958园区"
)
@Size
(
max
=
100
,
message
=
"详细地址长度最长100位"
)
private
String
address
;
}
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/AdamEntersParam.java
View file @
c07ef2f7
package
com
.
liquidnet
.
service
.
adam
.
dto
;
import
com.liquidnet.commons.lang.constant.LnsRegex
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
@ApiModel
(
value
=
"AdamEntersParam"
,
description
=
"添加/编辑入场人入参"
)
@Data
public
class
AdamEntersParam
implements
java
.
io
.
Serializable
{
private
static
final
long
serialVersionUID
=
8628253022063935727L
;
@ApiModelProperty
(
position
=
10
,
required
=
false
,
value
=
"入场人ID,编辑时必传[50]"
)
private
String
entersId
;
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"入场人名称[50]"
,
example
=
"Swagger"
)
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"入场人姓名[50]"
,
example
=
"Swagger"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
CHINESE_HANZI
,
message
=
"姓名必须为2~20位汉字"
)
private
String
name
;
@ApiModelProperty
(
position
=
12
,
required
=
true
,
value
=
"入场人手机号[11]"
,
example
=
"13100000000"
)
@Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
private
String
mobile
;
@ApiModelProperty
(
position
=
13
,
required
=
true
,
value
=
"证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证"
,
allowableValues
=
"1,2,3,4,5"
)
@Pattern
(
regexp
=
"\\b(1,2,3,4,5)\\b"
,
message
=
"证件类型无效"
)
private
Integer
type
;
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"入场人证件号[11]"
,
example
=
"110101110001010111"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
CHINESE_ID_CARD
,
message
=
"身份证号格式有误"
)
private
String
idCard
;
}
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/AdamThirdPartParam.java
View file @
c07ef2f7
...
...
@@ -3,7 +3,11 @@ package com.liquidnet.service.adam.dto;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.validation.annotation.Validated
;
import
javax.validation.Valid
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"AdamThirdPartParam"
,
description
=
"第三方账号登录注册入参"
)
...
...
@@ -13,10 +17,13 @@ public class AdamThirdPartParam implements Serializable {
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"第三方OPENID[64]"
)
private
String
openId
;
@ApiModelProperty
(
position
=
12
,
required
=
true
,
value
=
"昵称[64]"
,
example
=
"Swagger"
)
@Size
(
min
=
2
,
max
=
64
,
message
=
"昵称字符长度限制2~64位"
)
private
String
nickname
;
@ApiModelProperty
(
position
=
13
,
required
=
true
,
value
=
"头像[255]"
,
example
=
"http://pic.zhengzai.tv/default/avatar.png"
)
@Size
(
max
=
255
,
message
=
"头像字符长度大于255位"
)
private
String
avatar
;
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"平台类型[255]"
,
allowableValues
=
"WEIBO,WECHAT,QQ"
)
@Pattern
(
regexp
=
"\\b(WEIBO,WECHAT,QQ)\\b"
,
message
=
"平台类型无效"
)
private
String
platform
;
@ApiModelProperty
(
position
=
15
,
required
=
false
,
value
=
"手机号[新账号时必传]"
,
example
=
"13111111111"
)
private
String
mobile
;
...
...
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/AdamUserInfoParam.java
View file @
c07ef2f7
package
com
.
liquidnet
.
service
.
adam
.
dto
;
import
com.liquidnet.commons.lang.constant.LnsRegex
;
import
com.liquidnet.service.adam.dto.vo.AdamTagParentVo
;
import
com.liquidnet.service.adam.dto.vo.AdamTagVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
import
java.util.List
;
@ApiModel
(
value
=
"AdamUserInfoParam"
,
description
=
"个人资料编辑参数"
)
...
...
@@ -13,19 +18,27 @@ import java.util.List;
public
class
AdamUserInfoParam
implements
java
.
io
.
Serializable
{
private
static
final
long
serialVersionUID
=
-
1084524066864012398L
;
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"头像[255]"
,
example
=
"http://pic.zhengzai.tv/default/avatar.png"
)
@Size
(
max
=
255
,
message
=
"头像字符长度大于255位"
)
private
String
avatar
;
@ApiModelProperty
(
position
=
12
,
required
=
true
,
value
=
"背景[255]"
,
example
=
"https://img.zhengzai.tv/files/2021/01/13/5ffeab3584b7d.png"
)
@Size
(
max
=
255
,
message
=
"背景字符长度大于255位"
)
private
String
background
;
@ApiModelProperty
(
position
=
13
,
required
=
true
,
value
=
"昵称[32]"
,
example
=
"Swagger"
)
@Size
(
min
=
2
,
max
=
64
,
message
=
"昵称字符长度限制2~64位"
)
private
String
nickname
;
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"性别[32]"
,
example
=
"{\"val\":\"MS00\",\"desc\":\"其他性别\"}"
)
@NotNull
(
message
=
"性别标签不能为空"
)
private
AdamTagVo
sex
;
@ApiModelProperty
(
position
=
15
,
required
=
true
,
value
=
"生日[YYYY-MM-DD]"
,
example
=
"2021-05-17"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_YMD
,
message
=
"时间格式有误"
)
private
String
birthday
;
@ApiModelProperty
(
position
=
16
,
required
=
true
,
value
=
"常住地/区域[100]"
,
example
=
"北京 北京市 朝阳区"
)
@NotBlank
(
message
=
"常住地/区域不能为空"
)
private
String
area
;
@ApiModelProperty
(
position
=
17
,
required
=
true
,
value
=
"签名[255]"
,
example
=
"..................."
)
@Size
(
max
=
255
,
message
=
"签名过长"
)
private
String
signature
;
@ApiModelProperty
(
position
=
18
,
required
=
true
,
value
=
"标签[500]"
,
example
=
"[{\"val\":\"MMS01\",\"desc\":\"民歌\",\"tagVos\":[{\"val\":\"MMS0101\",\"desc\":\"A\"},{\"val\":\"MMS0102\",\"desc\":\"B\"}]},{\"val\":\"MMS02\",\"desc\":\"house\",\"tagVos\":[{\"val\":\"MMS0201\",\"desc\":\"C\"}]}]"
)
@NotNull
(
message
=
"风格标签不能为空"
)
private
List
<
AdamTagParentVo
>
tagMe
;
}
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamTagVo.java
View file @
c07ef2f7
...
...
@@ -3,6 +3,7 @@ package com.liquidnet.service.adam.dto.vo;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"AdamTagVo"
,
description
=
"标签库"
)
...
...
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/service/IAdamRdmService.java
View file @
c07ef2f7
...
...
@@ -62,4 +62,12 @@ public interface IAdamRdmService {
void
delUserMemberVoByUid
(
String
uid
);
AdamMemberSimpleVo
getMemberSimpleVo
();
boolean
setTagsForSex
(
List
<
AdamTagVo
>
voList
);
List
<
AdamTagVo
>
getTagsForSex
();
boolean
setTagsForMusic
(
List
<
AdamTagParentVo
>
voList
);
List
<
AdamTagParentVo
>
getTagsForMusic
();
}
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/constant/LnsRegex.java
View file @
c07ef2f7
...
...
@@ -2,6 +2,25 @@ package com.liquidnet.commons.lang.constant;
public
class
LnsRegex
{
public
static
class
Valid
{
/**
* yyyy-MM-dd HH:mm:ss
*/
public
static
final
String
DATETIME_FULL
=
"^(((((0[48]|[2468][048]|[3579][26])00))|(([0-9]{2})(0[48]|[2468][048]|[13579][26])))[-|.|/| ]0?2[-|.|/| ]29|(((?!0{1,4})[0-9]{1,4})[-|.|/| ](((0[13-9]|1[0-2]|[13-9])[-|.|/| ](29|30))|((0[13578]|(10|12)|[13578])[-|.|/| ]31)|((0(?:[1-9])|1(?:[0-2])|[1-9])[-|.|/| ](0(?:[1-9])|1[0-9]|2[0-8]|[1-9])))))( ((0?[0-9])|(1[0-9]|2[0-3])):(([1-5][0-9])|(0?[0-9])):(([1-5][0-9])|(0?[0-9])))?$"
;
/**
* yyyy-MM-dd
*/
public
static
final
String
DATETIME_YMD
=
"^(((((0[48]|[2468][048]|[3579][26])00))|(([0-9]{2})(0[48]|[2468][048]|[13579][26])))[-|.|/| ]0?2[-|.|/| ]29|(((?!0{1,4})[0-9]{1,4})[-|.|/| ](((0[13-9]|1[0-2]|[13-9])[-|.|/| ](29|30))|((0[13578]|(10|12)|[13578])[-|.|/| ]31)|((0(?:[1-9])|1(?:[0-2])|[1-9])[-|.|/| ](0(?:[1-9])|1[0-9]|2[0-8]|[1-9])))))$"
;
/**
* 汉字-姓名(2~20位)
*/
public
static
final
String
CHINESE_HANZI
=
"^[\\u4e00-\\u9fa5]{2,20}$"
;
/**
* 汉字-省|市|区(2~30位)
*/
public
static
final
String
CHINESE_PCD
=
"^[\\u4e00-\\u9fa5]{2,30}$"
;
/**
* 身份证号(15位||18位)
*/
public
static
final
String
CHINESE_ID_CARD
=
"(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)"
;
}
}
liquidnet-bus-common/liquidnet-common-exception/liquidnet-common-exception-handler-service/src/main/java/com/liquidnet/common/exception/RestControllerAdviceHandler.java
View file @
c07ef2f7
...
...
@@ -11,12 +11,15 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.context.request.WebRequest
;
import
javax.validation.ConstraintViolation
;
import
javax.validation.ConstraintViolationException
;
/**
...
...
@@ -34,12 +37,24 @@ public class RestControllerAdviceHandler {
@ExceptionHandler
(
value
=
Exception
.
class
)
@ResponseBody
public
ResponseEntity
serviceExceptionHandler
(
Exception
rex
,
WebRequest
request
)
{
public
ResponseEntity
<
Error
>
serviceExceptionHandler
(
Exception
rex
,
WebRequest
request
)
{
logger
.
error
(
"serviceExceptionHandler request:{},param:{}"
,
request
.
getContextPath
(),
JSON
.
toJSONString
(
request
.
getParameterMap
()));
if
(
rex
instanceof
ConstraintViolationException
)
{
ConstraintViolationException
ygex
=
((
ConstraintViolationException
)
rex
);
String
message
=
ygex
.
getMessage
().
split
(
"\\."
)[
1
];
logger
.
error
(
"LiquidnetServiceException errorCode:{} error : {}"
,
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
ygex
.
getMessage
());
String
message
=
((
ConstraintViolation
)
ygex
.
getConstraintViolations
().
toArray
()[
0
]).
getMessage
();
logger
.
error
(
"ConstraintViolationException code:{},msg:{}"
,
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
message
);
return
new
ResponseEntity
<
Error
>(
new
Error
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
message
),
HttpStatus
.
OK
);
}
if
(
rex
instanceof
MissingServletRequestParameterException
)
{
MissingServletRequestParameterException
ygex
=
((
MissingServletRequestParameterException
)
rex
);
String
message
=
ygex
.
getMessage
();
logger
.
error
(
"ConstraintViolationException code:{},msg:{}"
,
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
message
);
return
new
ResponseEntity
<
Error
>(
new
Error
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
message
),
HttpStatus
.
OK
);
}
if
(
rex
instanceof
MethodArgumentNotValidException
)
{
MethodArgumentNotValidException
ygex
=
((
MethodArgumentNotValidException
)
rex
);
String
message
=
ygex
.
getBindingResult
().
getFieldErrors
().
get
(
0
).
getDefaultMessage
();
logger
.
error
(
"ConstraintViolationException code:{},msg:{}"
,
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
message
);
return
new
ResponseEntity
<
Error
>(
new
Error
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
message
),
HttpStatus
.
OK
);
}
if
(
rex
instanceof
LiquidnetFeignException
)
{
...
...
@@ -47,7 +62,7 @@ public class RestControllerAdviceHandler {
String
errorCode
=
ygex
.
errorCode
().
getCode
();
String
message
=
ygex
.
getMessage
();
message
=
message
==
null
?
ygex
.
errorCode
().
getMessage
()
:
message
;
logger
.
error
(
"Liquidnet
ServiceException errorCode:{} error :
{}"
,
errorCode
,
ygex
.
getMessage
());
logger
.
error
(
"Liquidnet
FeignException code:{},msg:
{}"
,
errorCode
,
ygex
.
getMessage
());
return
new
ResponseEntity
<
Error
>(
new
Error
(
errorCode
,
message
),
HttpStatus
.
OK
);
}
if
(
rex
instanceof
LiquidnetServiceException
)
{
...
...
@@ -55,10 +70,10 @@ public class RestControllerAdviceHandler {
String
errorCode
=
ygex
.
errorCode
().
getCode
();
String
message
=
ygex
.
getMessage
();
message
=
message
==
null
?
ygex
.
errorCode
().
getMessage
()
:
message
;
logger
.
error
(
"LiquidnetServiceException
errorCode:{} error :
{}"
,
errorCode
,
ygex
.
getMessage
());
logger
.
error
(
"LiquidnetServiceException
code:{},msg:
{}"
,
errorCode
,
ygex
.
getMessage
());
return
new
ResponseEntity
<
Error
>(
new
Error
(
errorCode
,
message
),
HttpStatus
.
OK
);
}
else
{
logger
.
error
(
"serviceExceptionHandler
:{}
"
,
rex
);
logger
.
error
(
"serviceExceptionHandler
unknown exception
"
,
rex
);
return
new
ResponseEntity
<
Error
>(
new
Error
(
ErrorCode
.
HTTP_SYSTEM_ERROR
.
getCode
(),
ErrorCode
.
HTTP_SYSTEM_ERROR
.
getMessage
()),
HttpStatus
.
OK
);
}
}
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-adam-dev.yml
View file @
c07ef2f7
...
...
@@ -14,7 +14,7 @@ liquidnet:
pattern-file
:
'
%d{yyyy-MM-dd
HH:mm:ss.SSS}
[
%-5level]
%thread
[%logger{96}:%line]
-
%msg%n'
pattern-console
:
'
%d{yyyy-MM-dd
HH:mm:ss.SSS}
[
%-5level]
%thread
[%logger{96}:%line]
-
%msg%n'
pattern-rolling-file-name
:
${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level
-root
:
info
level
:
debug
rabbitmq
:
connection-timeout
:
5000
mysql
:
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-adam-test.yml
View file @
c07ef2f7
...
...
@@ -14,7 +14,7 @@ liquidnet:
pattern-file
:
'
%d{yyyy-MM-dd
HH:mm:ss.SSS}
[
%-5level]
%thread
[%logger{96}:%line]
-
%msg%n'
pattern-console
:
'
%d{yyyy-MM-dd
HH:mm:ss.SSS}
[
%-5level]
%thread
[%logger{96}:%line]
-
%msg%n'
pattern-rolling-file-name
:
${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level
-root
:
info
level
:
debug
rabbitmq
:
connection-timeout
:
3000
mysql
:
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-adam.yml
View file @
c07ef2f7
...
...
@@ -29,8 +29,7 @@ logging:
level
:
root
:
info
#以下是为指定包设置日志级别
com
:
liquidnet
:
info
com.liquidnet
:
${liquidnet.logfile.level}
# -----------------------------------------------------------
eureka
:
# client:
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/constant/AdamRedisConst.java
View file @
c07ef2f7
...
...
@@ -18,6 +18,8 @@ public class AdamRedisConst {
public
static
final
String
INFO_ENTERS
=
INFO
.
concat
(
"enters:"
);
public
static
final
String
INFO_ADDRESSES
=
INFO
.
concat
(
"addresses:"
);
public
static
final
String
INFO_TAGS_SEX
=
INFO
.
concat
(
"tags:sex"
);
public
static
final
String
INFO_TAGS_MUSIC
=
INFO
.
concat
(
"tags:sex"
);
public
static
final
String
INFO_MEMBER_SIMPLE
=
INFO
.
concat
(
"member_simple"
);
public
static
final
String
INFO_MEMBERS
=
ADAM
.
concat
(
":list:members"
);
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamAddressesController.java
View file @
c07ef2f7
...
...
@@ -17,8 +17,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -34,6 +37,7 @@ import java.util.List;
@ApiSupport
(
order
=
10050
)
@Api
(
tags
=
"收获地址"
)
@Slf4j
@Validated
@RestController
@RequestMapping
(
"addr"
)
public
class
AdamAddressesController
{
...
...
@@ -45,8 +49,7 @@ public class AdamAddressesController {
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"添加收获地址"
)
@PostMapping
(
"add"
)
public
ResponseDto
<
Object
>
add
(
@RequestBody
AdamAddressesParam
parameter
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
Object
>
add
(
@RequestBody
@Valid
AdamAddressesParam
parameter
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamAddresses
adamAddresses
=
new
AdamAddresses
();
...
...
@@ -78,7 +81,7 @@ public class AdamAddressesController {
@ApiOperationSupport
(
order
=
3
)
@ApiOperation
(
value
=
"设置默认收货地址"
)
@PostMapping
(
"def/{addrId}"
)
public
ResponseDto
<
Object
>
def
(
@PathVariable
String
addrId
)
{
public
ResponseDto
<
Object
>
def
(
@
NotBlank
(
message
=
"收货地址ID不能为空"
)
@
PathVariable
String
addrId
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamAddresses
addresses
=
adamRdmService
.
getAddressesByUidAddressesId
(
currentUid
,
addrId
);
...
...
@@ -92,8 +95,10 @@ public class AdamAddressesController {
@ApiOperationSupport
(
order
=
4
)
@ApiOperation
(
value
=
"编辑收获地址"
)
@PostMapping
(
"edit"
)
public
ResponseDto
<
Object
>
edit
(
@RequestBody
AdamAddressesParam
parameter
)
{
// TODO: 2021/4/28 校验
public
ResponseDto
<
Object
>
edit
(
@RequestBody
@Valid
AdamAddressesParam
parameter
)
{
if
(
StringUtils
.
isBlank
(
parameter
.
getAddressesId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10016"
));
}
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamAddresses
updateInfo
=
new
AdamAddresses
();
...
...
@@ -110,7 +115,7 @@ public class AdamAddressesController {
@ApiOperationSupport
(
order
=
5
)
@ApiOperation
(
value
=
"删除收获地址"
)
@PostMapping
(
"del/{addrId}"
)
public
ResponseDto
<
Object
>
del
(
@PathVariable
String
addrId
)
{
public
ResponseDto
<
Object
>
del
(
@
NotBlank
(
message
=
"收货地址ID不能为空"
)
@
PathVariable
String
addrId
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
...
...
@@ -124,10 +129,8 @@ public class AdamAddressesController {
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"收货地址详情"
)
@PostMapping
(
"query/{id}"
)
public
ResponseDto
<
AdamAddressesVo
>
query
(
@PathVariable
(
name
=
"id"
)
String
addrId
,
@RequestParam
(
name
=
"uid"
,
required
=
false
)
String
uid
)
{
// TODO: 2021/4/28 校验
public
ResponseDto
<
AdamAddressesVo
>
query
(
@NotBlank
(
message
=
"收货地址ID不能为空"
)
@PathVariable
(
name
=
"id"
)
String
addrId
,
@NotBlank
(
message
=
"用户ID不能为空"
)
@RequestParam
(
required
=
false
)
String
uid
)
{
AdamAddresses
addresses
=
adamRdmService
.
getAddressesByUidAddressesId
(
StringUtils
.
isBlank
(
uid
)
?
CurrentUtil
.
getCurrentUid
()
:
uid
,
addrId
);
return
null
==
addresses
?
ResponseDto
.
failure
(
ErrorMapping
.
get
(
10105
))
:
ResponseDto
.
success
(
AdamAddressesVo
.
getNew
().
copy
(
addresses
));
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamCollectionController.java
View file @
c07ef2f7
...
...
@@ -16,6 +16,10 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
/**
* <p>
* 收藏 前端控制器
...
...
@@ -35,9 +39,15 @@ public class AdamCollectionController {
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"添加收藏"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型[TICKET,VIDEO]"
,
allowableValues
=
"TICKET,VIDEO"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentId"
,
value
=
"内容ID[1,64]"
),
})
@PostMapping
(
"add"
)
public
ResponseDto
<
Object
>
add
(
@RequestParam
String
type
,
@RequestParam
String
contentId
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
Object
>
add
(
@Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"收藏类型无效"
)
@RequestParam
String
type
,
@Size
(
min
=
1
,
max
=
64
,
message
=
"内容ID长度限制为1~64位字符"
)
@RequestParam
String
contentId
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamCollectBaseVo
existVo
=
adamCollectionService
.
query
(
currentUid
,
type
,
contentId
);
...
...
@@ -55,13 +65,13 @@ public class AdamCollectionController {
@ApiOperationSupport
(
order
=
2
)
@ApiOperation
(
value
=
"删除收藏"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET,VIDEO
,SITE,ARTIST,BAND,BRAND,STYLE,GOODS,MUSIC,SONG
"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET,VIDEO"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentIds"
,
value
=
"内容ID[多个ID用','分隔]"
),
})
@PostMapping
(
"del"
)
public
ResponseDto
<
Object
>
del
(
@
RequestParam
String
type
,
@RequestParam
String
contentIds
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
Object
>
del
(
@
Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"收藏类型无效"
)
@RequestParam
String
type
,
@NotBlank
(
message
=
"内容Id不能为空"
)
@RequestParam
String
contentIds
)
{
adamCollectionService
.
del
(
CurrentUtil
.
getCurrentUid
(),
type
,
contentIds
.
split
(
","
));
return
ResponseDto
.
success
();
...
...
@@ -70,16 +80,15 @@ public class AdamCollectionController {
@ApiOperationSupport
(
order
=
3
)
@ApiOperation
(
value
=
"收藏列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET,VIDEO
,SITE,ARTIST,BAND,BRAND,STYLE,GOODS,MUSIC,SONG
"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET,VIDEO"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"pageNo"
,
value
=
"页码"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"pageSize"
,
value
=
"页展示条数"
,
example
=
"5"
),
})
@PostMapping
(
"list"
)
public
ResponseDto
<
PageInfo
<
AdamCollectVo
>>
list
(
@RequestParam
String
type
,
public
ResponseDto
<
PageInfo
<
AdamCollectVo
>>
list
(
@Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"收藏类型无效"
)
@RequestParam
String
type
,
@RequestParam
(
defaultValue
=
"1"
,
required
=
false
)
int
pageNo
,
@RequestParam
(
defaultValue
=
"5"
,
required
=
false
)
int
pageSize
)
{
// TODO: 2021/4/28 数据校验
pageNo
=
pageNo
>
0
?
pageNo
:
1
;
pageSize
=
pageSize
<=
0
||
pageSize
>
10
?
5
:
pageSize
;
...
...
@@ -89,15 +98,13 @@ public class AdamCollectionController {
// @ApiOperationSupport(order = 4)
// @ApiOperation(value = "获取特定内容的收藏用户列表 -> 返回结构待定")
// @ApiImplicitParams({
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "type", value = "收藏类型", allowableValues = "TICKET,VIDEO
,SITE,ARTIST,BAND,BRAND,STYLE,GOODS,MUSIC,SONG
"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "type", value = "收藏类型", allowableValues = "TICKET,VIDEO"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[64]"),
// })
// @PostMapping("list/user")
// public ResponseDto<Object> listUser(@RequestParam String type, @RequestParam String contentId) {
// // TODO: 2021/4/28 数据校验、身份认证、获取登录UID
// String uid = "1";
//
// // TODO: 2021/5/10
//
//
// return ResponseDto.success();
...
...
@@ -106,12 +113,14 @@ public class AdamCollectionController {
@ApiOperationSupport
(
order
=
5
)
@ApiOperation
(
value
=
"获取收藏状态"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET,VIDEO
,SITE,ARTIST,BAND,BRAND,STYLE,GOODS,MUSIC,SONG
"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET,VIDEO"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentId"
,
value
=
"内容ID[64]"
),
})
@GetMapping
(
"state"
)
public
ResponseDto
<
Boolean
>
state
(
@RequestParam
String
type
,
@RequestParam
String
contentId
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
Boolean
>
state
(
@Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"收藏类型无效"
)
@RequestParam
String
type
,
@Size
(
min
=
1
,
max
=
64
,
message
=
"内容ID长度限制为1~64位字符"
)
@RequestParam
String
contentId
)
{
return
ResponseDto
.
success
(
adamCollectionService
.
queryState
(
CurrentUtil
.
getCurrentUid
(),
type
,
contentId
));
}
}
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamDisposedController.java
View file @
c07ef2f7
...
...
@@ -17,6 +17,10 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
/**
* <p>
* 收藏 前端控制器
...
...
@@ -36,9 +40,15 @@ public class AdamDisposedController {
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"添加想去"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"想去类型[TICKET,VIDEO]"
,
allowableValues
=
"TICKET,VIDEO"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentId"
,
value
=
"内容ID[1,64]"
),
})
@PostMapping
(
"add"
)
public
ResponseDto
<
Object
>
add
(
@RequestParam
String
type
,
@RequestParam
String
contentId
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
Object
>
add
(
@Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"想去类型无效"
)
@RequestParam
String
type
,
@Size
(
min
=
1
,
max
=
64
,
message
=
"内容ID长度限制为1~64位字符"
)
@RequestParam
String
contentId
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamDisposedBaseVo
existVo
=
adamDisposedService
.
query
(
currentUid
,
type
,
contentId
);
...
...
@@ -57,13 +67,13 @@ public class AdamDisposedController {
@ApiOperationSupport
(
order
=
2
)
@ApiOperation
(
value
=
"删除想去"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET
,VIDEO
"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentIds"
,
value
=
"内容ID[多个ID用','分隔]"
),
})
@PostMapping
(
"del"
)
public
ResponseDto
<
Object
>
del
(
@
RequestParam
String
type
,
@RequestParam
String
contentIds
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
Object
>
del
(
@
Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"想去类型无效"
)
@RequestParam
String
type
,
@NotBlank
(
message
=
"内容Id不能为空"
)
@RequestParam
String
contentIds
)
{
adamDisposedService
.
del
(
CurrentUtil
.
getCurrentUid
(),
type
,
contentIds
.
split
(
","
));
return
ResponseDto
.
success
();
...
...
@@ -72,16 +82,15 @@ public class AdamDisposedController {
@ApiOperationSupport
(
order
=
3
)
@ApiOperation
(
value
=
"想去列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET
,VIDEO
"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"pageNo"
,
value
=
"页码"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"pageSize"
,
value
=
"页展示条数"
,
example
=
"5"
),
})
@PostMapping
(
"list"
)
public
ResponseDto
<
PageInfo
<
AdamDisposedVo
>>
list
(
@RequestParam
String
type
,
public
ResponseDto
<
PageInfo
<
AdamDisposedVo
>>
list
(
@Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"想去类型无效"
)
@RequestParam
String
type
,
@RequestParam
(
defaultValue
=
"1"
,
required
=
false
)
int
pageNo
,
@RequestParam
(
defaultValue
=
"5"
,
required
=
false
)
int
pageSize
)
{
// TODO: 2021/4/28 数据校验
pageNo
=
pageNo
>
0
?
pageNo
:
1
;
pageSize
=
pageSize
<=
0
||
pageSize
>
10
?
10
:
pageSize
;
...
...
@@ -91,17 +100,18 @@ public class AdamDisposedController {
@ApiOperationSupport
(
order
=
4
)
@ApiOperation
(
value
=
"想去用户列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentId"
,
value
=
"内容ID[64]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"收藏类型"
,
allowableValues
=
"TICKET
,VIDEO
"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentId"
,
value
=
"内容ID[
1,
64]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"pageNo"
,
value
=
"页码"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"pageSize"
,
value
=
"页展示条数"
,
example
=
"10"
),
})
@PostMapping
(
"list/user"
)
public
ResponseDto
<
PageInfo
<
AdamDisposedUserVo
>>
listUser
(
@RequestParam
String
type
,
@RequestParam
String
contentId
,
public
ResponseDto
<
PageInfo
<
AdamDisposedUserVo
>>
listUser
(
@Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"想去类型无效"
)
@RequestParam
String
type
,
@Size
(
min
=
1
,
max
=
64
,
message
=
"内容ID长度限制为1~64位字符"
)
@RequestParam
String
contentId
,
@RequestParam
(
defaultValue
=
"1"
,
required
=
false
)
int
pageNo
,
@RequestParam
(
defaultValue
=
"10"
,
required
=
false
)
int
pageSize
)
{
// TODO: 2021/4/28 数据校验
pageNo
=
pageNo
>
0
?
pageNo
:
1
;
pageSize
=
pageSize
<=
0
||
pageSize
>
20
?
20
:
pageSize
;
...
...
@@ -115,8 +125,10 @@ public class AdamDisposedController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"contentId"
,
value
=
"内容ID[64]"
),
})
@GetMapping
(
"state"
)
public
ResponseDto
<
Boolean
>
state
(
@RequestParam
String
type
,
@RequestParam
String
contentId
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
Boolean
>
state
(
@Pattern
(
regexp
=
"\\b(TICKET,VIDEO)\\b"
,
message
=
"想去类型无效"
)
@RequestParam
String
type
,
@Size
(
min
=
1
,
max
=
64
,
message
=
"内容ID长度限制为1~64位字符"
)
@RequestParam
String
contentId
)
{
return
ResponseDto
.
success
(
adamDisposedService
.
queryState
(
CurrentUtil
.
getCurrentUid
(),
type
,
contentId
));
}
}
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamEntersController.java
View file @
c07ef2f7
...
...
@@ -17,8 +17,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -34,6 +37,7 @@ import java.util.List;
@ApiSupport
(
order
=
10040
)
@Api
(
tags
=
"入场人"
)
@Slf4j
@Validated
@RestController
@RequestMapping
(
"enters"
)
public
class
AdamEntersController
{
...
...
@@ -45,11 +49,9 @@ public class AdamEntersController {
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"添加入场人"
)
@PostMapping
(
"add"
)
public
ResponseDto
<
String
>
add
(
@RequestBody
AdamEntersParam
parameter
)
{
// TODO: 2021/4/28 数据校验
public
ResponseDto
<
String
>
add
(
@RequestBody
@Valid
AdamEntersParam
parameter
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamEnters
addInfo
=
new
AdamEnters
();
BeanUtils
.
copyProperties
(
parameter
,
addInfo
);
addInfo
.
setUid
(
currentUid
);
...
...
@@ -79,7 +81,7 @@ public class AdamEntersController {
@ApiOperationSupport
(
order
=
3
)
@ApiOperation
(
value
=
"设置默认入场人"
)
@PostMapping
(
"def/{entersId}"
)
public
ResponseDto
<
Object
>
def
(
@PathVariable
String
entersId
)
{
public
ResponseDto
<
Object
>
def
(
@
NotBlank
(
message
=
"入场人ID不能为空"
)
@
PathVariable
String
entersId
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamEnters
enters
=
adamRdmService
.
getEntersByUidEntersId
(
currentUid
,
entersId
);
if
(
null
==
enters
)
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10105"
));
...
...
@@ -93,8 +95,10 @@ public class AdamEntersController {
@ApiOperationSupport
(
order
=
4
)
@ApiOperation
(
value
=
"编辑入场人"
)
@PostMapping
(
"edit"
)
public
ResponseDto
<
Object
>
edit
(
@RequestBody
AdamEntersParam
parameter
)
{
// TODO: 2021/4/28 校验
public
ResponseDto
<
Object
>
edit
(
@RequestBody
@Valid
AdamEntersParam
parameter
)
{
if
(
StringUtils
.
isBlank
(
parameter
.
getEntersId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10015"
));
}
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamEnters
enters
=
adamRdmService
.
getEntersByUidEntersId
(
currentUid
,
parameter
.
getEntersId
());
...
...
@@ -114,11 +118,11 @@ public class AdamEntersController {
@ApiOperationSupport
(
order
=
5
)
@ApiOperation
(
value
=
"删除入场人"
)
@PostMapping
(
"del/{entersId}"
)
public
ResponseDto
<
Object
>
del
(
@PathVariable
String
entersId
)
{
public
ResponseDto
<
Object
>
del
(
@
NotBlank
(
message
=
"入场人ID不能为空"
)
@
PathVariable
String
entersId
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamEnters
enters
=
adamRdmService
.
getEntersByUidEntersId
(
currentUid
,
entersId
);
if
(
null
==
enters
)
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
10105
));
if
(
null
==
enters
)
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10105"
));
adamEntersService
.
remove
(
currentUid
,
entersId
);
return
ResponseDto
.
success
();
...
...
@@ -127,10 +131,8 @@ public class AdamEntersController {
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"入场人详情"
)
@PostMapping
(
"query/{id}"
)
public
ResponseDto
<
AdamEntersVo
>
query
(
@PathVariable
(
name
=
"id"
)
String
entersId
,
@RequestParam
(
name
=
"uid"
,
required
=
false
)
String
uid
)
{
// TODO: 2021/4/28 校验
public
ResponseDto
<
AdamEntersVo
>
query
(
@NotBlank
(
message
=
"入场人ID不能为空"
)
@PathVariable
(
name
=
"id"
)
String
entersId
,
@NotBlank
(
message
=
"用户ID不能为空"
)
@RequestParam
(
required
=
false
)
String
uid
)
{
AdamEnters
info
=
adamRdmService
.
getEntersByUidEntersId
(
StringUtils
.
isBlank
(
uid
)
?
CurrentUtil
.
getCurrentUid
()
:
uid
,
entersId
);
return
null
==
info
?
ResponseDto
.
failure
(
ErrorMapping
.
get
(
10105
))
:
ResponseDto
.
success
(
AdamEntersVo
.
getNew
().
copy
(
info
));
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamLoginController.java
View file @
c07ef2f7
...
...
@@ -27,8 +27,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.core.env.Environment
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Arrays
;
import
java.util.HashMap
;
...
...
@@ -38,6 +42,7 @@ import java.util.Objects;
@ApiSupport
(
order
=
10010
)
@Api
(
tags
=
"用户登录"
)
@Slf4j
@Validated
@RestController
@RequestMapping
(
""
)
public
class
AdamLoginController
{
...
...
@@ -83,8 +88,8 @@ public class AdamLoginController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mobile"
,
value
=
"手机号"
),
})
@GetMapping
(
value
=
{
"send"
})
public
ResponseDto
<
Object
>
sendSms
(
@RequestParam
String
mobile
)
{
log
.
info
(
"send to mobile:{}"
,
mobile
);
public
ResponseDto
<
Object
>
sendSms
(
@
Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
@
RequestParam
String
mobile
)
{
log
.
debug
(
"send to mobile:{}"
,
mobile
);
LinkedMultiValueMap
<
String
,
String
>
paramsMap
=
new
LinkedMultiValueMap
<>();
paramsMap
.
add
(
"mobile"
,
mobile
);
...
...
@@ -112,9 +117,11 @@ public class AdamLoginController {
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"验证码"
),
})
@PostMapping
(
value
=
{
"login/sms"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginBySms
(
@RequestParam
String
mobile
,
@RequestParam
String
code
)
{
// TODO: 2021/5/12 参数检验
log
.
info
(
"mobile:{},code:{}"
,
mobile
,
code
);
public
ResponseDto
<
AdamLoginInfoVo
>
loginBySms
(
@Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
@RequestParam
String
mobile
,
@Pattern
(
regexp
=
"\\d{6}"
,
message
=
"验证码格式有误"
)
@RequestParam
String
code
)
{
log
.
debug
(
"mobile:{},code:{}"
,
mobile
,
code
);
if
(!
this
.
checkSmsCode
(
mobile
,
code
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10002"
));
...
...
@@ -139,9 +146,8 @@ public class AdamLoginController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"accessToken"
,
value
=
"访问令牌"
),
})
@PostMapping
(
value
=
{
"login/mobile"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByMobile
(
@RequestParam
String
accessToken
)
{
// TODO: 2021/5/10
log
.
info
(
"login by mobile access token:{}"
,
accessToken
);
public
ResponseDto
<
AdamLoginInfoVo
>
loginByMobile
(
@NotBlank
(
message
=
"访问令牌不能为空"
)
@RequestParam
String
accessToken
)
{
log
.
debug
(
"login by mobile access token:{}"
,
accessToken
);
String
mobile
=
this
.
getMobile
(
accessToken
);
if
(
StringUtils
.
isEmpty
(
mobile
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10005"
));
...
...
@@ -164,9 +170,12 @@ public class AdamLoginController {
@ApiOperationSupport
(
order
=
5
)
@ApiOperation
(
value
=
"第三方账号登录"
)
@PostMapping
(
value
=
{
"login/tpa"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByTpa
(
@RequestBody
AdamThirdPartParam
parameter
)
{
// TODO: 2021/5/10
log
.
info
(
"login by tpa:{}"
,
JsonUtils
.
toJson
(
parameter
));
public
ResponseDto
<
AdamLoginInfoVo
>
loginByTpa
(
@RequestBody
@Valid
AdamThirdPartParam
parameter
)
{
log
.
debug
(
"login by tpa:{}"
,
JsonUtils
.
toJson
(
parameter
));
if
(
StringUtils
.
isBlank
(
parameter
.
getOpenId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10009"
));
}
AdamLoginInfoVo
loginInfoVo
=
AdamLoginInfoVo
.
getNew
();
if
(
StringUtils
.
isEmpty
(
parameter
.
getMobile
()))
{
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamUserController.java
View file @
c07ef2f7
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamRdmServiceImpl.java
View file @
c07ef2f7
...
...
@@ -227,4 +227,24 @@ public class AdamRdmServiceImpl implements IAdamRdmService {
}
return
simpleVo
;
}
@Override
public
boolean
setTagsForSex
(
List
<
AdamTagVo
>
voList
)
{
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_TAGS_SEX
,
voList
);
}
@Override
public
List
<
AdamTagVo
>
getTagsForSex
()
{
return
(
List
<
AdamTagVo
>)
redisUtil
.
get
(
AdamRedisConst
.
INFO_TAGS_SEX
);
}
@Override
public
boolean
setTagsForMusic
(
List
<
AdamTagParentVo
>
voList
)
{
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_TAGS_MUSIC
,
voList
);
}
@Override
public
List
<
AdamTagParentVo
>
getTagsForMusic
()
{
return
(
List
<
AdamTagParentVo
>)
redisUtil
.
get
(
AdamRedisConst
.
INFO_TAGS_MUSIC
);
}
}
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/resources/errors.properties
View file @
c07ef2f7
...
...
@@ -6,6 +6,14 @@
10006
=
第三方账号未注册
10007
=
第三方账号已绑定其它账号
10008
=
已绑定同类型第三方账号
10009
=
OPENID不能为空
10010
=
10011
=
性别标签无效
10012
=
音乐风格标签无效
10013
=
10014
=
10015
=
入场人ID不能为空
10016
=
收货地址ID不能为空
10101
=
姓名或身份证件号无效
...
...
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