forked from alibaba/COLA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fulan.zjf
committed
Jan 4, 2019
1 parent
6a00153
commit 07e34ad
Showing
301 changed files
with
2,748 additions
and
2,861 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
...archetype-resources/__rootArtifactId__-app/src/main/java/convertor/CustomerConvertor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#set( $symbol_pound = '#' ) | ||
#set( $symbol_dollar = '$' ) | ||
#set( $symbol_escape = '\' ) | ||
package ${package}.convertor; | ||
|
||
import com.alibaba.cola.context.Context; | ||
import com.alibaba.cola.domain.DomainFactory; | ||
import com.alibaba.cola.convertor.ConvertorI; | ||
import ${package}.dto.clientobject.CustomerCO; | ||
import ${package}.domain.customer.entity.CustomerE; | ||
import ${package}.tunnel.database.dataobject.CustomerDO; | ||
import org.springframework.stereotype.Component; | ||
/** | ||
* General CustomerConvertor, the difference is implemented by Extension mechanism | ||
* | ||
* @author Frank Zhang | ||
* @date 2018-01-07 3:08 AM | ||
*/ | ||
@Component | ||
public class CustomerConvertor implements ConvertorI { | ||
|
||
public CustomerE clientToEntity(CustomerCO customerCO, Context context){ | ||
CustomerE customerE = DomainFactory.create(CustomerE.class); | ||
customerE.setCompanyName(customerCO.getCompanyName()); | ||
customerE.setContext(context); | ||
return customerE; | ||
} | ||
|
||
public CustomerCO dataToClient(CustomerDO dataObject) { | ||
CustomerCO customerCO = new CustomerCO(); | ||
customerCO.setCustomerName(dataObject.getCompanyName()); | ||
customerCO.setCustomerType(dataObject.getCompanyType()); | ||
customerCO.setMemberId(dataObject.getMemberId()); | ||
customerCO.setCustomerId(dataObject.getCustomerId()); | ||
return customerCO; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
.../__rootArtifactId__-app/src/main/java/convertor/extension/CustomerBizOneConvertorExt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#set( $symbol_pound = '#' ) | ||
#set( $symbol_dollar = '$' ) | ||
#set( $symbol_escape = '\' ) | ||
package ${package}.convertor.extension; | ||
|
||
import com.alibaba.cola.context.Context; | ||
import com.alibaba.cola.extension.Extension; | ||
import ${package}.common.BizCode; | ||
import ${package}.convertor.CustomerConvertor; | ||
import ${package}.convertor.extensionpoint.CustomerConvertorExtPt; | ||
import ${package}.domain.customer.entity.CustomerE; | ||
import ${package}.domain.customer.valueobject.SourceType; | ||
import ${package}.dto.clientobject.CustomerCO; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
@Extension(bizCode = BizCode.BIZ_ONE) | ||
public class CustomerBizOneConvertorExt implements CustomerConvertorExtPt{ | ||
|
||
@Autowired | ||
private CustomerConvertor customerConvertor; | ||
|
||
@Override | ||
public CustomerE clientToEntity(CustomerCO customerCO, Context context) { | ||
CustomerE customerE = customerConvertor.clientToEntity(customerCO, context); | ||
customerE.setSourceType(SourceType.BIZ_ONE); | ||
return customerE; | ||
} | ||
} |
Oops, something went wrong.