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
930bb1a7
Commit
930bb1a7
authored
Aug 07, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户端用户地址管理
parent
f6f1fad2
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
622 additions
and
2 deletions
+622
-2
ErrorCodeConstants.java
...iocoder/yudao/module/member/enums/ErrorCodeConstants.java
+3
-0
UserAddressController.java
.../member/controller/app/address/UserAddressController.java
+101
-0
package-info.java
...ao/module/member/controller/app/address/package-info.java
+0
-1
UserAddressConvert.java
...dao/module/member/convert/address/UserAddressConvert.java
+56
-0
UserAddressDO.java
...o/module/member/dal/dataobject/address/UserAddressDO.java
+51
-0
package-info.java
...ao/module/member/dal/dataobject/address/package-info.java
+0
-1
UserAddressMapper.java
...ao/module/member/dal/mysql/address/UserAddressMapper.java
+56
-0
OrderVStrategy.java
.../module/member/mq/consumer/score/core/OrderVStrategy.java
+1
-0
UserAddressService.java
...dao/module/member/service/address/UserAddressService.java
+70
-0
UserAddressServiceImpl.java
...module/member/service/address/UserAddressServiceImpl.java
+125
-0
UserAddressBackVO.java
...der/yudao/module/member/vo/address/UserAddressBackVO.java
+52
-0
UserAddressBaseVO.java
...der/yudao/module/member/vo/address/UserAddressBaseVO.java
+38
-0
UserAddressCreateReqVO.java
...udao/module/member/vo/address/UserAddressCreateReqVO.java
+12
-0
UserAddressQueryVO.java
...er/yudao/module/member/vo/address/UserAddressQueryVO.java
+40
-0
UserAddressUpdateReqVO.java
...udao/module/member/vo/address/UserAddressUpdateReqVO.java
+17
-0
No files found.
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java
View file @
930bb1a7
...
...
@@ -56,4 +56,7 @@ public interface ErrorCodeConstants {
ErrorCode
SCORE_RULE_DELETE_ERROR
=
new
ErrorCode
(
1004008011
,
"score.rule.delete.error"
);
ErrorCode
SCORE_RULE_UPDATE_ERROR
=
new
ErrorCode
(
1004008012
,
"score.rule.update.error"
);
ErrorCode
SCORE_RULE_FIELD_ERROR
=
new
ErrorCode
(
1004008013
,
"score.rule.field.error"
);
ErrorCode
USER_ADDRESS_NOT_EXISTS
=
new
ErrorCode
(
1004008014
,
"user.address.not.exists"
);
ErrorCode
USER_ADDRESS_FIELD_ERROR
=
new
ErrorCode
(
1004008015
,
"user.address.field.error"
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/UserAddressController.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
controller
.
app
.
address
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
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.service.address.UserAddressService
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressBackVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressCreateReqVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressUpdateReqVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
@Validated
@RestController
@Api
(
tags
=
"用户 APP - 会员收货地址"
)
@RequestMapping
(
"/member/user-address"
)
public
class
UserAddressController
{
@Resource
private
UserAddressService
userAddressService
;
@PostMapping
(
"/create"
)
@ApiOperation
(
"创建会员收货地址"
)
//@PreAuthenticated
public
CommonResult
<
Long
>
createUserAddress
(
@Valid
@RequestBody
UserAddressCreateReqVO
createReqVO
)
{
return
success
(
userAddressService
.
createUserAddress
(
createReqVO
));
}
@PostMapping
(
"/update"
)
@ApiOperation
(
"更新会员收货地址"
)
//@PreAuthenticated
public
CommonResult
<
Boolean
>
updateUserAddress
(
@Valid
@RequestBody
UserAddressUpdateReqVO
updateReqVO
)
{
userAddressService
.
updateUserAddress
(
updateReqVO
);
return
success
(
true
);
}
@PostMapping
(
"/delete"
)
@ApiOperation
(
"删除会员收货地址"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
//@PreAuthenticated
public
CommonResult
<
Boolean
>
deleteUserAddress
(
@RequestParam
(
"id"
)
Long
id
)
{
userAddressService
.
deleteUserAddress
(
id
);
return
success
(
true
);
}
@GetMapping
(
"/get"
)
@ApiOperation
(
"根据id获得会员收货地址"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
//@PreAuthenticated
public
CommonResult
<
UserAddressBackVO
>
getUserAddress
(
@RequestParam
(
"id"
)
Long
id
)
{
UserAddressDO
userAddress
=
userAddressService
.
getUserAddress
(
id
);
return
success
(
UserAddressConvert
.
INSTANCE
.
convert
(
userAddress
));
}
@GetMapping
(
"/member/list"
)
@ApiOperation
(
"获得会员收货地址列表"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"会员id"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
//@PreAuthenticated
public
CommonResult
<
List
<
UserAddressBackVO
>>
getUserAddressList
(
@RequestParam
(
"id"
)
Long
memberId
)
{
List
<
UserAddressDO
>
list
=
userAddressService
.
getUserAddressListByMemberId
(
memberId
);
return
success
(
UserAddressConvert
.
INSTANCE
.
convertList
(
list
));
}
//@GetMapping("/list")
//@ApiOperation("获得会员收货地址列表")
//@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
////@PreAuthenticated
//public CommonResult<List<UserAddressBackVO>> getUserAddressList(@RequestParam("ids") Collection<Long> ids) {
// List<UserAddressDO> list = userAddressService.getUserAddressList(ids);
// return success(UserAddressConvert.INSTANCE.convertList(list));
//}
//@GetMapping("/page")
//@ApiOperation("获得会员收货地址分页")
//@PreAuthenticated
//public CommonResult<PageResult<UserAddressBackVO>> getUserAddressPage(@Valid UserAddressQueryVO query, PageVO page) {
// PageResult<UserAddressDO> pageResult = userAddressService.getUserAddressPage(query, page);
// return success(UserAddressConvert.INSTANCE.convertPage(pageResult));
//}
//@GetMapping("/export-excel")
//@ApiOperation("导出会员收货地址 Excel")
//@PreAuthenticated
//@OperateLog(type = EXPORT)
//public void exportUserAddressExcel(@Valid UserAddressQueryVO query,
// HttpServletResponse response) throws IOException {
// List<UserAddressDO> list = userAddressService.getUserAddressList(query);
// // 导出 Excel
// List<UserAddressBackVO> datas = UserAddressConvert.INSTANCE.convertList(list);
// ExcelUtils.write(response, "会员收货地址.xls", "数据", UserAddressBackVO.class, datas);
//}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/package-info.java
deleted
100644 → 0
View file @
f6f1fad2
package
cn
.
iocoder
.
yudao
.
module
.
member
.
controller
.
app
.
address
;
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/address/UserAddressConvert.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
convert
.
address
;
import
java.util.*
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddressDO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressBackVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressCreateReqVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressUpdateReqVO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
/**
* 会员收货地址 Convert
* @author 系统管理员
*/
@Mapper
public
interface
UserAddressConvert
{
/*****转换MapStruct*****/
UserAddressConvert
INSTANCE
=
Mappers
.
getMapper
(
UserAddressConvert
.
class
);
/***
* 创建VO转实体
* @param bean
* @return
*/
UserAddressDO
convert
(
UserAddressCreateReqVO
bean
);
/***
* 修改VO转实体
* @param bean
* @return
*/
UserAddressDO
convert
(
UserAddressUpdateReqVO
bean
);
/***
* 实体转返回VO
* @param bean
* @return
*/
UserAddressBackVO
convert
(
UserAddressDO
bean
);
/***
* 实体列表转返回VO列表
* @param list
* @return
*/
List
<
UserAddressBackVO
>
convertList
(
List
<
UserAddressDO
>
list
);
/***
* 实体分页转返回分页
* @param page
* @return
*/
PageResult
<
UserAddressBackVO
>
convertPage
(
PageResult
<
UserAddressDO
>
page
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/UserAddressDO.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
dataobject
.
address
;
import
lombok.*
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO
;
/**
* 会员收货地址 DO
*
* @author 系统管理员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName
(
"member_user_address"
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
UserAddressDO
extends
BaseDO
{
/**
* 主键
*/
@TableId
private
Long
id
;
/**
* 会员id
*/
private
Long
memberId
;
/**
* 是否默认地址
*/
private
Integer
isDefault
;
/**
* 收货人姓名
*/
private
String
name
;
/**
* 区号
*/
private
String
areaCode
;
/**
* 收货人手机
*/
private
String
phone
;
/**
* 详细地址
*/
private
String
address
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/address/package-info.java
deleted
100644 → 0
View file @
f6f1fad2
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
dataobject
.
address
;
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/address/UserAddressMapper.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
mysql
.
address
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddressDO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressQueryVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* 会员收货地址 Mapper
* @author 系统管理员
*/
@Mapper
public
interface
UserAddressMapper
extends
AbstractMapper
<
UserAddressDO
>
{
@Override
default
PageResult
<
UserAddressDO
>
selectPage
(
PageVO
page
,
Object
object
)
{
if
(
object
instanceof
UserAddressQueryVO
)
{
UserAddressQueryVO
vo
=
(
UserAddressQueryVO
)
object
;
return
selectPage
(
page
,
new
LambdaQuery
<
UserAddressDO
>()
.
eqIfPresent
(
UserAddressDO:
:
getMemberId
,
vo
.
getMemberId
())
.
eqIfPresent
(
UserAddressDO:
:
getIsDefault
,
vo
.
getIsDefault
())
.
likeIfPresent
(
UserAddressDO:
:
getName
,
vo
.
getName
())
.
eqIfPresent
(
UserAddressDO:
:
getAreaCode
,
vo
.
getAreaCode
())
.
eqIfPresent
(
UserAddressDO:
:
getPhone
,
vo
.
getPhone
())
.
eqIfPresent
(
UserAddressDO:
:
getAddress
,
vo
.
getAddress
())
.
betweenIfPresent
(
UserAddressDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
orderByDesc
(
UserAddressDO:
:
getId
));
}
return
null
;
}
@Override
default
List
<
UserAddressDO
>
selectList
(
Object
object
)
{
if
(
object
instanceof
UserAddressQueryVO
)
{
UserAddressQueryVO
vo
=
(
UserAddressQueryVO
)
object
;
return
selectList
(
new
LambdaQuery
<
UserAddressDO
>()
.
eqIfPresent
(
UserAddressDO:
:
getMemberId
,
vo
.
getMemberId
())
.
eqIfPresent
(
UserAddressDO:
:
getIsDefault
,
vo
.
getIsDefault
())
.
likeIfPresent
(
UserAddressDO:
:
getName
,
vo
.
getName
())
.
eqIfPresent
(
UserAddressDO:
:
getAreaCode
,
vo
.
getAreaCode
())
.
eqIfPresent
(
UserAddressDO:
:
getPhone
,
vo
.
getPhone
())
.
eqIfPresent
(
UserAddressDO:
:
getAddress
,
vo
.
getAddress
())
.
betweenIfPresent
(
UserAddressDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
orderByDesc
(
UserAddressDO:
:
getId
));
}
return
null
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/mq/consumer/score/core/OrderVStrategy.java
View file @
930bb1a7
...
...
@@ -147,6 +147,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
}
}
// 校验累计最高分
// TODO:MaxScoreTotal为0时为不限制积分
Integer
userScoreTotalCount
=
getUserScoreTotalCount
(
scoreRuleDO
.
getId
(),
userId
);
if
(
userScoreTotalCount
>=
scoreRuleDO
.
getMaxScoreTotal
())
{
log
.
info
(
"Order in shipping listener: The user has reached the maximum score,userId:{},scoreRuleId:{}"
,
userId
,
scoreRuleDO
.
getId
());
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/address/UserAddressService.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
service
.
address
;
import
java.util.*
;
import
javax.validation.*
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.IService
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddressDO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressCreateReqVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressQueryVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressUpdateReqVO
;
/**
* 会员收货地址 Service 接口
*
* @author 系统管理员
*/
public
interface
UserAddressService
extends
IService
<
UserAddressDO
>
{
/**
* 创建会员收货地址
* @param createReqVO 创建信息
* @return 编号
*/
Long
createUserAddress
(
@Valid
UserAddressCreateReqVO
createReqVO
);
/**
* 更新会员收货地址
* @param updateReqVO 更新信息
*/
void
updateUserAddress
(
@Valid
UserAddressUpdateReqVO
updateReqVO
);
/**
* 删除会员收货地址
* @param id 编号
*/
void
deleteUserAddress
(
Long
id
);
/**
* 获得会员收货地址
* @param id 编号
* @return 会员收货地址
*/
UserAddressDO
getUserAddress
(
Long
id
);
/**
* 获得会员收货地址列表
* @param ids 编号
* @return 会员收货地址列表
*/
List
<
UserAddressDO
>
getUserAddressList
(
Collection
<
Long
>
ids
);
/**
* 获得会员收货地址分页
* @param page 分页查询
* @param query 查询
* @return 会员收货地址分页
*/
PageResult
<
UserAddressDO
>
getUserAddressPage
(
UserAddressQueryVO
query
,
PageVO
page
);
/**
* 获得会员收货地址列表, 用于 Excel 导出
* @param query 查询
* @return 会员收货地址列表
*/
List
<
UserAddressDO
>
getUserAddressList
(
UserAddressQueryVO
query
);
List
<
UserAddressDO
>
getUserAddressListByMemberId
(
Long
memberId
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/address/UserAddressServiceImpl.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
service
.
address
;
import
java.util.*
;
import
javax.annotation.Resource
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
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.mysql.address.UserAddressMapper
;
import
cn.iocoder.yudao.module.member.enums.YesOrNoTypeEnum
;
import
cn.iocoder.yudao.module.member.service.user.MemberUserService
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressBaseVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressCreateReqVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressQueryVO
;
import
cn.iocoder.yudao.module.member.vo.address.UserAddressUpdateReqVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
module
.
member
.
enums
.
ErrorCodeConstants
.*;
/**
* 会员收货地址 Service 实现类
*
* @author 系统管理员
*/
@Service
@Validated
public
class
UserAddressServiceImpl
extends
AbstractService
<
UserAddressMapper
,
UserAddressDO
>
implements
UserAddressService
{
@Resource
private
UserAddressMapper
userAddressMapper
;
@Resource
private
MemberUserService
userService
;
@Override
public
Long
createUserAddress
(
UserAddressCreateReqVO
createReqVO
)
{
// 插入
UserAddressDO
userAddress
=
UserAddressConvert
.
INSTANCE
.
convert
(
createReqVO
);
updateIsDefault
(
createReqVO
,
0L
);
userAddressMapper
.
insert
(
userAddress
);
// 返回
return
userAddress
.
getId
();
}
@Override
public
void
updateUserAddress
(
UserAddressUpdateReqVO
updateReqVO
)
{
// 校验存在
this
.
validateUserAddressExists
(
updateReqVO
.
getId
());
updateIsDefault
(
updateReqVO
,
updateReqVO
.
getId
());
// 更新
UserAddressDO
updateObj
=
UserAddressConvert
.
INSTANCE
.
convert
(
updateReqVO
);
userAddressMapper
.
updateById
(
updateObj
);
}
// 校验参数
private
void
verifyUserAddress
(
UserAddressBaseVO
reqVO
)
{
// 会员id是否存在
//Long memberId = reqVO.getMemberId();
//if (userService.getUser(memberId) == null) {
// throw exception(USER_NOT_EXISTS);
//}
if
(
StringUtils
.
isAnyBlank
(
reqVO
.
getAddress
(),
reqVO
.
getAreaCode
(),
reqVO
.
getName
(),
reqVO
.
getPhone
()))
{
throw
exception
(
USER_ADDRESS_FIELD_ERROR
);
}
// 校验手机号格式
if
(!
reqVO
.
getPhone
().
matches
(
"^1[3-9]\\d{9}$"
))
{
throw
exception
(
USER_ADDRESS_FIELD_ERROR
);
}
}
private
void
updateIsDefault
(
UserAddressBaseVO
updateReqVO
,
Long
id
)
{
// 如果更新了默认,修改其他地址默认状态保证只有一个默认
if
(
updateReqVO
.
getIsDefault
()
!=
null
&&
updateReqVO
.
getIsDefault
().
equals
(
YesOrNoTypeEnum
.
YES
.
ordinal
()))
{
for
(
UserAddressDO
userAddressDO
:
getUserAddressListByMemberId
(
updateReqVO
.
getMemberId
()))
{
if
(!
Objects
.
equals
(
userAddressDO
.
getId
(),
id
)
&&
userAddressDO
.
getIsDefault
().
equals
(
YesOrNoTypeEnum
.
YES
.
ordinal
()))
{
userAddressDO
.
setIsDefault
(
YesOrNoTypeEnum
.
NO
.
ordinal
());
userAddressMapper
.
updateById
(
userAddressDO
);
}
}
}
}
@Override
public
void
deleteUserAddress
(
Long
id
)
{
// 校验存在
this
.
validateUserAddressExists
(
id
);
// 删除
userAddressMapper
.
deleteById
(
id
);
}
private
void
validateUserAddressExists
(
Long
id
)
{
if
(
userAddressMapper
.
selectById
(
id
)
==
null
)
{
throw
exception
(
USER_ADDRESS_NOT_EXISTS
);
}
}
@Override
public
UserAddressDO
getUserAddress
(
Long
id
)
{
return
userAddressMapper
.
selectById
(
id
);
}
@Override
public
List
<
UserAddressDO
>
getUserAddressList
(
Collection
<
Long
>
ids
)
{
return
userAddressMapper
.
selectBatchIds
(
ids
);
}
@Override
public
PageResult
<
UserAddressDO
>
getUserAddressPage
(
UserAddressQueryVO
query
,
PageVO
page
)
{
return
userAddressMapper
.
selectPage
(
page
,
query
);
}
@Override
public
List
<
UserAddressDO
>
getUserAddressList
(
UserAddressQueryVO
query
)
{
return
userAddressMapper
.
selectList
(
query
);
}
@Override
public
List
<
UserAddressDO
>
getUserAddressListByMemberId
(
Long
memberId
)
{
return
userAddressMapper
.
selectList
(
"member_id"
,
memberId
);
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/address/UserAddressBackVO.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
address
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.annotations.*
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
/**
* 会员收货地址 Response VO
* @author 系统管理员
*/
@Data
@ApiModel
(
"管理后台 - 会员收货地址 Response VO"
)
public
class
UserAddressBackVO
{
@ExcelProperty
(
"主键"
)
@ApiModelProperty
(
value
=
"主键"
,
required
=
true
)
private
Long
id
;
@ExcelProperty
(
"会员id"
)
@ApiModelProperty
(
value
=
"会员id"
,
required
=
true
)
private
Long
memberId
;
@ExcelProperty
(
"是否默认地址"
)
@ApiModelProperty
(
value
=
"是否默认地址"
)
private
Integer
isDefault
;
@ExcelProperty
(
"收货人姓名"
)
@ApiModelProperty
(
value
=
"收货人姓名"
)
private
String
name
;
@ExcelProperty
(
"区号"
)
@ApiModelProperty
(
value
=
"区号"
)
private
String
areaCode
;
@ExcelProperty
(
"收货人手机"
)
@ApiModelProperty
(
value
=
"收货人手机"
)
private
String
phone
;
@ExcelProperty
(
"详细地址"
)
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
@ExcelProperty
(
"创建时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
true
)
private
Date
createTime
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/address/UserAddressBaseVO.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
address
;
import
lombok.*
;
import
io.swagger.annotations.*
;
import
javax.validation.constraints.*
;
/**
* 会员收货地址 Base VO,提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public
class
UserAddressBaseVO
{
@ApiModelProperty
(
value
=
"会员id"
,
required
=
true
)
@NotNull
(
message
=
"会员id不能为空"
)
private
Long
memberId
;
@ApiModelProperty
(
value
=
"是否默认地址(0是,1否)"
)
private
Integer
isDefault
=
1
;
@ApiModelProperty
(
value
=
"收货人姓名"
,
required
=
true
)
@NotNull
(
message
=
"收货人姓名不能为空"
)
private
String
name
=
""
;
@ApiModelProperty
(
value
=
"区号"
,
required
=
true
)
@NotNull
(
message
=
"区号不能为空"
)
private
String
areaCode
=
""
;
@ApiModelProperty
(
value
=
"收货人手机"
,
required
=
true
)
@NotNull
(
message
=
"收货人手机不能为空"
)
private
String
phone
=
""
;
@ApiModelProperty
(
value
=
"详细地址"
,
required
=
true
)
@NotNull
(
message
=
"详细地址不能为空"
)
private
String
address
=
""
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/address/UserAddressCreateReqVO.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
address
;
import
lombok.*
;
import
io.swagger.annotations.*
;
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
"管理后台 - 会员收货地址创建 Request VO"
)
public
class
UserAddressCreateReqVO
extends
UserAddressBaseVO
{
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/address/UserAddressQueryVO.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
address
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.annotations.*
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@Data
@ApiModel
(
"管理后台 - 会员收货地址查询 VO"
)
public
class
UserAddressQueryVO
{
@ApiModelProperty
(
value
=
"会员id"
)
private
Long
memberId
;
@ApiModelProperty
(
value
=
"是否默认地址"
)
private
Integer
isDefault
;
@ApiModelProperty
(
value
=
"收货人姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"区号"
)
private
String
areaCode
;
@ApiModelProperty
(
value
=
"收货人手机"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"开始创建时间"
)
private
Date
beginCreateTime
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"结束创建时间"
)
private
Date
endCreateTime
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/address/UserAddressUpdateReqVO.java
0 → 100644
View file @
930bb1a7
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
address
;
import
lombok.*
;
import
io.swagger.annotations.*
;
import
javax.validation.constraints.*
;
@ApiModel
(
"管理后台 - 会员收货地址更新 Request VO"
)
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
UserAddressUpdateReqVO
extends
UserAddressBaseVO
{
@ApiModelProperty
(
value
=
"主键"
,
required
=
true
)
@NotNull
(
message
=
"主键不能为空"
)
private
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