Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
644fa04e
Commit
644fa04e
authored
Apr 04, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 20180330-wechat-binding
parents
908a134d
188ab8f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+8
-11
ValidationUtil.java
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
+1
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
644fa04e
...
...
@@ -411,27 +411,24 @@ public class InnerController implements IBaseController {
@RequestMapping
(
"/contact/save/contacts"
)
public
JsonResult
save2Contact
(
Long
userId
,
@RequestParam
(
value
=
"contacts"
)
String
contactsStr
)
{
LOGGER
.
info
(
"保存用户联系人:userId:{}, contacts:{}"
,
userId
,
contactsStr
);
if
(
StringUtils
.
isEmpty
(
contactsStr
))
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
if
(
userId
==
null
)
{
LOGGER
.
info
(
"用户ID不能为空"
);
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
if
(
Objects
.
isNull
(
userId
)
||
StringUtils
.
isBlank
(
contactsStr
))
{
LOGGER
.
warn
(
"保存用户联系人:参数不完整:userId:{}, contacts:{}"
,
userId
,
contactsStr
);
return
JsonResult
.
buildErrorStateResult
(
"参数不完整"
,
String
.
valueOf
(
userId
).
concat
(
":"
).
concat
(
contactsStr
));
}
LOGGER
.
info
(
"保存用户联系人:userId:{}, contacts:{}"
,
userId
,
contactsStr
);
List
<
Contact
>
contacts
=
JSONObject
.
parseObject
(
contactsStr
,
new
TypeReference
<
List
<
Contact
>>(){});
if
(
CollectionUtils
.
isEmpty
(
contacts
))
{
LOGGER
.
info
(
"联系人不能空"
);
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
LOGGER
.
info
(
"联系人不能
为
空"
);
return
JsonResult
.
buildErrorStateResult
(
"联系人不能为空"
,
contacts
);
}
for
(
Contact
contact
:
contacts
)
{
if
(!
contact
.
valid
())
{
LOGGER
.
info
(
"用户手机号或姓名错误, phoneNo:{},name:{}"
,
contact
.
getPhoneNo
(),
contact
.
getName
());
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"用户手机号或姓名错误"
,
contact
);
}
}
List
<
Contact
>
result
=
contactService
.
save
(
userId
,
contacts
);
return
JsonResult
.
buildSuccessResult
(
null
,
ContactRet
.
contacts2ContactRets
(
result
));
return
JsonResult
.
buildSuccessResult
(
"保存成功"
,
ContactRet
.
contacts2ContactRets
(
result
));
}
@RequestMapping
(
"/contact/update/contact"
)
...
...
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
View file @
644fa04e
...
...
@@ -15,7 +15,7 @@ import java.util.regex.Pattern;
*/
public
class
ValidationUtil
{
private
static
String
phoneRegExp
=
"^1[345789][0-9]{9}$"
;
private
static
String
phoneRegExp
=
"^1[345
6
789][0-9]{9}$"
;
private
static
String
chineseNameRegExp
=
"^[\u4e00-\u9fa5]+(\\.|·)?[\u4e00-\u9fa5]+$"
;
private
static
String
ipv4RegExp
=
"^((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)\\.){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)$"
;
private
static
String
localIpv4RegExp
=
"^((172\\.(1[0-6]|2[0-9]|3[01]))|(192\\.168|169\\.254)|((127|10)\\.(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)))(\\.(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)){2}$"
;
...
...
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