├── spring-aop ├── settings.gradle ├── src │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── aop │ │ ├── config │ │ ├── LogExclusion.java │ │ └── LogConfig.java │ │ ├── AopApplication.java │ │ └── controller │ │ └── TestController.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── spring-poi ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ ├── excel.html │ │ │ │ └── excelList.html │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springpoi │ │ │ ├── dto │ │ │ └── ExcelData.java │ │ │ ├── SpringPoiApplication.java │ │ │ ├── util │ │ │ └── ExcelUtils.java │ │ │ └── ExcelController.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springpoi │ │ └── SpringPoiApplicationTests.java ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── spring-test ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springtest │ │ │ ├── vo │ │ │ ├── Positive.java │ │ │ └── Info.java │ │ │ ├── SpringTestApplication.java │ │ │ └── controller │ │ │ └── BlogController.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springtest │ │ ├── SpringTestApplicationTests.java │ │ ├── vo │ │ └── PositiveTest.java │ │ └── controller │ │ └── BlogControllerTest.java ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── spring-caching ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springcaching │ │ │ ├── SpringCachingApplication.java │ │ │ ├── config │ │ │ └── CachingConfig.java │ │ │ ├── service │ │ │ └── CashService.java │ │ │ └── controller │ │ │ └── CachingController.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springcaching │ │ └── SpringCachingApplicationTests.java ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── spring-event ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springevent │ │ │ ├── event │ │ │ ├── RegisteredEvent.java │ │ │ └── handler │ │ │ │ └── SmsEventHandler.java │ │ │ ├── config │ │ │ └── AsyncConfig.java │ │ │ ├── SpringEventApplication.java │ │ │ ├── service │ │ │ └── RegisterService.java │ │ │ └── controller │ │ │ └── TestController.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springevent │ │ └── SpringEventApplicationTests.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore └── build.gradle ├── spring-querydsl ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springquerydsl │ │ │ ├── repository │ │ │ └── PersonRepository.java │ │ │ ├── SpringQuerydslApplication.java │ │ │ ├── predicate │ │ │ └── PersonPredicate.java │ │ │ └── domain │ │ │ └── Person.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springquerydsl │ │ ├── SpringQuerydslApplicationTests.java │ │ └── repository │ │ └── PersonRepositoryTest.java ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── spring-rest-docs ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springrestdocs │ │ │ ├── Person.java │ │ │ ├── SpringRestDocsApplication.java │ │ │ └── HelloController.java │ ├── test │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springrestdocs │ │ │ ├── SpringRestDocsApplicationTests.java │ │ │ └── HelloControllerTest.java │ └── docs │ │ └── asciidoc │ │ └── index.adoc ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── spring-validation ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── static │ │ │ │ └── warning.jpg │ │ │ └── templates │ │ │ │ ├── complete.html │ │ │ │ └── add_user.html │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springvalidation │ │ │ ├── dto │ │ │ ├── RestReponse.java │ │ │ ├── User.java │ │ │ └── Obj.java │ │ │ ├── SpringValidationApplication.java │ │ │ ├── controller │ │ │ ├── ValidController.java │ │ │ └── UserController.java │ │ │ ├── annotation │ │ │ ├── validator │ │ │ │ └── TelValidator.java │ │ │ └── Tel.java │ │ │ └── filter │ │ │ └── AjaxBadResponseHandler.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springvalidation │ │ ├── SpringValidationApplicationTests.java │ │ └── controller │ │ └── ValidControllerTest.java ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── spring-cors ├── cors-test-2 │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── templates │ │ │ │ │ └── cors.html │ │ │ └── java │ │ │ │ └── me │ │ │ │ └── shinsunyoung │ │ │ │ └── corstest2 │ │ │ │ ├── CorsTest2Application.java │ │ │ │ └── CorsController.java │ │ └── test │ │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── corstest2 │ │ │ └── CorsTest2ApplicationTests.java │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ └── build.gradle └── cors-test-1 │ ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── corstest1 │ │ │ ├── CorsTest1Application.java │ │ │ ├── GreetingController.java │ │ │ └── WebConfig.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── corstest1 │ │ └── CorsTest1ApplicationTests.java │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── .gitignore │ └── build.gradle ├── spring-security ├── settings.gradle ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── message │ │ │ │ └── security_message.properties │ │ │ ├── static │ │ │ │ └── img │ │ │ │ │ └── info.jpeg │ │ │ └── templates │ │ │ │ ├── admin.html │ │ │ │ ├── main.html │ │ │ │ ├── signup.html │ │ │ │ └── login.html │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springsecurity │ │ │ ├── dto │ │ │ └── UserInfoDto.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ ├── SpringSecurityApplication.java │ │ │ ├── config │ │ │ ├── MvcConfig.java │ │ │ ├── SecurityMessageConfig.java │ │ │ └── WebSecurityConfig.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── service │ │ │ └── UserService.java │ │ │ └── domain │ │ │ └── UserInfo.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springsecurity │ │ └── SpringSecurityApplicationTests.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── intelliJ-plugin ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ └── main │ │ ├── java │ │ ├── action │ │ │ ├── MyEdit.java │ │ │ ├── MyForm.java │ │ │ └── TopMenu.java │ │ └── ui │ │ │ ├── TestForm.java │ │ │ └── TestForm.form │ │ └── resources │ │ └── META-INF │ │ └── plugin.xml ├── build.gradle ├── .gitignore ├── gradlew.bat └── gradlew ├── spring-map-struct ├── settings.gradle ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ └── hello.html │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springmapstruct │ │ │ ├── mapper │ │ │ ├── EntityMapper.java │ │ │ └── PeopleMapper.java │ │ │ ├── repository │ │ │ └── PeopleRepository.java │ │ │ ├── SpringMapStructApplication.java │ │ │ ├── service │ │ │ ├── dto │ │ │ │ └── PeopleDTO.java │ │ │ └── PeopleService.java │ │ │ ├── entity │ │ │ └── People.java │ │ │ └── controller │ │ │ └── PeopleController.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springmapstruct │ │ └── SpringMapStructApplicationTests.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── .gitignore ├── spring-jwt ├── src │ ├── main │ │ ├── resources │ │ │ └── application.yml │ │ └── java │ │ │ └── me │ │ │ └── shinsunyoung │ │ │ └── springjwt │ │ │ ├── user │ │ │ ├── model │ │ │ │ ├── response │ │ │ │ │ ├── LoginUserResponse.java │ │ │ │ │ └── AddUserResponse.java │ │ │ │ ├── LoginUserDto.java │ │ │ │ ├── AddUserDto.java │ │ │ │ └── UserDto.java │ │ │ ├── repository │ │ │ │ └── UserRepository.java │ │ │ ├── api │ │ │ │ ├── User.http │ │ │ │ └── UserApi.java │ │ │ ├── domain │ │ │ │ └── User.java │ │ │ └── service │ │ │ │ └── UserAccountService.java │ │ │ ├── base │ │ │ ├── jwt │ │ │ │ ├── JwtProperties.java │ │ │ │ ├── JwtAuthenticationFilter.java │ │ │ │ └── JwtTokenProvider.java │ │ │ └── config │ │ │ │ └── WebSecurityConfig.java │ │ │ └── SpringJwtApplication.java │ └── test │ │ └── java │ │ └── me │ │ └── shinsunyoung │ │ └── springjwt │ │ └── SpringJwtApplicationTests.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore └── build.gradle └── .github └── ISSUE_TEMPLATE └── example-code-issue-template.md /spring-aop/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'aop' 2 | -------------------------------------------------------------------------------- /spring-aop/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-poi/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-caching/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-event/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-poi/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-poi' 2 | -------------------------------------------------------------------------------- /spring-querydsl/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-rest-docs/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-test/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-test' 2 | -------------------------------------------------------------------------------- /spring-validation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-caching/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-caching' 2 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-querydsl/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-querydsl' 2 | -------------------------------------------------------------------------------- /spring-security/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-security' 2 | -------------------------------------------------------------------------------- /intelliJ-plugin/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'intelliJ-plugin' 2 | 3 | -------------------------------------------------------------------------------- /spring-map-struct/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-map-struct' 2 | -------------------------------------------------------------------------------- /spring-rest-docs/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-rest-docs' 2 | -------------------------------------------------------------------------------- /spring-validation/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-validation' 2 | -------------------------------------------------------------------------------- /spring-cors/cors-test-1/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=1000 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | **/bin/ 3 | 4 | **/settings.gradle 5 | **/gradlew.bat 6 | **/gradlew -------------------------------------------------------------------------------- /spring-security/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console -------------------------------------------------------------------------------- /spring-map-struct/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | -------------------------------------------------------------------------------- /spring-jwt/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | jwt: 2 | issuer: ajufresh@gmail.com 3 | secretKey: secretKey 4 | tokenPrefix: Bearer -------------------------------------------------------------------------------- /spring-security/src/main/resources/message/security_message.properties: -------------------------------------------------------------------------------- 1 | AbstractUserDetailsAuthenticationProvider.badCredentials = 아이디나 비밀번호를 확인해주세요. -------------------------------------------------------------------------------- /spring-aop/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-aop/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-event/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-event/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-jwt/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-jwt/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-poi/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-poi/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-caching/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-caching/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /intelliJ-plugin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/intelliJ-plugin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-map-struct/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-map-struct/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-querydsl/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-querydsl/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-rest-docs/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-rest-docs/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-security/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-security/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-validation/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-validation/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-security/src/main/resources/static/img/info.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-security/src/main/resources/static/img/info.jpeg -------------------------------------------------------------------------------- /spring-validation/src/main/resources/static/warning.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-validation/src/main/resources/static/warning.jpg -------------------------------------------------------------------------------- /spring-cors/cors-test-1/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-cors/cors-test-1/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-cors/cors-test-2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinsunyoung/example-code/HEAD/spring-cors/cors-test-2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/example-code-issue-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: example code issue template 3 | about: add or edit 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | > description 11 | -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/mapper/EntityMapper.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct.mapper; 2 | 3 | 4 | public interface EntityMapper { 5 | 6 | E toEntity(D dto); 7 | 8 | D toDto(E entity); 9 | 10 | } -------------------------------------------------------------------------------- /spring-aop/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-jwt/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-poi/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /intelliJ-plugin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-caching/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-event/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-map-struct/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-querydsl/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-security/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-validation/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-rest-docs/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-cors/cors-test-1/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-validation/src/main/resources/templates/complete.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Validation Example 6 | 7 | 8 |

회원가입이 완료되었습니다!

9 | 10 | -------------------------------------------------------------------------------- /spring-poi/src/main/java/me/shinsunyoung/springpoi/dto/ExcelData.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springpoi.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class ExcelData { 9 | 10 | private Integer num; 11 | 12 | private String name; 13 | 14 | private String email; 15 | 16 | } -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/dto/UserInfoDto.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class UserInfoDto { 9 | private String email; 10 | private String password; 11 | 12 | private String auth; 13 | } 14 | -------------------------------------------------------------------------------- /spring-event/src/main/java/me/shinsunyoung/springevent/event/RegisteredEvent.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springevent.event; 2 | 3 | public class RegisteredEvent { 4 | 5 | private String name; 6 | 7 | public RegisteredEvent(String name) { 8 | this.name = name; 9 | } 10 | 11 | public String getName() { 12 | return name; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-jwt/src/test/java/me/shinsunyoung/springjwt/SpringJwtApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringJwtApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-poi/src/test/java/me/shinsunyoung/springpoi/SpringPoiApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springpoi; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringPoiApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-test/src/test/java/me/shinsunyoung/springtest/SpringTestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springtest; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringTestApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /intelliJ-plugin/src/main/java/action/MyEdit.java: -------------------------------------------------------------------------------- 1 | package action; 2 | 3 | import com.intellij.openapi.actionSystem.AnAction; 4 | import com.intellij.openapi.actionSystem.AnActionEvent; 5 | 6 | public class MyEdit extends AnAction { 7 | 8 | @Override 9 | public void actionPerformed(AnActionEvent e) { 10 | // TODO: insert action logic here 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-cors/cors-test-1/src/test/java/me/shinsunyoung/corstest1/CorsTest1ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.corstest1; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CorsTest1ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/src/test/java/me/shinsunyoung/corstest2/CorsTest2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.corstest2; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CorsTest2ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-event/src/test/java/me/shinsunyoung/springevent/SpringEventApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springevent; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringEventApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-event/src/main/java/me/shinsunyoung/springevent/config/AsyncConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springevent.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.scheduling.annotation.EnableAsync; 5 | 6 | @EnableAsync 7 | @Configuration 8 | public class AsyncConfig { 9 | 10 | // 추가로 스레드 관리 가능 11 | 12 | } 13 | -------------------------------------------------------------------------------- /spring-caching/src/test/java/me/shinsunyoung/springcaching/SpringCachingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springcaching; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringCachingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-querydsl/src/test/java/me/shinsunyoung/springquerydsl/SpringQuerydslApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springquerydsl; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringQuerydslApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-rest-docs/src/test/java/me/shinsunyoung/springrestdocs/SpringRestDocsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springrestdocs; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringRestDocsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-security/src/test/java/me/shinsunyoung/springsecurity/SpringSecurityApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringSecurityApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-map-struct/src/test/java/me/shinsunyoung/springmapstruct/SpringMapStructApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringMapStructApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-rest-docs/src/docs/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | == 인사하기 2 | 3 | === Request 4 | 5 | CURL: 6 | include::{snippets}/hello/curl-request.adoc[] 7 | 8 | Request Parameters: 9 | include::{snippets}/hello/http-request.adoc[] 10 | 11 | Request HTTP Example: 12 | include::{snippets}/hello/http-request.adoc[] 13 | 14 | === Response 15 | Response: 16 | include::{snippets}/hello/http-response.adoc[] -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/model/response/LoginUserResponse.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.model.response; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class LoginUserResponse { 7 | 8 | private final String accessToken; 9 | 10 | public LoginUserResponse(String accessToken) { 11 | this.accessToken = accessToken; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-validation/src/test/java/me/shinsunyoung/springvalidation/SpringValidationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringValidationApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-test/src/main/java/me/shinsunyoung/springtest/vo/Positive.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springtest.vo; 2 | 3 | public class Positive { 4 | 5 | private int number; 6 | private boolean isPositive; 7 | 8 | public boolean isPositive() { 9 | return isPositive; 10 | } 11 | 12 | public Positive(int number) { 13 | this.number = number; 14 | this.isPositive = number > 0; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-aop/src/main/java/me/shinsunyoung/aop/config/LogExclusion.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.aop.config; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.METHOD}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface LogExclusion { 11 | 12 | } 13 | 14 | -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/mapper/PeopleMapper.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct.mapper; 2 | 3 | import me.shinsunyoung.springmapstruct.entity.People; 4 | import me.shinsunyoung.springmapstruct.service.dto.PeopleDTO; 5 | import org.mapstruct.Mapper; 6 | 7 | @Mapper(componentModel = "spring") 8 | public interface PeopleMapper extends EntityMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.repository; 2 | 3 | 4 | import java.util.Optional; 5 | import me.shinsunyoung.springjwt.user.domain.User; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | public interface UserRepository extends JpaRepository { 9 | 10 | Optional findByEmail(String email); 11 | } 12 | -------------------------------------------------------------------------------- /intelliJ-plugin/src/main/java/action/MyForm.java: -------------------------------------------------------------------------------- 1 | package action; 2 | 3 | import com.intellij.openapi.actionSystem.AnAction; 4 | import com.intellij.openapi.actionSystem.AnActionEvent; 5 | import ui.TestForm; 6 | 7 | public class MyForm extends AnAction { 8 | 9 | @Override 10 | public void actionPerformed(AnActionEvent e) { 11 | 12 | TestForm testForm = new TestForm(); 13 | 14 | testForm.onShowing(); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.repository; 2 | 3 | import java.util.Optional; 4 | import me.shinsunyoung.springsecurity.domain.UserInfo; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | public interface UserRepository extends JpaRepository { 8 | Optional findByEmail(String email); 9 | } 10 | -------------------------------------------------------------------------------- /spring-test/src/main/java/me/shinsunyoung/springtest/vo/Info.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springtest.vo; 2 | 3 | public class Info { 4 | 5 | private String name; 6 | private String id; 7 | 8 | public Info(String name, String id) { 9 | this.name = name; 10 | this.id = id; 11 | } 12 | 13 | public String getName() { 14 | return name; 15 | } 16 | 17 | public String getId() { 18 | return id; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/dto/RestReponse.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.dto; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class RestReponse { 7 | 8 | private boolean success; 9 | private String message; 10 | private Object data; 11 | 12 | public RestReponse(boolean success, String message) { 13 | this.success = success; 14 | this.message = message; 15 | } 16 | } -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/repository/PeopleRepository.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct.repository; 2 | 3 | 4 | import me.shinsunyoung.springmapstruct.entity.People; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface PeopleRepository extends JpaRepository { 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/model/LoginUserDto.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.model; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Setter 7 | @Getter 8 | public class LoginUserDto { 9 | 10 | private String email; 11 | private String password; 12 | 13 | public LoginUserDto(String email, String password) { 14 | this.email = email; 15 | this.password = password; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-poi/src/main/java/me/shinsunyoung/springpoi/SpringPoiApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springpoi; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringPoiApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringPoiApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-test/src/main/java/me/shinsunyoung/springtest/SpringTestApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springtest; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringTestApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringTestApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-cors/cors-test-1/src/main/java/me/shinsunyoung/corstest1/CorsTest1Application.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.corstest1; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CorsTest1Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CorsTest1Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/src/main/java/me/shinsunyoung/corstest2/CorsTest2Application.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.corstest2; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CorsTest2Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CorsTest2Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/SpringSecurityApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringSecurityApplication { 8 | public static void main(String[] args) { 9 | SpringApplication.run(SpringSecurityApplication.class, args); 10 | } 11 | } -------------------------------------------------------------------------------- /spring-poi/src/main/resources/templates/excel.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 엑셀 업로드 6 | 7 | 8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /intelliJ-plugin/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'org.jetbrains.intellij' version '0.4.20' 4 | } 5 | 6 | group 'me.shinsunyoung' 7 | version '1.0' 8 | 9 | sourceCompatibility = 1.8 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | testCompile group: 'junit', name: 'junit', version: '4.12' 17 | } 18 | 19 | // See https://github.com/JetBrains/gradle-intellij-plugin/ 20 | intellij { 21 | version '2019.3.4' 22 | } -------------------------------------------------------------------------------- /spring-cors/cors-test-1/src/main/java/me/shinsunyoung/corstest1/GreetingController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.corstest1; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | //@CrossOrigin(origins = "http://localhost:8080") 7 | @RestController 8 | public class GreetingController { 9 | 10 | @GetMapping("/hello") 11 | public String hello() { 12 | return "안녕하세요?"; 13 | } 14 | } -------------------------------------------------------------------------------- /spring-caching/src/main/java/me/shinsunyoung/springcaching/SpringCachingApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springcaching; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringCachingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringCachingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-querydsl/src/main/java/me/shinsunyoung/springquerydsl/repository/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springquerydsl.repository; 2 | 3 | import me.shinsunyoung.springquerydsl.domain.Person; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.querydsl.QuerydslPredicateExecutor; 6 | 7 | public interface PersonRepository extends JpaRepository, 8 | QuerydslPredicateExecutor { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /spring-rest-docs/src/main/java/me/shinsunyoung/springrestdocs/Person.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springrestdocs; 2 | 3 | public class Person { 4 | 5 | private String name; 6 | private String message; 7 | 8 | public Person(String name, String message) { 9 | this.name = name; 10 | this.message = message; 11 | } 12 | 13 | public String getName() { 14 | return name; 15 | } 16 | 17 | public String getMessage() { 18 | return message; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-querydsl/src/main/java/me/shinsunyoung/springquerydsl/SpringQuerydslApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springquerydsl; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringQuerydslApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringQuerydslApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-rest-docs/src/main/java/me/shinsunyoung/springrestdocs/SpringRestDocsApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springrestdocs; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringRestDocsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringRestDocsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/SpringMapStructApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringMapStructApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringMapStructApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/service/dto/PeopleDTO.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct.service.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class PeopleDTO { 9 | 10 | /** 11 | * 유저의 아이디 (PK) 12 | */ 13 | private Long id; 14 | 15 | /** 16 | * 유저의 이름 17 | */ 18 | private String name; 19 | 20 | /** 21 | * 유저의 나이 22 | */ 23 | private String age; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spring-poi/src/main/java/me/shinsunyoung/springpoi/util/ExcelUtils.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springpoi.util; 2 | 3 | public class ExcelUtils { 4 | 5 | private ExcelUtils() { 6 | 7 | } 8 | 9 | public static boolean isExcel(String mime, String extension) { 10 | return mime.equals("application/x-tika-ooxml") && // Microsoft Office 파일의 MIME은 application/x-tika-ooxml 11 | extension.equals("xlsx") || extension.equals("xls"); // 확장자가 xls 또는 xlsx 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/SpringValidationApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringValidationApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringValidationApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-aop/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /spring-poi/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /intelliJ-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /spring-caching/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /spring-security/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/model/response/AddUserResponse.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.model.response; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import me.shinsunyoung.springjwt.user.domain.User; 6 | 7 | @Setter 8 | @Getter 9 | public class AddUserResponse { 10 | 11 | private String email; 12 | private Long id; 13 | 14 | public AddUserResponse(User user) { 15 | this.email = user.getEmail(); 16 | this.id = user.getId(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spring-map-struct/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /spring-map-struct/src/main/resources/templates/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

회원정보 입력

9 | 10 |
11 | 이름 : 12 | 나이 : 13 | 14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /spring-validation/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /spring-aop/src/main/java/me/shinsunyoung/aop/AopApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.aop; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 6 | 7 | @SpringBootApplication 8 | @EnableAspectJAutoProxy // 추가 9 | public class AopApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(AopApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-event/src/main/java/me/shinsunyoung/springevent/SpringEventApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springevent; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | 7 | 8 | @SpringBootApplication 9 | public class SpringEventApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringEventApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/model/AddUserDto.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.model; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import me.shinsunyoung.springjwt.user.domain.User; 6 | 7 | @Setter 8 | @Getter 9 | public class AddUserDto { 10 | 11 | private String email; 12 | private String password; 13 | 14 | public User toEntity(String encodePassword) { 15 | return User.builder() 16 | .email(email) 17 | .password(encodePassword) 18 | .build(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-querydsl/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | **/settings.gradle 8 | **/gradlew.bat 9 | **/gradlew 10 | 11 | ### STS ### 12 | .apt_generated 13 | .classpath 14 | .factorypath 15 | .project 16 | .settings 17 | .springBeans 18 | .sts4-cache 19 | 20 | ### IntelliJ IDEA ### 21 | .idea 22 | *.iws 23 | *.iml 24 | *.ipr 25 | out/ 26 | 27 | ### NetBeans ### 28 | /nbproject/private/ 29 | /nbbuild/ 30 | /dist/ 31 | /nbdist/ 32 | /.nb-gradle/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | -------------------------------------------------------------------------------- /spring-event/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | !**/src/main/**/out/ 24 | !**/src/test/**/out/ 25 | 26 | ### NetBeans ### 27 | /nbproject/private/ 28 | /nbbuild/ 29 | /dist/ 30 | /nbdist/ 31 | /.nb-gradle/ 32 | 33 | ### VS Code ### 34 | .vscode/ 35 | -------------------------------------------------------------------------------- /spring-test/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | !**/src/main/**/out/ 24 | !**/src/test/**/out/ 25 | 26 | ### NetBeans ### 27 | /nbproject/private/ 28 | /nbbuild/ 29 | /dist/ 30 | /nbdist/ 31 | /.nb-gradle/ 32 | 33 | ### VS Code ### 34 | .vscode/ 35 | -------------------------------------------------------------------------------- /spring-rest-docs/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | !**/src/main/**/out/ 24 | !**/src/test/**/out/ 25 | 26 | ### NetBeans ### 27 | /nbproject/private/ 28 | /nbbuild/ 29 | /dist/ 30 | /nbdist/ 31 | /.nb-gradle/ 32 | 33 | ### VS Code ### 34 | .vscode/ 35 | -------------------------------------------------------------------------------- /spring-cors/cors-test-1/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | !**/src/main/**/out/ 24 | !**/src/test/**/out/ 25 | 26 | ### NetBeans ### 27 | /nbproject/private/ 28 | /nbbuild/ 29 | /dist/ 30 | /nbdist/ 31 | /.nb-gradle/ 32 | 33 | ### VS Code ### 34 | .vscode/ 35 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | !**/src/main/**/out/ 24 | !**/src/test/**/out/ 25 | 26 | ### NetBeans ### 27 | /nbproject/private/ 28 | /nbbuild/ 29 | /dist/ 30 | /nbdist/ 31 | /.nb-gradle/ 32 | 33 | ### VS Code ### 34 | .vscode/ 35 | -------------------------------------------------------------------------------- /intelliJ-plugin/src/main/java/action/TopMenu.java: -------------------------------------------------------------------------------- 1 | package action; 2 | 3 | import com.intellij.openapi.actionSystem.AnAction; 4 | import com.intellij.openapi.actionSystem.AnActionEvent; 5 | import com.intellij.openapi.project.Project; 6 | import com.intellij.openapi.ui.Messages; 7 | 8 | public class TopMenu extends AnAction { 9 | 10 | @Override 11 | public void actionPerformed(AnActionEvent anActionEvent) { 12 | Project project = anActionEvent.getProject(); 13 | 14 | Messages.showMessageDialog(project, "안녕하세요! 좋은 하루 되세요", "아침인사", Messages.getInformationIcon()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/src/main/resources/templates/cors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /spring-cors/cors-test-1/src/main/java/me/shinsunyoung/corstest1/WebConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.corstest1; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | // @Override 11 | // public void addCorsMappings(CorsRegistry registry) { 12 | // registry.addMapping("/**") 13 | // .allowedOrigins("http://localhost:8080"); 14 | // } 15 | } 16 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/controller/ValidController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.controller; 2 | 3 | import javax.validation.Valid; 4 | import me.shinsunyoung.springvalidation.dto.Obj; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class ValidController { 11 | @PostMapping("/valid") 12 | public Obj valid(@RequestBody @Valid Obj object){ 13 | return object; 14 | } 15 | } -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/base/jwt/JwtProperties.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.base.jwt; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.boot.context.properties.ConstructorBinding; 7 | 8 | @RequiredArgsConstructor 9 | @Getter 10 | @ConstructorBinding 11 | @ConfigurationProperties(prefix = "jwt") 12 | public class JwtProperties { 13 | 14 | private final String issuer; 15 | private final String secretKey; 16 | private final String tokenPrefix; 17 | } 18 | -------------------------------------------------------------------------------- /spring-jwt/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | bin/ 17 | !**/src/main/**/bin/ 18 | !**/src/test/**/bin/ 19 | 20 | ### IntelliJ IDEA ### 21 | .idea 22 | *.iws 23 | *.iml 24 | *.ipr 25 | out/ 26 | !**/src/main/**/out/ 27 | !**/src/test/**/out/ 28 | 29 | ### NetBeans ### 30 | /nbproject/private/ 31 | /nbbuild/ 32 | /dist/ 33 | /nbdist/ 34 | /.nb-gradle/ 35 | 36 | ### VS Code ### 37 | .vscode/ 38 | -------------------------------------------------------------------------------- /spring-rest-docs/src/main/java/me/shinsunyoung/springrestdocs/HelloController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springrestdocs; 2 | 3 | import org.springframework.http.ResponseEntity; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @RestController 9 | public class HelloController { 10 | 11 | @GetMapping("/hello/{name}") 12 | public ResponseEntity hello(@PathVariable String name) { 13 | return ResponseEntity.ok() 14 | .body(new Person(name, "안녕하세요!")); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/SpringJwtApplication.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt; 2 | 3 | import me.shinsunyoung.springjwt.base.jwt.JwtProperties; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 7 | 8 | @EnableConfigurationProperties({JwtProperties.class}) 9 | @SpringBootApplication 10 | public class SpringJwtApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringJwtApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/annotation/validator/TelValidator.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.annotation.validator; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | import me.shinsunyoung.springvalidation.annotation.Tel; 6 | 7 | public class TelValidator implements ConstraintValidator { 8 | 9 | @Override 10 | public boolean isValid(String value, ConstraintValidatorContext context) { 11 | if (value == null) { 12 | return false; 13 | } 14 | 15 | return value.matches("(01[016789])(\\d{3,4})(\\d{4})"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-event/src/main/java/me/shinsunyoung/springevent/service/RegisterService.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springevent.service; 2 | 3 | import me.shinsunyoung.springevent.event.RegisteredEvent; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.ApplicationEventPublisher; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class RegisterService { 10 | 11 | @Autowired 12 | ApplicationEventPublisher publisher; 13 | 14 | public void hello(String name) { 15 | // 회원가입 처리 로직 16 | System.out.println("회원 추가 완료"); 17 | publisher.publishEvent(new RegisteredEvent(name)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring-cors/cors-test-1/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.3.2.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '1.8' 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | implementation 'org.springframework.boot:spring-boot-starter-web' 17 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 18 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 19 | } 20 | } 21 | 22 | test { 23 | useJUnitPlatform() 24 | } 25 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/admin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | admin 6 | 7 | 8 |

관리자 전용 페이지

9 | ID :
10 | 소유 권한 :
11 | 12 |
13 | 14 | 15 |
16 | 17 | -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/entity/People.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct.entity; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | @Setter 11 | @Getter 12 | @Entity 13 | public class People { 14 | 15 | /** 16 | * 유저의 아이디 (PK) 17 | */ 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.IDENTITY) 20 | private Long id; 21 | 22 | /** 23 | * 유저의 이름 24 | */ 25 | private String name; 26 | 27 | /** 28 | * 유저의 나이 29 | */ 30 | private String age; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/main.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | main 7 | 8 | 9 |

회원 전용 페이지

10 | ID :
11 | 소유 권한 :
12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /spring-caching/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.7.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '1.0' 9 | sourceCompatibility = '1.8' 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | implementation 'org.springframework.boot:spring-boot-starter-web' 17 | compile('org.springframework.boot:spring-boot-starter-cache') 18 | 19 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 20 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 21 | } 22 | } 23 | 24 | test { 25 | useJUnitPlatform() 26 | } 27 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/signup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sign up 6 | 7 | 8 |

Sign Up


9 | 10 |
11 | email :
12 | password :
13 | admin 14 | user
15 | 16 |

17 | 18 | Go to login → 19 | 20 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/annotation/Tel.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | import javax.validation.Constraint; 8 | import me.shinsunyoung.springvalidation.annotation.validator.TelValidator; 9 | 10 | @Target(ElementType.FIELD) // 필드에 적용 11 | @Retention(RetentionPolicy.RUNTIME) // 실행할동안 어노테이션 유지 12 | @Constraint(validatedBy = TelValidator.class) 13 | public @interface Tel { 14 | String message() default "휴대폰 번호"; // 오류 메세지 default 15 | Class[] groups() default {}; 16 | Class[] payload() default {}; 17 | } 18 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.3.2.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '1.8' 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | implementation 'org.springframework.boot:spring-boot-starter-web' 17 | implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 18 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 19 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 20 | } 21 | } 22 | 23 | test { 24 | useJUnitPlatform() 25 | } 26 | -------------------------------------------------------------------------------- /spring-event/src/main/java/me/shinsunyoung/springevent/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springevent.controller; 2 | 3 | import me.shinsunyoung.springevent.service.RegisterService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @Autowired 13 | RegisterService service; 14 | 15 | @GetMapping("/register/{name}") 16 | public void register(@PathVariable String name) { 17 | service.hello(name); 18 | System.out.println("회원가입을 완료했어요"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /spring-querydsl/src/main/java/me/shinsunyoung/springquerydsl/predicate/PersonPredicate.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springquerydsl.predicate; 2 | 3 | import com.querydsl.core.BooleanBuilder; 4 | 5 | import com.querydsl.core.types.Predicate; 6 | import me.shinsunyoung.springquerydsl.domain.QPerson; 7 | 8 | public class PersonPredicate { 9 | 10 | 11 | public static Predicate search(String firstName, String lastName){ 12 | QPerson person = QPerson.person; 13 | 14 | BooleanBuilder builder = new BooleanBuilder(); 15 | 16 | if(firstName != null){ 17 | builder.and(person.firstName.eq(firstName)); 18 | } 19 | if(lastName != null){ 20 | builder.and(person.lastName.eq(lastName)); 21 | } 22 | return builder; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/api/User.http: -------------------------------------------------------------------------------- 1 | ### 1. 일반 접근 - 403 2 | GET http://localhost:8080/hello 3 | 4 | ### 2. 회원가입 5 | POST http://localhost:8080/sign-up 6 | Content-Type: application/json 7 | 8 | { 9 | "email": "ajufresh@gmail.com", 10 | "password": "password" 11 | } 12 | 13 | 14 | ### 3. 로그인 15 | POST http://localhost:8080/sign-in 16 | Content-Type: application/json 17 | 18 | { 19 | "email": "ajufresh@gmail.com", 20 | "password": "password" 21 | } 22 | 23 | 24 | ### 4. 헤더 접근 25 | GET http://localhost:8080/hello 26 | Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhanVmcmVzaEBnbWFpbC5jb20iLCJpYXQiOjE2MjIzNzkxODAsImV4cCI6MTYyMjM4MDk4MCwiaWQiOjEsImVtYWlsIjoiYWp1ZnJlc2hAZ21haWwuY29tIn0.IcVVZciv6UdnDSyAZLfUXe9iSctufLBMnO6Oy0tX-Og -------------------------------------------------------------------------------- /spring-test/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.3.2.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '1.0' 9 | sourceCompatibility = '1.8' 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | implementation 'org.springframework.boot:spring-boot-starter-web' 17 | testCompile("pl.pragmatists:JUnitParams:1.1.0") 18 | testCompile("org.springframework.boot:spring-boot-starter-test") 19 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 20 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 21 | } 22 | } 23 | 24 | test { 25 | useJUnitPlatform() 26 | } 27 | -------------------------------------------------------------------------------- /spring-cors/cors-test-2/src/main/java/me/shinsunyoung/corstest2/CorsController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.corstest2; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | import org.springframework.web.client.RestTemplate; 7 | 8 | @Controller 9 | public class CorsController { 10 | 11 | @GetMapping("/api/view") 12 | public String view() { 13 | return "/cors"; 14 | } 15 | 16 | @GetMapping("/api/proxy") 17 | @ResponseBody 18 | public String proxy() { 19 | String url = "http://localhost:1000/hello"; 20 | 21 | RestTemplate restTemplate = new RestTemplate(); 22 | return restTemplate.getForObject(url, String.class); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-poi/src/main/resources/templates/excelList.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
#이름이메일
26 | 27 | -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/config/MvcConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class MvcConfig implements WebMvcConfigurer { 9 | 10 | // 요청 - 뷰 연결 11 | public void addViewControllers(ViewControllerRegistry registry) { 12 | registry.addViewController("/").setViewName("main"); 13 | registry.addViewController("/login").setViewName("login"); 14 | registry.addViewController("/admin").setViewName("admin"); 15 | registry.addViewController("/signup").setViewName("signup"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /intelliJ-plugin/src/main/java/ui/TestForm.java: -------------------------------------------------------------------------------- 1 | package ui; 2 | 3 | import java.awt.BorderLayout; 4 | import javax.swing.JButton; 5 | import javax.swing.JDialog; 6 | import javax.swing.JLabel; 7 | import javax.swing.JPanel; 8 | import javax.swing.JTextField; 9 | 10 | public class TestForm { 11 | 12 | private JDialog dialog = new JDialog(); 13 | 14 | private JButton search; 15 | private JTextField textField; 16 | private JPanel panel; 17 | private JLabel label; 18 | 19 | public void onShowing(){ 20 | 21 | dialog.add(panel, BorderLayout.CENTER); 22 | dialog.pack(); 23 | dialog.setLocation(200, 200); 24 | dialog.setVisible(true); 25 | 26 | search.addActionListener(event -> onClick()); 27 | } 28 | 29 | private void onClick() { 30 | label.setText(textField.getText()); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/model/UserDto.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.model; 2 | 3 | import io.jsonwebtoken.Claims; 4 | import java.util.Collection; 5 | import java.util.Collections; 6 | import lombok.Getter; 7 | import org.springframework.security.core.GrantedAuthority; 8 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 9 | 10 | @Getter 11 | public class UserDto { 12 | 13 | private final Long id; 14 | private final String email; 15 | 16 | public UserDto(Claims claims) { 17 | this.id = claims.get("id", Long.class); 18 | this.email = claims.get("email", String.class); 19 | } 20 | 21 | public Collection getAuthorities() { 22 | return Collections.singleton(new SimpleGrantedAuthority("ROLE_USER")); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-aop/src/main/java/me/shinsunyoung/aop/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.aop.controller; 2 | 3 | import me.shinsunyoung.aop.config.LogExclusion; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @PostMapping("/test") 13 | public String test(@RequestBody String request){ 14 | return request; 15 | } 16 | 17 | @GetMapping("/test1") 18 | public void test1(){ 19 | System.out.println("TEST1"); 20 | } 21 | 22 | @LogExclusion // 로깅 제외 23 | @GetMapping("/test2") 24 | public void test2(){ 25 | System.out.println("TEST2"); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /spring-caching/src/main/java/me/shinsunyoung/springcaching/config/CachingConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springcaching.config; 2 | 3 | import java.util.Arrays; 4 | import org.springframework.cache.CacheManager; 5 | import org.springframework.cache.annotation.EnableCaching; 6 | import org.springframework.cache.concurrent.ConcurrentMapCache; 7 | import org.springframework.cache.support.SimpleCacheManager; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | @Configuration 12 | @EnableCaching 13 | public class CachingConfig { 14 | 15 | @Bean 16 | public CacheManager cacheManager() { 17 | SimpleCacheManager cacheManager = new SimpleCacheManager(); 18 | cacheManager.setCaches(Arrays.asList( 19 | new ConcurrentMapCache("product"))); 20 | return cacheManager; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /spring-event/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.3.3.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.10.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '1.0' 9 | sourceCompatibility = '1.8' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | implementation 'org.springframework.boot:spring-boot-starter-web' 23 | compileOnly 'org.projectlombok:lombok' 24 | annotationProcessor 'org.projectlombok:lombok' 25 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 26 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 27 | } 28 | } 29 | 30 | test { 31 | useJUnitPlatform() 32 | } 33 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/dto/User.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.dto; 2 | 3 | import java.io.Serializable; 4 | import javax.validation.constraints.Email; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.Pattern; 7 | import javax.validation.constraints.Size; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | @Getter 12 | @Setter 13 | public class User implements Serializable { 14 | 15 | @NotBlank(message = "이메일을 입력해주세요.") 16 | @Email(message = "이메일 형식을 맞춰주세요.") 17 | private String email; 18 | 19 | @NotBlank(message = "이름을 입력해주세요.") 20 | @Size(min = 2, max = 8, message = "이름을 2~8자 사이로 입력해주세요.") 21 | private String name; 22 | 23 | @Pattern(regexp="[a-zA-Z1-9]{6,12}", message = "비밀번호는 영어와 숫자로 포함해서 6~12자리 이내로 입력해주세요.") 24 | private String password; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | login 6 | 7 | 8 |

Login


9 | 10 | 11 |
12 | 13 | email :
14 | password :
15 | 16 |

17 | 18 |
19 | 20 |
21 | 22 | Go to join! → 23 | 24 | -------------------------------------------------------------------------------- /spring-test/src/main/java/me/shinsunyoung/springtest/controller/BlogController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springtest.controller; 2 | 3 | import me.shinsunyoung.springtest.vo.Info; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | public class BlogController { 12 | 13 | @GetMapping("/blog") 14 | public String blogGet(@RequestParam String name, @RequestParam String id){ 15 | return name + "의 블로그입니다. " + id; 16 | } 17 | 18 | 19 | @PostMapping("/blog") 20 | public String blogPost(@RequestBody Info info){ 21 | return info.getName() + "의 블로그입니다. " + info.getId(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /spring-event/src/main/java/me/shinsunyoung/springevent/event/handler/SmsEventHandler.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springevent.event.handler; 2 | 3 | import me.shinsunyoung.springevent.event.RegisteredEvent; 4 | import org.springframework.context.event.EventListener; 5 | import org.springframework.scheduling.annotation.Async; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class SmsEventHandler { 10 | 11 | @Async 12 | @EventListener 13 | public void sendSms(RegisteredEvent event) throws InterruptedException { 14 | Thread.sleep(2000); 15 | System.out.println(event.getName() + "님에게 가입 축하 메세지를 전송했습니다."); 16 | } 17 | 18 | @Async 19 | @EventListener 20 | public void makeCoupon(RegisteredEvent event) throws InterruptedException { 21 | Thread.sleep(1000); 22 | System.out.println(event.getName() + "님에게 쿠폰을 전송했습니다."); 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/filter/AjaxBadResponseHandler.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.filter; 2 | 3 | import me.shinsunyoung.springvalidation.dto.RestReponse; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.MethodArgumentNotValidException; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.RestControllerAdvice; 8 | 9 | @RestControllerAdvice 10 | public class AjaxBadResponseHandler { 11 | 12 | @ExceptionHandler(MethodArgumentNotValidException.class) 13 | public ResponseEntity validException( 14 | MethodArgumentNotValidException ex) { 15 | 16 | RestReponse restReponse = new RestReponse(false, 17 | "유효성 검사 실패 : " + ex.getBindingResult().getAllErrors().get(0).getDefaultMessage()); 18 | 19 | return ResponseEntity.badRequest() 20 | .body(restReponse); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /spring-jwt/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.5.0' 3 | id 'io.spring.dependency-management' version '1.0.11.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '1.0' 9 | sourceCompatibility = '11' 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 17 | implementation 'org.springframework.boot:spring-boot-starter-security' 18 | implementation 'org.springframework.boot:spring-boot-starter-web' 19 | implementation 'io.jsonwebtoken:jjwt:0.9.1' 20 | compileOnly 'org.projectlombok:lombok' 21 | runtimeOnly 'com.h2database:h2' 22 | annotationProcessor 'org.projectlombok:lombok' 23 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 24 | testImplementation 'org.springframework.security:spring-security-test' 25 | } 26 | 27 | test { 28 | useJUnitPlatform() 29 | } 30 | -------------------------------------------------------------------------------- /spring-aop/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.6.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '1.8' 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | implementation 'org.springframework.boot:spring-boot-starter-web' 17 | testCompile("org.springframework.boot:spring-boot-starter-test") 18 | compile('org.springframework.boot:spring-boot-starter-aop') 19 | 20 | compileOnly 'org.projectlombok:lombok' 21 | annotationProcessor 'org.projectlombok:lombok' 22 | 23 | compile group: 'com.google.guava', name: 'guava', version: '18.0' 24 | 25 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 26 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 27 | } 28 | } 29 | 30 | test { 31 | useJUnitPlatform() 32 | } 33 | -------------------------------------------------------------------------------- /spring-validation/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.6.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '1.0' 9 | sourceCompatibility = '1.8' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 23 | implementation 'org.springframework.boot:spring-boot-starter-web' 24 | testCompile("org.springframework.boot:spring-boot-starter-test") 25 | compileOnly 'org.projectlombok:lombok' 26 | annotationProcessor 'org.projectlombok:lombok' 27 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 28 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 29 | } 30 | } 31 | 32 | test { 33 | useJUnitPlatform() 34 | } 35 | -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/dto/Obj.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.dto; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Getter; 8 | import lombok.NoArgsConstructor; 9 | import me.shinsunyoung.springvalidation.annotation.Tel; 10 | 11 | @NoArgsConstructor 12 | @Getter 13 | public class Obj { 14 | 15 | @NotBlank(message = "이름") 16 | private String name; 17 | 18 | @NotNull(message = "나이") 19 | private Integer age; 20 | 21 | @Tel 22 | private String tel; 23 | 24 | @Builder 25 | public Obj(@NotBlank(message = "이름") String name, 26 | @NotNull(message = "나이") Integer age) { 27 | this.name = name; 28 | this.age = age; 29 | } 30 | 31 | public Obj(@NotBlank(message = "이름") String name, 32 | @NotNull(message = "나이") Integer age, String tel) { 33 | this.name = name; 34 | this.age = age; 35 | this.tel = tel; 36 | } 37 | } -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/domain/User.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.domain; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import lombok.AccessLevel; 9 | import lombok.Builder; 10 | import lombok.Getter; 11 | import lombok.NoArgsConstructor; 12 | 13 | @NoArgsConstructor(access = AccessLevel.PROTECTED) 14 | @Getter 15 | @Entity 16 | public class User { 17 | 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.IDENTITY) 20 | @Column(name = "id", updatable = false) 21 | private Long id; 22 | 23 | @Column(name = "email", nullable = false, unique = true) 24 | private String email; 25 | 26 | @Column(name = "password", nullable = false) 27 | private String password; 28 | 29 | @Builder 30 | public User(Long id, String email, String password) { 31 | this.id = id; 32 | this.email = email; 33 | this.password = password; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-querydsl/src/main/java/me/shinsunyoung/springquerydsl/domain/Person.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springquerydsl.domain; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import lombok.Getter; 9 | import lombok.NoArgsConstructor; 10 | 11 | @Getter 12 | @Entity 13 | public class Person { 14 | @Id 15 | @GeneratedValue(strategy= GenerationType.IDENTITY) 16 | private Integer id; 17 | 18 | @Column(nullable=false) 19 | private String firstName; 20 | 21 | @Column(nullable=false) 22 | private String lastName; 23 | 24 | @Column(nullable=false) 25 | private Integer age; 26 | 27 | @Column(unique=true) 28 | private String email; 29 | 30 | public Person(String firstName, String lastName, int age, String email) { 31 | this.firstName = firstName; 32 | this.lastName = lastName; 33 | this.age = age; 34 | this.email = email; 35 | } 36 | 37 | public Person() { 38 | } 39 | } -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/service/PeopleService.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct.service; 2 | 3 | 4 | import me.shinsunyoung.springmapstruct.entity.People; 5 | import me.shinsunyoung.springmapstruct.mapper.PeopleMapper; 6 | import me.shinsunyoung.springmapstruct.repository.PeopleRepository; 7 | import me.shinsunyoung.springmapstruct.service.dto.PeopleDTO; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | @Service 12 | public class PeopleService { 13 | 14 | @Autowired 15 | PeopleRepository peopleRepository; 16 | 17 | @Autowired 18 | PeopleMapper peopleMapper; 19 | 20 | public PeopleService(PeopleMapper peopleMapper) { 21 | this.peopleMapper = peopleMapper; 22 | } 23 | 24 | /** 25 | * 유저 저장 26 | * 27 | * @param peopleDTO peopleDTO 28 | */ 29 | public void save(PeopleDTO peopleDTO) { 30 | 31 | People people = peopleMapper.toEntity(peopleDTO); 32 | peopleRepository.save(people); 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/config/SecurityMessageConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.config; 2 | 3 | import java.util.Locale; 4 | import org.springframework.context.MessageSource; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.support.ReloadableResourceBundleMessageSource; 8 | 9 | /** 10 | * 메세지 관련 Config 파일 11 | */ 12 | @Configuration 13 | public class SecurityMessageConfig { 14 | 15 | @Bean 16 | public MessageSource messageSource() { 17 | Locale.setDefault(Locale.KOREA); // 위치 한국으로 설정 (한국어로 에러 메세지 나오게) 18 | ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); 19 | 20 | messageSource.setDefaultEncoding("UTF-8"); // 인코딩 설정 21 | messageSource.setBasenames("classpath:message/security_message", "classpath:org/springframework/security/messages"); // 커스텀한 properties 파일, security properties 파일 순서대로 설정 22 | return messageSource; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spring-map-struct/src/main/java/me/shinsunyoung/springmapstruct/controller/PeopleController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springmapstruct.controller; 2 | 3 | import me.shinsunyoung.springmapstruct.service.PeopleService; 4 | import me.shinsunyoung.springmapstruct.service.dto.PeopleDTO; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.ModelAttribute; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | @Controller 13 | public class PeopleController { 14 | 15 | @Autowired 16 | PeopleService peopleService; 17 | 18 | @GetMapping("/") 19 | public String getPeople() { 20 | return "hello"; 21 | } 22 | 23 | @PostMapping("/") 24 | @ResponseBody 25 | public String postPeople(@ModelAttribute PeopleDTO peopleDTO) { 26 | 27 | peopleService.save(peopleDTO); 28 | 29 | return "success"; 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /spring-test/src/test/java/me/shinsunyoung/springtest/vo/PositiveTest.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springtest.vo; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import java.util.Arrays; 6 | import java.util.Collection; 7 | import junitparams.JUnitParamsRunner; 8 | import junitparams.Parameters; 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | 12 | @RunWith(JUnitParamsRunner.class) 13 | public class PositiveTest { 14 | 15 | @Test 16 | // @Parameters({ 17 | // "1, true", 18 | // "2, true", 19 | // "-1, false" 20 | // }) 21 | // @Parameters(method = "parametersForPositive") 22 | @Parameters 23 | public void positive(int number, boolean isPositive) { 24 | // given, when 25 | Positive positive = new Positive(number); 26 | 27 | // then 28 | assertThat(positive.isPositive()).isEqualTo(isPositive); 29 | } 30 | 31 | private Collection parametersForPositive() { // parametersFor + method name 32 | return Arrays.asList(new Object[][]{ 33 | {1, true}, 34 | {2, true}, 35 | {-1, false} 36 | }); 37 | } 38 | } -------------------------------------------------------------------------------- /spring-caching/src/main/java/me/shinsunyoung/springcaching/service/CashService.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springcaching.service; 2 | 3 | import org.springframework.cache.annotation.Cacheable; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class CashService { 8 | 9 | @Cacheable(value = "product") 10 | public String vendingMachine(char code) { 11 | 12 | String output = ""; 13 | 14 | System.out.println(code + " product를 조회합니다 ..."); 15 | 16 | // 각 코드에 맞는 결과물 리턴 17 | if (code == 'S') { 18 | output = "과자"; 19 | } else if (code == 'D') { 20 | output = "음료수"; 21 | } else if (code == 'G') { 22 | output = "껌"; 23 | } 24 | 25 | return output; 26 | } 27 | 28 | public String vendingMachine2(char code) { 29 | 30 | String output = ""; 31 | 32 | System.out.println(code + " product를 조회합니다 ..."); 33 | 34 | // 각 코드에 맞는 결과물 리턴 35 | if (code == 'S') { 36 | output = "과자"; 37 | } else if (code == 'D') { 38 | output = "음료수"; 39 | } else if (code == 'G') { 40 | output = "껌"; 41 | } 42 | 43 | return output; 44 | } 45 | } -------------------------------------------------------------------------------- /spring-validation/src/main/java/me/shinsunyoung/springvalidation/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.controller; 2 | 3 | import me.shinsunyoung.springvalidation.dto.Obj; 4 | import me.shinsunyoung.springvalidation.dto.User; 5 | import javax.validation.Valid; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.validation.BindingResult; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | @Controller 13 | public class UserController { 14 | 15 | @GetMapping("/user") 16 | public String getAddPage(User user){ 17 | return "add_user"; 18 | } 19 | 20 | @PostMapping("/user") 21 | public String addUser(@Valid User user, BindingResult result){ 22 | 23 | if(result.hasErrors()){ 24 | return "add_user"; 25 | } 26 | return "complete"; 27 | } 28 | 29 | @ResponseBody 30 | @GetMapping("/object_test") 31 | public Obj letsGo() { 32 | 33 | return Obj.builder() 34 | .name("선영") 35 | .build(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-security/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.7.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '1.0' 9 | sourceCompatibility = '1.8' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | compile('org.springframework.boot:spring-boot-starter-thymeleaf') 23 | compileOnly('org.projectlombok:lombok') 24 | annotationProcessor('org.projectlombok:lombok') 25 | compile('org.springframework.boot:spring-boot-starter-web') 26 | compile('org.springframework.boot:spring-boot-starter-data-jpa') 27 | compile('com.h2database:h2') 28 | 29 | // 추가 30 | compile('org.springframework.boot:spring-boot-starter-security') 31 | compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity5') 32 | 33 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 34 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 35 | } 36 | } 37 | 38 | test { 39 | useJUnitPlatform() 40 | } 41 | -------------------------------------------------------------------------------- /spring-map-struct/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.6.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | id 'net.ltgt.apt' version '0.15' 6 | } 7 | 8 | apply plugin: "net.ltgt.apt" 9 | 10 | group = 'me.shinsunyoung' 11 | version = '0.0.1' 12 | sourceCompatibility = '1.8' 13 | 14 | repositories { 15 | mavenCentral() 16 | } 17 | 18 | dependencies { 19 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 20 | implementation 'org.springframework.boot:spring-boot-starter-web' 21 | runtimeOnly 'com.h2database:h2' 22 | implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 23 | 24 | compileOnly 'org.projectlombok:lombok' 25 | annotationProcessor 'org.projectlombok:lombok' 26 | 27 | compile('org.mapstruct:mapstruct:1.3.0.Beta2') 28 | compileOnly('org.mapstruct:mapstruct-processor:1.3.0.Beta2') 29 | annotationProcessor('org.mapstruct:mapstruct-processor:1.3.0.Beta2') 30 | 31 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 32 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 33 | } 34 | } 35 | 36 | test { 37 | useJUnitPlatform() 38 | } 39 | -------------------------------------------------------------------------------- /spring-validation/src/main/resources/templates/add_user.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Validation Example 6 | 7 | 13 | 14 | 15 | 16 | 17 |

회원가입 폼

18 | 19 |
20 | 21 | 이름 22 | 23 |
24 |

25 |
26 |
27 | 28 | 이메일 29 | 30 |

31 |
32 | 33 | 비밀번호 34 | 35 | 36 |
37 | 38 | 39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /spring-poi/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.6.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'me.shinsunyoung' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '1.8' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 23 | implementation 'org.springframework.boot:spring-boot-starter-web' 24 | compileOnly 'org.projectlombok:lombok' 25 | annotationProcessor 'org.projectlombok:lombok' 26 | 27 | compile group: 'org.apache.poi', name: 'poi', version: '3.11' 28 | compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.11' 29 | compile group: 'org.apache.tika', name: 'tika-core', version: '1.22' // apache tika 30 | 31 | compile group: 'commons-io', name: 'commons-io', version: '2.4' 32 | 33 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 34 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 35 | } 36 | } 37 | 38 | test { 39 | useJUnitPlatform() 40 | } 41 | -------------------------------------------------------------------------------- /intelliJ-plugin/src/main/resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | me.shinsunyoung.parrot_popup 3 | Parrot PopUp 4 | fresh 5 | 6 | 여기에 설명을 적으면 됩니다! 8 |

html 태그를 이용합니다.

9 | ]]>
10 | 11 | 15 | 16 | 17 | com.intellij.modules.platform 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
-------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import lombok.RequiredArgsConstructor; 6 | import lombok.extern.slf4j.Slf4j; 7 | import me.shinsunyoung.springsecurity.dto.UserInfoDto; 8 | import me.shinsunyoung.springsecurity.service.UserService; 9 | import org.springframework.security.core.context.SecurityContextHolder; 10 | import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | import org.springframework.web.bind.annotation.PostMapping; 14 | 15 | @RequiredArgsConstructor 16 | @Controller 17 | public class UserController { 18 | 19 | private final UserService userService; 20 | 21 | @PostMapping("/user") 22 | public String signup(UserInfoDto infoDto) { // 회원 추가 23 | userService.save(infoDto); 24 | return "redirect:/login"; 25 | } 26 | 27 | @GetMapping(value = "/logout") 28 | public String logoutPage(HttpServletRequest request, HttpServletResponse response) { 29 | new SecurityContextLogoutHandler().logout(request, response, SecurityContextHolder.getContext().getAuthentication()); 30 | return "redirect:/login"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-caching/src/main/java/me/shinsunyoung/springcaching/controller/CachingController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springcaching.controller; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Random; 6 | import me.shinsunyoung.springcaching.service.CashService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | @RestController 12 | public class CachingController { 13 | 14 | @Autowired 15 | CashService cashService; 16 | 17 | private final char[] productCode = {'S', 'D', 'G'}; // 상품 코드들 18 | Random random = new Random(); 19 | 20 | /** 21 | * 캐시 사용 22 | * 23 | * @return 24 | */ 25 | @GetMapping("/cache") 26 | public List cahce(){ 27 | 28 | List products = new ArrayList<>(); 29 | 30 | for(int i=0; i<10; i++){ 31 | // 랜덤으로 코드를 뽑아서 코드로 값을 바꿔주는 메소드 호출 32 | products.add(cashService.vendingMachine(productCode[random.nextInt(3)])); 33 | } 34 | 35 | return products; 36 | } 37 | 38 | 39 | /** 40 | * 캐시 사용 41 | * 42 | * @return 43 | */ 44 | @GetMapping("/non-cache") 45 | public List nonCahce(){ 46 | 47 | List products = new ArrayList<>(); 48 | 49 | for(int i=0; i<10; i++){ 50 | products.add(cashService.vendingMachine2(productCode[random.nextInt(3)])); 51 | } 52 | 53 | return products; 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /spring-rest-docs/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.3.1.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | id 'org.asciidoctor.convert' version "1.5.3" // (1) 6 | } 7 | 8 | group = 'me.shinsunyoung' 9 | version = '1.0' 10 | sourceCompatibility = '1.8' 11 | 12 | ext { 13 | snippetsDir = file('build/generated-snippets') // (2) 14 | } 15 | 16 | asciidoctor { // (3) 17 | inputs.dir snippetsDir 18 | dependsOn test 19 | } 20 | 21 | repositories { 22 | mavenCentral() 23 | } 24 | 25 | dependencies { 26 | implementation 'org.springframework.boot:spring-boot-starter-web' 27 | testCompile("org.springframework.boot:spring-boot-starter-test") 28 | 29 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 30 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 31 | } 32 | 33 | asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor:1.2.6.RELEASE' // (4) 34 | testCompile group: 'org.springframework.restdocs', name: 'spring-restdocs-mockmvc', version: '2.0.2.RELEASE' // (5) 35 | } 36 | 37 | test { 38 | useJUnitPlatform() 39 | } 40 | 41 | // (6) 42 | //bootJar { 43 | // dependsOn asciidoctor 44 | // from ("${asciidoctor.outputDir}/html5") { 45 | // into "static/docs" 46 | // } 47 | //} 48 | 49 | task copyDocument(type: Copy) { 50 | dependsOn asciidoctor 51 | 52 | from file("build/asciidoc/html5/") 53 | into file("src/main/resources/static/docs") 54 | } 55 | 56 | build { 57 | dependsOn copyDocument 58 | } 59 | 60 | -------------------------------------------------------------------------------- /spring-querydsl/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.6.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" // 추가 6 | } 7 | 8 | group = 'me.shinsunyoung' 9 | version = '1.0' 10 | sourceCompatibility = '1.8' 11 | 12 | configurations { 13 | compileOnly { 14 | extendsFrom annotationProcessor 15 | } 16 | } 17 | 18 | repositories { 19 | mavenCentral() 20 | } 21 | 22 | dependencies { 23 | implementation 'org.springframework.boot:spring-boot-starter-web' 24 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 25 | testCompile("org.springframework.boot:spring-boot-starter-test") 26 | 27 | compileOnly 'org.projectlombok:lombok' 28 | annotationProcessor 'org.projectlombok:lombok' 29 | runtimeOnly 'com.h2database:h2' 30 | 31 | implementation 'com.querydsl:querydsl-jpa' // 추가 32 | 33 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 34 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 35 | } 36 | } 37 | 38 | def querydslDir = "$buildDir/generated/querydsl" // 추가 39 | 40 | /* Querydsl Q-class 추가 코드 */ 41 | querydsl { 42 | jpa = true 43 | querydslSourcesDir = querydslDir 44 | } 45 | sourceSets { 46 | main.java.srcDir querydslDir 47 | } 48 | configurations { 49 | querydsl.extendsFrom compileClasspath 50 | } 51 | compileQuerydsl { 52 | options.annotationProcessorPath = configurations.querydsl 53 | } 54 | 55 | 56 | test { 57 | useJUnitPlatform() 58 | } 59 | -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/service/UserService.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.service; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import me.shinsunyoung.springsecurity.domain.UserInfo; 5 | import me.shinsunyoung.springsecurity.dto.UserInfoDto; 6 | import me.shinsunyoung.springsecurity.repository.UserRepository; 7 | import org.springframework.security.core.userdetails.UserDetailsService; 8 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 9 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 10 | import org.springframework.stereotype.Service; 11 | 12 | @RequiredArgsConstructor 13 | @Service 14 | public class UserService implements UserDetailsService { 15 | 16 | private final UserRepository userRepository; 17 | 18 | /** 19 | * 회원정보 저장 20 | * 21 | * @param infoDto 회원정보가 들어있는 DTO 22 | * @return 저장되는 회원의 PK 23 | */ 24 | public Long save(UserInfoDto infoDto) { 25 | BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); 26 | infoDto.setPassword(encoder.encode(infoDto.getPassword())); 27 | 28 | return userRepository.save(UserInfo.builder() 29 | .email(infoDto.getEmail()) 30 | .auth(infoDto.getAuth()) 31 | .password(infoDto.getPassword()).build()).getCode(); 32 | } 33 | 34 | /** 35 | * Spring Security 필수 메소드 구현 36 | * 37 | * @param email 이메일 38 | * @return UserDetails 39 | * @throws UsernameNotFoundException 유저가 없을 때 예외 발생 40 | */ 41 | @Override // 기본적인 반환 타입은 UserDetails, UserDetails를 상속받은 User로 반환 타입 지정 (자동으로 다운 캐스팅됨) 42 | public UserInfo loadUserByUsername(String email) throws UsernameNotFoundException { // 시큐리티에서 지정한 서비스이기 때문에 이 메소드를 필수로 구현 43 | return userRepository.findByEmail(email) 44 | .orElseThrow(() -> new UsernameNotFoundException((email))); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /intelliJ-plugin/src/main/java/ui/TestForm.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/api/UserApi.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.api; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import me.shinsunyoung.springjwt.user.model.AddUserDto; 5 | import me.shinsunyoung.springjwt.user.model.LoginUserDto; 6 | import me.shinsunyoung.springjwt.user.model.UserDto; 7 | import me.shinsunyoung.springjwt.user.model.response.AddUserResponse; 8 | import me.shinsunyoung.springjwt.user.model.response.LoginUserResponse; 9 | import me.shinsunyoung.springjwt.user.service.UserAccountService; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.http.ResponseEntity; 12 | import org.springframework.security.core.annotation.AuthenticationPrincipal; 13 | import org.springframework.web.bind.annotation.GetMapping; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.RequestBody; 16 | import org.springframework.web.bind.annotation.RestController; 17 | 18 | 19 | @RequiredArgsConstructor 20 | @RestController 21 | public class UserApi { 22 | 23 | private final UserAccountService userAccountService; 24 | 25 | @PostMapping("/sign-up") 26 | public ResponseEntity signUp(@RequestBody AddUserDto addUserDto) { 27 | AddUserResponse savedUser = userAccountService.signUp(addUserDto); 28 | 29 | return ResponseEntity.status(HttpStatus.CREATED) 30 | .body(savedUser); 31 | } 32 | 33 | @PostMapping("/sign-in") 34 | public ResponseEntity signIn( 35 | @RequestBody LoginUserDto loginUserDto) { 36 | LoginUserResponse loginUserResponse = userAccountService.signIn(loginUserDto); 37 | 38 | return ResponseEntity.ok() 39 | .body(loginUserResponse); 40 | } 41 | 42 | 43 | @GetMapping("/hello") 44 | public String hello(@AuthenticationPrincipal UserDto user) { 45 | return user.getEmail() + ", 안녕하세요!"; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/user/service/UserAccountService.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.user.service; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import me.shinsunyoung.springjwt.base.jwt.JwtTokenProvider; 5 | import me.shinsunyoung.springjwt.user.domain.User; 6 | import me.shinsunyoung.springjwt.user.model.AddUserDto; 7 | import me.shinsunyoung.springjwt.user.model.LoginUserDto; 8 | import me.shinsunyoung.springjwt.user.model.response.AddUserResponse; 9 | import me.shinsunyoung.springjwt.user.model.response.LoginUserResponse; 10 | import me.shinsunyoung.springjwt.user.repository.UserRepository; 11 | import org.springframework.security.crypto.password.PasswordEncoder; 12 | import org.springframework.stereotype.Service; 13 | 14 | @RequiredArgsConstructor 15 | @Service 16 | public class UserAccountService { 17 | 18 | private final UserRepository userRepository; 19 | private final JwtTokenProvider jwtTokenProvider; 20 | private final PasswordEncoder passwordEncoder; 21 | 22 | public AddUserResponse signUp(AddUserDto user) { 23 | String encodingPassword = encodingPassword(user.getPassword()); 24 | User savedUser = userRepository.save(user.toEntity(encodingPassword)); 25 | 26 | return new AddUserResponse(savedUser); 27 | } 28 | 29 | public LoginUserResponse signIn(LoginUserDto userDto) { 30 | User user = userRepository.findByEmail(userDto.getEmail()) 31 | .orElseThrow(IllegalArgumentException::new); 32 | 33 | passwordMustBeSame(userDto.getPassword(), user.getPassword()); 34 | 35 | String token = jwtTokenProvider.makeJwtToken(user); 36 | return new LoginUserResponse(token); 37 | } 38 | 39 | private void passwordMustBeSame(String requestPassword, String password) { 40 | if (!passwordEncoder.matches(requestPassword, password)) { 41 | throw new IllegalArgumentException(); 42 | } 43 | } 44 | 45 | private String encodingPassword(String password) { 46 | return passwordEncoder.encode(password); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/base/jwt/JwtAuthenticationFilter.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.base.jwt; 2 | 3 | import io.jsonwebtoken.ExpiredJwtException; 4 | import java.io.IOException; 5 | import javax.servlet.FilterChain; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import lombok.Builder; 10 | import lombok.Getter; 11 | import me.shinsunyoung.springjwt.user.model.UserDto; 12 | import org.springframework.http.HttpHeaders; 13 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 14 | import org.springframework.security.core.context.SecurityContextHolder; 15 | import org.springframework.web.filter.OncePerRequestFilter; 16 | 17 | @Getter 18 | public class JwtAuthenticationFilter extends OncePerRequestFilter { 19 | 20 | private final JwtTokenProvider jwtTokenProvider; 21 | 22 | @Builder 23 | private JwtAuthenticationFilter(JwtTokenProvider jwtTokenProvider) { 24 | this.jwtTokenProvider = jwtTokenProvider; 25 | } 26 | 27 | public static JwtAuthenticationFilter of(JwtTokenProvider jwtTokenProvider) { 28 | return JwtAuthenticationFilter.builder() 29 | .jwtTokenProvider(jwtTokenProvider) 30 | .build(); 31 | } 32 | 33 | @Override 34 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, 35 | FilterChain filterChain) throws IOException, ServletException { 36 | String authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION); 37 | 38 | try { 39 | UserDto user = jwtTokenProvider.getUserDtoOf(authorizationHeader); 40 | SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken( 41 | user, 42 | "", 43 | user.getAuthorities())); 44 | 45 | filterChain.doFilter(request, response); 46 | } catch (ExpiredJwtException exception) { 47 | logger.error("ExpiredJwtException", exception); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/base/jwt/JwtTokenProvider.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.base.jwt; 2 | 3 | import io.jsonwebtoken.Claims; 4 | import io.jsonwebtoken.Header; 5 | import io.jsonwebtoken.Jwts; 6 | import io.jsonwebtoken.SignatureAlgorithm; 7 | import java.time.Duration; 8 | import java.util.Date; 9 | import lombok.RequiredArgsConstructor; 10 | import me.shinsunyoung.springjwt.user.domain.User; 11 | import me.shinsunyoung.springjwt.user.model.UserDto; 12 | import org.springframework.stereotype.Component; 13 | 14 | @RequiredArgsConstructor 15 | @Component 16 | public class JwtTokenProvider { 17 | 18 | private final JwtProperties jwtProperties; 19 | 20 | public String makeJwtToken(User user) { 21 | Date now = new Date(); 22 | 23 | return Jwts.builder() 24 | .setHeaderParam(Header.TYPE, Header.JWT_TYPE) 25 | .setIssuer(jwtProperties.getIssuer()) 26 | .setIssuedAt(now) 27 | .setExpiration(new Date(now.getTime() + Duration.ofMinutes(30).toMillis())) 28 | .claim("id", user.getId()) 29 | .claim("email", user.getEmail()) 30 | .signWith(SignatureAlgorithm.HS256, jwtProperties.getSecretKey()) 31 | .compact(); 32 | } 33 | 34 | public UserDto getUserDtoOf(String authorizationHeader) { 35 | validationAuthorizationHeader(authorizationHeader); 36 | 37 | String token = extractToken(authorizationHeader); 38 | Claims claims = parsingToken(token); 39 | 40 | return new UserDto(claims); 41 | } 42 | 43 | private Claims parsingToken(String token) { 44 | return Jwts.parser() 45 | .setSigningKey(jwtProperties.getSecretKey()) 46 | .parseClaimsJws(token) 47 | .getBody(); 48 | } 49 | 50 | private void validationAuthorizationHeader(String header) { 51 | if (header == null || !header.startsWith(jwtProperties.getTokenPrefix())) { 52 | throw new IllegalArgumentException(); 53 | } 54 | } 55 | 56 | private String extractToken(String authorizationHeader) { 57 | return authorizationHeader.substring(jwtProperties.getTokenPrefix().length()); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /spring-rest-docs/src/test/java/me/shinsunyoung/springrestdocs/HelloControllerTest.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springrestdocs; 2 | 3 | import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document; 4 | import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration; 5 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 6 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; 7 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; 8 | 9 | import org.junit.Before; 10 | import org.junit.Rule; 11 | import org.junit.Test; 12 | import org.junit.runner.RunWith; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.boot.test.context.SpringBootTest; 15 | import org.springframework.http.MediaType; 16 | import org.springframework.restdocs.JUnitRestDocumentation; 17 | import org.springframework.test.context.junit4.SpringRunner; 18 | import org.springframework.test.web.servlet.MockMvc; 19 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 20 | import org.springframework.web.context.WebApplicationContext; 21 | 22 | @RunWith(SpringRunner.class) 23 | @SpringBootTest 24 | public class HelloControllerTest { 25 | 26 | @Rule 27 | public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(); 28 | 29 | private MockMvc mockMvc; 30 | 31 | @Autowired 32 | WebApplicationContext context; 33 | 34 | 35 | @Before 36 | public void setUp() { 37 | this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context) 38 | .apply(documentationConfiguration(this.restDocumentation)) 39 | .build(); 40 | } 41 | 42 | @Test 43 | public void Hello_테스트() throws Exception { 44 | 45 | // given 46 | String name = "칩앤데일"; 47 | 48 | // when 49 | mockMvc.perform(get("/hello/" + name) 50 | .characterEncoding("utf-8") 51 | .accept(MediaType.APPLICATION_JSON)) 52 | .andExpect(status().isOk()) // then 53 | .andExpect(jsonPath("$.name").value(name)) 54 | .andDo(document("hello")); 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /spring-jwt/src/main/java/me/shinsunyoung/springjwt/base/config/WebSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springjwt.base.config; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import me.shinsunyoung.springjwt.base.jwt.JwtAuthenticationFilter; 5 | import me.shinsunyoung.springjwt.base.jwt.JwtTokenProvider; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.security.authentication.AuthenticationManager; 9 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 10 | import org.springframework.security.config.annotation.web.builders.WebSecurity; 11 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 12 | import org.springframework.security.config.http.SessionCreationPolicy; 13 | import org.springframework.security.crypto.factory.PasswordEncoderFactories; 14 | import org.springframework.security.crypto.password.PasswordEncoder; 15 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; 16 | 17 | @RequiredArgsConstructor 18 | @Configuration 19 | public class WebSecurityConfig extends WebSecurityConfigurerAdapter { 20 | 21 | private static final String[] PUBLIC_URLS = { 22 | "/sign-up", "/sign-in" 23 | }; 24 | 25 | private final JwtTokenProvider jwtTokenProvider; 26 | 27 | @Bean 28 | public PasswordEncoder passwordEncoderParser() { 29 | return PasswordEncoderFactories.createDelegatingPasswordEncoder(); 30 | } 31 | 32 | @Override 33 | public AuthenticationManager authenticationManagerBean() throws Exception { 34 | return super.authenticationManagerBean(); 35 | } 36 | 37 | @Override 38 | protected void configure(HttpSecurity http) throws Exception { 39 | http.csrf().disable() 40 | .httpBasic().disable() 41 | .formLogin().disable() 42 | .logout().disable(); 43 | 44 | http.authorizeRequests() 45 | .mvcMatchers(PUBLIC_URLS).permitAll() 46 | .anyRequest().authenticated(); 47 | 48 | http.sessionManagement() 49 | .sessionCreationPolicy(SessionCreationPolicy.STATELESS); 50 | 51 | http.addFilterBefore( 52 | JwtAuthenticationFilter.of(jwtTokenProvider), 53 | UsernamePasswordAuthenticationFilter.class); 54 | } 55 | 56 | @Override 57 | public void configure(WebSecurity web) { 58 | web.ignoring() 59 | .mvcMatchers(PUBLIC_URLS); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /spring-aop/src/main/java/me/shinsunyoung/aop/config/LogConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.aop.config; 2 | 3 | import com.google.common.base.Joiner; 4 | import java.util.Map; 5 | import java.util.stream.Collectors; 6 | import javax.servlet.http.HttpServletRequest; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.aspectj.lang.ProceedingJoinPoint; 9 | import org.aspectj.lang.annotation.Around; 10 | import org.aspectj.lang.annotation.Aspect; 11 | import org.springframework.stereotype.Component; 12 | import org.springframework.web.context.request.RequestAttributes; 13 | import org.springframework.web.context.request.RequestContextHolder; 14 | import org.springframework.web.context.request.ServletRequestAttributes; 15 | 16 | @Slf4j 17 | @Component 18 | @Aspect 19 | public class LogConfig { 20 | 21 | @Around("within(me.shinsunyoung.aop.controller..*) && !@annotation(me.shinsunyoung.aop.config.LogExclusion)") // 22 | public Object logging(ProceedingJoinPoint pjp) throws Throwable { // 2 23 | 24 | String params = getRequestParams(); // request 값 가져오기 25 | 26 | long startAt = System.currentTimeMillis(); 27 | 28 | log.info("-----------> REQUEST : {}({}) = {}", pjp.getSignature().getDeclaringTypeName(), 29 | pjp.getSignature().getName(), params); 30 | 31 | Object result = pjp.proceed(); // 4 32 | 33 | long endAt = System.currentTimeMillis(); 34 | 35 | log.info("-----------> RESPONSE : {}({}) = {} ({}ms)", pjp.getSignature().getDeclaringTypeName(), 36 | pjp.getSignature().getName(), result, endAt - startAt); 37 | 38 | return result; 39 | } 40 | 41 | 42 | private String paramMapToString(Map paramMap) { 43 | return paramMap.entrySet().stream() 44 | .map(entry -> String.format("%s -> (%s)", 45 | entry.getKey(), Joiner.on(",").join(entry.getValue()))) 46 | .collect(Collectors.joining(", ")); 47 | } 48 | 49 | // Get request values 50 | private String getRequestParams() { 51 | 52 | String params = "없음"; 53 | 54 | RequestAttributes requestAttributes = RequestContextHolder 55 | .getRequestAttributes(); // 3 56 | 57 | if (requestAttributes != null) { 58 | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder 59 | .getRequestAttributes()).getRequest(); 60 | 61 | Map paramMap = request.getParameterMap(); 62 | if (!paramMap.isEmpty()) { 63 | params = " [" + paramMapToString(paramMap) + "]"; 64 | } 65 | } 66 | 67 | return params; 68 | } 69 | } -------------------------------------------------------------------------------- /intelliJ-plugin/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS="-Xmx64m" 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/config/WebSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.config; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import me.shinsunyoung.springsecurity.service.UserService; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 8 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 9 | import org.springframework.security.config.annotation.web.builders.WebSecurity; 10 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 11 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 12 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 13 | import org.springframework.security.crypto.password.PasswordEncoder; 14 | 15 | @EnableWebSecurity // Security 사용 16 | @RequiredArgsConstructor 17 | @Configuration 18 | public class WebSecurityConfig extends WebSecurityConfigurerAdapter { 19 | 20 | private final UserService userService; 21 | 22 | @Override 23 | public void configure(WebSecurity web) { // static 하위 파일 목록(css, js, img) 인증 무시 24 | web.ignoring().antMatchers("/css/**", "/js/**", "/img/**", "/h2-console/**"); 25 | } 26 | 27 | @Override 28 | protected void configure(HttpSecurity http) throws Exception { // http 관련 인증 설정 29 | http 30 | .authorizeRequests() // 접근에 대한 인증 설정 31 | .antMatchers("/login", "/signup", "/user").permitAll() // 누구나 접근 허용 32 | .antMatchers("/").hasRole("USER") // USER, ADMIN만 접근 가능 33 | .antMatchers("/admin").hasRole("ADMIN") // ADMIN만 접근 가능 34 | .anyRequest().authenticated() // 나머지 요청들은 권한의 종류에 상관 없이 권한이 있어야 접근 가능 35 | .and() 36 | .formLogin() // 로그인에 관한 설정 37 | .loginPage("/login") // 로그인 페이지 링크 38 | .defaultSuccessUrl("/") // 로그인 성공 후 리다이렉트 주소 39 | .and() 40 | .logout() // 로그아웃 41 | .logoutSuccessUrl("/login") // 로그아웃 성공시 리다이렉트 주소 42 | .invalidateHttpSession(true) // 세션 날리기 43 | ; 44 | } 45 | 46 | @Override 47 | public void configure(AuthenticationManagerBuilder auth) throws Exception { // 필요한 정보들을 가져오는 곳 48 | auth.userDetailsService(userService).passwordEncoder(new BCryptPasswordEncoder()); // 해당 서비스(userService)에서는 UserDetailsService를 implements해서 loadUserByUsername() 구현해야함 (서비스 참고) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /spring-security/src/main/java/me/shinsunyoung/springsecurity/domain/UserInfo.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springsecurity.domain; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | import javax.persistence.Column; 8 | import javax.persistence.Entity; 9 | import javax.persistence.GeneratedValue; 10 | import javax.persistence.GenerationType; 11 | import javax.persistence.Id; 12 | import lombok.AccessLevel; 13 | import lombok.Builder; 14 | import lombok.Getter; 15 | import lombok.NoArgsConstructor; 16 | import org.springframework.security.core.GrantedAuthority; 17 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 18 | import org.springframework.security.core.userdetails.UserDetails; 19 | 20 | @NoArgsConstructor(access = AccessLevel.PROTECTED) 21 | @Entity 22 | @Getter 23 | public class UserInfo implements UserDetails { 24 | 25 | @Id 26 | @Column(name = "code") 27 | @GeneratedValue(strategy= GenerationType.IDENTITY) 28 | private Long code; 29 | 30 | @Column(name = "email", unique = true) 31 | private String email; 32 | 33 | @Column(name = "password") 34 | private String password; 35 | 36 | @Column(name = "auth") 37 | private String auth; 38 | 39 | @Builder 40 | public UserInfo(String email, String password, String auth) { 41 | this.email = email; 42 | this.password = password; 43 | this.auth = auth; 44 | } 45 | 46 | // 사용자의 권한을 콜렉션 형태로 반환 47 | // 단, 클래스 자료형은 GrantedAuthority를 구현해야함 48 | @Override 49 | public Collection getAuthorities() { 50 | Set roles = new HashSet<>(); 51 | 52 | for (String role : auth.split(",")) { 53 | roles.add(new SimpleGrantedAuthority(role)); 54 | } 55 | 56 | return roles; 57 | } 58 | 59 | // 사용자의 id를 반환 (unique한 값) 60 | @Override 61 | public String getUsername() { 62 | return email; 63 | } 64 | 65 | // 사용자의 password를 반환 66 | @Override 67 | public String getPassword() { 68 | return password; 69 | } 70 | 71 | // 계정 만료 여부 반환 72 | @Override 73 | public boolean isAccountNonExpired() { 74 | // 만료되었는지 확인하는 로직 75 | return true; // true -> 만료되지 않았음 76 | } 77 | 78 | // 계정 잠금 여부 반환 79 | @Override 80 | public boolean isAccountNonLocked() { 81 | // 계정 잠금되었는지 확인하는 로직 82 | return true; // true -> 잠금되지 않았음 83 | } 84 | 85 | // 패스워드의 만료 여부 반환 86 | @Override 87 | public boolean isCredentialsNonExpired() { 88 | // 패스워드가 만료되었는지 확인하는 로직 89 | return true; // true -> 만료되지 않았음 90 | } 91 | 92 | // 계정 사용 가능 여부 반환 93 | @Override 94 | public boolean isEnabled() { 95 | // 계정이 사용 가능한지 확인하는 로직 96 | return true; // true -> 사용 가능 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /spring-poi/src/main/java/me/shinsunyoung/springpoi/ExcelController.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springpoi; 2 | 3 | import static me.shinsunyoung.springpoi.util.ExcelUtils.isExcel; 4 | 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import me.shinsunyoung.springpoi.dto.ExcelData; 9 | import org.apache.commons.io.FilenameUtils; 10 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; 11 | import org.apache.poi.ss.usermodel.Row; 12 | import org.apache.poi.ss.usermodel.Sheet; 13 | import org.apache.poi.ss.usermodel.Workbook; 14 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; 15 | import org.apache.tika.Tika; 16 | import org.springframework.stereotype.Controller; 17 | import org.springframework.ui.Model; 18 | import org.springframework.web.bind.annotation.GetMapping; 19 | import org.springframework.web.bind.annotation.PostMapping; 20 | import org.springframework.web.bind.annotation.RequestParam; 21 | import org.springframework.web.multipart.MultipartFile; 22 | 23 | @Controller 24 | public class ExcelController { 25 | 26 | /** 27 | * 뷰를 리턴해주는 메소드 28 | * 29 | * @return 뷰 이름 30 | */ 31 | @GetMapping("/excel") 32 | public String main() { 33 | return "excel"; 34 | } 35 | 36 | /** 37 | * 엑셀 파일 읽기 38 | * 39 | * @param file MultipartFile 40 | * @param model Model 41 | * @return 뷰 이름 42 | * @throws IOException 엑셀 파일이 아닌 다른 파일을 업로드 했을 때 43 | */ 44 | @PostMapping("/excel/read") 45 | public String readExcel(@RequestParam("file") MultipartFile file, Model model) 46 | throws IOException { 47 | 48 | Tika tika = new Tika(); // Apache Tika 사용 49 | String detect = tika.detect(file.getBytes()); // Tika를 사용해서 MIME 타입 얻어내기 50 | 51 | List dataList = new ArrayList<>(); 52 | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); 53 | 54 | if (!isExcel(detect, extension)) { 55 | throw new IOException("엑셀파일만 업로드 해주세요."); 56 | } 57 | 58 | Workbook workbook = null; 59 | 60 | if (extension.equals("xlsx")) { 61 | workbook = new XSSFWorkbook(file.getInputStream()); 62 | } else if (extension.equals("xls")) { 63 | workbook = new HSSFWorkbook(file.getInputStream()); 64 | } 65 | 66 | assert workbook != null; 67 | Sheet worksheet = workbook.getSheetAt(0); 68 | 69 | for (int i = 1; i < worksheet.getPhysicalNumberOfRows(); i++) { 70 | 71 | Row row = worksheet.getRow(i); 72 | 73 | ExcelData data = new ExcelData(); 74 | 75 | data.setNum((int) row.getCell(0).getNumericCellValue()); 76 | data.setName(row.getCell(1).getStringCellValue()); 77 | data.setEmail(row.getCell(2).getStringCellValue()); 78 | 79 | dataList.add(data); 80 | } 81 | 82 | model.addAttribute("datas", dataList); 83 | 84 | return "excelList"; 85 | } 86 | } -------------------------------------------------------------------------------- /spring-test/src/test/java/me/shinsunyoung/springtest/controller/BlogControllerTest.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springtest.controller; 2 | 3 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 4 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; 5 | import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; 6 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; 7 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; 8 | 9 | import com.fasterxml.jackson.databind.ObjectMapper; 10 | import me.shinsunyoung.springtest.vo.Info; 11 | import org.junit.Before; 12 | import org.junit.Test; 13 | import org.junit.runner.RunWith; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; 16 | import org.springframework.http.MediaType; 17 | import org.springframework.test.context.junit4.SpringRunner; 18 | import org.springframework.test.web.servlet.MockMvc; 19 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 20 | import org.springframework.util.LinkedMultiValueMap; 21 | import org.springframework.util.MultiValueMap; 22 | import org.springframework.web.context.WebApplicationContext; 23 | import org.springframework.web.filter.CharacterEncodingFilter; 24 | 25 | @RunWith(SpringRunner.class) 26 | @WebMvcTest(BlogController.class) 27 | public class BlogControllerTest { 28 | 29 | @Autowired 30 | private MockMvc mockMvc; 31 | 32 | @Autowired 33 | private ObjectMapper objectMapper; 34 | 35 | @Autowired 36 | private WebApplicationContext ctx; 37 | 38 | @Before 39 | public void setup() { 40 | mockMvc = MockMvcBuilders.webAppContextSetup(ctx) 41 | .addFilters(new CharacterEncodingFilter("UTF-8", true)) // 한글 깨짐 처리 42 | .build(); 43 | } 44 | 45 | @Test 46 | public void 테스트_GET() throws Exception { 47 | 48 | MultiValueMap info = new LinkedMultiValueMap<>(); 49 | 50 | info.add("name", "칩"); 51 | info.add("id", "chip"); 52 | 53 | mockMvc.perform(get("/blog") // 1, 2 54 | .params(info)) // 3 55 | .andExpect(status().isOk()) // 4 56 | .andExpect(content().string("칩의 블로그입니다. chip")) 57 | .andDo(print()); // 5 58 | } 59 | 60 | 61 | @Test 62 | public void 테스트_POST() throws Exception { 63 | 64 | String content = objectMapper.writeValueAsString(new Info("데일", "dale")); 65 | 66 | mockMvc.perform(post("/blog") 67 | .content(content) 68 | .contentType(MediaType.APPLICATION_JSON) 69 | .accept(MediaType.APPLICATION_JSON)) 70 | .andExpect(status().isOk()) 71 | .andExpect(content().string("데일의 블로그입니다. dale")) 72 | .andDo(print()); 73 | } 74 | } -------------------------------------------------------------------------------- /spring-validation/src/test/java/me/shinsunyoung/springvalidation/controller/ValidControllerTest.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springvalidation.controller; 2 | 3 | import static org.junit.Assert.*; 4 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; 5 | import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; 6 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; 7 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; 8 | 9 | import com.fasterxml.jackson.databind.ObjectMapper; 10 | import me.shinsunyoung.springvalidation.dto.Obj; 11 | import org.junit.Test; 12 | import org.junit.runner.RunWith; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; 15 | import org.springframework.http.MediaType; 16 | import org.springframework.test.context.junit4.SpringRunner; 17 | import org.springframework.test.web.servlet.MockMvc; 18 | 19 | @RunWith(SpringRunner.class) 20 | @WebMvcTest(ValidController.class) 21 | public class ValidControllerTest { 22 | 23 | @Autowired 24 | private MockMvc mockMvc; 25 | 26 | @Autowired 27 | private ObjectMapper objectMapper; 28 | 29 | 30 | @Test 31 | public void validation_실패() throws Exception { 32 | String content = objectMapper.writeValueAsString(new Obj("냠냠이", null)); 33 | 34 | mockMvc.perform(post("/valid") 35 | .content(content) 36 | .contentType(MediaType.APPLICATION_JSON) 37 | .accept(MediaType.APPLICATION_JSON)) 38 | .andExpect(status().is4xxClientError()) 39 | .andExpect(jsonPath("$.message").value("유효성 검사 실패 : 나이")) 40 | .andDo(print()); 41 | } 42 | 43 | @Test 44 | public void validation_성공() throws Exception { 45 | String content = objectMapper.writeValueAsString(new Obj("냠냠이", 10)); 46 | 47 | mockMvc.perform(post("/valid") 48 | .content(content) 49 | .contentType(MediaType.APPLICATION_JSON) 50 | .accept(MediaType.APPLICATION_JSON)) 51 | .andExpect(status().isOk()) 52 | .andDo(print()); 53 | } 54 | 55 | 56 | @Test 57 | public void 핸드폰번호_validation_성공() throws Exception { 58 | String content = objectMapper.writeValueAsString(new Obj("냠냠이", 10, "01012345678")); 59 | 60 | mockMvc.perform(post("/valid") 61 | .content(content) 62 | .contentType(MediaType.APPLICATION_JSON) 63 | .accept(MediaType.APPLICATION_JSON)) 64 | .andExpect(status().isOk()) 65 | .andDo(print()); 66 | } 67 | 68 | 69 | @Test 70 | public void 핸드폰번호_validation_실패() throws Exception { 71 | String content = objectMapper.writeValueAsString(new Obj("냠냠이", 10, "123456789123")); 72 | 73 | mockMvc.perform(post("/valid") 74 | .content(content) 75 | .contentType(MediaType.APPLICATION_JSON) 76 | .accept(MediaType.APPLICATION_JSON)) 77 | .andExpect(status().is4xxClientError()) 78 | .andExpect(jsonPath("$.message").value("유효성 검사 실패 : 휴대폰 번호")) 79 | .andDo(print()); 80 | } 81 | 82 | 83 | } -------------------------------------------------------------------------------- /spring-querydsl/src/test/java/me/shinsunyoung/springquerydsl/repository/PersonRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package me.shinsunyoung.springquerydsl.repository; 2 | 3 | 4 | import static org.assertj.core.api.Assertions.assertThat; 5 | 6 | import com.querydsl.core.QueryResults; 7 | import com.querydsl.jpa.impl.JPAQueryFactory; 8 | import java.util.List; 9 | import javax.persistence.EntityManager; 10 | import javax.persistence.PersistenceContext; 11 | import me.shinsunyoung.springquerydsl.domain.Person; 12 | import me.shinsunyoung.springquerydsl.domain.QPerson; 13 | import me.shinsunyoung.springquerydsl.predicate.PersonPredicate; 14 | import org.junit.Before; 15 | import org.junit.Test; 16 | import org.junit.runner.RunWith; 17 | import org.springframework.beans.factory.annotation.Autowired; 18 | import org.springframework.boot.test.context.SpringBootTest; 19 | import org.springframework.test.context.junit4.SpringRunner; 20 | 21 | @RunWith(SpringRunner.class) 22 | @SpringBootTest 23 | public class PersonRepositoryTest { 24 | 25 | @Autowired 26 | private PersonRepository repository; 27 | 28 | @PersistenceContext // 영속성 객체를 자동으로 삽입해줌 29 | private EntityManager em; 30 | 31 | @Before 32 | public void cleanUp() throws Exception { 33 | repository.deleteAll(); 34 | 35 | repository.save(new Person("철수", "김", 22, "kim@chulsu.com")); 36 | repository.save(new Person("차차", "김", 15, "cha@cha.cha")); 37 | repository.save(new Person("프링", "스", 41, "spring@bo.com")); 38 | repository.save(new Person("자바", "김", 38, "imjava@java.net")); 39 | repository.save(new Person("쿼리", "최", 19, "choi@que.com")); 40 | repository.save(new Person("고당", "최", 76, "best@good.com")); 41 | repository.save(new Person("선화", "스", 11, "flower@cha.cha")); 42 | } 43 | 44 | @Test 45 | public void 모든_리스트_가져오기() throws Exception { 46 | List personList = repository.findAll(); 47 | assertThat(personList.size()).isEqualTo(7); // 총 갯수 48 | } 49 | 50 | @Test 51 | public void 김씨_성_찾기() throws Exception { 52 | 53 | JPAQueryFactory queryFactory = new JPAQueryFactory(em); 54 | 55 | QPerson person = QPerson.person; 56 | 57 | long result = queryFactory.selectFrom(person).where(person.lastName.eq("김")).fetchCount(); // 성이 김씨인 사람 찾기 58 | List result2 = queryFactory.selectFrom(person).where(person.lastName.eq("김"), person.email.like("%.com")).fetch(); // 성이 김씨이고 메일 뒤가 com으로 끝나는 사람 찾기 59 | QueryResults result3 = queryFactory.selectFrom(person).where(person.lastName.eq("김"), person.age.between(20,40)).fetchResults(); // 성이 김씨이고 나이가 20~40세 사이인 사람 찾기 60 | 61 | assertThat(result).isEqualTo(3); 62 | assertThat(result2.get(0).getFirstName()).isEqualTo("철수"); 63 | assertThat(result3.getTotal()).isEqualTo(2); 64 | } 65 | 66 | @Test 67 | public void 스선화_찾기() throws Exception { 68 | 69 | List result = (List) repository.findAll(PersonPredicate.search("선화", "스")); // 성이 스이고 이름이 선화인 사람 찾기 70 | List result2 = (List) repository.findAll(PersonPredicate.search(null, "스")); // 성이 스씨인 사람 찾기 71 | List result3 = (List) repository.findAll(PersonPredicate.search(null, null)); 72 | 73 | assertThat(result.size()).isEqualTo(1); 74 | assertThat(result2.size()).isEqualTo(2); 75 | assertThat(result3.size()).isEqualTo(7); 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /spring-aop/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /spring-poi/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /spring-caching/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /spring-querydsl/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /spring-security/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /spring-test/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | 88 | @rem Execute Gradle 89 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 90 | 91 | :end 92 | @rem End local scope for the variables with windows NT shell 93 | if "%ERRORLEVEL%"=="0" goto mainEnd 94 | 95 | :fail 96 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 97 | rem the _cmd.exe /c_ return code! 98 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 99 | exit /b 1 100 | 101 | :mainEnd 102 | if "%OS%"=="Windows_NT" endlocal 103 | 104 | :omega 105 | -------------------------------------------------------------------------------- /spring-validation/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /spring-rest-docs/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | 88 | @rem Execute Gradle 89 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 90 | 91 | :end 92 | @rem End local scope for the variables with windows NT shell 93 | if "%ERRORLEVEL%"=="0" goto mainEnd 94 | 95 | :fail 96 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 97 | rem the _cmd.exe /c_ return code! 98 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 99 | exit /b 1 100 | 101 | :mainEnd 102 | if "%OS%"=="Windows_NT" endlocal 103 | 104 | :omega 105 | -------------------------------------------------------------------------------- /spring-map-struct/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /intelliJ-plugin/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS='"-Xmx64m"' 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /spring-map-struct/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ]; do 30 | ls=$(ls -ld "$PRG") 31 | link=$(expr "$ls" : '.*-> \(.*\)$') 32 | if expr "$link" : '/.*' >/dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=$(dirname "$PRG")"/$link" 36 | fi 37 | done 38 | SAVED="$(pwd)" 39 | cd "$(dirname \"$PRG\")/" >/dev/null 40 | APP_HOME="$(pwd -P)" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=$(basename "$0") 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn() { 53 | echo "$*" 54 | } 55 | 56 | die() { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "$(uname)" in 69 | CYGWIN*) 70 | cygwin=true 71 | ;; 72 | Darwin*) 73 | darwin=true 74 | ;; 75 | MINGW*) 76 | msys=true 77 | ;; 78 | NONSTOP*) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ]; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ]; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ]; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then 109 | MAX_FD_LIMIT=$(ulimit -H -n) 110 | if [ $? -eq 0 ]; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ]; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ]; then 130 | APP_HOME=$(cygpath --path --mixed "$APP_HOME") 131 | CLASSPATH=$(cygpath --path --mixed "$CLASSPATH") 132 | JAVACMD=$(cygpath --unix "$JAVACMD") 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null) 136 | SEP="" 137 | for dir in $ROOTDIRSRAW; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ]; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@"; do 149 | CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -) 150 | CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition 153 | eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg") 154 | else 155 | eval $(echo args$i)="\"$arg\"" 156 | fi 157 | i=$(expr $i + 1) 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save() { 175 | for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /spring-aop/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /spring-poi/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /spring-caching/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /spring-querydsl/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /spring-security/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a userInfo-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | --------------------------------------------------------------------------------