【旧】面向服务的组件模块集合,每个子模块一个独立服务。

home chao fbf84da9aa 修改说明 il y a 5 ans
caimei-search b155a95181 迁移Mall搜索服务 il y a 5 ans
.gitignore 3ccf3aa207 Initial commit il y a 5 ans
README.md fbf84da9aa 修改说明 il y a 5 ans
pom.xml 0b3a88c0b2 init files il y a 5 ans

README.md

caimei-modules-soa

面向服务的组件模块集合,每个子模块一个独立服务。

迁移服务注意点:

1. 数据类型:

  • 数据库:bigint --> Java: Long (之前是Integer)
  • 数据库:decemal --> Java: BigDecimal (之前是double)

### 2. 实体类:

  • entity下的实体类和数据表对应,不要修改,可根据数据表自动生成
  • entity.vo下的实体类是使用的实体类,继承自entity,类名以Vo标识
  • 实体类不用写get/set方法,直接加@Data标注就好

3. 使用(以搜索服务为例):

  1. pom.xml引入
<dependency>
	<groupId>com.caimei.module</groupId>
	<artifactId>caimei-search</artifactId>
	<version>0.0.1-SNAPSHOT</version>
</dependency>
  1. 启动类加扫描
@SpringBootApplication(scanBasePackages = {"调用者controller包路径", "com.caimei.module.service"})
@MapperScan("com.caimei.module.dao")
public class DemoApplication {
    public static void main(String[] args) {SpringApplication.run(DemoApplication.class, args);}
}
  1. controller类注入
private SearchService searchService;
@Autowired
public void setSearchService(SearchService searchService){
	this.searchService = searchService;
}