合并代码

This commit is contained in:
岳鹏磊 2019-05-31 17:54:40 +08:00
parent a80f324851
commit d008e92baa
15 changed files with 1091 additions and 0 deletions

View File

@ -0,0 +1,73 @@
spring:
# datasource
datasource:
url: jdbc:mysql://180.167.213.26:13306/mall_order?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name: com.mysql.jdbc.Driver
username: root
password: ${MALL_MYSQL_PASSWORD}
# mybatis
#mybatis:
# config-location: classpath:mybatis-config.xml
# mapper-locations: classpath:mapper/*.xml
# type-aliases-package: cn.iocoder.mall.order.biz.dataobject
#
# mybatis-plus
mybatis-plus:
configuration:
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
global-config:
db-config:
id-type: auto
mapper-locations: classpath*:mapper/*.xml
type-aliases-package: cn.iocoder.mall.order.biz.dataobject
# dubbo
dubbo:
application:
name: order-service
registry:
address: zookeeper://127.0.0.1:2181
protocol:
port: -1
name: dubbo
scan:
base-packages: cn.iocoder.mall.order.biz.service
provider:
filter: -exception
CartService:
version: 1.0.0
OrderService:
version: 1.0.0
OrderReturnService:
version: 1.0.0
OrderLogisticsService:
version: 1.0.0
OrderCommentService:
version: 1.0.0
consumer:
timeout: 120000 # 设置长一点,方便调试代码
ProductSpuService:
version: 1.0.0
PromotionActivityService:
version: 1.0.0
CouponService:
version: 1.0.0
PayRefundService:
version: 1.0.0
UserAddressService:
version: 1.0.0
PayTransactionService:
version: 1.0.0
DataDictService:
version: 1.0.0
# logging
logging:
level:
# dao 开启 debug 模式 mybatis 输入 sql
cn.iocoder.mall.order.biz.dao: debug
# seata
seata:
tx-service-group: my_test_tx_group

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.mall.order.biz.dao.OrderCommentReplayMapper">
<sql id="FIELDS">
id,comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,
reply_user_id,reply_user_nick_name,reply_user_avatar,user_type,reply_like_count,create_time,update_time
</sql>
<!--插入-->
<insert id="insert" parameterType="OrderCommentReplyDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id
reply_user_nick_name,reply_user_avatar,user_type,create_time,update_time)
VALUES (#{commentId},#{replyType},#{parentId},#{parentUserId},#{parentUserNickName},#{parentUserAvatar},#{replyContent},#{replyUserId},
#{replyUserNickName},#{replyUserAvatar},#{userType},#{createTime},#{updateTime})
</insert>
<!--根据评论 id 和用户类型获取商家回复列表-->
<select id="selectCommentMerchantReplyByCommentId" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
SELECT
<include refid="FIELDS" />
FROM order_comment_replay
WHERE
comment_id = #{commentId}
AND
user_type = #{userType}
ORDER BY create_time DESC
</select>
<!--根据评论 id 和用户类型获取评论总数-->
<select id="selectCommentReplyTotalCountByCommentId" parameterType="Integer" resultType="java.lang.Integer">
SELECT
COUNT (*)
FROM order_comment_replay
WHERE
comment_id = #{commentId}
AND
user_type = #{userType}
</select>
<!--分页用户回复-->
<select id="selectCommentReplyPage" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
SELECT
<include refid="FIELDS" />
FROM order_comment_replay
WHERE
comment_id = #{commentId}
AND
user_type = #{userType}
ORDER BY create_time DESC
LIMIT ${pageNo * pageSize}, ${pageSize}
</select>
<!--根据评论 id 查询商家最新的评论列表-->
<select id="selectCommentNewMerchantReplyByCommentIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
</select>
</mapper>

View File

@ -0,0 +1,29 @@
spring:
application:
name: product-application
cloud:
sentinel:
transport:
port: 8719
dashboard: localhost:12088
metric:
charset: UTF-8
eager: false
# server
server:
port: 18081
servlet:
context-path: /product-api/
swagger:
enable: false
management:
endpoints:
web:
exposure:
include: health,info,env,metrics,prometheus
metrics:
enabled: true

View File

@ -0,0 +1,45 @@
spring:
# datasource
datasource:
url: jdbc:mysql://180.167.213.26:13306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name: com.mysql.jdbc.Driver
username: root
password: ${MALL_MYSQL_PASSWORD}
# mybatis
mybatis-plus:
config-location: classpath:mybatis-config.xml
mapper-locations: classpath:mapper/*.xml
type-aliases-package: cn.iocoder.mall.product.dataobject
# dubbo
dubbo:
application:
name: product-service
registry:
address: zookeeper://127.0.0.1:2181
protocol:
port: -1
name: dubbo
scan:
base-packages: cn.iocoder.mall.product.service
provider:
filter: -exception
ProductAttrService:
version: 1.0.0
ProductCategoryService:
version: 1.0.0
ProductSpuService:
version: 1.0.0
OAuth2Service:
version: 1.0.0
# rocketmq
rocketmq:
name-server: 127.0.0.1:9876
producer:
group: product-producer-group
# seata
seata:
tx-service-group: my_test_tx_group

View File

@ -0,0 +1,67 @@
spring:
# datasource
datasource:
url: jdbc:mysql://180.167.213.26:13306/mall_admin?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name: com.mysql.jdbc.Driver
username: root
password: ${MALL_MYSQL_PASSWORD}
# mybatis
#mybatis:
# config-location: classpath:mybatis-config.xml
# mapper-locations: classpath:mapper/*.xml
# type-aliases-package: cn.iocoder.mall.admin.dataobject
# mybatis-plus
mybatis-plus:
configuration:
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
global-config:
db-config:
id-type: auto
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
mapper-locations: classpath*:mapper/*.xml
type-aliases-package: cn.iocoder.mall.admin.dataobject
# sms
sms:
yunPian:
apiKey:
aliYun:
accessKeyId:
accessSecret:
# dubbo
dubbo:
application:
name: admin-service
registry:
address: zookeeper://127.0.0.1:2181
protocol:
port: -1
name: dubbo
scan:
base-packages: cn.iocoder.mall.admin.service
provider:
filter: -exception
AdminAccessLogService:
version: 1.0.0
AdminService:
version: 1.0.0
DataDictService:
version: 1.0.0
OAuth2Service:
version: 1.0.0
ResourceService:
version: 1.0.0
RoleService:
version: 1.0.0
SmsService:
version: 1.0.0
# logging
logging:
level:
# dao 开启 debug 模式 mybatis 输入 sql
cn.iocoder.mall.admin.dao: debug

View File

@ -0,0 +1,70 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.mall.admin.api.dto.systemlog.AccessLogAddDTO;
import cn.iocoder.mall.admin.api.dto.systemlog.ExceptionLogAddDTO;
import cn.iocoder.mall.admin.dataobject.AccessLogDO;
import cn.iocoder.mall.admin.dataobject.ExceptionLogDO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class AccessLogConvertImpl implements AccessLogConvert {
@Override
public AccessLogDO convert(AccessLogAddDTO accessLogAddDTO) {
if ( accessLogAddDTO == null ) {
return null;
}
AccessLogDO accessLogDO = new AccessLogDO();
accessLogDO.setTraceId( accessLogAddDTO.getTraceId() );
accessLogDO.setUserId( accessLogAddDTO.getUserId() );
accessLogDO.setUserType( accessLogAddDTO.getUserType() );
accessLogDO.setApplicationName( accessLogAddDTO.getApplicationName() );
accessLogDO.setUri( accessLogAddDTO.getUri() );
accessLogDO.setQueryString( accessLogAddDTO.getQueryString() );
accessLogDO.setMethod( accessLogAddDTO.getMethod() );
accessLogDO.setUserAgent( accessLogAddDTO.getUserAgent() );
accessLogDO.setIp( accessLogAddDTO.getIp() );
accessLogDO.setStartTime( accessLogAddDTO.getStartTime() );
accessLogDO.setResponseTime( accessLogAddDTO.getResponseTime() );
accessLogDO.setErrorCode( accessLogAddDTO.getErrorCode() );
accessLogDO.setErrorMessage( accessLogAddDTO.getErrorMessage() );
return accessLogDO;
}
@Override
public ExceptionLogDO convert(ExceptionLogAddDTO exceptionLogAddDTO) {
if ( exceptionLogAddDTO == null ) {
return null;
}
ExceptionLogDO exceptionLogDO = new ExceptionLogDO();
exceptionLogDO.setTraceId( exceptionLogAddDTO.getTraceId() );
exceptionLogDO.setUserId( exceptionLogAddDTO.getUserId() );
exceptionLogDO.setUserType( exceptionLogAddDTO.getUserType() );
exceptionLogDO.setApplicationName( exceptionLogAddDTO.getApplicationName() );
exceptionLogDO.setUri( exceptionLogAddDTO.getUri() );
exceptionLogDO.setQueryString( exceptionLogAddDTO.getQueryString() );
exceptionLogDO.setMethod( exceptionLogAddDTO.getMethod() );
exceptionLogDO.setUserAgent( exceptionLogAddDTO.getUserAgent() );
exceptionLogDO.setIp( exceptionLogAddDTO.getIp() );
exceptionLogDO.setExceptionTime( exceptionLogAddDTO.getExceptionTime() );
exceptionLogDO.setExceptionName( exceptionLogAddDTO.getExceptionName() );
exceptionLogDO.setExceptionMessage( exceptionLogAddDTO.getExceptionMessage() );
exceptionLogDO.setExceptionRootCauseMessage( exceptionLogAddDTO.getExceptionRootCauseMessage() );
exceptionLogDO.setExceptionStackTrace( exceptionLogAddDTO.getExceptionStackTrace() );
exceptionLogDO.setExceptionClassName( exceptionLogAddDTO.getExceptionClassName() );
exceptionLogDO.setExceptionFileName( exceptionLogAddDTO.getExceptionFileName() );
exceptionLogDO.setExceptionMethodName( exceptionLogAddDTO.getExceptionMethodName() );
exceptionLogDO.setExceptionLineNumber( exceptionLogAddDTO.getExceptionLineNumber() );
return exceptionLogDO;
}
}

View File

@ -0,0 +1,110 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.common.framework.vo.PageResult;
import cn.iocoder.mall.admin.api.bo.admin.AdminAuthenticationBO;
import cn.iocoder.mall.admin.api.bo.admin.AdminBO;
import cn.iocoder.mall.admin.api.dto.admin.AdminAddDTO;
import cn.iocoder.mall.admin.api.dto.admin.AdminUpdateDTO;
import cn.iocoder.mall.admin.dataobject.AdminDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:55+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class AdminConvertImpl implements AdminConvert {
@Override
public AdminBO convert(AdminDO adminDO) {
if ( adminDO == null ) {
return null;
}
AdminBO adminBO = new AdminBO();
adminBO.setId( adminDO.getId() );
adminBO.setUsername( adminDO.getUsername() );
adminBO.setNickname( adminDO.getNickname() );
adminBO.setStatus( adminDO.getStatus() );
adminBO.setCreateTime( adminDO.getCreateTime() );
return adminBO;
}
@Override
public AdminAuthenticationBO convert2(AdminDO admin) {
if ( admin == null ) {
return null;
}
AdminAuthenticationBO adminAuthenticationBO = new AdminAuthenticationBO();
adminAuthenticationBO.setId( admin.getId() );
adminAuthenticationBO.setNickname( admin.getNickname() );
return adminAuthenticationBO;
}
@Override
public AdminDO convert(AdminAddDTO adminAddDTO) {
if ( adminAddDTO == null ) {
return null;
}
AdminDO adminDO = new AdminDO();
adminDO.setUsername( adminAddDTO.getUsername() );
adminDO.setNickname( adminAddDTO.getNickname() );
adminDO.setPassword( adminAddDTO.getPassword() );
return adminDO;
}
@Override
public AdminDO convert(AdminUpdateDTO adminUpdateDTO) {
if ( adminUpdateDTO == null ) {
return null;
}
AdminDO adminDO = new AdminDO();
adminDO.setId( adminUpdateDTO.getId() );
adminDO.setUsername( adminUpdateDTO.getUsername() );
adminDO.setNickname( adminUpdateDTO.getNickname() );
adminDO.setPassword( adminUpdateDTO.getPassword() );
return adminDO;
}
@Override
public List<AdminBO> convert(List<AdminDO> adminBOs) {
if ( adminBOs == null ) {
return null;
}
List<AdminBO> list = new ArrayList<AdminBO>( adminBOs.size() );
for ( AdminDO adminDO : adminBOs ) {
list.add( convert( adminDO ) );
}
return list;
}
@Override
public PageResult<AdminBO> convert(IPage<AdminDO> page) {
if ( page == null ) {
return null;
}
PageResult<AdminBO> pageResult = new PageResult<AdminBO>();
pageResult.setList( convert( page.getRecords() ) );
pageResult.setTotal( (int) page.getTotal() );
return pageResult;
}
}

View File

@ -0,0 +1,85 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.mall.admin.api.bo.datadict.DataDictBO;
import cn.iocoder.mall.admin.api.dto.datadict.DataDictAddDTO;
import cn.iocoder.mall.admin.api.dto.datadict.DataDictUpdateDTO;
import cn.iocoder.mall.admin.dataobject.DataDictDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class DataDictConvertImpl implements DataDictConvert {
@Override
public DataDictDO convert(DataDictAddDTO dataDictAddDTO) {
if ( dataDictAddDTO == null ) {
return null;
}
DataDictDO dataDictDO = new DataDictDO();
dataDictDO.setEnumValue( dataDictAddDTO.getEnumValue() );
dataDictDO.setValue( dataDictAddDTO.getValue() );
dataDictDO.setDisplayName( dataDictAddDTO.getDisplayName() );
dataDictDO.setSort( dataDictAddDTO.getSort() );
dataDictDO.setMemo( dataDictAddDTO.getMemo() );
return dataDictDO;
}
@Override
public DataDictDO convert(DataDictUpdateDTO dataDictUpdateDTO) {
if ( dataDictUpdateDTO == null ) {
return null;
}
DataDictDO dataDictDO = new DataDictDO();
dataDictDO.setId( dataDictUpdateDTO.getId() );
dataDictDO.setEnumValue( dataDictUpdateDTO.getEnumValue() );
dataDictDO.setValue( dataDictUpdateDTO.getValue() );
dataDictDO.setDisplayName( dataDictUpdateDTO.getDisplayName() );
dataDictDO.setSort( dataDictUpdateDTO.getSort() );
dataDictDO.setMemo( dataDictUpdateDTO.getMemo() );
return dataDictDO;
}
@Override
public DataDictBO convert(DataDictDO dataDictDO) {
if ( dataDictDO == null ) {
return null;
}
DataDictBO dataDictBO = new DataDictBO();
dataDictBO.setId( dataDictDO.getId() );
dataDictBO.setEnumValue( dataDictDO.getEnumValue() );
dataDictBO.setValue( dataDictDO.getValue() );
dataDictBO.setDisplayName( dataDictDO.getDisplayName() );
dataDictBO.setSort( dataDictDO.getSort() );
dataDictBO.setMemo( dataDictDO.getMemo() );
dataDictBO.setCreateTime( dataDictDO.getCreateTime() );
return dataDictBO;
}
@Override
public List<DataDictBO> convert(List<DataDictDO> dataDictDOs) {
if ( dataDictDOs == null ) {
return null;
}
List<DataDictBO> list = new ArrayList<DataDictBO>( dataDictDOs.size() );
for ( DataDictDO dataDictDO : dataDictDOs ) {
list.add( convert( dataDictDO ) );
}
return list;
}
}

View File

@ -0,0 +1,42 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.mall.admin.api.bo.oauth2.OAuth2AccessTokenBO;
import cn.iocoder.mall.admin.api.bo.oauth2.OAuth2AuthenticationBO;
import cn.iocoder.mall.admin.dataobject.OAuth2AccessTokenDO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class OAuth2ConvertImpl implements OAuth2Convert {
@Override
public OAuth2AccessTokenBO convertToAccessToken(OAuth2AccessTokenDO oauth2AccessTokenDO) {
if ( oauth2AccessTokenDO == null ) {
return null;
}
OAuth2AccessTokenBO oAuth2AccessTokenBO = new OAuth2AccessTokenBO();
oAuth2AccessTokenBO.setAccessToken( oauth2AccessTokenDO.getId() );
oAuth2AccessTokenBO.setRefreshToken( oauth2AccessTokenDO.getRefreshToken() );
return oAuth2AccessTokenBO;
}
@Override
public OAuth2AuthenticationBO convertToAuthentication(OAuth2AccessTokenDO oauth2AccessTokenDO) {
if ( oauth2AccessTokenDO == null ) {
return null;
}
OAuth2AuthenticationBO oAuth2AuthenticationBO = new OAuth2AuthenticationBO();
oAuth2AuthenticationBO.setUserId( oauth2AccessTokenDO.getUserId() );
oAuth2AuthenticationBO.setUserType( oauth2AccessTokenDO.getUserType() );
return oAuth2AuthenticationBO;
}
}

View File

@ -0,0 +1,91 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.mall.admin.api.bo.resource.ResourceBO;
import cn.iocoder.mall.admin.api.dto.resource.ResourceAddDTO;
import cn.iocoder.mall.admin.api.dto.resource.ResourceUpdateDTO;
import cn.iocoder.mall.admin.dataobject.ResourceDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ResourceConvertImpl implements ResourceConvert {
@Override
public ResourceBO convert(ResourceDO resourceDO) {
if ( resourceDO == null ) {
return null;
}
ResourceBO resourceBO = new ResourceBO();
resourceBO.setPermissions( translateListFromString( resourceDO.getPermissions() ) );
resourceBO.setId( resourceDO.getId() );
resourceBO.setType( resourceDO.getType() );
resourceBO.setSort( resourceDO.getSort() );
resourceBO.setDisplayName( resourceDO.getDisplayName() );
resourceBO.setPid( resourceDO.getPid() );
resourceBO.setHandler( resourceDO.getHandler() );
resourceBO.setIcon( resourceDO.getIcon() );
resourceBO.setCreateTime( resourceDO.getCreateTime() );
return resourceBO;
}
@Override
public List<ResourceBO> convert(List<ResourceDO> resourceDOs) {
if ( resourceDOs == null ) {
return null;
}
List<ResourceBO> list = new ArrayList<ResourceBO>( resourceDOs.size() );
for ( ResourceDO resourceDO : resourceDOs ) {
list.add( convert( resourceDO ) );
}
return list;
}
@Override
public ResourceDO convert(ResourceAddDTO resourceAddDTO) {
if ( resourceAddDTO == null ) {
return null;
}
ResourceDO resourceDO = new ResourceDO();
resourceDO.setPermissions( translateStringFromList( resourceAddDTO.getPermissions() ) );
resourceDO.setType( resourceAddDTO.getType() );
resourceDO.setSort( resourceAddDTO.getSort() );
resourceDO.setDisplayName( resourceAddDTO.getDisplayName() );
resourceDO.setPid( resourceAddDTO.getPid() );
resourceDO.setHandler( resourceAddDTO.getHandler() );
resourceDO.setIcon( resourceAddDTO.getIcon() );
return resourceDO;
}
@Override
public ResourceDO convert(ResourceUpdateDTO resourceUpdateDTO) {
if ( resourceUpdateDTO == null ) {
return null;
}
ResourceDO resourceDO = new ResourceDO();
resourceDO.setPermissions( translateStringFromList( resourceUpdateDTO.getPermissions() ) );
resourceDO.setId( resourceUpdateDTO.getId() );
resourceDO.setType( resourceUpdateDTO.getType() );
resourceDO.setSort( resourceUpdateDTO.getSort() );
resourceDO.setDisplayName( resourceUpdateDTO.getDisplayName() );
resourceDO.setPid( resourceUpdateDTO.getPid() );
resourceDO.setHandler( resourceUpdateDTO.getHandler() );
resourceDO.setIcon( resourceUpdateDTO.getIcon() );
return resourceDO;
}
}

View File

@ -0,0 +1,89 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.common.framework.vo.PageResult;
import cn.iocoder.mall.admin.api.bo.role.RoleBO;
import cn.iocoder.mall.admin.api.dto.role.RoleAddDTO;
import cn.iocoder.mall.admin.api.dto.role.RoleUpdateDTO;
import cn.iocoder.mall.admin.dataobject.RoleDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class RoleConvertImpl implements RoleConvert {
@Override
public RoleDO convert(RoleAddDTO roleAddDTO) {
if ( roleAddDTO == null ) {
return null;
}
RoleDO roleDO = new RoleDO();
roleDO.setName( roleAddDTO.getName() );
return roleDO;
}
@Override
public RoleDO convert(RoleUpdateDTO roleUpdateDTO) {
if ( roleUpdateDTO == null ) {
return null;
}
RoleDO roleDO = new RoleDO();
roleDO.setId( roleUpdateDTO.getId() );
roleDO.setName( roleUpdateDTO.getName() );
return roleDO;
}
@Override
public RoleBO convert(RoleDO roleDO) {
if ( roleDO == null ) {
return null;
}
RoleBO roleBO = new RoleBO();
roleBO.setId( roleDO.getId() );
roleBO.setName( roleDO.getName() );
roleBO.setCreateTime( roleDO.getCreateTime() );
return roleBO;
}
@Override
public List<RoleBO> convert(List<RoleDO> roleDOs) {
if ( roleDOs == null ) {
return null;
}
List<RoleBO> list = new ArrayList<RoleBO>( roleDOs.size() );
for ( RoleDO roleDO : roleDOs ) {
list.add( convert( roleDO ) );
}
return list;
}
@Override
public PageResult<RoleBO> convert(IPage<RoleDO> page) {
if ( page == null ) {
return null;
}
PageResult<RoleBO> pageResult = new PageResult<RoleBO>();
pageResult.setList( convert( page.getRecords() ) );
pageResult.setTotal( (int) page.getTotal() );
return pageResult;
}
}

View File

@ -0,0 +1,64 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.mall.admin.api.bo.sms.PageSmsSignBO.Sign;
import cn.iocoder.mall.admin.api.bo.sms.SmsSignBO;
import cn.iocoder.mall.admin.dataobject.SmsSignDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class SmsSignConvertImpl implements SmsSignConvert {
@Override
public SmsSignBO convert(SmsSignDO smsSignDO) {
if ( smsSignDO == null ) {
return null;
}
SmsSignBO smsSignBO = new SmsSignBO();
smsSignBO.setId( smsSignDO.getId() );
smsSignBO.setSign( smsSignDO.getSign() );
smsSignBO.setApplyStatus( smsSignDO.getApplyStatus() );
smsSignBO.setApplyMessage( smsSignDO.getApplyMessage() );
return smsSignBO;
}
@Override
public List<Sign> convert(List<SmsSignDO> smsSignDOList) {
if ( smsSignDOList == null ) {
return null;
}
List<Sign> list = new ArrayList<Sign>( smsSignDOList.size() );
for ( SmsSignDO smsSignDO : smsSignDOList ) {
list.add( smsSignDOToSign( smsSignDO ) );
}
return list;
}
protected Sign smsSignDOToSign(SmsSignDO smsSignDO) {
if ( smsSignDO == null ) {
return null;
}
Sign sign = new Sign();
sign.setId( smsSignDO.getId() );
sign.setPlatform( smsSignDO.getPlatform() );
sign.setSign( smsSignDO.getSign() );
sign.setApplyStatus( smsSignDO.getApplyStatus() );
sign.setApplyMessage( smsSignDO.getApplyMessage() );
sign.setUpdateTime( smsSignDO.getUpdateTime() );
sign.setCreateTime( smsSignDO.getCreateTime() );
return sign;
}
}

View File

@ -0,0 +1,101 @@
package cn.iocoder.mall.admin.convert;
import cn.iocoder.mall.admin.api.bo.sms.PageSmsTemplateBO.Sign;
import cn.iocoder.mall.admin.api.bo.sms.PageSmsTemplateBO.Template;
import cn.iocoder.mall.admin.api.bo.sms.SmsTemplateBO;
import cn.iocoder.mall.admin.dataobject.SmsSignDO;
import cn.iocoder.mall.admin.dataobject.SmsTemplateDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class SmsTemplateConvertImpl implements SmsTemplateConvert {
@Override
public SmsTemplateBO convert(SmsTemplateDO smsTemplateDO) {
if ( smsTemplateDO == null ) {
return null;
}
SmsTemplateBO smsTemplateBO = new SmsTemplateBO();
smsTemplateBO.setId( smsTemplateDO.getId() );
smsTemplateBO.setSmsSignId( smsTemplateDO.getSmsSignId() );
smsTemplateBO.setTemplate( smsTemplateDO.getTemplate() );
smsTemplateBO.setApplyStatus( smsTemplateDO.getApplyStatus() );
smsTemplateBO.setApplyMessage( smsTemplateDO.getApplyMessage() );
return smsTemplateBO;
}
@Override
public List<Template> convert(List<SmsTemplateDO> smsTemplateDOList) {
if ( smsTemplateDOList == null ) {
return null;
}
List<Template> list = new ArrayList<Template>( smsTemplateDOList.size() );
for ( SmsTemplateDO smsTemplateDO : smsTemplateDOList ) {
list.add( smsTemplateDOToTemplate( smsTemplateDO ) );
}
return list;
}
@Override
public List<Sign> convertTemplateSign(List<SmsSignDO> smsSignDOList) {
if ( smsSignDOList == null ) {
return null;
}
List<Sign> list = new ArrayList<Sign>( smsSignDOList.size() );
for ( SmsSignDO smsSignDO : smsSignDOList ) {
list.add( smsSignDOToSign( smsSignDO ) );
}
return list;
}
protected Template smsTemplateDOToTemplate(SmsTemplateDO smsTemplateDO) {
if ( smsTemplateDO == null ) {
return null;
}
Template template = new Template();
template.setId( smsTemplateDO.getId() );
template.setSmsSignId( smsTemplateDO.getSmsSignId() );
if ( smsTemplateDO.getPlatform() != null ) {
template.setPlatform( String.valueOf( smsTemplateDO.getPlatform() ) );
}
template.setTemplateCode( smsTemplateDO.getTemplateCode() );
template.setTemplate( smsTemplateDO.getTemplate() );
template.setSmsType( smsTemplateDO.getSmsType() );
template.setApplyStatus( smsTemplateDO.getApplyStatus() );
template.setApplyMessage( smsTemplateDO.getApplyMessage() );
template.setUpdateTime( smsTemplateDO.getUpdateTime() );
template.setCreateTime( smsTemplateDO.getCreateTime() );
return template;
}
protected Sign smsSignDOToSign(SmsSignDO smsSignDO) {
if ( smsSignDO == null ) {
return null;
}
Sign sign = new Sign();
sign.setId( smsSignDO.getId() );
sign.setSign( smsSignDO.getSign() );
sign.setApplyStatus( smsSignDO.getApplyStatus() );
sign.setApplyMessage( smsSignDO.getApplyMessage() );
return sign;
}
}

View File

@ -0,0 +1,87 @@
package cn.iocoder.mall.user.biz.convert;
import cn.iocoder.mall.user.api.bo.UserAddressBO;
import cn.iocoder.mall.user.api.dto.UserAddressAddDTO;
import cn.iocoder.mall.user.api.dto.UserAddressUpdateDTO;
import cn.iocoder.mall.user.biz.dataobject.UserAddressDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:38+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class UserAddressConvertImpl implements UserAddressConvert {
@Override
public UserAddressDO convert(UserAddressAddDTO userAddressAddDTO) {
if ( userAddressAddDTO == null ) {
return null;
}
UserAddressDO userAddressDO = new UserAddressDO();
userAddressDO.setUserId( userAddressAddDTO.getUserId() );
userAddressDO.setAreaNo( userAddressAddDTO.getAreaNo() );
userAddressDO.setName( userAddressAddDTO.getName() );
userAddressDO.setMobile( userAddressAddDTO.getMobile() );
userAddressDO.setAddress( userAddressAddDTO.getAddress() );
userAddressDO.setHasDefault( userAddressAddDTO.getHasDefault() );
return userAddressDO;
}
@Override
public UserAddressDO convert(UserAddressUpdateDTO userAddressUpdateDTO) {
if ( userAddressUpdateDTO == null ) {
return null;
}
UserAddressDO userAddressDO = new UserAddressDO();
userAddressDO.setId( userAddressUpdateDTO.getId() );
userAddressDO.setUserId( userAddressUpdateDTO.getUserId() );
userAddressDO.setAreaNo( userAddressUpdateDTO.getAreaNo() );
userAddressDO.setName( userAddressUpdateDTO.getName() );
userAddressDO.setMobile( userAddressUpdateDTO.getMobile() );
userAddressDO.setAddress( userAddressUpdateDTO.getAddress() );
userAddressDO.setHasDefault( userAddressUpdateDTO.getHasDefault() );
return userAddressDO;
}
@Override
public UserAddressBO convert(UserAddressDO userAddressDO) {
if ( userAddressDO == null ) {
return null;
}
UserAddressBO userAddressBO = new UserAddressBO();
userAddressBO.setId( userAddressDO.getId() );
userAddressBO.setUserId( userAddressDO.getUserId() );
userAddressBO.setAreaNo( userAddressDO.getAreaNo() );
userAddressBO.setName( userAddressDO.getName() );
userAddressBO.setMobile( userAddressDO.getMobile() );
userAddressBO.setAddress( userAddressDO.getAddress() );
userAddressBO.setHasDefault( userAddressDO.getHasDefault() );
return userAddressBO;
}
@Override
public List<UserAddressBO> convertUserAddressBOList(List<UserAddressDO> userAddressDOList) {
if ( userAddressDOList == null ) {
return null;
}
List<UserAddressBO> list = new ArrayList<UserAddressBO>( userAddressDOList.size() );
for ( UserAddressDO userAddressDO : userAddressDOList ) {
list.add( convert( userAddressDO ) );
}
return list;
}
}

View File

@ -0,0 +1,78 @@
package cn.iocoder.mall.user.biz.convert;
import cn.iocoder.mall.user.api.bo.UserBO;
import cn.iocoder.mall.user.api.bo.user.UserAuthenticationBO;
import cn.iocoder.mall.user.api.dto.UserUpdateDTO;
import cn.iocoder.mall.user.biz.dataobject.UserDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T17:43:37+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class UserConvertImpl implements UserConvert {
@Override
public UserBO convert(UserDO userDO) {
if ( userDO == null ) {
return null;
}
UserBO userBO = new UserBO();
userBO.setId( userDO.getId() );
userBO.setMobile( userDO.getMobile() );
userBO.setNickname( userDO.getNickname() );
userBO.setAvatar( userDO.getAvatar() );
userBO.setStatus( userDO.getStatus() );
userBO.setCreateTime( userDO.getCreateTime() );
return userBO;
}
@Override
public UserAuthenticationBO convert2(UserDO userDO) {
if ( userDO == null ) {
return null;
}
UserAuthenticationBO userAuthenticationBO = new UserAuthenticationBO();
userAuthenticationBO.setId( userDO.getId() );
userAuthenticationBO.setNickname( userDO.getNickname() );
return userAuthenticationBO;
}
@Override
public UserDO convert(UserUpdateDTO userUpdateDTO) {
if ( userUpdateDTO == null ) {
return null;
}
UserDO userDO = new UserDO();
userDO.setId( userUpdateDTO.getId() );
userDO.setNickname( userUpdateDTO.getNickname() );
userDO.setAvatar( userUpdateDTO.getAvatar() );
return userDO;
}
@Override
public List<UserBO> convert(List<UserDO> userDOs) {
if ( userDOs == null ) {
return null;
}
List<UserBO> list = new ArrayList<UserBO>( userDOs.size() );
for ( UserDO userDO : userDOs ) {
list.add( convert( userDO ) );
}
return list;
}
}