添加前台工程
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.macro.mall.portal;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan({"com.macro.mall.mapper","com.macro.mall.portal.dao"})
|
||||
public class MallPortalApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MallPortalApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.macro.mall.portal.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* Swagger2API文档的配置
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class Swagger2Config {
|
||||
@Bean
|
||||
public Docket createRestApi(){
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.macro.mall.portal.controller"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("mall前台系统")
|
||||
.description("mall前台系统")
|
||||
.contact("macro")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
26
mall-portal/src/main/resources/application.properties
Normal file
26
mall-portal/src/main/resources/application.properties
Normal file
@@ -0,0 +1,26 @@
|
||||
#===server start===
|
||||
server.port=8085
|
||||
#===server end===
|
||||
|
||||
#===logging start===
|
||||
logging.level.org.springframework.data.mongodb.core=debug
|
||||
logging.level.com.macro.mall.mapper=debug
|
||||
logging.level.com.macro.mall.portal.dao=debug
|
||||
#===logging end===
|
||||
|
||||
#===datasource start===
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/mall
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
#===datasource end===
|
||||
|
||||
#===mybatis start===
|
||||
mybatis.mapper-locations=classpath:dao/*.xml,classpath*:com/**/mapper/*.xml
|
||||
#===mybatis end===
|
||||
|
||||
#===mongodb start===
|
||||
spring.data.mongodb.host=localhost
|
||||
spring.data.mongodb.port=27017
|
||||
spring.data.mongodb.database=mall-port
|
||||
#===mongodb end===
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.macro.mall.portal;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class MallPortalApplicationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user