Skip to content

Commit

Permalink
fix archetype web issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fulan.zjf committed Jul 7, 2020
1 parent b4fc71d commit 25ffd2b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
Binary file removed COLA MOCK 介绍.pptx
Binary file not shown.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ COLA首先是作为架构的存在,是一种应用架构思想,主要是制
### cola-archetype-service
用来生成纯后端应用(没有Controller),生成应用的命令为:
```
mvn archetype:generate -DgroupId=com.alibaba.demo -DartifactId=demo -Dversion=1.0.0-SNAPSHOT -Dpackage=com.alibaba.demo -DarchetypeArtifactId=cola-framework-archetype-service -DarchetypeGroupId=com.alibaba.cola -DarchetypeVersion=3.0.0
mvn archetype:generate -DgroupId=com.alibaba.demo -DartifactId=demoService -Dversion=1.0.0-SNAPSHOT -Dpackage=com.alibaba.demo -DarchetypeArtifactId=cola-framework-archetype-service -DarchetypeGroupId=com.aliyun -DarchetypeVersion=3.0.0
```

### cola-archetype-web
用来生成Web后端应用(有Controller),生成应用的命令为:
```
mvn archetype:generate -DgroupId=com.alibaba.demo -DartifactId=demo -Dversion=1.0.0-SNAPSHOT -Dpackage=com.alibaba.demo -DarchetypeArtifactId=cola-framework-archetype-web -DarchetypeGroupId=com.alibaba.cola -DarchetypeVersion=3.0.0
mvn archetype:generate -DgroupId=com.alibaba.demo -DartifactId=demoWeb -Dversion=1.0.0-SNAPSHOT -Dpackage=com.alibaba.demo -DarchetypeArtifactId=cola-framework-archetype-web -DarchetypeGroupId=com.aliyun -DarchetypeVersion=3.0.0
```

## COLA框架
Expand Down Expand Up @@ -73,7 +73,7 @@ com

**2、启动SpringBoot:**

首先在demo目录下运行mvn install(如果不想运行测试,可以加上-DskipTests参数)。然后进入start目录,执行mvn spring-boot:run
首先在demoWeb目录下运行mvn install(如果不想运行测试,可以加上-DskipTests参数)。然后进入start目录,执行mvn spring-boot:run
运行成功的话,可以看到SpringBoot启动成功的界面。

**3、 执行测试:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#set( $symbol_escape = '\' )
package ${package}.executor;

import com.alibaba.cola.domain.DomainEventServiceI;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.exception.BizException;
import ${package}.dto.CustomerAddCmd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#set( $symbol_escape = '\' )
package ${package}.config;

import com.alibaba.cola.boot.Bootstrap;
import com.alibaba.cola.boot.SpringBootstrap;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -17,11 +17,8 @@
public class ColaConfig {

@Bean(initMethod = "init")
public Bootstrap bootstrap() {
Bootstrap bootstrap = new Bootstrap();
List<String> packagesToScan = new ArrayList<>();
packagesToScan.add("${package}");
bootstrap.setPackages(packagesToScan);
public SpringBootstrap bootstrap() {
SpringBootstrap bootstrap = new SpringBootstrap();
return bootstrap;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void testCustomerAddSuccess(){
Assert.assertTrue(response.isSuccess());
}

@Test
@Test(expected = BizException.class)
public void testCustomerAddCompanyNameConflict(){
//1.prepare
CustomerAddCmd customerAddCmd = new CustomerAddCmd();
Expand Down

0 comments on commit 25ffd2b

Please sign in to comment.