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
Aug 26, 2019
1 parent
ea84312
commit 9d59107
Showing
295 changed files
with
3,469 additions
and
1,928 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.alibaba.cola</groupId> | ||
<artifactId>cola-framework-archetype-service</artifactId> | ||
<version>2.0.0</version> | ||
<packaging>maven-archetype</packaging> | ||
|
||
<name>cola framework archetype</name> | ||
|
||
<build> | ||
<extensions> | ||
<extension> | ||
<groupId>org.apache.maven.archetype</groupId> | ||
<artifactId>archetype-packaging</artifactId> | ||
<version>3.0.1</version> | ||
</extension> | ||
</extensions> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-archetype-plugin</artifactId> | ||
<version>3.0.1</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
<!-- already in parent | ||
<distributionManagement> | ||
<snapshotRepository> | ||
<id>snapshots</id> | ||
<url>http://repo.alibaba-inc.com/mvn/snapshots</url> | ||
</snapshotRepository> | ||
</distributionManagement> | ||
--> | ||
</project> |
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
29 changes: 29 additions & 0 deletions
29
.../archetype-resources/__rootArtifactId__-app/src/main/java/executor/CustomerAddCmdExe.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,29 @@ | ||
#set( $symbol_pound = '#' ) | ||
#set( $symbol_dollar = '$' ) | ||
#set( $symbol_escape = '\' ) | ||
package ${package}.executor; | ||
|
||
|
||
import com.alibaba.cola.command.Command; | ||
import com.alibaba.cola.command.CommandExecutorI; | ||
import com.alibaba.cola.domain.DomainEventServiceI; | ||
import com.alibaba.cola.dto.Response; | ||
import com.alibaba.cola.exception.BizException; | ||
import ${package}.dto.CustomerAddCmd; | ||
import ${package}.dto.domainmodel.ErrorCode; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
@Command | ||
public class CustomerAddCmdExe implements CommandExecutorI<Response, CustomerAddCmd>{ | ||
|
||
@Override | ||
public Response execute(CustomerAddCmd cmd) { | ||
//The flow of usecase is defined here. | ||
//The core ablility should be implemented in Domain. or sink to Domian gradually | ||
if(cmd.getCustomer().getCompanyName().equals("ConflictCompanyName")){ | ||
throw new BizException(ErrorCode.B_CUSTOMER_companyNameConflict, "公司名冲突"); | ||
} | ||
return Response.buildSuccess(); | ||
} | ||
|
||
} |
Oops, something went wrong.