Last active
August 5, 2019 02:09
-
-
Save sojw/d8c55001b28d838a096c3256d4b1a7ac to your computer and use it in GitHub Desktop.
Revisions
-
sojw revised this gist
Jun 17, 2016 . 1 changed file with 19 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ @Api(value = "Some API") @RestController @RequestMapping(value = "/Service") public class SampleApiContorller { @Autowired private ResponseEntityUtil responseEntityUtil; @Autowired private ServiceApiProxyFactory serviceApiProxyFactory; @ApiOperation(value = "Category List API", notes = "get some list ", response = Category.class, responseContainer = "List") @RequestMapping(value = {"/CategoryList.json"}, produces = Type.JSON_UTF8, method = RequestMethod.GET) public ResponseEntity<?> legacyCategoryList( @ApiParam(value = "service id", required = true) @RequestParam("serviceId") String serviceId, @ApiParam(hidden = true) @ModelAttribute("loginInfo") LoginInfo loginInfo) throws Exception { List<Category> categories = serviceApiProxyFactory.getCategoryList(loginInfo.getId()); return responseEntityUtil.success(categories); } } -
sojw revised this gist
Jun 17, 2016 . No changes.There are no files selected for viewing
-
sojw revised this gist
Jun 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ @ComponentScan(basePackages = "com.naver", useDefaultFilters = false, includeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = Controller.class), @ComponentScan.Filter(type = FilterType.ANNOTATION, value = ControllerAdvice.class)}) @Import({CoreApplicationContextConfiguration.class, SwaggerConfig.class}) public class SpringMvcConfiguration extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { -
sojw revised this gist
Jun 17, 2016 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ @Configuration @EnableWebMvc @EnableSwagger2 @ComponentScan(basePackages = "com.naver", useDefaultFilters = false, includeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = Controller.class), @ComponentScan.Filter(type = FilterType.ANNOTATION, value = ControllerAdvice.class)}) @Import({CoreApplicationContextConfiguration.class, SwaggerConfig.class}) public class WebMvcConfiguration extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("/static/"); // swagger 설정 registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); } } -
sojw revised this gist
Jun 17, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,15 +4,15 @@ public class SwaggerConfiguration { @Bean public Docket documentation() { return new Docket(DocumentationType.SWAGGER_2).select().apis( RequestHandlerSelectors.basePackage("api.class.packagename")).paths(PathSelectors.any()).build().pathMapping( "/").apiInfo(apiInfo()); } @Bean UiConfiguration uiConfig() { return new UiConfiguration("validatorUrl"); } private ApiInfo apiInfo() { return new ApiInfo("Swagger API", "Swagger API Desc", "1.0", "My Apps API terms of service", "[email protected]", "", ""); } } -
sojw revised this gist
Jun 17, 2016 . No changes.There are no files selected for viewing
-
sojw created this gist
Jun 17, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ @Configuration @EnableSwagger2 public class SwaggerConfiguration { @Bean public Docket documentation() { return new Docket(DocumentationType.SWAGGER_2).select().apis( RequestHandlerSelectors.basePackage("com.naver.plug.api.v1.cafe")).paths(PathSelectors.any()).build().pathMapping( "/").apiInfo(apiInfo()); } @Bean UiConfiguration uiConfig() { return new UiConfiguration("validatorUrl"); } private ApiInfo apiInfo() { return new ApiInfo("PLUG API", "PLUG API 명세서", "1.0", "My Apps API terms of service", "[email protected]", "", ""); } }