diff --git a/cloud-common/src/main/java/com/cm/common/config/SwaggerConfig.java b/cloud-common/src/main/java/com/cm/common/config/SwaggerConfig.java index 3d28c31..301c462 100644 --- a/cloud-common/src/main/java/com/cm/common/config/SwaggerConfig.java +++ b/cloud-common/src/main/java/com/cm/common/config/SwaggerConfig.java @@ -141,6 +141,22 @@ public class SwaggerConfig { .build(); } + @Bean + public Docket createRestApiWeb() { + List responseMessageList = responseMessageList(); + return new Docket(DocumentationType.SWAGGER_2) + .globalResponseMessage(RequestMethod.POST, responseMessageList) + .globalResponseMessage(RequestMethod.DELETE, responseMessageList) + .globalResponseMessage(RequestMethod.PUT, responseMessageList) + .globalResponseMessage(RequestMethod.GET, responseMessageList) + .groupName(ISystemConstant.API_GROUP_WEB) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.basePackage(swaggerBasePackage)) + .paths(PathSelectors.ant("/web/**")) + .build(); + } + private ApiInfo apiInfo() { return new ApiInfoBuilder() .title(swaggerTitle) diff --git a/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java b/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java index 43da154..d8257ee 100644 --- a/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java +++ b/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java @@ -32,6 +32,10 @@ public interface ISystemConstant { * 微信接口前缀 */ String API_TAGS_WECHAT_PREFIX = "微信接口-"; + /** + * 网页接口 + */ + String API_TAGS_WEB_PREFIX = "网页接口-"; /** * 系统接口分组 */ @@ -52,10 +56,18 @@ public interface ISystemConstant { * 微信接口分组 */ String API_GROUP_WECHAT = "WECHAT"; + /** + * 网页接口分组 + */ + String API_GROUP_WEB = "WEB"; /** * api前缀 */ String API_PREFIX = "/api"; + /** + * 网页前缀 + */ + String API_WEB_PREFIX = "/web"; /** * 路由前缀 */