Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
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
lanbaoming
jiedao-api-boot-master
Commits
df1a30a9
Commit
df1a30a9
authored
Aug 08, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户端地址管理
parent
0904f244
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
UserAddressServiceImpl.java
...module/member/service/address/UserAddressServiceImpl.java
+8
-3
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/address/UserAddressServiceImpl.java
View file @
df1a30a9
...
@@ -3,8 +3,10 @@ package cn.iocoder.yudao.module.member.service.address;
...
@@ -3,8 +3,10 @@ package cn.iocoder.yudao.module.member.service.address;
import
java.util.*
;
import
java.util.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
cn.hutool.core.util.StrUtil
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi
;
import
cn.iocoder.yudao.module.member.convert.address.UserAddressConvert
;
import
cn.iocoder.yudao.module.member.convert.address.UserAddressConvert
;
import
cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddressDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddressDO
;
import
cn.iocoder.yudao.module.member.dal.mysql.address.UserAddressMapper
;
import
cn.iocoder.yudao.module.member.dal.mysql.address.UserAddressMapper
;
...
@@ -35,9 +37,12 @@ public class UserAddressServiceImpl extends AbstractService<UserAddressMapper, U
...
@@ -35,9 +37,12 @@ public class UserAddressServiceImpl extends AbstractService<UserAddressMapper, U
private
UserAddressMapper
userAddressMapper
;
private
UserAddressMapper
userAddressMapper
;
@Resource
@Resource
private
MemberUserService
userService
;
private
MemberUserService
userService
;
@Resource
private
ParamValidatorApi
paramValidatorApi
;
@Override
@Override
public
Long
createUserAddress
(
UserAddressCreateReqVO
createReqVO
)
{
public
Long
createUserAddress
(
UserAddressCreateReqVO
createReqVO
)
{
verifyUserAddress
(
createReqVO
);
// 插入
// 插入
UserAddressDO
userAddress
=
UserAddressConvert
.
INSTANCE
.
convert
(
createReqVO
);
UserAddressDO
userAddress
=
UserAddressConvert
.
INSTANCE
.
convert
(
createReqVO
);
updateIsDefault
(
createReqVO
,
0L
);
updateIsDefault
(
createReqVO
,
0L
);
...
@@ -48,6 +53,7 @@ public class UserAddressServiceImpl extends AbstractService<UserAddressMapper, U
...
@@ -48,6 +53,7 @@ public class UserAddressServiceImpl extends AbstractService<UserAddressMapper, U
@Override
@Override
public
void
updateUserAddress
(
UserAddressUpdateReqVO
updateReqVO
)
{
public
void
updateUserAddress
(
UserAddressUpdateReqVO
updateReqVO
)
{
verifyUserAddress
(
updateReqVO
);
// 校验存在
// 校验存在
this
.
validateUserAddressExists
(
updateReqVO
.
getId
());
this
.
validateUserAddressExists
(
updateReqVO
.
getId
());
updateIsDefault
(
updateReqVO
,
updateReqVO
.
getId
());
updateIsDefault
(
updateReqVO
,
updateReqVO
.
getId
());
...
@@ -67,9 +73,8 @@ public class UserAddressServiceImpl extends AbstractService<UserAddressMapper, U
...
@@ -67,9 +73,8 @@ public class UserAddressServiceImpl extends AbstractService<UserAddressMapper, U
throw
exception
(
USER_ADDRESS_FIELD_ERROR
,
"Address,AreaCode,Name,Phone must not null"
);
throw
exception
(
USER_ADDRESS_FIELD_ERROR
,
"Address,AreaCode,Name,Phone must not null"
);
}
}
// 校验手机号格式
// 校验手机号格式
if
(!
reqVO
.
getPhone
().
matches
(
"^1[3-9]\\d{9}$"
))
{
String
mobileCode
=
reqVO
.
getAreaCode
()
+
StrUtil
.
COLON
+
reqVO
.
getPhone
();
throw
exception
(
USER_ADDRESS_FIELD_ERROR
,
"phone number error"
);
paramValidatorApi
.
validatorMobile
(
mobileCode
);
}
}
}
private
void
updateIsDefault
(
UserAddressBaseVO
updateReqVO
,
Long
id
)
{
private
void
updateIsDefault
(
UserAddressBaseVO
updateReqVO
,
Long
id
)
{
...
...
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