将文档接口分开:管理端和用户端
This commit is contained in:
parent
2a3d46113e
commit
d6171e842d
|
@ -47,20 +47,42 @@ public class WebMvcConfiguration extends WebMvcConfigurationSupport {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过knife4j生成接口文档
|
* 通过knife4j生成接口文档
|
||||||
*
|
* 管理后台文档
|
||||||
* @return Docket
|
* @return Docket
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public Docket docket() {
|
public Docket docketAdmin() {
|
||||||
ApiInfo apiInfo = new ApiInfoBuilder()
|
ApiInfo apiInfo = new ApiInfoBuilder()
|
||||||
.title("苍穹外卖项目接口文档")
|
.title("苍穹外卖项目接口文档")
|
||||||
.version("2.0")
|
.version("2.0")
|
||||||
.description("苍穹外卖项目接口文档")
|
.description("苍穹外卖项目接口文档")
|
||||||
.build();
|
.build();
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.groupName("管理端接口")
|
||||||
.apiInfo(apiInfo)
|
.apiInfo(apiInfo)
|
||||||
.select()
|
.select()
|
||||||
.apis(RequestHandlerSelectors.basePackage("com.sky.controller"))
|
.apis(RequestHandlerSelectors.basePackage("com.sky.controller.admin"))
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过knife4j生成接口文档
|
||||||
|
* 用户前台文档
|
||||||
|
* @return Docket
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Docket docketUser() {
|
||||||
|
ApiInfo apiInfo = new ApiInfoBuilder()
|
||||||
|
.title("苍穹外卖项目接口文档")
|
||||||
|
.version("2.0")
|
||||||
|
.description("苍穹外卖项目接口文档")
|
||||||
|
.build();
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.groupName("用户端接口")
|
||||||
|
.apiInfo(apiInfo)
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.basePackage("com.sky.controller.user"))
|
||||||
.paths(PathSelectors.any())
|
.paths(PathSelectors.any())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import javax.annotation.Resource;
|
||||||
|
|
||||||
@RestController("userShopController")
|
@RestController("userShopController")
|
||||||
@RequestMapping("/admin/user")
|
@RequestMapping("/admin/user")
|
||||||
@Api(tags = "用户店铺相关接口")
|
@Api(tags = "店铺相关接口")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ShopController {
|
public class ShopController {
|
||||||
public static final String KEY = "SHOP_STATUS";
|
public static final String KEY = "SHOP_STATUS";
|
||||||
|
|
Loading…
Reference in New Issue