├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── Dockerfile ├── DockerizeSpringBoot ├── ReadMe.md ├── frontend ├── css │ └── animate.min.css ├── index.html ├── js │ └── wow.min.js ├── pictures │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── favicon.png │ ├── header.jpg │ └── logo.png ├── style.css ├── template.js └── tutorials │ ├── Eklenti.txt │ ├── Html_Templates.html │ ├── Tymeleaf_Templates.html │ ├── _1_Html │ ├── Araştırma_Ödevi.txt │ ├── Templates.html │ ├── _01_formatter.html │ ├── _01_Ödev_formatter.png │ ├── _02_list.html │ ├── _02_Ödev_list.png │ ├── _03_table.html │ ├── _03_Ödev_table.png │ ├── _04_video_music.html │ ├── _05_favicon_iframe_map.html │ ├── _06_basic_form.html │ ├── _07_advancad_form.html │ └── _07_Ödev register.png │ ├── _2_Css3 │ ├── css.html │ ├── login-form-page-website-vector-template-registration-ui-design-144478124.jpg │ └── style.css │ ├── _3_Bootstrap │ ├── Templates.html │ ├── bootstrap_1.html │ └── countryside-6700296_640.jpg │ ├── _4_Project_OnePages │ └── Templates.html │ ├── _5_Javascript │ ├── Array.pdf │ ├── Javascript-1.html │ ├── Javascript-2.html │ ├── Template.js │ ├── Template2.js │ └── Templates.html │ ├── _6_jQuery │ └── Templates.html │ ├── _7_EcmaScript │ └── Templates.html │ ├── _8_React │ └── Templates.html │ ├── content │ └── movie.mp4 │ ├── picture │ ├── dag.jpg │ ├── doga.jpg │ ├── favicon.jpg │ ├── laptop-g4cd540ce6_1920.jpg │ ├── orman.jpg │ └── startup-g2b65a7d2a_1920.jpg │ └── tabnine.png ├── log └── blog.log ├── memory_persist └── denemedb.mv.db ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── hamitmizrak │ │ ├── EcodationFullStack3Application.java │ │ ├── bean │ │ ├── BeanConfig.java │ │ ├── BeanDto.java │ │ ├── ModelMapperBean.java │ │ ├── PasswordEncoderBean.java │ │ └── RegisterBean.java │ │ ├── business │ │ └── dto │ │ │ ├── ComputerDto.java │ │ │ ├── ProductDto.java │ │ │ └── RegisterDto.java │ │ ├── data │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── RegisterEntity.java │ │ └── repository │ │ │ └── IRegisterRepository.java │ │ ├── desinpattern │ │ ├── Deneme.java │ │ └── creational │ │ │ ├── _1_Singleton.java │ │ │ └── _2_Builder.java │ │ ├── exception │ │ ├── HamitMizrakException.java │ │ └── ResourceNotFoundException.java │ │ ├── git │ │ ├── Examples.java │ │ ├── Sunum.txt │ │ ├── fetch-pull.png │ │ ├── git_codes.html │ │ └── merge.png │ │ ├── iofilter │ │ ├── MainFilter.java │ │ └── ProductFilter.java │ │ ├── java │ │ ├── _001_WhatIsJava.java │ │ ├── _002_Variable.java │ │ ├── _003_Psvm.java │ │ ├── _004_Operator.java │ │ ├── _005_Primitive.java │ │ ├── _006_PrimitiveDefaultVariable.java │ │ ├── _007_Wrapper.java │ │ ├── _008_OtherSubject.java │ │ ├── _009_ornek_BirinciDerecenBirBilinmeyenli.java │ │ ├── _010_ornek_DereceyeCevirmek.java │ │ ├── _011_ornek_HesapMakinasi.java │ │ ├── _012_String.java │ │ ├── _013_System.java │ │ ├── _014_UserDataScanner.java │ │ ├── _014_UserDatajOptional.java │ │ ├── _015_EscapeCharacter.java │ │ ├── _016_Math.java │ │ ├── _017_Random.java │ │ ├── _018_Cast.java │ │ ├── _019_StringBuilderStringBuffer.java │ │ ├── _020_StringTokenizerStringSplit.java │ │ ├── _021_Conditional.java │ │ ├── _022_Conditional2.java │ │ ├── _023_Loop.java │ │ ├── _024_HomeWork.java │ │ ├── _025_isLetterisDigitisSymbol.java │ │ ├── _026_Formatter.java │ │ ├── _027_Date.java │ │ ├── _028_LocalDate.java │ │ ├── _029_TryCatchExceptionError.java │ │ ├── _030_CompilerTimeError.java │ │ ├── _031_TryCatchExceptionError.java │ │ ├── _032_HamitMizrak.java │ │ ├── _033_Method.java │ │ ├── _034_Enum.java │ │ ├── _035_Array.java │ │ ├── _036_MultipleArray.java │ │ ├── _037_ArrayExamples.java │ │ ├── _038_Country.java │ │ ├── _039_MultiThread.java │ │ ├── _040_IO.java │ │ ├── _041_Generics.java │ │ ├── _042_DataStructures.java │ │ ├── _043_JavaEllipsis.java │ │ ├── _044_DecoderEncoder.java │ │ ├── _045_RandomUUID.java │ │ └── _045_RecursiveFactoriyel.java │ │ ├── javase │ │ └── _001_WhatIsJava.java │ │ ├── linux │ │ ├── LinuxCodes.java │ │ └── linux_codes.txt │ │ ├── oop │ │ ├── OopTutorials.java │ │ ├── abstracx │ │ │ ├── MainClass.java │ │ │ ├── Person.java │ │ │ ├── Student.java │ │ │ └── Teacher.java │ │ ├── inheritance │ │ │ ├── MainClass.java │ │ │ ├── Person.java │ │ │ ├── Student.java │ │ │ └── Teacher.java │ │ └── interfacex │ │ │ ├── IDeneme.java │ │ │ └── MainClassData.java │ │ ├── pdf │ │ ├── Java Anahtar Kelimeleri ve Kısa Açıklamaları.pdf │ │ ├── JavaScript-call-apply-bind.pdf │ │ ├── Unicode sunum.rtf │ │ └── solid │ │ │ ├── _1_SingleResponsibility.java │ │ │ ├── _2_1_OpenClosedFailed.java │ │ │ └── _2_2_OpenClosedSuccess.java │ │ ├── pictures │ │ └── Exception-in-java1.png │ │ ├── security │ │ └── SecurityProject.java │ │ ├── socket │ │ ├── HamitMizrakException.java │ │ ├── TwoWayClient.java │ │ └── TwoWayServer.java │ │ └── ui │ │ ├── mvc │ │ ├── BeanController.java │ │ ├── ComputerController.java │ │ ├── ProductController.java │ │ ├── RegisterController.java │ │ └── SecurityController.java │ │ └── rest │ │ ├── client │ │ └── RegisterClientController.java │ │ └── impl │ │ └── RegisterRestController.java └── resources │ ├── application.properties │ ├── banner.txt │ ├── messages.properties │ ├── public │ ├── Deneme │ ├── Deneme.html │ └── error │ │ ├── 401.html │ │ ├── 403.html │ │ ├── 404.html │ │ └── 500.html │ ├── static │ ├── Deneme │ ├── css │ │ ├── styles.css │ │ └── template.css │ └── js │ │ ├── data.js │ │ └── template.js │ └── templates │ ├── admin.html │ ├── computer1.html │ ├── computer2.html │ ├── computer3.html │ ├── computer4.html │ ├── index.html │ ├── login.html │ ├── logout.html │ ├── publicPage.html │ ├── registerApiCreate.html │ ├── registerApiDetailPage.html │ ├── registerApiList.html │ ├── registerApiUpdate.html │ ├── registerClientCreate.html │ ├── registerClientDetailPage.html │ ├── registerClientList.html │ ├── registerClientUpdate.html │ ├── success.html │ ├── thymeleaf1.html │ ├── thymeleaf2.html │ ├── thymeleaf3.html │ ├── thymeleaf4.html │ └── thymeleaf5.html └── test └── java └── com └── hamitmizrak └── EcodationFullStack3ApplicationTests.java /.gitignore: -------------------------------------------------------------------------------- 1 | # special data 2 | secret 3 | log 4 | memory_persist 5 | 6 | HELP.md 7 | target/ 8 | !.mvn/wrapper/maven-wrapper.jar 9 | !**/src/main/**/target/ 10 | !**/src/test/**/target/ 11 | 12 | ### STS ### 13 | .apt_generated 14 | .classpath 15 | .factorypath 16 | .project 17 | .settings 18 | .springBeans 19 | .sts4-cache 20 | 21 | ### IntelliJ IDEA ### 22 | .idea 23 | *.iws 24 | *.iml 25 | *.ipr 26 | 27 | ### NetBeans ### 28 | /nbproject/private/ 29 | /nbbuild/ 30 | /dist/ 31 | /nbdist/ 32 | /.nb-gradle/ 33 | build/ 34 | !**/src/main/**/build/ 35 | !**/src/test/**/build/ 36 | 37 | ### VS Code ### 38 | .vscode/ 39 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Rest Api Dockerize 2 | FROM openjdk:18 3 | LABEL maintainer="hamitmizrak" 4 | ADD target/DevOps_PropertyFinder-0.0.1-SNAPSHOT.jar DevOps_PropertyFinder.jar 5 | ENTRYPOINT ["java", "-jar" ,"DevOps_PropertyFinder.jar"] -------------------------------------------------------------------------------- /DockerizeSpringBoot: -------------------------------------------------------------------------------- 1 | 1.ADIM: maven package jar oluştur 2 | ####################### 3 | 2.ADIM: Dockerfile yaz 4 | 5 | # Rest Api Dockerize 6 | FROM openjdk:18 7 | LABEL maintainer="hamitmizrak" 8 | ADD target/DevOps_PropertyFinder-0.0.1-SNAPSHOT.jar DevOps_PropertyFinder.jar 9 | ENTRYPOINT ["java", "-jar" ,"DevOps_PropertyFinder.jar"] 10 | 11 | ####################### 12 | Dockerfile sonrasında ==> 13 | docker build . 14 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | ![](https://komarev.com/ghpvc/?username=hamitmizrak) 2 | 3 | ![readme](./picture/readme.jpg) 4 | 5 | # Ecodation Java Full Stack Developer -3 (18 Haziran 2022) 6 | * [GitHub]() 7 | 8 | ```shell 9 | git clone 10 | ``` 11 | 12 | ### Gereksinimler 13 | Java 18 14 | intellij idea Ultimate 15 | Visual Studio Code 16 | Node js 17 | --- 18 | 19 | ## Visual Studio codes 20 | Extensisons 21 | - Browser preview 22 | - Auto Close tag 23 | - Auto import 24 | - Auto rename tag 25 | - Bootstrap 5 Quick Snipperts 26 | - Bracket Pair Colorizer 2 27 | - Css Snippet 28 | - Es7+ React/REdux/React-Native snippets 29 | - Html Snippets 30 | - JsQuery Snippets 31 | - Live Server 32 | - Material Icon Theme 33 | - Open-in-Browser 34 | - Path Intellisense 35 | - Prettier Code formatter 36 | - Project Manager 37 | - Reactjs code Snippets 38 | --- 39 | 40 | ## Tecnology 41 | ##FrontEnd 42 | - Html5 43 | - Css3 44 | - responsive design 45 | - Js 46 | - jquery 47 | - Bootstrap 48 | - react 49 | --- 50 | 51 | ## BackEnd 52 | * javase 53 | * jdbc crud native 54 | * hibernate 55 | * spring core 56 | * spring mvc 57 | * spring data 58 | * spring rest 59 | * spring security 60 | 61 | --- 62 | 63 | ## Libraries 64 | Thymeleaf 65 | Lombok 66 | Validation 67 | 68 | ## Database 69 | > H2 Database 70 | > Mysql 71 | > Postgresql 72 | 73 | --- 74 | ## dependency 75 | Spring Web 76 | Spring Data JPA 77 | Spring Rest 78 | Spring Security 79 | 80 | --- 81 | # Spring Tools 82 | Spring Boot DevTools 83 | Spring Configuration Processor 84 | Spring Boot Actuator 85 | 86 | --- 87 | 88 | ## Docker Deployment 89 | 90 | 1.ADIM 91 | npx create-react-app frontend 92 | cd frontend 93 | npm start 94 | code . 95 | 96 | 2.ADIM 97 | NOT: node_modules siliyoruz bunu sonrasında 98 | npm i 99 | 100 | 3.ADIM 101 | terminal: package.json seviyesinde olacak şekilde 102 | npm install axios 103 | npm install bootstrap --save 104 | npm install node-sass --save 105 | 106 | 107 | -------------------------------------------------------------------------------- /frontend/pictures/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/pictures/1.jpg -------------------------------------------------------------------------------- /frontend/pictures/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/pictures/2.jpg -------------------------------------------------------------------------------- /frontend/pictures/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/pictures/3.jpg -------------------------------------------------------------------------------- /frontend/pictures/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/pictures/4.jpg -------------------------------------------------------------------------------- /frontend/pictures/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/pictures/favicon.png -------------------------------------------------------------------------------- /frontend/pictures/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/pictures/header.jpg -------------------------------------------------------------------------------- /frontend/pictures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/pictures/logo.png -------------------------------------------------------------------------------- /frontend/template.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/template.js -------------------------------------------------------------------------------- /frontend/tutorials/Eklenti.txt: -------------------------------------------------------------------------------- 1 | https://github.com/tonsky/FiraCode 2 | https://www.youtube.com/watch?v=ieY1GuP5nJw 3 | 4 | tabnine 5 | -------------------------------------------------------------------------------- /frontend/tutorials/Html_Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Portfolyo Sites 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /frontend/tutorials/Tymeleaf_Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Ana Sayfa

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/Araştırma_Ödevi.txt: -------------------------------------------------------------------------------- 1 | HTML5 2 | ############################## 3 | semantic- non-semantic nedir ? 4 | colspan ve rowspan nedir ? 5 | 6 | 7 | 8 | CSS3 9 | ############################## 10 | 11 | 12 | 13 | BOOTSTRAP 14 | ############################## 15 | 16 | 17 | 18 | JAVASCRIPT 19 | ############################## 20 | 21 | 22 | 23 | JQUERY 24 | ############################## 25 | 26 | 27 | 28 | ES5-6 29 | ############################## 30 | 31 | 32 | REACT 33 | ############################## -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My template 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_01_formatter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My template 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 47 | bold
48 | italic
49 | big
50 | güçlü
51 | small
52 | code
53 | vurgulu
54 | fosforlu kalem
55 | H2O
56 | 102
57 | 10.000 TL 9.999 TL
58 | 59 | 60 |
61 |
==> alt satıra geçmek 62 | 63 | aynı satırdan devam etmek için kullanırız 64 |
==> uzun çizgi 65 |

Lorem ipsum dolor sit amet consectetur adipisicing elit.

66 |
67 | 68 |

heading -1

69 |

heading -2

70 |

heading -3

71 |

heading -4

72 |
heading -5
73 |
heading -6
74 |
75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_01_Ödev_formatter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/_1_Html/_01_Ödev_formatter.png -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_02_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My template 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | Google 47 | 48 | 49 | 50 | not picture 51 | 52 | 53 |
54 | 55 | not picture 56 | 57 | 58 |
59 | 60 | ul: unordered list:düzensiz 61 | 66 | 67 | ol: ordered list:düzenli 68 |
    69 |
  1. düzenli-1
  2. 70 |
  3. düzenli-2
  4. 71 |
  5. düzenli-3
  6. 72 |
73 | 74 | örnek 75 |
    76 |
  1. Frontend
  2. 77 |
  3. Backend
  4. 78 |
  5. 79 | Database 80 | 85 |
  6. 86 |
87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_02_Ödev_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/_1_Html/_02_Ödev_list.png -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_03_table.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My template 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
IDFrontendBackendDatabase
1Html5JavaMysql
2Html5JavaMysql
© Bütün Haklar saklıdır
77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_03_Ödev_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/_1_Html/_03_Ödev_table.png -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_04_video_music.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My template 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
50 | 51 | 52 | 53 |
54 |

Video

55 | 60 |
61 | 62 |

Music

63 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_05_favicon_iframe_map.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My template 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
50 | 51 | 52 |
53 | 54 |
55 |

Emoji: UTF-8

56 | 128516 57 | 128525 58 | 128151 59 | 60 |

😍

61 | 62 | 63 |

iframe

64 | 65 | 66 |
67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_06_basic_form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My template 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
50 |
51 |

Register

52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 80 | 81 | 82 | 83 |
Adı:
Soyadı:
Email:
Password:
77 | 78 | 79 |
84 |
85 | 86 | 87 |
88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /frontend/tutorials/_1_Html/_07_Ödev register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/_1_Html/_07_Ödev register.png -------------------------------------------------------------------------------- /frontend/tutorials/_2_Css3/login-form-page-website-vector-template-registration-ui-design-144478124.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/_2_Css3/login-form-page-website-vector-template-registration-ui-design-144478124.jpg -------------------------------------------------------------------------------- /frontend/tutorials/_3_Bootstrap/Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Ana Sayfa

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /frontend/tutorials/_3_Bootstrap/countryside-6700296_640.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/_3_Bootstrap/countryside-6700296_640.jpg -------------------------------------------------------------------------------- /frontend/tutorials/_4_Project_OnePages/Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Ana Sayfa

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /frontend/tutorials/_5_Javascript/Array.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/_5_Javascript/Array.pdf -------------------------------------------------------------------------------- /frontend/tutorials/_5_Javascript/Template2.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $(document).keydown(function (tus) { 3 | //alert(tus); 4 | //console.log(tus); 5 | //document.writeln(tus.keyCode); 6 | tus.preventDefault(); 7 | if (tus.ctrlKey) { 8 | if ((tus.keyCode == 66)) { 9 | alert("siz Ctrl+b bastınız"); 10 | } 11 | } 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /frontend/tutorials/_5_Javascript/Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Ana Sayfa

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /frontend/tutorials/_6_jQuery/Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Ana Sayfa

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /frontend/tutorials/_7_EcmaScript/Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Ana Sayfa

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /frontend/tutorials/_8_React/Templates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Ana Sayfa

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /frontend/tutorials/content/movie.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/content/movie.mp4 -------------------------------------------------------------------------------- /frontend/tutorials/picture/dag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/picture/dag.jpg -------------------------------------------------------------------------------- /frontend/tutorials/picture/doga.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/picture/doga.jpg -------------------------------------------------------------------------------- /frontend/tutorials/picture/favicon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/picture/favicon.jpg -------------------------------------------------------------------------------- /frontend/tutorials/picture/laptop-g4cd540ce6_1920.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/picture/laptop-g4cd540ce6_1920.jpg -------------------------------------------------------------------------------- /frontend/tutorials/picture/orman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/picture/orman.jpg -------------------------------------------------------------------------------- /frontend/tutorials/picture/startup-g2b65a7d2a_1920.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/picture/startup-g2b65a7d2a_1920.jpg -------------------------------------------------------------------------------- /frontend/tutorials/tabnine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/frontend/tutorials/tabnine.png -------------------------------------------------------------------------------- /memory_persist/denemedb.mv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/memory_persist/denemedb.mv.db -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/EcodationFullStack3Application.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; 6 | 7 | 8 | //exclude:dahil etmemek 9 | /*@SpringBootApplication(exclude = { 10 | //SecurityAutoConfiguration.class 11 | //org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, 12 | // org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration.class 13 | } 14 | )*/ 15 | @SpringBootApplication 16 | public class EcodationFullStack3Application { 17 | 18 | //PSVM Method 19 | public static void main(String[] args) { 20 | 21 | //devtool active inactive 22 | System.setProperty("spring.devtools.restart.enabled","true"); 23 | 24 | //Disables headless JOptionPane 25 | System.setProperty("java.awt.headless", "false"); 26 | 27 | //PSVM 28 | SpringApplication.run(EcodationFullStack3Application.class, args); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/bean/BeanConfig.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.bean; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | public class BeanConfig { 8 | 9 | @Bean 10 | public BeanDto beanDto(){ 11 | return BeanDto.builder().id(44L).beanData("Bean Data ").beanName("Bean Adı"). build(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/bean/BeanDto.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.bean; 2 | 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.extern.log4j.Log4j2; 9 | 10 | @Data 11 | @NoArgsConstructor 12 | @AllArgsConstructor 13 | @Builder 14 | @Log4j2 15 | public class BeanDto { 16 | 17 | private Long id; 18 | private String beanName; 19 | private String beanData; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/bean/ModelMapperBean.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.bean; 2 | 3 | import org.modelmapper.ModelMapper; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class ModelMapperBean { 9 | 10 | @Bean 11 | public ModelMapper modelMapperMethod(){ 12 | return new ModelMapper(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/bean/PasswordEncoderBean.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.bean; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 6 | import org.springframework.security.crypto.password.PasswordEncoder; 7 | 8 | @Configuration 9 | public class PasswordEncoderBean { 10 | 11 | @Bean 12 | public PasswordEncoder passwordEncoderMethod(){ 13 | return new BCryptPasswordEncoder(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/bean/RegisterBean.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.bean; 2 | 3 | import com.hamitmizrak.data.entity.RegisterEntity; 4 | import com.hamitmizrak.data.repository.IRegisterRepository; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | @Configuration 10 | public class RegisterBean { 11 | 12 | @Autowired 13 | IRegisterRepository repository; 14 | 15 | @Bean 16 | public void registerData(){ 17 | for (int i = 1; i <=5 ; i++) { 18 | RegisterEntity registerEntity=RegisterEntity.builder().name("adi "+i).email("email"+i+"@xyz.com").password("Hm12"+i). build(); 19 | repository.save(registerEntity); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/business/dto/ComputerDto.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.business.dto;public class ComputerDto { 2 | } 3 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/business/dto/ProductDto.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.business.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | import lombok.extern.log4j.Log4j2; 8 | 9 | @Data 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | @Builder 13 | @Log4j2 14 | public class ProductDto { 15 | 16 | private Long id; 17 | private String productName; 18 | private double productPrice; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/business/dto/RegisterDto.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.business.dto; 2 | import lombok.Data; 3 | import javax.validation.constraints.Email; 4 | import javax.validation.constraints.NotEmpty; 5 | import javax.validation.constraints.Pattern; 6 | import javax.validation.constraints.Size; 7 | import java.io.Serializable; 8 | 9 | //lombok 10 | @Data 11 | public class RegisterDto implements Serializable { 12 | public static final long serialVersionUID = 1L; 13 | 14 | private Long id; 15 | 16 | //validation 17 | @NotEmpty(message = "adı boş geçilemez") 18 | private String name; 19 | 20 | @NotEmpty(message = "email boş geçilemez") 21 | @Email(message = "uygun formatta girmediniz örneğin: deneme@xyz.com") 22 | private String email; 23 | 24 | @NotEmpty(message = "Şifre boş geçilemez") 25 | @Size(min=5,max=10,message = "kullanıcı şifresi 5 ile 10 arasında olması gerekiyor.") 26 | //@Pattern( regexp = "^[a-zA-Z0-9]{5}") 27 | private String password; 28 | 29 | //parametresiz constructor 30 | public RegisterDto() {} 31 | 32 | //parametreli constructor 33 | public RegisterDto(Long id, String name, String email, String password) { 34 | this.id = id; 35 | this.name = name; 36 | this.email = email; 37 | this.password = password; 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/data/entity/BaseEntity.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.data.entity; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.hibernate.annotations.CreationTimestamp; 6 | 7 | import javax.persistence.*; 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | //lombok 12 | @Getter @Setter 13 | 14 | //sup class 15 | @MappedSuperclass 16 | abstract public class BaseEntity implements Serializable { 17 | public static final long serialVersionUID = 1L; 18 | 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.IDENTITY) 21 | private Long id; 22 | 23 | @Temporal(TemporalType.TIMESTAMP) 24 | @CreationTimestamp 25 | @Column(name = "created_date") 26 | private Date createdDate; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/data/entity/RegisterEntity.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.data.entity; 2 | import lombok.AllArgsConstructor; 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import javax.persistence.*; 7 | import java.io.Serializable; 8 | 9 | //lombok 10 | @Data 11 | @NoArgsConstructor 12 | @AllArgsConstructor 13 | @Builder 14 | 15 | //Entity 16 | @Entity 17 | @Table(name="register") 18 | public class RegisterEntity extends BaseEntity implements Serializable { 19 | public static final Long serialVersionUID =1L; 20 | 21 | private String name; 22 | @Column(name="email",nullable = false,unique = false) 23 | private String email; 24 | 25 | private String password; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/data/repository/IRegisterRepository.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.data.repository; 2 | 3 | import com.hamitmizrak.data.entity.RegisterEntity; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | public interface IRegisterRepository extends CrudRepository { 11 | 12 | List findByName(String name); 13 | List findDistinctByName(String name); 14 | List findByNameStartsWith(String name); 15 | List findByNameEndsWith(String name); 16 | List findFirstByOrderById(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/desinpattern/Deneme.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.desinpattern; 2 | 3 | public class Deneme { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/desinpattern/creational/_1_Singleton.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.desinpattern.creational; 2 | 3 | // sadece 1 tane instance kullanmak kullanıyoruz 4 | public class _1_Singleton { 5 | 6 | //1 constructor private yapmak 7 | private _1_Singleton(){} 8 | 9 | //Class değişkeni 10 | private static _1_Singleton instance; 11 | 12 | public static _1_Singleton getInstance() { 13 | if(instance==null){ 14 | instance=new _1_Singleton(); 15 | } 16 | return instance; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/desinpattern/creational/_2_Builder.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.desinpattern.creational; 2 | 3 | public class _2_Builder { 4 | //Creation Design Pattern 2. 5 | //Parametreli constructor aza indirmek için kullanıyoruz 6 | } 7 | 8 | //Writer 9 | class Writer{ 10 | //field 11 | private int id; 12 | private String name; 13 | private String surname; 14 | 15 | //constructor 16 | public Writer(Builder builder) { 17 | this.id = builder.id; 18 | this.name = builder.name; 19 | this.surname = builder.surname; 20 | } 21 | //toString 22 | @Override 23 | public String toString() { 24 | return "Writer{" + "id=" + id + ", name=" + name + ", surname=" + surname + '}'; 25 | } 26 | 27 | //Nested Class (inner class) 28 | //Normalde Javada birden fazla public veya static class yazamazsınız (inner class hariç) 29 | public static class Builder{ 30 | //field 31 | private int id; 32 | private String name; 33 | private String surname; 34 | 35 | //parametresiz constructor 36 | public Builder() { 37 | } 38 | 39 | //parametreli Builder Class id Metodu 40 | public Builder id (int id) { 41 | this.id = id; 42 | return this; 43 | } 44 | //parametreli Builder Class name Metodu 45 | public Builder name(String name) { 46 | this.name = name; 47 | return this; 48 | } 49 | //parametreli Builder Class surname Metodu 50 | public Builder surname(String surname) { 51 | this.surname = surname; 52 | return this; 53 | } 54 | 55 | //build: ana class ile nested classı bağla 56 | public Writer build(){ 57 | return new Writer(this); 58 | } 59 | 60 | } 61 | } 62 | 63 | 64 | //PSVM MainClass 65 | class MainClass{ 66 | public static void main(String[] args) { 67 | Writer writer=new Writer.Builder().id(1).name("Hamit").surname("Mızrak").build(); 68 | System.out.println(writer); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/exception/HamitMizrakException.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.exception; 2 | 3 | public class HamitMizrakException extends RuntimeException{ 4 | 5 | public HamitMizrakException(String message) { 6 | super(message); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value= HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException{ 8 | 9 | public ResourceNotFoundException(String message) { 10 | super(message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/git/Examples.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.git; 2 | 3 | public class Examples { 4 | 5 | //JDK -SDK : Aleyna 6 | //Dilara : Merge -Rebase arasındaki farklar 7 | //Kadir : pull ile Fetch arasındaki farklar ? 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/git/Sunum.txt: -------------------------------------------------------------------------------- 1 | Merge-Rebase --> Dilara 2 | 3 | Aslında ikiside aynı kapıya çıkan, amacı iki branchi birleştirmek Merge ve Rebase’in. Birbirinden ayrıldıkları nokta amaçlarına nasıl ulaştıkları. 4 | Projemizin bir master branchi(ana branch) ve sonnradan bizim oluşturduğumuz diğer branchleri oluyor. 5 | Merge yaptığmızda iki branchdeki tüm dosyalar birleşiyor ve bu branchlerin tüm historysini ulaşabiliyoruz. Yani yaptığımız tüm commit işlemlerini görebiliyoruz. Master branch, diğer branch te yapılan tüm değişiklikleri alıyor ve kendisine entegre ediyor. 6 | Rebase de ise rebase komutu yazılan branch diğer branchteki dosyaları kendine ekler ve tek bir commit geçmişi oluşur. Diğer branchte herhangi bir değişiklik olmuyor ve history kısmında branchlerin birleştiğine dair bir bilgi görmüyoruz.Rebase sonrasında projenizin iki farklı branch'i olduğuna dair herhangi bir tarihsel iz oluşmaz. 7 | Eğer tüm değişiklikleri görmek istiyorsanız merge yapmak daha mantıklı çünkü merge tüm değişiklikleri olduğu gibi korur. 8 | 9 | ######################################################################################################################################################### 10 | 11 | Pull-Fetch --> Kadir 12 | 13 | 14 | 15 | ######################################################################################################################################################### 16 | 17 | JDK -SDK : Aleyna 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/git/fetch-pull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/src/main/java/com/hamitmizrak/git/fetch-pull.png -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/git/git_codes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Document 9 | 10 | 11 | iyi bir commit özellikleri 12 | 1-) hatasız kodları göndermek 13 | 2-) çok kod olarak göndermemek birbiriyle alakasız dosyaları göndermeyin. 14 | 3-) micro düzeyde ilermek makro komutlardan sakınmak 15 | 16 | git clone https://github.com/hamitmizrak/EcodationJavaFullStack3.git 17 | 18 | git init 19 | git status 20 | 21 | git add . 22 | git add deneme.txt 23 | git add java* 24 | 25 | git commit -m "1.satır" 26 | git commit --amend -m "1.satır revize" 27 | git commit -a -m "3.commit" 28 | 29 | git --help 30 | git log 31 | 32 | 33 | git branch -M main 34 | git remote add origin https://github.com/hamitmizrak/EcodationJavaFullStack3.git 35 | 36 | git stash 37 | git stash save "satashAdi" 38 | git stash list 39 | git stash apply stash@{0} 40 | git stash pop 41 | git stash drop stash@{0} 42 | 43 | git brach 44 | git branch frontend 45 | git checkout frontend 46 | 47 | git add . 48 | git commit -m "yeni kod" 49 | git checkout main 50 | git merge frontend 51 | git merge --no-ff frontend (no fast forward) 52 | 53 | git branch 54 | git branch frontend 55 | git checkout frontend 56 | VEYA 57 | git checkout -b frontend 58 | git branch -D frontend ==> delete 59 | 60 | git checkout -b backend 61 | cat >> deneme.txt 62 | git add . 63 | git commit -m "backend" 64 | git push -u origin backend 65 | 66 | git tag 67 | git add . 68 | git commit -m "version1" 69 | git tag v1 70 | 71 | cat >> version2.txt 72 | git add . 73 | git commit -m "version2" 74 | git tag v2 75 | 76 | 77 | git checkout v1 78 | git checkout v2 79 | git checkout main 80 | 81 | git tag --delete v1 v2 82 | git push origin v1 83 | 84 | cat >> .gitigore ==> git tarafından takip edilmesini istemediğimiz dosyalar için kullanılır 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/git/merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/src/main/java/com/hamitmizrak/git/merge.png -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/iofilter/MainFilter.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.iofilter; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | import java.util.Arrays; 6 | import java.util.List; 7 | 8 | //Class düzleminde filter yapmak 9 | @Log4j2 10 | public class MainFilter { 11 | 12 | // filterMethod 13 | private static void filterMethod() { 14 | //Instance 15 | ProductFilter filter1 = ProductFilter.builder().id(1L).name("ürün 1 ").price(100).build(); 16 | ProductFilter filter2 = ProductFilter.builder().id(1L).name("ürün 2 ").price(200).build(); 17 | ProductFilter filter3 = ProductFilter.builder().id(1L).name("ürün 3 ").price(300).build(); 18 | ProductFilter filter4 = ProductFilter.builder().id(1L).name("ürün 4 ").price(400).build(); 19 | 20 | //Arrays.asList() 21 | List filterList = Arrays.asList(filter1, filter2, filter3,filter4); 22 | int counterProduct=0; 23 | for( ProductFilter temp : filterList){ 24 | if(temp.getPrice()>=200){ 25 | log.info(temp); 26 | counterProduct++; 27 | } 28 | } 29 | log.info(counterProduct+" Tane veri bulundu"); 30 | } //end filterMethod 31 | 32 | //PSVM 33 | public static void main(String[] args) { 34 | filterMethod(); 35 | } 36 | 37 | } //end MainFilter 38 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/iofilter/ProductFilter.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.iofilter; 2 | 3 | import lombok.Builder; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Getter @Setter 8 | @Builder 9 | public class ProductFilter { 10 | 11 | // object variable 12 | private Long id; 13 | private String name; 14 | private int price; 15 | 16 | //parametresiz constructor 17 | public ProductFilter() { 18 | this.id=0L; 19 | this.name="ürün adı girilmedi"; 20 | this.price=0; 21 | } 22 | 23 | //parametresiz constructor 24 | public ProductFilter(Long id, String name, int price) { 25 | this.id = id; 26 | this.name = name; 27 | this.price = price; 28 | } 29 | 30 | //toString method 31 | 32 | @Override 33 | public String toString() { 34 | return "ProductFilter{" + 35 | "id=" + id + 36 | ", name='" + name + '\'' + 37 | ", price=" + price + 38 | '}'; 39 | } 40 | 41 | }//end ProductFilter 42 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_002_Variable.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _002_Variable { 4 | 5 | 6 | /* 7 | Variable: Değişken 8 | camelCase yazalım Örneğin: String degiskenAdi; 9 | Değişken adları isim,sıfat olacak şekilde kurgulabiliriz. 10 | Kısa ve öz olmalı gelecekteki biz onu okuduğumuzda hemen anlamalıyız. 11 | değişkenlerleri ingilizce kelimeler kullanırsak çok daha iyidir 12 | Türkçedeki üğşçö kullanmayalım kullanırsak birşey olmaz ancak compilerdan sonra bu harflerin karşılığı yoksa hata verir 13 | String çözümDüğümü; 14 | Unicode Ascii code nedir ? 15 | Değişken adları olarak rezerve edilmiş kelimler kullanamazsınız. Aşağıdaki kullanamazsınız 16 | https://tr.wikibooks.org/wiki/Java/Anahtar_kelimeler 17 | 18 | */ 19 | 20 | 21 | /* //camelCase 22 | String degiskenAdi; 23 | 24 | //Dolar veya altçizgi(_) ile başlayabiliriz. bunların hariçinde sayı veya özel singelerle başlanmaz 25 | String $degiskenAdi; 26 | String _degiskenAdi; 27 | 28 | //Dolar veya altçizgi(_) ile başlayabiliriz. bunların hariçinde sayı veya özel singelerle başlanmaz 29 | String +_degiskenAdi; 30 | String ~_degiskenAdi; 31 | String &_degiskenAdi; 32 | 33 | //Değişkenler sayı ile başlamaz ancak sayı ile bitebilir. 34 | String 44_degiskenAdi; 35 | String _degiskenAdi44;*/ 36 | String deneme; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_003_Psvm.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _003_Psvm { 4 | 5 | //psvm ===> TAB 6 | public static void main(String[] args) { 7 | 8 | //sout ==> TAB 9 | System.out.println("Merhaba Dünya"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_004_Operator.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _004_Operator { 4 | 5 | //psvm ===> TAB 6 | public static void main(String[] args) { 7 | //Aritmetik operatörler: + - * / % 8 | //ilişkisel operatörler < <= > >= 9 | //Mantıksal Operatörler: &&=VE ||=VEYA !=DEĞİL 10 | //Atama operatörler: String kelime="Malatya" +=, -= ,*=, /= 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_005_Primitive.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _005_Primitive { 4 | 5 | //psvm ===> TAB 6 | public static void main(String[] args) { 7 | 8 | //Syntax Error 9 | //logical Error 10 | //Run time Error 11 | //Compiler Time Error 12 | 13 | //cast: f-L 14 | 15 | //Primitive Type 16 | // 8 tane türü vardır. 17 | //ilke Türler javanın 100/100 OOP olmamasına neden olandır. 18 | //Hafıza Stack Memory kullanır. 19 | //instance (new ) kullanmadan çalışır. 20 | //null değer alamazlar. 21 | //bazen primitive türleri Wrapper yapılara çevirmekn zorunda kalırız. 22 | 23 | 24 | // primitive Type : 8 tane primitive Type vardır. 25 | // tamsayılar: b1;//true 39 | b3=1>5; //false 40 | 41 | //karakter: char 42 | char c4='@'; 43 | System.out.println(c4); 44 | 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_006_PrimitiveDefaultVariable.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _006_PrimitiveDefaultVariable { 4 | 5 | //psvm ===> TAB 6 | public static void main(String[] args) { 7 | 8 | 9 | 10 | //Primitive Type 11 | // 8 tane türü vardır. 12 | //ilke Türler javanın 100/100 OOP olmamasına neden olandır. 13 | //Hafıza Stack Memory kullanır. 14 | //instance (new ) kullanmadan çalışır. 15 | //null değer alamazlar. 16 | //bazen primitive türleri Wrapper yapılara çevirmekn zorunda kalırız. 17 | 18 | 19 | // primitive Type : 8 tane primitive Type vardır. 20 | // tamsayılarda default : 0 (Sıfır): b TAB 6 | public static void main(String[] args) { 7 | 8 | //Data type: Primitive + Wrapper 9 | //Primitive Type 10 | // 8 tane türü vardır. 11 | //ilke Türler javanın 100/100 OOP olmamasına neden olandır. 12 | //Hafıza Stack Memory kullanır. 13 | //instance (new ) kullanmadan çalışır. 14 | //null değer alamazlar. 15 | //bazen primitive türleri Wrapper yapılara çevirmekn zorunda kalırız. 16 | //String primitive Değildir. 17 | 18 | // primitive Type : 8 tane primitive Type vardır. 19 | // tamsayılar: b1;//true 33 | b3=1>5; //false 34 | 35 | //karakter: char 36 | char c4='@'; 37 | System.out.println(c4); 38 | 39 | ///////////////////////////////////////////////////////////////////////////////////////////// 40 | //Wrapper Type (Sarmalayıcı Type) 41 | //Data type: Primitive + Wrapper 42 | //Gelişmiş tiplerdir 43 | //Hafıza Heap Memory kullanır. 44 | //instance (new ) kullanıyoruz. 45 | //null değer verebiliriz.. 46 | //String wrapper type. 47 | 48 | Byte wb1 = 127; 49 | Short ws1 = 128; 50 | Integer wi1 = 1555155; 51 | Long wl1 = 151515151545L; 52 | 53 | // virgüllü sayılar: float TAB 6 | public static void main(String[] args) { 7 | 8 | long telephoneNumber1=11122334455L; 9 | System.out.println(telephoneNumber1); 10 | 11 | long telephoneNumber2=111_22_33_44_55L; 12 | System.out.println(telephoneNumber2); 13 | 14 | // sayı sistemleri 15 | //2 sayı sistemi (0-1) 16 | int binary=0b00110; 17 | System.out.println(binary); 18 | 19 | //8 sayı sistemi (1-2-3-4-5-6-7) 20 | int octal = 7415120; 21 | System.out.println(octal); 22 | 23 | 24 | //16 sayı sistemi (1-2-3-4-5-6-7-8-9-a-b-c-d-e-f) 25 | int hexadecimal = 0xfff; 26 | System.out.println(hexadecimal); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_009_ornek_BirinciDerecenBirBilinmeyenli.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _009_ornek_BirinciDerecenBirBilinmeyenli { 4 | 5 | //psvm ===> TAB 6 | public static void main(String[] args) { 7 | 8 | //X=5k+8y 9 | //k=5//y=3 10 | 11 | int x,k=5,y=3; 12 | x=5*k+8*y; 13 | System.out.println(x); 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_010_ornek_DereceyeCevirmek.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _010_ornek_DereceyeCevirmek { 4 | 5 | //psvm ===> TAB 6 | public static void main(String[] args) { 7 | 8 | //Dereceyi Fahrenhayta çevirmek 9 | // F=C*9/5+32 10 | double f,c=0; 11 | f=c*9/5+32; 12 | System.out.println(f); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_011_ornek_HesapMakinasi.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _011_ornek_HesapMakinasi { 4 | 5 | //psvm ===> TAB 6 | public static void main(String[] args) { 7 | 8 | // x=20,y=5; 9 | //bu değişkenlerin; 10 | //1-) Toplamları 11 | //2-) Çarpmaları 12 | //3-) Bölme x/y 13 | //4-) Kalan x%y 14 | //5-) Çıkarma 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_012_String.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import java.util.Locale; 4 | 5 | public class _012_String { 6 | 7 | //psvm ===> TAB 8 | public static void main(String[] args) { 9 | //String primitive type değildir. 10 | String dataValue = "Merhabalar Nasılsınız"; 11 | System.out.println("Karakter Sayısı: " + dataValue.length()); 12 | System.out.println("trim: başından veya sonunda boşlukları al" + dataValue.trim().length()); 13 | System.out.println("M ile mi başlıyor" + dataValue.startsWith("M")); 14 | System.out.println("z ile mi bitiyor" + dataValue.endsWith("z")); 15 | System.out.println("bütün harfler küçük olsun" + dataValue.toLowerCase()); 16 | System.out.println("bütün harfler büyük olsun" + dataValue.toUpperCase()); 17 | 18 | //charAt: biz sayı veririz bize harf döner ==> sıfırıncı indisten başlar bize harf döner 19 | System.out.println(dataValue.charAt(0)); 20 | System.out.println(dataValue.charAt(20)); 21 | System.out.println(dataValue.charAt(dataValue.length() - 1)); 22 | 23 | //indexOf ==>Harf veririrz bize sayı döner 24 | System.out.println(dataValue.indexOf("Merhabalar")); 25 | System.out.println(dataValue.lastIndexOf("Merhabalar")); 26 | 27 | //replace: değiştirmek için 28 | String newData = "Yeni kelime"; 29 | String allData = dataValue.replace(dataValue, newData); 30 | System.out.println(allData); 31 | 32 | //contains: Bu cümlede bu kelime geçiyor mu ? sonuç doğruysa: true döner 33 | System.out.println(dataValue.contains("Merhabalar")); 34 | 35 | //concat: cümlenin sonuna ekleme yapar. 36 | String data = dataValue.concat(".INC"); 37 | System.out.println(data); 38 | 39 | //isEmpty(): Boş mu ? eğer varsa hayır dolu dönüş false 40 | System.out.println(dataValue.isEmpty()); 41 | 42 | //equals: kelimeler birbirine eşit mi eşitse dönüş true 43 | System.out.println(dataValue.equals("Merhabalar Nasılsınız Merhabalar")); 44 | 45 | 46 | //subString: kelimeyi parçalamak 47 | //unutma: subString conditional ile çözmemiz gerekiyor. 48 | if (dataValue.length() > 30) { 49 | System.out.println(dataValue.substring(1)); 50 | System.out.println(dataValue.substring(1, 4)); //1<=X<=4-1 51 | //kelimenin sondan 2 karakterden sonrasını göster 52 | System.out.println(dataValue.substring(30)); 53 | System.out.println(dataValue.substring(dataValue.length() - 2)); 54 | } 55 | 56 | //split: regex String dizisine dönüştürür. 57 | String[] arrayData = dataValue.split(" "); 58 | for (String temp : arrayData) { 59 | System.out.println(temp); 60 | } 61 | 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_013_System.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import java.util.Date; 4 | 5 | public class _013_System { 6 | 7 | public static void main(String[] args) { 8 | //System 9 | //System.in ==> Javaya Veri girişi 10 | //System.out ==> Javadan Veri çıkışı 11 | System.out.print("Bundan sonraki alt satıra geçirmez"); 12 | System.out.println("Deneme"); 13 | System.err.println("Error C"); 14 | 15 | //Şu andaki zamanı verir 16 | System.out.println(new Date(System.currentTimeMillis())); 17 | 18 | //Garbarage Collection 19 | System.gc(); 20 | 21 | //logout 22 | System.exit(0); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_014_UserDataScanner.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import java.util.Scanner; 4 | 5 | public class _014_UserDataScanner { 6 | 7 | public static void main(String[] args) { 8 | //Scanner : java util paketinden gelir kullanıcıdan veri almak istediğimizde kullanırıız. 9 | //Ancak Scanner'da char için kullanamıyoruz. ancak biz başka yöntemle alabiliriz. 10 | ////char yoktur 11 | //nextByte() nextShort() nextInt() nextLong() nextFloat() nextDouble() next() nextLine() 12 | Scanner klavye=new Scanner(System.in); 13 | System.out.println("Lütfen bir isim giriniz"); 14 | String nameData=klavye.nextLine(); 15 | System.out.println(nameData); 16 | 17 | //Bir tuşa basınız 18 | System.out.println("Lütfen Herhangi bir tuşa basınız"); 19 | klavye.hasNext(); 20 | 21 | //Scanner char kullanmak istiyorum 22 | System.out.println(nameData.charAt(0)); 23 | 24 | //klavye kapat ancak bu satırdan sonra klavye çağırırsak hatalarla karşılaşırız. 25 | klavye.close(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_014_UserDatajOptional.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | import javax.swing.*; 3 | public class _014_UserDatajOptional { 4 | public static void main(String[] args) { 5 | //import javax.swing.jOptionPane; 6 | //JOptionPane: dönüşü String'tir. 7 | String dataValue = JOptionPane.showInputDialog("Lütfen birşey giriniz"); 8 | System.out.println(dataValue.substring(0)); 9 | 10 | //String ==> To Cast 11 | int dataNumber = Integer.valueOf(JOptionPane.showInputDialog("Lütfen bir sayı giriniz")); 12 | System.out.println(dataNumber * dataNumber); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_015_EscapeCharacter.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _015_EscapeCharacter { 4 | 5 | public static void main(String[] args) { 6 | //EscapeCharacter: Çıkış karakterdir. 7 | //Bazen özel simgeleri kullanamadığımız zaman kullanırız. 8 | // ters slash(\) kullanıyoruz. 9 | 10 | System.out.println(" \" " ); 11 | System.out.println(" \' " ); 12 | // \n ==> yeni bir satır 13 | // \r ==> alt satır 14 | // \t ==> bir tab kadar boşluk 15 | System.out.println("1.satır\n\r\t2.satır " ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_016_Math.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _016_Math { 4 | 5 | public static void main(String[] args) { 6 | //Math: Mathematics kısaltmasıdır 7 | //Math sınıf static bir yapıya sahiptir 8 | //java.lang kütüphanesinden import ederiz. 9 | //Math iç içe yazabilirsiniz ==> Math.round(Math.random()) 10 | 11 | // 2 tane sabitimiz vardır 12 | //Math.PI ==> 3.14 (final double) 13 | //Math.E ==> 2.71 (final double) 14 | 15 | //Sabitler 16 | System.out.println("PI SAYISI: "+Math.PI); 17 | System.out.println("E SAYISI: "+Math.E); 18 | 19 | //Hesap işlemler 20 | System.out.println("KAREKÖK: "+Math.sqrt(16)); 21 | System.out.println("MUTLAK DEĞER: "+Math.abs(-4)); 22 | System.out.println("ÜSLÜ DEĞER: "+Math.pow(2,5)); 23 | 24 | //min max 25 | System.out.println("MIN: "+Math.min(-2,500)); 26 | System.out.println("MAX: "+Math.max(-2,500)); 27 | 28 | //Yuvarlama 29 | System.out.println("YUKARI YUVARLA: "+Math.ceil(4.1)); 30 | System.out.println("AŞAĞI YUVARLA: "+Math.floor(4.1)); 31 | System.out.println("AŞAĞI/YUKARI YUVARLA: "+Math.round(6.5)); //.5 ve yukarı ise yukarı yuvarlar 32 | System.out.println("AŞAĞI/YUKARI YUVARLA: "+Math.round(6.4)); //.4 ve yukarı ise aşağı yuvarlar 33 | 34 | //Rastgele 35 | System.out.println(Math.round(Math.random()*4+1)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_017_Random.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import java.util.Random; 4 | 5 | public class _017_Random { 6 | public static void main(String[] args) { 7 | //Math sınıf static bir yapıya sahiptir 8 | //Rastgele 9 | double rastgele1=Math.round(Math.random()*4+1); 10 | System.out.println(rastgele1); 11 | 12 | //Random classtır ==> object 13 | Random random=new Random(); 14 | int rastgele2=random.nextInt(4)+1; 15 | System.out.println(rastgele2); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_018_Cast.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import java.util.Random; 4 | 5 | public class _018_Cast { 6 | public static void main(String[] args) { 7 | //Cast: dönüştürme 8 | //String => tam sayıya çevirmek 9 | //Tam sayı=> String'e çeviriri 10 | 11 | //1-) Cast float,double ==> f-L 12 | float f1=14.45f; 13 | float f2=(float)14.45; 14 | 15 | long l1=15551515L; 16 | long l2=(long)15551515; 17 | 18 | //2-) Büyük olanının içine küçük ekleyebilirsiniz 19 | byte b3=14; 20 | long l3=b3; 21 | 22 | //3-) Büyük olanının içine küçük ekleyebilirsiniz 23 | long l4=1515151545L; 24 | byte b4= (byte) l4; 25 | 26 | //4-)Boxing: primitive Türü(null veremezsiniz) Wrapper(null verebiliriz) Class benzetmedir. 27 | int primitive5=44545; 28 | Integer wrapper5=primitive5; 29 | 30 | //5-)UnBoxing: Wrapper Class primitive Türe benzetmedir. 31 | Integer wrapper6=121389; 32 | int primitive6=wrapper6; 33 | 34 | //6-) String'i ==> Tam sayıya çevirmek 35 | String str6="14"; 36 | System.out.println(16+str6); 37 | 38 | //1.YOL: wrapper tür olarak veri döner 39 | int stringToInteger1=Integer.valueOf(str6); 40 | System.out.println(16+stringToInteger1); 41 | 42 | //2.YOL: primitive türden veri döner 43 | int stringToInteger2=Integer.parseInt(str6); 44 | System.out.println(16+stringToInteger2); 45 | 46 | //7-) Tam sayıyı ==> String'e çevirmek 47 | int number7=20; 48 | System.out.println(number7+"30"); 49 | 50 | //1.YOL: wrapper tür olarak veri döner 51 | String cast7_1=String.valueOf(number7); 52 | System.out.println(cast7_1+"30"); 53 | 54 | //2.YOL: 55 | String cast7_2=Integer.toString(number7); 56 | System.out.println(cast7_2+"30"); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_019_StringBuilderStringBuffer.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _019_StringBuilderStringBuffer { 4 | public static void main(String[] args) { 5 | //String Birleştirmek 6 | String str1="JavaSE",str2="JavaEE",str3="JavaME"; 7 | 8 | //1-) Birleştirme(Artı operant): 9 | // hantaldır. her data için döngü bir kere daha çalışır 10 | String sb1=str1+str2+str3; 11 | System.out.println(sb1); 12 | 13 | //2-) Birleştirme(concat method): 14 | String sb2=str1.concat(str2).concat(str3); 15 | System.out.println(sb2); 16 | 17 | // String Builder String Buffer 18 | // 1-) Not Thread-safe Thread Safe 19 | // 1-) faster slow 20 | // 1-) Java 5 Java 1 21 | // 1-) güvensizdir Daha güvenli 22 | // 1-) Asenkron Senkron(aynı anda sadece bir iş çalışır) 23 | 24 | //3-) StringBuilder: database,services,socket 25 | StringBuilder sb3=new StringBuilder(); 26 | sb3.append(str1).append(str2).append(str3); 27 | String changeString3=sb3.toString(); 28 | System.out.println(changeString3); 29 | 30 | //4-) StringBuffer 31 | StringBuffer sb4=new StringBuffer(); 32 | sb4.append(str1).append(str2).append(str3); 33 | String changeString4=sb4.toString(); 34 | System.out.println(changeString4); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_020_StringTokenizerStringSplit.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | import java.util.Arrays; 6 | import java.util.StringTokenizer; 7 | 8 | @Log4j2 9 | public class _020_StringTokenizerStringSplit { 10 | public static void main(String[] args) { 11 | //String parçalamak: 12 | String valueData="JavaSE&JavaEE+ JavaME~JSP-JSF_Spring"; 13 | 14 | //1.YOL Parçalama 15 | String [] parcala1=valueData.split(" "); 16 | Arrays.asList(parcala1).forEach(System.out::println); 17 | 18 | //2.YOL-A: default boşluğa göre parçalama yapar 19 | StringTokenizer parcala2=new StringTokenizer(valueData); 20 | //nextToken(): parçalalanacak veri varsa 21 | while(parcala2.hasMoreTokens()){ 22 | //log.info(parcala2.nextToken()); 23 | System.out.println(parcala2.nextToken()); 24 | } 25 | 26 | //2.YOL-B: default boşluğa göre parçalama yapar biz burada delimiter ekleyebiliriz 27 | StringTokenizer parcala3=new StringTokenizer(valueData,"&+~-_ "); 28 | while(parcala3.hasMoreTokens()){ 29 | System.out.println(parcala3.nextToken()); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_021_Conditional.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | @Log4j2 6 | public class _021_Conditional { 7 | public static void main(String[] args) { 8 | 9 | //global variable 10 | int number=45; 11 | 12 | //conditional: if else 13 | if(number>=10){ 14 | System.out.println("sayı 10 büyüktür"); 15 | }else{ 16 | System.out.println("sayı 10 küçüktür"); 17 | } 18 | 19 | //Ternary: daha yazılabilir. daha az kodla gösterdik 20 | String resultTernary= (number>=10) ? "sayı 10 büyüktür":"sayı 10 küçüktür" ; 21 | System.out.println(resultTernary); 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_022_Conditional2.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | @Log4j2 6 | public class _022_Conditional2 { 7 | public static void main(String[] args) { 8 | 9 | //global variable 10 | int number = 5; 11 | 12 | //conditional: if - else if - else 13 | if (number == 1) { 14 | System.out.println("sayı 1"); 15 | } else if (number == 2) { 16 | System.out.println("sayı 2"); 17 | } else if (number == 3) { 18 | System.out.println("sayı 3"); 19 | } else if (number == 4) { 20 | System.out.println("sayı 4"); 21 | } else if (number == 5) { 22 | System.out.println("sayı 5"); 23 | } else { 24 | System.out.println("sayı 5 büyüktür"); 25 | } 26 | 27 | 28 | //switch case 29 | switch (number){ 30 | case 1: 31 | System.out.println("sayı 1"); 32 | break; 33 | case 2: 34 | System.out.println("sayı 2"); 35 | break; 36 | case 3: 37 | System.out.println("sayı 3"); 38 | break; 39 | case 4: 40 | System.out.println("sayı 4"); 41 | break; 42 | case 5: 43 | System.out.println("sayı 5"); 44 | break; 45 | default: 46 | System.out.println("sayı 5 büyüktür"); 47 | break; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_023_Loop.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | @Log4j2 6 | public class _023_Loop { 7 | public static void main(String[] args) { 8 | 9 | //Loop Döngüde 10 | //1-) iterative for 11 | //NOT: for sonsuz döngü ==> for(;;){} 12 | for (int i = 0; i < 10; i++) { 13 | System.out.print(i+" "); 14 | } 15 | System.out.println("\n**********************"); 16 | 17 | //2-) while 18 | //NOT: for sonsuz döngü ==> while(true){} 19 | int k= 0; 20 | while(k<10){ 21 | System.out.print(k+" "); 22 | k++; 23 | } 24 | System.out.println("\n**********************"); 25 | //3-) do-while: şart sağlansın veya sağlanması en az 1 kez çalışır 26 | int m= 0; 27 | do{ 28 | System.out.print(m+" "); 29 | m++; 30 | }while(m<10); 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_024_HomeWork.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | @Log4j2 6 | public class _024_HomeWork { 7 | public static void main(String[] args) { 8 | 9 | // Örnek: 1-10 arasında 5 tane random sayı üretelim ? (Random, for) ? 10 | // Örnek: 1-10 arasında 5 tane random sayı üretelim ve bunları toplayalım ? 11 | 12 | // Örnek: Vize Final Ödevi 13 | // kullanıcıdan alınan vize ve final notuna göre geçme(ortalama) Algoritması 14 | // eğer kullanıcı vize veya final 0(sıfır) bir değer girerse sistemden atsın 15 | // ekranda "Sifir disiplin hatasi Sistemden cikiliyor" 16 | // bunun haricinde sürekli vize final sorsun 17 | 18 | // Not Harfleri ==> AA BA BB FF 19 | // not ortalaması: ortalama<50 altında ise kaldı FF 20 | // not ortalaması: ortalama==50 Geçti 21 | // not ortalaması: 55<=x<=69 BB 22 | // not ortalaması: 70<=x<=84 BA 23 | // not ortalaması: 85<=x<=100 AA 24 | 25 | // Vize:40% Final:60% 26 | // Dikkat: Consolda virgül kullanmalısın. 27 | 28 | // while sonsuz döngü ==> while(true) {} 29 | // for sonsuz döngü ==> for(;;) {} 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_025_isLetterisDigitisSymbol.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.*; 4 | import lombok.extern.log4j.Log4j2; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.stereotype.Component; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import java.util.Scanner; 11 | 12 | @Log4j2 13 | public class _025_isLetterisDigitisSymbol { 14 | 15 | public static void main(String[] args) { 16 | //Character ==> java.lang kütüphane gelir 17 | while(true){ 18 | Scanner klavye = new Scanner(System.in); 19 | System.out.println("\nLütfen bir harf giriniz"); 20 | //char cevirdim 21 | char dataValue = klavye.nextLine().charAt(0); 22 | 23 | if (Character.isDigit(dataValue)) 24 | System.out.println("Bu bir sayıdır"); 25 | else if (Character.isLetter(dataValue)) { 26 | System.out.println("Bu bir harftir"); 27 | log.info("Bu bir harftir"); 28 | } else 29 | System.out.println("Bu bir özel simgedir"); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_026_Formatter.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | import java.util.Locale; 8 | import java.util.Scanner; 9 | 10 | @Log4j2 11 | public class _026_Formatter { 12 | 13 | public static void main(String[] args) { 14 | //System 15 | //System.out.println("Cikti" ); 16 | //System.err.println("Cikti" ); 17 | // System.out.print("Cikti " ); 18 | 19 | 20 | //System.out.printf(); 21 | // SeDeF : 22 | 23 | //Pattern Date 24 | Locale locale = new Locale("tr", "TR"); 25 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("[dd - MMMM - yyyy] HH:mm:ss", locale); 26 | Date date2 = new Date(); 27 | String str = simpleDateFormat.format(date2); 28 | 29 | //Manuel Date 30 | Date date1 = new Date(); 31 | String allTime = String.valueOf(date1.getHours() + ":" + date1.getMinutes() + ":" + date1.getSeconds()); 32 | 33 | String systemDate = "[" + new Date(System.currentTimeMillis()).toString() + "]"+allTime; 34 | String allClass = _026_Formatter.class + ""; 35 | 36 | int d = 44; 37 | float f = 44.23f; 38 | System.out.printf("%-20s %-40s %-40s %-20d %3.2f", str, systemDate, allClass, d, f); 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_027_Date.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.util.Calendar; 7 | import java.util.Date; 8 | import java.util.Locale; 9 | 10 | @Log4j2 11 | public class _027_Date { 12 | 13 | public static void main(String[] args) { 14 | // 1 ocak 1970 15 | // 1900 ekle veya çıkar 16 | // java.util.Date date=new Date(); 17 | // log.info(date); 18 | // log.info(date.getDate()); 19 | // log.info(date.getDay()); //1-31 20 | // log.info(date.getMonth()); // 0 -11 21 | // log.info(date.getHours()); //0-23 22 | // log.info(date.getMinutes());//0-59 23 | // log.info(date.getSeconds());//0-59 24 | 25 | Locale locale=new Locale("tr","TR"); 26 | SimpleDateFormat simpleDateFormat=new SimpleDateFormat("[dd - MMMM - yyyy] HH:mm:ss",locale); 27 | 28 | //Date 29 | Date date=new Date(); 30 | String str=simpleDateFormat.format(date); 31 | System.out.println(str); 32 | 33 | //Calendar 34 | Calendar calendar=Calendar.getInstance(); 35 | String str2=simpleDateFormat.format(calendar.getTime()); 36 | System.out.println(str2); 37 | 38 | 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_028_LocalDate.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.time.LocalDate; 7 | import java.time.LocalDateTime; 8 | import java.time.LocalTime; 9 | import java.time.format.DateTimeFormatter; 10 | import java.util.Calendar; 11 | import java.util.Date; 12 | import java.util.Locale; 13 | 14 | @Log4j2 15 | public class _028_LocalDate { 16 | 17 | public static void main(String[] args) { 18 | //pattern 19 | Locale locale=new Locale("tr","TR"); 20 | SimpleDateFormat simpleDateFormat=new SimpleDateFormat("[dd - MMMM - yyyy] HH:mm:ss",locale); 21 | 22 | //1-Date 23 | Date date=new Date(); 24 | String str=simpleDateFormat.format(date); 25 | System.out.println(str); 26 | 27 | //2-Calendar 28 | Calendar calendar=Calendar.getInstance(); 29 | String str2=simpleDateFormat.format(calendar.getTime()); 30 | System.out.println(str2); 31 | 32 | //3-LocalDate 33 | // Class Description 34 | // LocalDate (year, month, day (yyyy-MM-dd)) 35 | // LocalTime (HH-mm-ss-ns) 36 | // LocalDateTime (yyyy-MM-dd-HH-mm-ss-ns) 37 | // DateTimeFormatter Formatter for displaying and parsing date-time objects 38 | 39 | //java.time 40 | //LocalDate 41 | LocalDate localDate=LocalDate.now(); 42 | System.out.println(localDate); 43 | 44 | //LocalTime 45 | LocalTime localTime=LocalTime.now(); 46 | System.out.println(localTime); 47 | 48 | //LocalDateTime 49 | LocalDateTime localDateTime=LocalDateTime.now(); 50 | System.out.println(localDateTime); 51 | 52 | //Pattern 53 | DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("dd/MMMM/yyyy HH:mm:ss"); 54 | String str3=dateTimeFormatter.format(LocalDateTime.now()); 55 | System.out.println(str3); 56 | 57 | 58 | System.out.println(nowLlocalDate()); 59 | System.out.println(nowCalendarLocale()); 60 | } 61 | 62 | // date Turkish time 63 | public static String nowCalendarLocale() { 64 | return new SimpleDateFormat("dd-MMMM-yyyy HH:mm:ss ", new Locale("tr", "TR")).format(Calendar.getInstance().getTime()); 65 | } 66 | 67 | public static String nowLlocalDate() { 68 | return DateTimeFormatter.ofPattern("dd/MMMM/yyyy HH:mm:ss").format(LocalDateTime.now()); 69 | } 70 | 71 | 72 | 73 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_029_TryCatchExceptionError.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.time.LocalDate; 7 | import java.time.LocalDateTime; 8 | import java.time.LocalTime; 9 | import java.time.format.DateTimeFormatter; 10 | import java.util.Calendar; 11 | import java.util.Date; 12 | import java.util.Locale; 13 | 14 | @Log4j2 15 | public class _029_TryCatchExceptionError { 16 | 17 | public static void main(String[] args) { 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_030_CompilerTimeError.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _030_CompilerTimeError { 4 | public static void main(String[] args) { 5 | StackOverflow.test(5); 6 | } 7 | } 8 | 9 | 10 | // Class 1 11 | class StackOverflow { 12 | 13 | // method of this class 14 | public static void test(int i) 15 | { 16 | // No correct as base condition leads to 17 | // non-stop recursion. 18 | int counter=0; 19 | if (i == 0) 20 | return; 21 | else { 22 | test(i++); 23 | counter++; 24 | } 25 | System.out.println("Counter: "+counter); 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_031_TryCatchExceptionError.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | 5 | @Log4j2 6 | public class _031_TryCatchExceptionError { 7 | 8 | public static void main(String[] args) throws ArithmeticException, NullPointerException, _032_HamitMizrak { 9 | //syntax error 10 | // Int number=44; 11 | // System.out.println(number); 12 | 13 | //logical error 14 | try { 15 | int number1=2; 16 | int number2=0; 17 | int number3= number1/number2; 18 | throw new ArithmeticException("Sıfıra Bölemezsiniz ikinci sayı sıfır olmamalıdır"); 19 | }catch (ArithmeticException | NullPointerException ai) { 20 | 21 | System.out.println("ai exception: "+"getMessage: istisnanın mesajı ==>"+ai.getMessage()); 22 | System.out.println("ai exception: "+"toString: istisna adı ve istisna mesajını ==> "+ai.toString()); 23 | System.out.println("printStackTrace"); 24 | ai.printStackTrace(); 25 | System.out.println("getStackTrace ==> bizi istisnanın bilgilerilerini dizi olarak döner"); 26 | StackTraceElement [] dizi= ai.getStackTrace(); 27 | for(StackTraceElement temp:dizi){ 28 | System.out.println(temp); 29 | } 30 | } catch ( Exception exception) { 31 | System.out.println("common exception"); 32 | exception.printStackTrace(); 33 | }finally { 34 | System.out.println("Sistemde her halikarda çalışacak yeğane yerdir."); 35 | System.out.println("database.close() socket.close()"); 36 | } 37 | 38 | System.out.println("Son data"); 39 | 40 | //throw: kendi ististinamızı oluşturduj 41 | //throw new ArithmeticException("Sıfıra Bölemezsiniz ikinci sayı sıfır olmamalıdır"); 42 | throw new _032_HamitMizrak(" Sifira Bolemezsiniz ikinci sayi sifir olamalidir."); 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_032_HamitMizrak.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | 4 | public class _032_HamitMizrak extends Exception { 5 | 6 | //Parametreli constructor 7 | public _032_HamitMizrak(String message) { 8 | super(message); 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_033_Method.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | 4 | import java.util.Scanner; 5 | import java.util.UUID; 6 | 7 | public class _033_Method { 8 | 9 | 10 | public static void voidliParametresizMethod() { 11 | System.out.println("voidli Parametresiz Method"); 12 | 13 | UUID uuid=UUID.randomUUID(); 14 | System.out.println(uuid); 15 | } 16 | 17 | 18 | public static void voidliParametreliMethod(int sayi) { 19 | System.out.println("voidli Parametreli Method " + sayi); 20 | } 21 | 22 | 23 | public static String voidsizParametresizMethod() { 24 | return "voidsiz Parametresiz Method"; 25 | } 26 | 27 | public static String voidsizParametreliMethod(String data) { 28 | return "voidsiz Parametresiz Method "+data; 29 | } 30 | 31 | //recursive Method 32 | public static int useData(){ 33 | Scanner klavye=new Scanner(System.in); 34 | System.out.println("Lütfen bir sayı giriniz"); 35 | return klavye.nextInt(); 36 | } 37 | 38 | //4!=4 * 3 *2*1 39 | public static int recursiveFactoriyel(int number) throws _032_HamitMizrak { 40 | if(number<0) 41 | throw new _032_HamitMizrak("Sıfırdan Küçük giremezsiniz"); 42 | if(number==0 || number==1) 43 | return 1; 44 | return number*recursiveFactoriyel(number-1); 45 | } 46 | 47 | 48 | 49 | public static void main(String[] args) throws _032_HamitMizrak { 50 | 51 | while(true){ 52 | int number=useData(); 53 | int result=recursiveFactoriyel(number); 54 | System.out.println(number+"sayısının Faktöriyel Sonucu: "+result); 55 | 56 | } 57 | // 58 | // voidliParametresizMethod(); 59 | // voidliParametreliMethod(44); 60 | // 61 | // String str1= voidsizParametresizMethod(); 62 | // System.out.println(str1); 63 | // 64 | // String str2= voidsizParametreliMethod("Merhabalar"); 65 | // System.out.println(str2); 66 | } 67 | 68 | 69 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_034_Enum.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | //ENUM 4 | //Önceden sabitlenmiş veriler için kullanıyoruz. 5 | //1 metre:100cm , 1kg=1000gr ,Aylar:12 tanedir Gün: 24 saat, Ölçüler:Küçük,Orta,Büyük 6 | //1 saat:60 dakika 1dakika=60 saniye 1 saniye=1000milisaniye 7 | //Java 5 gelen özelliktir. 8 | //Tür güvenliğini Sağlamak(type safe) 9 | //Classlara benzemektedir. Classtaki en önemli farkı Tür Güvenliğini sağlamak 10 | //Sadece bizim verdiğimiz değerler dışında her hangi bir değer veremezsiniz 11 | //Kodların daha okunaklı bir sayı bize sunar. 12 | 13 | //Dikkat: 14 | //Değişkenlerde final kullanmalıyız. 15 | // Amaçımız encapsulationda setter gelmesin 16 | 17 | //constructurda private olmalıdır. 18 | //constructur private olursa instance (new) oluşturamayız. 19 | 20 | import nonapi.io.github.classgraph.json.JSONUtils; 21 | 22 | //ICE 23 | //interface ==> public interface isim{} 24 | //class ==> public class isim{} 25 | //enum ==> public enum isim{} 26 | public enum _034_Enum { 27 | //enum sıra numarası yani ordinal sıfırdan başlar 28 | PAZARTESI,SALI,CARSAMBA,PERSEMBE,CUMA,CUMARTESI,PAZAR 29 | } 30 | 31 | //class 32 | class Olcu{ 33 | public static void main(String[] args) { 34 | _034_Enum enumVariable=_034_Enum.PAZARTESI; 35 | System.out.println(enumVariable); 36 | System.out.println("Sıra: "+enumVariable.ordinal()); 37 | System.out.println("Values: "+enumVariable.values()[0]); 38 | 39 | String str=_034_Enum.PAZARTESI.toString(); 40 | System.out.println("toString ==> "+str); 41 | 42 | for( _034_Enum temp :_034_Enum.values()){ 43 | System.out.print(temp+" "); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_035_Array.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | 4 | import java.util.Random; 5 | 6 | public class _035_Array { 7 | 8 | public static void main(String[] args) { 9 | int [] dizi=new int[10]; 10 | for (int i =0; i <10 ; i++) { 11 | Random rastgele=new Random(); 12 | int number= rastgele.nextInt(10)+1; 13 | dizi[i]=number; 14 | } 15 | 16 | for (int i = 0; i extends Thread 4 | //interface ==> implement Runnable 5 | //Metot ==> Thread t1=new Thread(new Runnable()); 6 | 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | // 1-) extend 11 | @Getter @Setter 12 | public class _039_MultiThread extends Thread{ 13 | 14 | //Object variable 15 | private String className; 16 | 17 | //parametresiz constructor 18 | public _039_MultiThread() { 19 | } 20 | 21 | //parametreliconstructor 22 | public _039_MultiThread(String className) { 23 | this.className = className; 24 | } 25 | 26 | @Override 27 | public void run() { 28 | for (int i = 1; i <= 10; i++) { 29 | try { 30 | Thread.sleep(500); 31 | 32 | if(i==1){ 33 | System.out.println("\n####Başlangıç"); 34 | System.out.println(this.className); 35 | }else if(i==10){ 36 | System.out.println("\n####Bitiş"); 37 | System.out.println(this.className); 38 | }else{ 39 | System.out.println(this.className); 40 | } 41 | 42 | } catch (InterruptedException e) { 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | } 48 | } 49 | 50 | class _039_MultiThread0{ 51 | public static void main(String[] args) throws InterruptedException { 52 | _039_MultiThread thread1=new _039_MultiThread("1.instance"); 53 | _039_MultiThread thread2=new _039_MultiThread("2.instance"); 54 | _039_MultiThread thread3=new _039_MultiThread("3.instance"); 55 | 56 | thread1.setPriority(Thread.MIN_PRIORITY); 57 | thread2.setPriority(Thread.NORM_PRIORITY); 58 | thread3.setPriority(Thread.MAX_PRIORITY); 59 | 60 | thread1.start(); 61 | thread2.start(); 62 | thread3.start(); 63 | thread3.wait(); 64 | thread3.notifyAll(); 65 | 66 | System.out.println("getClassName: "+ thread1.getClassName()); 67 | System.out.println("getId: "+ thread1.getId()); 68 | System.out.println("getName: "+ thread1.getName()); 69 | System.out.println("hashCode: "+ thread1.hashCode()); 70 | System.out.println("isAlive: "+ thread1.isAlive()); 71 | thread1.setName("yeni ad"); 72 | System.out.println("getName: "+ thread1.getName()); 73 | 74 | } 75 | } 76 | 77 | 78 | 79 | // 2-) interface 80 | class _039_MultiThread2 implements Runnable { 81 | 82 | @Override 83 | public void run() { 84 | 85 | } 86 | } 87 | 88 | 89 | // 3-) Method 90 | class _039_MultiThread3 { 91 | 92 | public static void main(String[] args) { 93 | Thread thread=new Thread(new Runnable() { 94 | @Override 95 | public void run() { 96 | 97 | } 98 | }); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_040_IO.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | import java.io.*; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | import java.util.Locale; 8 | import java.util.Scanner; 9 | 10 | //FileInputStream ==> 8 bitlik okuma 11 | //FileReader ==> 16 bit okuma 12 | @Log4j2 13 | public class _040_IO { 14 | 15 | //PATH 16 | public final static String PATH = "C:\\fileio\\deneme.txt"; 17 | 18 | //Scanner 19 | private static Scanner klavye=new Scanner(System.in); 20 | 21 | //Formatter Date //Pattern Date 22 | private static String userDateFormatter() { 23 | Locale locale = new Locale("tr", "TR"); 24 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("[dd - MMMM - yyyy] HH:mm:ss ==>", locale); 25 | Date date2 = new Date(); 26 | String str = simpleDateFormat.format(date2); 27 | return str; 28 | } 29 | 30 | //Kullanıcıdan veri almak 31 | public static String writeUser() { 32 | Scanner klavye = new Scanner(System.in); 33 | System.out.println("\nLutfen Birseyler yaziniz"); 34 | String userData=klavye.nextLine(); 35 | String allDateUserData=userDateFormatter().concat(" "+userData); 36 | return allDateUserData; 37 | } 38 | 39 | //fileWriter 40 | private static void fileWriter() throws _032_HamitMizrak { 41 | try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(PATH, true))) { 42 | bufferedWriter.write("\n" + writeUser()); 43 | bufferedWriter.flush(); 44 | } catch (IOException io) { 45 | io.printStackTrace(); 46 | } catch (Exception e) { 47 | throw new _032_HamitMizrak(" IO Hatası: " + e); 48 | } 49 | } 50 | 51 | //fileReader 52 | private static void fileReader() throws _032_HamitMizrak { 53 | try(BufferedReader bufferedReader=new BufferedReader(new FileReader(PATH))){ 54 | StringBuilder builder=new StringBuilder(); 55 | String rows=""; 56 | while( (rows=bufferedReader.readLine())!=null ){ 57 | builder.append(rows).append(" "); 58 | } 59 | String datatoString=builder.toString(); 60 | log.info(datatoString); 61 | }catch (IOException io) { 62 | io.printStackTrace(); 63 | } catch (Exception e) { 64 | throw new _032_HamitMizrak(" IO Hatası: " + e); 65 | } 66 | } 67 | 68 | public static void chooiseFile() throws _032_HamitMizrak { 69 | while(true){ 70 | System.out.println("\nLutfen Seciminizi Yapiniz\n1-)Yazma\n2-)Okuma\n3-)Cikis"); 71 | int chooise=klavye.nextInt(); 72 | switch (chooise){ 73 | case 1: 74 | fileWriter(); 75 | break; 76 | 77 | case 2: 78 | fileReader(); 79 | break; 80 | 81 | case 3: 82 | System.out.println("Sistemden Çıkış yapılıyor"); 83 | System.exit(0); 84 | break; 85 | 86 | default: 87 | System.out.println("Lutfen doğru seçim yapınız"); 88 | break; 89 | } 90 | } 91 | } 92 | 93 | public static void main(String[] args) throws _032_HamitMizrak { 94 | chooiseFile(); 95 | 96 | } 97 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_041_Generics.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import lombok.*; 4 | import lombok.extern.log4j.Log4j2; 5 | 6 | //İçinde Bütün Referans Tipleri barındırır. 7 | // Byte Short Integer Long Boolean Float Double Character Class 8 | // <> ile gösterilir 9 | 10 | @Log4j2 11 | @Getter 12 | @Setter 13 | @Builder 14 | public class _041_Generics { 15 | 16 | //Object Variable 17 | private T data; 18 | 19 | //parametresiz constructor 20 | public _041_Generics() { 21 | } 22 | 23 | //parametreli constructor 24 | public _041_Generics(T data) { 25 | this.data = data; 26 | } 27 | } 28 | 29 | //PSVM 30 | class GenericsMainClass { 31 | public static void main(String[] args) { 32 | _041_Generics generics=new _041_Generics("Merhabalar"); 33 | System.out.println(generics.getData()); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_043_JavaEllipsis.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | public class _043_JavaEllipsis { 4 | // JAVA (...) ==> Java Ellipsis 5 | // JAVASCRIPT (...) ==> Rest Operator(Rest Parameter) 6 | 7 | // Normal dizi parametresi alan method 8 | public static void arrayNormalMethod(int[] dizi){ 9 | for(int temp:dizi){ 10 | System.out.print(temp+" "); 11 | } 12 | } 13 | 14 | // Ellipsis dizi method 15 | public static void arrayEllipsisMethod(int... dizi){ 16 | for(int temp:dizi){ 17 | System.out.print(temp+" "); 18 | } 19 | } 20 | 21 | 22 | public static void main(String[] args) { 23 | int [] dizi={1,2,3,4,5}; 24 | arrayNormalMethod(dizi); 25 | System.out.println("\n**************************"); 26 | arrayEllipsisMethod(dizi); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_044_DecoderEncoder.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | 4 | import java.util.Base64; 5 | import java.util.Scanner; 6 | 7 | //Java 8 gelen özelliktir. 8 | public class _044_DecoderEncoder { 9 | private static String USER_DATA_STATIC = ""; 10 | 11 | private static String userData() { 12 | Scanner klavye = new Scanner(System.in); 13 | System.out.println("Lütfen birşeyler yazınız"); 14 | String user = klavye.nextLine(); 15 | USER_DATA_STATIC = user; 16 | return user; 17 | } 18 | 19 | //Encoder Method 20 | public static String encoderMethod(String klavye) { 21 | //import java.util.Base64; 22 | Base64.Encoder encoderData = Base64.getEncoder(); 23 | //Veriyi şifrelemek 24 | String sifrele = encoderData.encodeToString(klavye.getBytes()); 25 | return sifrele; 26 | } 27 | 28 | //Decoder Method 29 | public static String decoderMethod(String sifrelenmisData) { 30 | Base64.Decoder decoderData = Base64.getDecoder(); 31 | String sifreCoz = new String(decoderData.decode(sifrelenmisData)); 32 | return sifreCoz; 33 | } 34 | 35 | //PSVM 36 | public static void main(String[] args) { 37 | String klavye = userData(); 38 | String sifrelenmisVeri = encoderMethod(klavye); 39 | String sifreCoz = decoderMethod(sifrelenmisVeri); 40 | System.out.println("İlk Hali: " + klavye); 41 | System.out.println("Şifrelenmiş Hali: " + sifrelenmisVeri); 42 | System.out.println("Şifrenin Çözülmüş Hali: " + sifreCoz); 43 | } 44 | 45 | }//_044_DecoderEncoder 46 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_045_RandomUUID.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | 4 | import java.util.Base64; 5 | import java.util.Scanner; 6 | import java.util.UUID; 7 | 8 | //Java 8 gelen özelliktir. 9 | public class _045_RandomUUID { 10 | 11 | //PSVM 12 | public static void main(String[] args) { 13 | // Random unique (benzersiz tekil bir yapı) için kullanıyoruz. 14 | //Java Util paketinten türetilir 15 | // hexadecimal tabanlıdır 16 | UUID uuid=UUID.randomUUID(); 17 | System.out.println(uuid); 18 | 19 | //String'e çevirdim 20 | String data=uuid.toString(); 21 | } 22 | 23 | }//_045_RandomUUID 24 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/java/_045_RecursiveFactoriyel.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.java; 2 | 3 | import com.hamitmizrak.socket.HamitMizrakException; 4 | import lombok.extern.log4j.Log4j2; 5 | import java.util.Scanner; 6 | 7 | @Log4j2 8 | public class _045_RecursiveFactoriyel { 9 | 10 | //User Data 11 | private static char userData() { 12 | Scanner klavye = new Scanner(System.in); 13 | System.out.println("Lütfen bir sayı yazınız"); 14 | char dataValue = klavye.nextLine().charAt(0); 15 | return dataValue; 16 | } 17 | 18 | //validation Data 19 | private static int validationData(){ 20 | char dataValue=userData(); 21 | if (Character.isDigit(dataValue)) 22 | log.info("Bu bir sayıdır"); 23 | else if (Character.isLetter(dataValue)) { 24 | log.info("Bu bir harftir"); 25 | validationData(); 26 | } else{ 27 | System.out.println("Bu bir özel simgedir"); 28 | validationData(); 29 | } 30 | //return Character.getNumericValue(dataValue); 31 | System.out.println(dataValue); 32 | return Integer.valueOf(dataValue) ; 33 | } 34 | 35 | 36 | //recursive Method 37 | public static Integer recursiveFactoriyel(int fac){ 38 | if(fac<0) 39 | throw new HamitMizrakException("Sıfırdan Küçük giremezsiniz"); 40 | if(fac==0 || fac==1) 41 | return 1; 42 | return fac*recursiveFactoriyel(fac-1); 43 | } 44 | 45 | //PSVM 46 | public static void main(String[] args) { 47 | while(true){ 48 | int result2=recursiveFactoriyel( validationData()); 49 | // int result2=recursiveFactoriyel(4); 50 | System.out.println(result2); 51 | } 52 | } 53 | 54 | }//_045_RecursiveFactoriyel 55 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/javase/_001_WhatIsJava.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.javase; 2 | 3 | public class _001_WhatIsJava { 4 | 5 | public static void main(String[] args) { 6 | // 7 | /**/ 8 | int $_variable55=44; 9 | /*operatörler*/ 10 | /* 11 | + 12 | - 13 | * 14 | / 15 | % */ 16 | 17 | //Primitive 8 18 | //stack hafıza 19 | //1 byte = 8 bit 01 20 | //f-L 21 | byte b1=127; //-128<=X<+127 1byte=8 bit 2^7 22 | short s1=128; 23 | int i1=4545; 24 | long l1=45451555L; 25 | 26 | float f2=4414.552f; 27 | double d2=4545451555.55; 28 | 29 | boolean b3=3>1; 30 | char c3='('; 31 | 32 | // Wrapper 33 | // heap 34 | Byte wrapper; 35 | 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/linux/linux_codes.txt: -------------------------------------------------------------------------------- 1 | Linux 2 | 1-) Shell (Kabuk) ==> Kullanıcıdan gelen istekleri Kernel'a iletir.' 3 | 2-) kernel (çekirdek) ==> Yazılım ile Donanım arasındaki haberleşmeyi sağlıyor 4 | 5 | GNU =GNU is not Unix 6 | GNU/GPL 7 | GPL Temel Özgürlük ilkesi 8 | 1-) programım istediğimiz gibi kullanabiliriz 9 | 2-) kod ekle , sil , oku 10 | 3-) Kopyası alıp dağıtım 11 | 4-) var olan sürümü değiştirip dağıtabiliriz. 12 | 13 | ######################################################################################## 14 | sudo apt install curl 15 | curl --version 16 | sudo apt-get install zip 17 | sudo apt-get install gunzip 18 | sudo apt install vim 19 | 20 | ping google.com 21 | curl google.com 22 | 23 | man mkdir ==> detaylı gösterim. 24 | info mkdir ==> bilgi almak 25 | whereis java 26 | hostname --help 27 | pwd ==> Bulunduğumuz dizini gösterir. 28 | hostname ==> ağ adını 29 | whoami ==> user 30 | clear 31 | history ==> önceki yazdığımız komutları getirir 32 | 33 | # dizine gitmek 34 | cd dizinAdi 35 | cd . 36 | cd .. 37 | cd ~ 38 | cd / 39 | 40 | # listeleme 41 | ls -l ==> küçükten büyüğe doğru 42 | ls -al ==> gizli dosyaları göster küçükten büyüğe 43 | ls -lar ==> büyükten küçüğe 44 | ls -t ==> zamana göre 45 | d rwx r-x r-x ==> d=directory r=read w=write x=execute 46 | 47 | 48 | #isim değiştirme(rename) ve taşımak için kullanıyoruz. 49 | mv deneme.txt degisti.txt 50 | mv degisti.txt cloneDizini 51 | 52 | #copy 53 | cp degisti.txt clone 54 | 55 | #diff 56 | diff deneme.txt deneme2.txt 57 | 58 | 59 | # dizin oluştur 60 | mkdir dizin 61 | 62 | # dizin sil 63 | rmdir dizin 64 | 65 | # eğer dizin içinde dizin varsa yani dizin dolu ise 66 | rm -r dizin 67 | rm -rf dizin 68 | 69 | # dosya yazma ve okumak 70 | cat >> deneme.txt ==> son satırdan devam eder 71 | cat > deneme.txt ==> bütün dosya siler sona ekler 72 | vim deneme.txt 73 | tail deneme.txt 74 | 75 | vim deneme.txt 76 | g ==> ilk stır için kullanıyoruz 77 | 78 | 79 | cat deneme.txt 80 | tac deneme.txt 81 | 82 | tail deneme.txt ==> sondan 10 satırı gösterir. 83 | tail -n 15 deneme.txt ==> sondan 15 satırı göster 84 | tail -f deneme.txt ==> yeni yazılan yerleri gösterir. 85 | 86 | # tek dosya 87 | tar: tape archive 88 | tar -cf butun.tar ./* ==> sıkıştırma yapmadan 89 | tar -zcf butun.tar.gz ./* ==> sıkıştırma yaparak saklamak 90 | 91 | gzip -9 deneme.txt 92 | gzip -9 ./* 93 | 94 | gunzip deneme.txt ==> dosya sıkıştır 95 | gunzip ./* ==> dosya açmak 96 | 97 | # zip 98 | sudo apt-get install zip 99 | zip -r butun.zip ./* 100 | 101 | # unzip 102 | sudo apt-get install unzip 103 | unzip butun.zip 104 | 105 | 106 | ########################################################### 107 | 1-) Masa üstüne deneme adında bir dizin oluşturalım 108 | 2-) bu deneme dizinin içine java.txt dosyası oluşturalım 109 | 3-) java.txt dosyasının içine Ben java öğreniyorum yazalım. 110 | 4-) bu oluşturduğumuz java.txt içine son satırına "son satır" yazalım. 111 | 5-) bulunduğumuz yeri adını bulalım (pwd) 112 | 6-) sil.txt dosyası oluşturalım bunu komutlarla silelim. 113 | 7-) deneme dizininin sıkıştıralım sonra bu sıkıştırılmış dizini açalım (zip 114 | 115 | 116 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/oop/OopTutorials.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.oop; 2 | 3 | 4 | /* Inheritance - Polymorohism - Encapsulation - Abstraction(abstract+interface) */ 5 | /* pojo < bean productDtoList=new ArrayList<>(); 37 | for (int i = 1; i <= 10; i++) { 38 | ProductDto productDto=ProductDto.builder().id(Long.valueOf(i)).productName("Ürün adı "+i).productPrice(i*100). build(); 39 | productDtoList.add(productDto); 40 | } 41 | model.addAttribute("controller_list",productDtoList); 42 | log.info(productDtoList); 43 | return "thymeleaf2"; 44 | } 45 | 46 | 47 | //@PathVariable 48 | // http://localhost:8080/mvc3 49 | // http://localhost:8080/mvc3/44 50 | // http://localhost:8080/mvc3/44/bilgisayar 51 | @GetMapping({"mvc3","mvc3/{id}","mvc3/{id}/{product_name}"}) 52 | //@ResponseBody 53 | public String getThymeleaf3( 54 | @PathVariable(value = "id",required = false) Long productId, 55 | @PathVariable(value = "product_name",required = false) String productName, 56 | Model model){ 57 | ProductDto productDto=ProductDto.builder().id(productId).productName(productName).productPrice(400). build(); 58 | if(productId==null){ 59 | model.addAttribute("controller_key","Not Found"); 60 | }else if(productId==0){ 61 | model.addAttribute("controller_key","Bad Request"); 62 | }else{ 63 | model.addAttribute("controller_key",productDto); 64 | } 65 | return "thymeleaf3"; 66 | } 67 | 68 | 69 | //@RequestParam 70 | // http://localhost:8080/mvc4?id=55&&product=bilgisayar 71 | // http://localhost:8080/mvc4?product=bilgisayar 72 | @GetMapping("mvc4") 73 | public String getThymeleaf4( 74 | @RequestParam(name = "id",required = false,defaultValue = "1") Long id, 75 | @RequestParam(name = "product") String product, 76 | Model model){ 77 | ProductDto productDto=ProductDto.builder().id(id).productName(product).productPrice(400). build(); 78 | model.addAttribute("controller_key",productDto); 79 | return "thymeleaf4"; 80 | } 81 | 82 | //@RequestParam 83 | // http://localhost:8080/mvc5/44?product=bilgisayar 84 | @GetMapping("mvc5/{id}") 85 | public String getThymeleaf5( 86 | @PathVariable(name = "id") Long id, 87 | @RequestParam(name = "product") String product, 88 | Model model){ 89 | ProductDto productDto=ProductDto.builder().id(id).productName(product).productPrice(400). build(); 90 | model.addAttribute("controller_key",productDto); 91 | return "thymeleaf5"; 92 | } 93 | 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/ui/mvc/SecurityController.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.ui.mvc; 2 | 3 | import org.springframework.security.core.Authentication; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | 15 | @Controller 16 | public class SecurityController { 17 | // private Authentication authentication= SecurityContextHolder.getContext().getAuthentication(); 18 | 19 | //public (index) 20 | // http://localhost:8080/security/index 21 | @GetMapping("/security/index") 22 | public String getPublic() { 23 | return "publicPage"; 24 | } 25 | 26 | //public (success) 27 | // http://localhost:8080/success 28 | @GetMapping("/success") 29 | public String getSuccess() { 30 | return "success"; 31 | } 32 | 33 | //private (secret Admin Page) 34 | // http://localhost:8080/admin 35 | @GetMapping("/admin") 36 | public String getPrivate(Model model) { 37 | //sistemdeki kullanıcıyı Admin sayfasına yönlendirdik 38 | Authentication authentication= SecurityContextHolder.getContext().getAuthentication(); 39 | String user=""; 40 | if(authentication!=null){ 41 | user=authentication.getName(); 42 | } 43 | model.addAttribute("user_key",user); 44 | return "admin"; 45 | } 46 | 47 | // http://localhost:8080/user 48 | @GetMapping("/user") 49 | @ResponseBody 50 | public String getUser(){ 51 | Authentication authentication= SecurityContextHolder.getContext().getAuthentication(); 52 | String user=""; 53 | if(authentication!=null){ 54 | user=authentication.getName(); 55 | } 56 | return "Hoşgeldiniz:"+user; 57 | } 58 | 59 | //http://localhost:8080/login 60 | //http://localhost:8080/login?error 61 | @GetMapping("/login") 62 | public String getLogin(@RequestParam(value="error",required = false)String error, Model model) { 63 | //Eğer şifre veya kullanıcı adı yanlış girilirse 64 | if(error!=null) 65 | model.addAttribute("login_key","Kullanıcı adı veya şifreniz Yanlış"); 66 | else//Sayfa açılır açılmaz 67 | model.addAttribute("login_key","Lütfen Bilgilerinizi Giriniz"); 68 | return "login"; 69 | } 70 | 71 | //http://localhost:8080/logout 72 | @GetMapping("/logout") 73 | public String getLogin(HttpServletRequest request, HttpServletResponse response, Model model) { 74 | 75 | //sistemde bir kulllanıcı varsa 76 | Authentication authentication= SecurityContextHolder.getContext().getAuthentication(); 77 | if(authentication!=null){ 78 | new SecurityContextLogoutHandler().logout(request,response,authentication); 79 | model.addAttribute("logout_key","Çıkış Yapıldı"); 80 | }else{ 81 | model.addAttribute("logout_key","Sistemde kullanıcı yoktur"); 82 | } 83 | return "logout"; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/hamitmizrak/ui/rest/client/RegisterClientController.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak.ui.rest.client; 2 | 3 | import com.hamitmizrak.business.dto.RegisterDto; 4 | import org.springframework.core.ParameterizedTypeReference; 5 | import org.springframework.http.HttpEntity; 6 | import org.springframework.http.HttpMethod; 7 | import org.springframework.http.ResponseEntity; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.client.RestTemplate; 13 | import java.util.List; 14 | 15 | //CLIENT 16 | @Controller 17 | public class RegisterClientController { 18 | 19 | //Api yazan şu sorulur ? 20 | //1-) URL 21 | //2-) Model 22 | //3-) Get Post Put Delete 23 | 24 | //LIST 25 | // http://localhost:8080/client/register/list 26 | @GetMapping("client/register/list") 27 | //@ResponseBody 28 | public String getClientAllData(Model model){ 29 | String URL="http://localhost:8080/api/v1/list/register"; 30 | RestTemplate restTemplate=new RestTemplate(); 31 | ResponseEntity> responseEntity=restTemplate.exchange(URL, HttpMethod.GET, HttpEntity.EMPTY, new ParameterizedTypeReference>() { 32 | }); 33 | List registerDtoList=responseEntity.getBody(); 34 | registerDtoList.forEach((temp)->{System.out.println(temp);}); 35 | model.addAttribute("register_client_list",responseEntity.getBody()); 36 | return "registerClientList"; 37 | } 38 | 39 | //FIND 40 | // http://localhost:8080/client/find/register/1 41 | @GetMapping( {"/client/find/register/{id}","/client/find/register" } ) 42 | public String getClientFindById(@PathVariable(name="id",required = false) Long id, Model model){ 43 | String URL="http://localhost:8080/api/v1/find/register/"+id; 44 | RestTemplate restTemplate=new RestTemplate(); 45 | RegisterDto registerDto=restTemplate.getForObject(URL,RegisterDto.class); 46 | model.addAttribute("register_client_find",registerDto); 47 | return "registerClientDetailPage"; 48 | } 49 | 50 | 51 | //DELETE 52 | // http://localhost:8080/client/delete/register/1 53 | @GetMapping( {"/client/delete/register/{id}","/client/delete/register" } ) 54 | public String getClientDeleteById(@PathVariable(name="id",required = false) Long id, Model model){ 55 | String URL="http://localhost:8080/api/v1/delete/register/"+id; 56 | RestTemplate restTemplate=new RestTemplate(); 57 | RegisterDto registerDto=restTemplate.getForObject(URL,RegisterDto.class); 58 | model.addAttribute("register_client_delete",registerDto); 59 | return "redirect:/client/register/list"; 60 | } 61 | 62 | //CREATE 2639 page 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _ _ _ _ __ __ _ 2 | | | | | __ _ _ __ ___ (_) |_ | \/ |_ _____ __ __ _| | __ 3 | | |_| |/ _` | '_ ` _ \| | __| | |\/| | |_ / '__/ _` | |/ / 4 | | _ | (_| | | | | | | | |_ | | | | |/ /| | | (_| | < 5 | |_| |_|\__,_|_| |_| |_|_|\__| |_| |_|_/___|_| \__,_|_|\_\ 6 | -------------------------------------------------------------------------------- /src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | # product 2 | product.id=\u00DCr\u00FCn ID 3 | product.name=\u00DCr\u00FCn Ad\u0131 4 | product.price=\u00DCr\u00FCn Fiyat\u0131 5 | product.status=\u00DCr\u00FCn Durumu 6 | 7 | # register 8 | register.list=\u00DCye Kay\u0131t Listesi 9 | register.create=\u00DCye Kay\u0131t Olu\u015Ftur 10 | register.speed=Haz\u0131r veri olu\u015Ftur 11 | 12 | register.id=Register ID 13 | register.name=Register Ad\u0131 14 | register.email=Register Email 15 | register.password=Register \u015Eifresi 16 | 17 | register.delete=Silmek 18 | register.update=G\u00FCncelle 19 | register.show=G\u00F6ster -------------------------------------------------------------------------------- /src/main/resources/public/Deneme: -------------------------------------------------------------------------------- 1 | Strict Mode 2 | Erişim ve atama (Getter ve Setter) metotları 3 | Rezerve kelimeler ve anahtarlar (Reserved Words & Property Keys) 4 | String.prototype.CharAt(); 5 | Object.defineProperty() 6 | Object.keys() 7 | Object.getOwnPropertyNames() 8 | Object.create(); 9 | Array.isArray() 10 | Array.forEach() 11 | Array.map() 12 | Array.filter() 13 | Array.reduce() 14 | Array.every() 15 | Array.indexOf() 16 | Array.lastIndexOf() 17 | Date.now() 18 | Date.prototype.toISOString(); 19 | JSON.parse() 20 | JSON.stringify(); 21 | …..prottype.toJSON(); 22 | Function prototype.bind() 23 | Legal trailing commas 24 | Multiline string literals 25 | Object.getPrototypeOf(), Object.getOwnPropertyDescriptor(), Object.preventExtensions(), Object.isExtensible(), Object.seal(), Object.isSealed(), Object.freeze(), Object.isFrozen() -------------------------------------------------------------------------------- /src/main/resources/public/Deneme.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/src/main/resources/public/Deneme.html -------------------------------------------------------------------------------- /src/main/resources/public/error/401.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

401

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/resources/public/error/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

403

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/resources/public/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

404 sayfası

41 |

Birşeyler ters gitti

42 |
43 | 44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/main/resources/public/error/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

500

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/resources/static/Deneme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamitmizrak/EcodationJavaFullStack3/cdcaf8b769c8610133392ec31a2307b43b456b4c/src/main/resources/static/Deneme -------------------------------------------------------------------------------- /src/main/resources/static/css/styles.css: -------------------------------------------------------------------------------- 1 | html { 2 | scroll-behavior: smooth; 3 | } 4 | 5 | ::-webkit-scrollbar { 6 | width: 5px; 7 | } 8 | 9 | ::-webkit-scrollbar-track { 10 | display: none; 11 | } 12 | 13 | ::-webkit-scrollbar-thumb { 14 | -webkit-box-shadow: 0 0 3px 0px rgba(0, 0, 0, 0.12); 15 | background-color: rgb(206, 206, 206); 16 | outline: 1px solid slategrey; 17 | } 18 | 19 | .container-fluid { 20 | padding-left: 32px; 21 | padding-right: 32px; 22 | } 23 | 24 | .page-container { 25 | padding-top: 30px; 26 | padding-bottom: 30px; 27 | } 28 | 29 | .story-container > .sidebar { 30 | position: fixed; 31 | left: 0; 32 | top: 0; 33 | bottom: 0; 34 | width: 250px; 35 | z-index: 100; 36 | overflow: auto; 37 | border-right: solid 1px #f1f1f1; 38 | background-color: #F5F7F9; 39 | } 40 | 41 | .story-container .story-logo { 42 | font-size: 1rem; 43 | letter-spacing: 1px; 44 | text-transform: uppercase; 45 | padding: 15px; 46 | text-align: center; 47 | } 48 | 49 | .story-menu { 50 | list-style: none; 51 | margin-left: 0; 52 | margin-top: 30px; 53 | padding-left: 0; 54 | } 55 | 56 | .story-menu > li > a { 57 | display: block; 58 | text-decoration: none; 59 | padding: 8px 15px; 60 | border-bottom: solid 1px #f1f1f1; 61 | } 62 | 63 | .story-menu > li > .heading { 64 | display: block; 65 | text-decoration: none; 66 | padding: 8px 15px; 67 | margin-top: 20px; 68 | } 69 | 70 | .story-container > .contents { 71 | position: relative; 72 | margin-left: 250px; 73 | } 74 | 75 | @media (max-width: 767px) { 76 | .story-container > .sidebar { 77 | position: initial; 78 | width: 100%; 79 | } 80 | 81 | .story-container > .contents { 82 | margin-left: 0; 83 | } 84 | } 85 | 86 | section { 87 | padding-top: 50px; 88 | padding-bottom: 50px; 89 | } 90 | 91 | section#intro { 92 | padding-top: 100px; 93 | padding-bottom: 100px; 94 | } 95 | 96 | pre > code { 97 | padding: 32px !important; 98 | background-color: #F5F7F9 !important; 99 | } 100 | 101 | code { 102 | border-radius: 4px; 103 | } 104 | 105 | footer { 106 | text-align: center; 107 | padding: 30px; 108 | border-top: solid 1px #f1f1f1; 109 | } 110 | 111 | .fs-12 { 112 | font-size: 12px; 113 | } 114 | -------------------------------------------------------------------------------- /src/main/resources/static/css/template.css: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | p{ 4 | font-size: 2rem; 5 | } 6 | */ 7 | -------------------------------------------------------------------------------- /src/main/resources/static/js/template.js: -------------------------------------------------------------------------------- 1 | //alert("Merhabalar") -------------------------------------------------------------------------------- /src/main/resources/templates/admin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

DİKKKATTTTT Sadece Üye olanlar Admin Sayfasını Görebilir..

41 |

42 | Anasayfa 43 | CRUD Form İşlemleri 44 | Logout 45 | Login 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/resources/templates/computer1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 | 41 |

Merhabalar thy1

42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/templates/computer2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 | 41 |

Merhabalar thy1

42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/templates/computer3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 | 41 |

Merhabalar thy1

42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/templates/computer4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 | 41 |
42 |
43 |

Computer

44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Anasayfa

33 | Anasayfa 34 | Admin Page 35 | Logout 36 | Login 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Login Sayfası

33 |

34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/resources/templates/logout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Güvenli Çıkış Yapıldı

33 | 34 |

35 | Anasayfa 36 | Admin Page 37 | Logout 38 | Login 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/resources/templates/publicPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Herkese Açık Sayfa Login olmanızı gerek yoktur.

41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/resources/templates/registerApiCreate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Register Create 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 |

FORM

36 | 37 |
38 |
39 |
40 |
41 |
42 | 43 | 44 |
45 |
46 | 47 |
48 |
49 | 50 | 51 |
52 |
53 | 54 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 | Temizle 63 | 64 |
65 |
66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/main/resources/templates/registerClientCreate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Register Create 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 |

FORM

41 | 42 |
43 |
44 |
45 |
46 |
47 | 48 | 49 |
50 |
51 | 52 |
53 |
54 | 55 | 56 |
57 |
58 | 59 |
60 |
61 | 62 | 63 |
64 |
65 |
66 |
67 | Temizle 68 | 69 |
70 |
71 |
72 |
73 |
74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/main/resources/templates/success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

Kayıt Başarılı

41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/main/resources/templates/thymeleaf1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 | 41 |

42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/templates/thymeleaf2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

thymeleaf2

41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/resources/templates/thymeleaf3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

thymeleaf3

41 | 42 |

43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/templates/thymeleaf4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

thymeleaf4

41 | 42 |

43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/templates/thymeleaf5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 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 |

thymeleaf5

41 | 42 |

43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/test/java/com/hamitmizrak/EcodationFullStack3ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.hamitmizrak; 2 | 3 | import org.junit.jupiter.api.*; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EcodationFullStack3ApplicationTests { 8 | 9 | /* private static String data="55"; 10 | //Herşeyden önce 11 | @BeforeAll 12 | static void getBeforeAll(){ 13 | data="44"; 14 | System.out.println("Herşeyden önce ==> getBeforeAll"+data); 15 | } 16 | 17 | //Testten hemen önce 18 | @BeforeEach 19 | void getBeforeEach(){ 20 | System.out.println("Her hangi birşeyden önce ==> BeforeEach"); 21 | } 22 | 23 | // @AfterEach ile@BeforeEach arasındadır 24 | @Test 25 | void getTest(){ 26 | System.out.println("@Test data: "+data); 27 | } 28 | 29 | @Test 30 | void getFail(){ 31 | Assertions.fail("Fail sonuçu"); 32 | } 33 | 34 | @Test 35 | @Disabled("disable")//calışmayacak test 36 | void getDisable(){ 37 | System.out.println("@Disable data: "+data); 38 | } 39 | 40 | //Testten hemen sonra 41 | @AfterEach 42 | void getAfterEach(){ 43 | System.out.println("Her hangi birşeyden sonra ==> AfterEach"); 44 | } 45 | 46 | @AfterAll 47 | static void getAfterAll(){ 48 | data=null; 49 | System.out.println("Herşeyden sonra ==> AfterAll"+data); 50 | }*/ 51 | } 52 | --------------------------------------------------------------------------------