├── Coffee Shop. (Starbucks And Nero) Homework -4 ├── Coffee Shop. (Starbucks And Nero) Homework -4.iml ├── easywsdl │ ├── ExKsoap2-1.0.3.1.jar │ └── ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar ├── out │ └── production │ │ └── Coffee Shop. (Starbucks And Nero) Homework -4 │ │ ├── Abstract │ │ ├── BaseCustomerManager.class │ │ ├── CustomerCheckService.class │ │ ├── GeneralCustomerService.class │ │ └── IEntity.class │ │ ├── Adapters │ │ └── MernisServiceAdapter.class │ │ ├── Concrate │ │ ├── CustomerManager.class │ │ ├── NeroCustomerManager.class │ │ └── StarbucksCustomerManager.class │ │ ├── Console │ │ └── Main.class │ │ ├── Entities │ │ └── Customer.class │ │ └── MernisService │ │ ├── AQUDateTimeConverter.class │ │ ├── AQUExtendedSoapSerializationEnvelope.class │ │ ├── AQUHelper.class │ │ ├── AQUKPSPublicSoap$1.class │ │ ├── AQUKPSPublicSoap$AQUIWcfMethod.class │ │ ├── AQUKPSPublicSoap.class │ │ ├── AQUKPSPublicSoap12$1.class │ │ ├── AQUKPSPublicSoap12$AQUIWcfMethod.class │ │ ├── AQUKPSPublicSoap12.class │ │ ├── AQUMarshalGuid.class │ │ ├── AQUStandardDateTimeConverter.class │ │ └── Metadata.info └── src │ ├── Abstract │ ├── BaseCustomerManager.java │ ├── CustomerCheckService.java │ ├── GeneralCustomerService.java │ └── IEntity.java │ ├── Adapters │ └── MernisServiceAdapter.java │ ├── Concrate │ ├── CustomerManager.java │ ├── NeroCustomerManager.java │ └── StarbucksCustomerManager.java │ ├── Console │ └── Main.java │ ├── Entities │ └── Customer.java │ └── MernisService │ ├── AQUDateTimeConverter.java │ ├── AQUExtendedSoapSerializationEnvelope.java │ ├── AQUHelper.java │ ├── AQUKPSPublicSoap.java │ ├── AQUKPSPublicSoap12.java │ ├── AQUMarshalGuid.java │ ├── AQUStandardDateTimeConverter.java │ └── Metadata.info ├── Game Backend Homework -3 ├── Homework -3.iml ├── out │ └── production │ │ └── Homework -3 │ │ ├── Abstract │ │ ├── CampaingService.class │ │ ├── Entity.class │ │ ├── GameService.class │ │ ├── GamerService.class │ │ └── SaleService.class │ │ ├── Concrete │ │ ├── CampaignManager.class │ │ ├── GameManager.class │ │ ├── GamerManager.class │ │ └── SaleManager.class │ │ ├── Console │ │ └── Main.class │ │ ├── Entities │ │ ├── Campaign.class │ │ ├── Game.class │ │ ├── Gamer.class │ │ └── Sale.class │ │ └── Utils │ │ └── Valiadtion.class └── src │ ├── Abstract │ ├── CampaingService.java │ ├── Entity.java │ ├── GameService.java │ ├── GamerService.java │ └── SaleService.java │ ├── Concrete │ ├── CampaignManager.java │ ├── GameManager.java │ ├── GamerManager.java │ └── SaleManager.java │ ├── Console │ └── Main.java │ ├── Entities │ ├── Campaign.java │ ├── Game.java │ ├── Gamer.java │ └── Sale.java │ └── Utils │ └── Valiadtion.java ├── Homework -1 ├── Home Work - 1.iml └── src │ ├── Category.java │ ├── Course.java │ ├── CourseManager.java │ └── Main.java ├── Homework -2 ├── out │ └── production │ │ └── Homwork2-Day3 │ │ ├── Instructor.class │ │ ├── InstructorManager.class │ │ ├── Main.class │ │ ├── Student.class │ │ ├── StudentManager.class │ │ ├── User.class │ │ └── UserManager.class └── src │ ├── Instructor.java │ ├── InstructorManager.java │ ├── Main.java │ ├── Student.java │ ├── StudentManager.java │ ├── User.java │ └── UserManager.java ├── Homework -5 ├── Homework -5.iml ├── out │ └── production │ │ └── Homework -5 │ │ ├── business │ │ ├── abstracts │ │ │ ├── AuthService.class │ │ │ └── UsersService.class │ │ └── concretes │ │ │ ├── AuthManager.class │ │ │ └── UsersManager.class │ │ ├── console │ │ └── Main.class │ │ ├── core │ │ └── GoogleApiServiceAdapter.class │ │ ├── dateAccess │ │ ├── abstracts │ │ │ └── UserDao.class │ │ └── concretes │ │ │ └── MemoryUserDao.class │ │ ├── entities │ │ ├── abstracts │ │ │ └── Entity.class │ │ └── concretes │ │ │ └── User.class │ │ └── googleApi │ │ └── GoogleApiService.class └── src │ ├── business │ ├── abstracts │ │ ├── AuthService.java │ │ └── UsersService.java │ └── concretes │ │ ├── AuthManager.java │ │ └── UsersManager.java │ ├── console │ └── Main.java │ ├── core │ └── GoogleApiServiceAdapter.java │ ├── dateAccess │ ├── abstracts │ │ └── UserDao.java │ └── concretes │ │ └── MemoryUserDao.java │ ├── entities │ ├── abstracts │ │ └── Entity.java │ └── concretes │ │ └── User.java │ └── googleApi │ └── GoogleApiService.java ├── Homework -6 ├── HELP.md ├── HrmsFinalProject.iml ├── mvnw ├── mvnw.cmd ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── kodlamaio │ │ │ │ └── hrmsfinalproject │ │ │ │ ├── HrmsFinalProjectApplication.java │ │ │ │ ├── api │ │ │ │ └── controllers │ │ │ │ │ └── JobTitlesController.java │ │ │ │ ├── business │ │ │ │ ├── abstracts │ │ │ │ │ └── JobTitleService.java │ │ │ │ └── concretes │ │ │ │ │ └── JobTitleManager.java │ │ │ │ ├── dataaccess │ │ │ │ └── abstracts │ │ │ │ │ └── JobTitleDao.java │ │ │ │ └── entities │ │ │ │ └── concretes │ │ │ │ └── JobTitle.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── kodlamaio │ │ └── hrmsfinalproject │ │ └── HrmsFinalProjectApplicationTests.java └── target │ ├── classes │ ├── application.properties │ └── kodlamaio │ │ └── hrmsfinalproject │ │ ├── HrmsFinalProjectApplication.class │ │ ├── api │ │ └── controllers │ │ │ └── JobTitlesController.class │ │ ├── business │ │ ├── abstracts │ │ │ └── JobTitleService.class │ │ └── concretes │ │ │ └── JobTitleManager.class │ │ ├── dataaccess │ │ └── abstracts │ │ │ └── JobTitleDao.class │ │ └── entities │ │ └── concretes │ │ └── JobTitle.class │ └── test-classes │ └── kodlamaio │ └── hrmsfinalproject │ └── HrmsFinalProjectApplicationTests.class ├── Java Basics ├── Preparing for the Camp.iml └── src │ ├── Arrays.java │ ├── FirendsNumbers.java │ ├── Loops.java │ ├── Main.java │ ├── Methods2.java │ ├── MultiDimensionalArrayDemo.java │ ├── NumberFinding.java │ ├── PerfectNumber.java │ ├── ReCapDemo1.java │ ├── ReCapDemo2.java │ ├── ReCapDemo3.java │ ├── ReCapDemo4.java │ ├── ReCapDemo5.java │ ├── StringsDemo.java │ └── Switch.java ├── LICENSE ├── README.md ├── advancedJavaScript ├── index.html ├── package-lock.json ├── package.json └── src │ ├── app.js │ └── oop │ └── index.js ├── inheritance ├── inheritance.iml ├── inheritance2 │ ├── inheritance2.iml │ └── src │ │ ├── CustomerManager.java │ │ ├── DatabaseLogger.java │ │ ├── EmailLogger.java │ │ ├── FileLogger.java │ │ ├── LogManager.java │ │ ├── Logger.java │ │ ├── SmsLogger.java │ │ └── main.java └── src │ ├── CorporateCustomer.java │ ├── Customer.java │ ├── CustomerManager.java │ ├── IndividualCustomer.java │ └── Main.java ├── interfaces ├── interfaces.iml └── src │ ├── Customer.java │ ├── CustomerManager.java │ ├── DateBaseLogger.java │ ├── EmailLogger.java │ ├── FileLogger.java │ ├── Logger.java │ ├── Main.java │ ├── SmsLogger.java │ └── Utils.java ├── intro ├── intro.iml └── src │ ├── JavaVeriables.java │ └── Main.java ├── nLayeredDemo ├── nLayeredDemo.iml ├── out │ └── production │ │ └── nLayeredDemo │ │ ├── Console │ │ └── Main.class │ │ └── nLayeredDemo │ │ ├── Core │ │ ├── JLoggerManagerAdapter.class │ │ └── LoggerService.class │ │ ├── JLogger │ │ └── JLoggerManager.class │ │ ├── business │ │ ├── abstracts │ │ │ └── ProductService.class │ │ └── concretes │ │ │ └── ProductManager.class │ │ ├── dataAccess │ │ ├── abstracts │ │ │ └── ProductDao.class │ │ └── concretes │ │ │ ├── AbcProductDao.class │ │ │ └── HibernateProductDao.class │ │ └── entites │ │ ├── abstracts │ │ └── Entity.class │ │ └── concretes │ │ └── Product.class └── src │ ├── Console │ └── Main.java │ └── nLayeredDemo │ ├── Core │ ├── JLoggerManagerAdapter.java │ └── LoggerService.java │ ├── JLogger │ └── JLoggerManager.java │ ├── business │ ├── abstracts │ │ └── ProductService.java │ └── concretes │ │ └── ProductManager.java │ ├── dataAccess │ ├── abstracts │ │ └── ProductDao.java │ └── concretes │ │ ├── AbcProductDao.java │ │ └── HibernateProductDao.java │ └── entites │ ├── abstracts │ └── Entity.java │ └── concretes │ └── Product.java ├── northwind ├── HELP.md ├── mvnw ├── mvnw.cmd ├── northwind.iml ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── company │ │ │ │ ├── Entites │ │ │ │ └── concretes │ │ │ │ │ └── Product.java │ │ │ │ ├── NorthwindApplication.java │ │ │ │ ├── api │ │ │ │ └── controllers │ │ │ │ │ └── ProductsController.java │ │ │ │ ├── bussines │ │ │ │ ├── abstracts │ │ │ │ │ └── ProductSerivce.java │ │ │ │ └── concretes │ │ │ │ │ └── ProductManager.java │ │ │ │ └── dataAccess │ │ │ │ └── abstracts │ │ │ │ └── ProdutDao.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── northwind │ │ └── NorthwindApplicationTests.java └── target │ ├── classes │ ├── application.properties │ └── com │ │ └── company │ │ ├── Entites │ │ └── concretes │ │ │ └── Product.class │ │ ├── NorthwindApplication.class │ │ ├── api │ │ └── controllers │ │ │ └── ProductsController.class │ │ ├── bussines │ │ ├── abstracts │ │ │ └── ProductSerivce.class │ │ └── concretes │ │ │ └── ProductManager.class │ │ └── dataAccess │ │ └── abstracts │ │ └── ProdutDao.class │ └── test-classes │ └── com │ └── example │ └── northwind │ └── NorthwindApplicationTests.class ├── northwind2 ├── HELP.md ├── mvnw ├── mvnw.cmd ├── northwind.iml ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── company │ │ │ │ ├── Entites │ │ │ │ └── concretes │ │ │ │ │ └── Product.java │ │ │ │ ├── NorthwindApplication.java │ │ │ │ ├── api │ │ │ │ └── controllers │ │ │ │ │ └── ProductsController.java │ │ │ │ ├── bussines │ │ │ │ ├── abstracts │ │ │ │ │ └── ProductSerivce.java │ │ │ │ └── concretes │ │ │ │ │ └── ProductManager.java │ │ │ │ ├── core │ │ │ │ └── utilitis │ │ │ │ │ └── results │ │ │ │ │ ├── DataResult.java │ │ │ │ │ ├── ErrorDataResult.java │ │ │ │ │ ├── ErrorResult.java │ │ │ │ │ ├── Result.java │ │ │ │ │ ├── SuccessDataResult.java │ │ │ │ │ └── SuccessResult.java │ │ │ │ └── dataAccess │ │ │ │ └── abstracts │ │ │ │ └── ProdutDao.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── northwind │ │ └── NorthwindApplicationTests.java └── target │ ├── classes │ ├── application.properties │ └── com │ │ └── company │ │ ├── Entites │ │ └── concretes │ │ │ └── Product.class │ │ ├── NorthwindApplication.class │ │ ├── api │ │ └── controllers │ │ │ └── ProductsController.class │ │ ├── bussines │ │ ├── abstracts │ │ │ └── ProductSerivce.class │ │ └── concretes │ │ │ └── ProductManager.class │ │ ├── core │ │ └── utilitis │ │ │ └── results │ │ │ ├── DataResult.class │ │ │ ├── ErrorDataResult.class │ │ │ ├── ErrorResult.class │ │ │ ├── Result.class │ │ │ ├── SuccessDataResult.class │ │ │ └── SuccessResult.class │ │ └── dataAccess │ │ └── abstracts │ │ └── ProdutDao.class │ └── test-classes │ └── com │ └── example │ └── northwind │ └── NorthwindApplicationTests.class ├── northwind3 ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── kodlamaio │ │ │ └── northwind │ │ │ ├── NorthwindApplication.java │ │ │ ├── api │ │ │ └── controllers │ │ │ │ └── ProductsController.java │ │ │ ├── business │ │ │ ├── abstracts │ │ │ │ └── ProductService.java │ │ │ └── concretes │ │ │ │ └── ProductManager.java │ │ │ ├── core │ │ │ └── utilities │ │ │ │ └── results │ │ │ │ ├── DataResult.java │ │ │ │ ├── ErrorDataResult.java │ │ │ │ ├── ErrorResult.java │ │ │ │ ├── Result.java │ │ │ │ ├── SuccessDataResult.java │ │ │ │ └── SuccessResult.java │ │ │ ├── dataAccess │ │ │ └── abstracts │ │ │ │ └── ProductDao.java │ │ │ └── entities │ │ │ └── concretes │ │ │ ├── Category.java │ │ │ └── Product.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── kodlamaio │ └── northwind │ └── NorthwindApplicationTests.java ├── northwind4 ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── kodlamaio │ │ │ └── northwind │ │ │ ├── NorthwindApplication.java │ │ │ ├── api │ │ │ └── controllers │ │ │ │ ├── ProductsController.java │ │ │ │ └── UsersController.java │ │ │ ├── business │ │ │ ├── abstracts │ │ │ │ ├── ProductService.java │ │ │ │ └── UserService.java │ │ │ └── concretes │ │ │ │ ├── ProductManager.java │ │ │ │ └── UserManager.java │ │ │ ├── core │ │ │ ├── dataAccess │ │ │ │ └── UserDao.java │ │ │ ├── entities │ │ │ │ └── User.java │ │ │ └── utilities │ │ │ │ └── results │ │ │ │ ├── DataResult.java │ │ │ │ ├── ErrorDataResult.java │ │ │ │ ├── ErrorResult.java │ │ │ │ ├── Result.java │ │ │ │ ├── SuccessDataResult.java │ │ │ │ └── SuccessResult.java │ │ │ ├── dataAccess │ │ │ └── abstracts │ │ │ │ └── ProductDao.java │ │ │ └── entities │ │ │ ├── concretes │ │ │ ├── Category.java │ │ │ └── Product.java │ │ │ └── dtos │ │ │ └── ProductWithCategoryDto.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── kodlamaio │ └── northwind │ └── NorthwindApplicationTests.java └── oopintro ├── oopintro.iml └── src ├── Category.java ├── Main.java ├── Product.java └── ProductManager.java /Coffee Shop. (Starbucks And Nero) Homework -4/Coffee Shop. (Starbucks And Nero) Homework -4.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/easywsdl/ExKsoap2-1.0.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/easywsdl/ExKsoap2-1.0.3.1.jar -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/easywsdl/ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/easywsdl/ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/BaseCustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/BaseCustomerManager.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/CustomerCheckService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/CustomerCheckService.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/GeneralCustomerService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/GeneralCustomerService.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/IEntity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Abstract/IEntity.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Adapters/MernisServiceAdapter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Adapters/MernisServiceAdapter.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Concrate/CustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Concrate/CustomerManager.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Concrate/NeroCustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Concrate/NeroCustomerManager.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Concrate/StarbucksCustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Concrate/StarbucksCustomerManager.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Console/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Console/Main.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Entities/Customer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/Entities/Customer.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUDateTimeConverter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUDateTimeConverter.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUExtendedSoapSerializationEnvelope.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUExtendedSoapSerializationEnvelope.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUHelper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUHelper.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap$1.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap$AQUIWcfMethod.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap$AQUIWcfMethod.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap12$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap12$1.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap12$AQUIWcfMethod.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap12$AQUIWcfMethod.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap12.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUKPSPublicSoap12.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUMarshalGuid.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUMarshalGuid.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUStandardDateTimeConverter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/AQUStandardDateTimeConverter.class -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/out/production/Coffee Shop. (Starbucks And Nero) Homework -4/MernisService/Metadata.info: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5.11.5.0 5 | Basic 6 | easywsdl 7 | AQUKPSPublicSoap 8 | 9 | 10 | https://tckimlik.nvi.gov.tr/service/kpspublic.asmx 11 | 12 | MernisService 13 | false 14 | true 15 | false 16 | true 17 | false 18 | false 19 | false 20 | false 21 | Default 22 | 23 | false 24 | false 25 | Java 26 | None 27 | true 28 | false 29 | false 30 | 31 | 32 | AQUDateTimeConverter.java 33 | AQUExtendedSoapSerializationEnvelope.java 34 | AQUHelper.java 35 | AQUKPSPublicSoap.java 36 | AQUKPSPublicSoap12.java 37 | AQUMarshalGuid.java 38 | AQUStandardDateTimeConverter.java 39 | 40 | 41 | ExKsoap2-1.0.3.1.jar 42 | ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar 43 | 44 | 45 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Abstract/BaseCustomerManager.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Customer; 4 | 5 | public class BaseCustomerManager implements GeneralCustomerService { 6 | @Override 7 | public void saveAll(Customer customer) { 8 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 9 | " tüm mevcut cafelere kaydedildi"); 10 | } 11 | 12 | @Override 13 | public void deleteAll(Customer customer) { 14 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 15 | " tüm mevcut cafelerden silindi"); 16 | } 17 | 18 | @Override 19 | public void updateAll(Customer customer) { 20 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 21 | " tüm mevcut cafelerde güncellendi"); 22 | } 23 | 24 | @Override 25 | public void saveStarbucks(Customer customer) { 26 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 27 | " starbucks cafesine kaydedildi"); 28 | } 29 | 30 | @Override 31 | public void deleteStarbucks(Customer customer) { 32 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 33 | " starbucks cafesinden silindi"); 34 | } 35 | 36 | @Override 37 | public void updateStarbucks(Customer customer) { 38 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 39 | " starbucks cafesinde güncellendi "); 40 | } 41 | 42 | @Override 43 | public void saveNero(Customer customer) { 44 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 45 | " nero cafesine kaydedildi."); 46 | 47 | } 48 | 49 | @Override 50 | public void deleteNero(Customer customer) { 51 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 52 | " nero cafesinde silindi"); 53 | } 54 | 55 | @Override 56 | public void updateNero(Customer customer) { 57 | System.out.println(customer.getFirstName()+" "+customer.getLastName()+" "+"Adlı müşterinin bilgileri," + 58 | " nero cafesinde güncellendi"); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Abstract/CustomerCheckService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Customer; 4 | 5 | public interface CustomerCheckService { 6 | boolean checkIfRealPerson(Customer customer); 7 | } 8 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Abstract/GeneralCustomerService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Customer; 4 | 5 | public interface GeneralCustomerService { 6 | 7 | // Genel hepsini kapsayan 8 | void saveAll(Customer customer); 9 | void deleteAll(Customer customer); 10 | void updateAll(Customer customer); 11 | 12 | //Starbucks 13 | void saveStarbucks(Customer customer); 14 | void deleteStarbucks(Customer customer); 15 | void updateStarbucks(Customer customer); 16 | 17 | //Nero 18 | 19 | void saveNero(Customer customer); 20 | void deleteNero(Customer customer); 21 | void updateNero(Customer customer); 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Abstract/IEntity.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | public interface IEntity { 4 | } 5 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Adapters/MernisServiceAdapter.java: -------------------------------------------------------------------------------- 1 | package Adapters; 2 | 3 | import Abstract.CustomerCheckService; 4 | import Entities.Customer; 5 | import MernisService.AQUKPSPublicSoap; 6 | 7 | public class MernisServiceAdapter implements CustomerCheckService { 8 | 9 | 10 | @Override 11 | public boolean checkIfRealPerson(Customer customer) { 12 | 13 | 14 | AQUKPSPublicSoap publicSoap = new AQUKPSPublicSoap(); 15 | 16 | try { 17 | return publicSoap.TCKimlikNoDogrula(Long.valueOf(customer.getNationalityId()), customer.getFirstName().toUpperCase(), 18 | customer.getLastName().toUpperCase(), customer.getDateOfBirth().getYear()); 19 | } catch (Exception e) { 20 | e.printStackTrace(); 21 | } 22 | return false; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Concrate/CustomerManager.java: -------------------------------------------------------------------------------- 1 | package Concrate; 2 | 3 | import Abstract.BaseCustomerManager; 4 | 5 | public class CustomerManager extends BaseCustomerManager { 6 | } 7 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Concrate/NeroCustomerManager.java: -------------------------------------------------------------------------------- 1 | package Concrate; 2 | 3 | import Abstract.BaseCustomerManager; 4 | 5 | public class NeroCustomerManager extends BaseCustomerManager { 6 | } 7 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Concrate/StarbucksCustomerManager.java: -------------------------------------------------------------------------------- 1 | package Concrate; 2 | 3 | import Abstract.BaseCustomerManager; 4 | 5 | public class StarbucksCustomerManager extends BaseCustomerManager { 6 | } 7 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Console/Main.java: -------------------------------------------------------------------------------- 1 | package Console; 2 | 3 | import Concrate.CustomerManager; 4 | import Concrate.NeroCustomerManager; 5 | import Concrate.StarbucksCustomerManager; 6 | import Entities.Customer; 7 | 8 | import java.time.LocalDate; 9 | import java.util.Date; 10 | 11 | public class Main { 12 | 13 | public static void main(String[] args) { 14 | 15 | // 3 Müşteri oluşturma simülasyonu 16 | 17 | //1 18 | Customer customer = new Customer("Tarik","koc",new Date(2000,1,1) ,"12345678901"); 19 | //2 20 | Customer customer1 = new Customer("Kaan","koc" , new Date(2000,2,2),"12345678901"); 21 | //3 22 | Customer customer2 = new Customer("Abdulhakim","kaya" , new Date(2000,3,3),"12345678901"); 23 | 24 | // Starbucks'a müşteri ekleme , güncelleme , silme Simülasyonu 25 | 26 | StarbucksCustomerManager starbucksCustomerManager = new StarbucksCustomerManager(); 27 | starbucksCustomerManager.saveStarbucks(customer); // Kaydetme 28 | starbucksCustomerManager.updateStarbucks(customer); // güncelleme 29 | starbucksCustomerManager.deleteStarbucks(customer); //Silme 30 | 31 | System.out.println("*****************************"); 32 | 33 | // Nero'ya müşteri ekleme , güncelleme , silme Simülasyonu 34 | 35 | NeroCustomerManager neroCustomerManager = new NeroCustomerManager(); 36 | neroCustomerManager.saveNero(customer1); // kaydetme 37 | neroCustomerManager.updateNero(customer1); // güncelleme 38 | neroCustomerManager.deleteNero(customer1); // silme 39 | 40 | System.out.println("*****************************"); 41 | 42 | // Tüm mevcut cafelere ekleme 43 | 44 | CustomerManager customerManager = new CustomerManager(); 45 | customerManager.saveAll(customer2); // kaydetme 46 | customerManager.updateAll(customer2); // güncelleme 47 | customerManager.deleteAll(customer2); // Silme 48 | 49 | 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/Entities/Customer.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import Abstract.IEntity; 4 | 5 | import java.time.LocalDate; 6 | import java.util.Date; 7 | 8 | public class Customer implements IEntity { 9 | 10 | private String firstName; 11 | private String lastName; 12 | private Date dateOfBirth; 13 | private String nationalityId; 14 | 15 | public Customer(){ 16 | 17 | } 18 | public Customer(String firstName, String lastName, Date dateOfBirth, String nationalityId) { 19 | this.setFirstName(firstName); 20 | this.setLastName(lastName); 21 | this.setDateOfBirth(dateOfBirth); 22 | this.setNationalityId(nationalityId); 23 | } 24 | 25 | 26 | public String getFirstName() { 27 | return firstName; 28 | } 29 | 30 | public void setFirstName(String firstName) { 31 | this.firstName = firstName; 32 | } 33 | 34 | public String getLastName() { 35 | return lastName; 36 | } 37 | 38 | public void setLastName(String lastName) { 39 | this.lastName = lastName; 40 | } 41 | 42 | public Date getDateOfBirth() { 43 | return dateOfBirth; 44 | } 45 | 46 | public void setDateOfBirth(Date dateOfBirth) { 47 | this.dateOfBirth = dateOfBirth; 48 | } 49 | 50 | public String getNationalityId() { 51 | return nationalityId; 52 | } 53 | 54 | public void setNationalityId(String nationalityId) { 55 | this.nationalityId = nationalityId; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/MernisService/AQUDateTimeConverter.java: -------------------------------------------------------------------------------- 1 | package MernisService; 2 | 3 | //---------------------------------------------------- 4 | // 5 | // Generated by www.easywsdl.com 6 | // Version: 5.11.5.0 7 | // 8 | // Created by Quasar Development 9 | // 10 | //---------------------------------------------------- 11 | 12 | import java.util.Date; 13 | 14 | 15 | public interface AQUDateTimeConverter 16 | { 17 | java.util.Date convertDateTime(String strDate); 18 | java.util.Date convertTime(String strDate); 19 | java.util.Date convertDate(String strDate); 20 | String convertDuration(String value); 21 | String getStringFromDateTime(Date value); 22 | String getStringFromDate(Date value); 23 | String getStringFromTime(Date value); 24 | String getStringFromDuration(String value); 25 | } -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/MernisService/AQUMarshalGuid.java: -------------------------------------------------------------------------------- 1 | package MernisService; 2 | 3 | //---------------------------------------------------- 4 | // 5 | // Generated by www.easywsdl.com 6 | // Version: 5.11.5.0 7 | // 8 | // Created by Quasar Development 9 | // 10 | //---------------------------------------------------- 11 | 12 | 13 | import org.ksoap2.serialization.Marshal; 14 | import org.ksoap2.serialization.PropertyInfo; 15 | import org.ksoap2.serialization.SoapSerializationEnvelope; 16 | import org.xmlpull.v1.XmlPullParser; 17 | import org.xmlpull.v1.XmlPullParserException; 18 | import org.xmlpull.v1.XmlSerializer; 19 | 20 | import java.io.IOException; 21 | import java.util.UUID; 22 | 23 | 24 | public class AQUMarshalGuid implements Marshal 25 | { 26 | public java.lang.Object readInstance(XmlPullParser parser, java.lang.String namespace, java.lang.String name,PropertyInfo expected) throws IOException, XmlPullParserException 27 | { 28 | return UUID.fromString(parser.nextText()); 29 | } 30 | 31 | public void register(SoapSerializationEnvelope cm) 32 | { 33 | cm.addMapping(cm.xsd, "guid", UUID.class, this); 34 | } 35 | 36 | public void writeInstance(XmlSerializer writer, java.lang.Object obj) throws IOException 37 | { 38 | writer.text(obj.toString()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/MernisService/AQUStandardDateTimeConverter.java: -------------------------------------------------------------------------------- 1 | package MernisService; 2 | 3 | //---------------------------------------------------- 4 | // 5 | // Generated by www.easywsdl.com 6 | // Version: 5.11.5.0 7 | // 8 | // Created by Quasar Development 9 | // 10 | //---------------------------------------------------- 11 | 12 | import java.text.SimpleDateFormat; 13 | import java.util.Date; 14 | import java.util.Locale; 15 | 16 | 17 | 18 | public class AQUStandardDateTimeConverter implements AQUDateTimeConverter 19 | { 20 | public java.util.TimeZone TimeZone=java.util.TimeZone.getTimeZone("UTC"); 21 | 22 | @Override 23 | public Date convertDateTime(String strDate) 24 | { 25 | java.lang.String[] formats = new java.lang.String[] { 26 | "yyyy-MM-dd'T'HH:mm:ss.SSS", 27 | "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", 28 | "yyyy-MM-dd'T'HH:mm:ssZ", 29 | "yyyy-MM-dd'T'HH:mm:ss", 30 | "yyyy-MM-dd'T'HH:mm", 31 | "yyyy-MM-dd" 32 | }; 33 | return parse(strDate,formats); 34 | } 35 | 36 | private Date parse(String strDate,java.lang.String[] formats){ 37 | if(strDate==null) 38 | { 39 | return null; 40 | } 41 | for (java.lang.String frm : formats) 42 | { 43 | try 44 | { 45 | SimpleDateFormat format = new SimpleDateFormat(frm, Locale.US); 46 | format.setTimeZone(java.util.TimeZone.getTimeZone("UTC")); 47 | return format.parse(strDate); 48 | } 49 | catch (java.lang.Exception ex) 50 | { 51 | } 52 | } 53 | return null; 54 | } 55 | 56 | @Override 57 | public Date convertTime(String strDate) 58 | { 59 | java.lang.String[] formats = new java.lang.String[] { 60 | "HH:mm:ss.SSS", 61 | "HH:mm:ss", 62 | "HH:mm" 63 | }; 64 | return parse(strDate,formats); 65 | } 66 | 67 | @Override 68 | public Date convertDate(String strDate) 69 | { 70 | return convertDateTime(strDate); 71 | } 72 | 73 | @Override 74 | public String convertDuration(String value) { 75 | return value; 76 | } 77 | 78 | @Override 79 | public String getStringFromDateTime(Date value) 80 | { 81 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); 82 | format.setTimeZone(TimeZone); 83 | return format.format(value); 84 | } 85 | 86 | @Override 87 | public String getStringFromDate(Date value) 88 | { 89 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.US); 90 | format.setTimeZone(TimeZone); 91 | return format.format(value); 92 | } 93 | 94 | @Override 95 | public String getStringFromTime(Date value) 96 | { 97 | SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss", Locale.US); 98 | format.setTimeZone(TimeZone); 99 | return format.format(value); 100 | } 101 | 102 | @Override 103 | public String getStringFromDuration(String value) 104 | { 105 | return value; 106 | } 107 | } 108 | 109 | 110 | -------------------------------------------------------------------------------- /Coffee Shop. (Starbucks And Nero) Homework -4/src/MernisService/Metadata.info: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5.11.5.0 5 | Basic 6 | easywsdl 7 | AQUKPSPublicSoap 8 | 9 | 10 | https://tckimlik.nvi.gov.tr/service/kpspublic.asmx 11 | 12 | MernisService 13 | false 14 | true 15 | false 16 | true 17 | false 18 | false 19 | false 20 | false 21 | Default 22 | 23 | false 24 | false 25 | Java 26 | None 27 | true 28 | false 29 | false 30 | 31 | 32 | AQUDateTimeConverter.java 33 | AQUExtendedSoapSerializationEnvelope.java 34 | AQUHelper.java 35 | AQUKPSPublicSoap.java 36 | AQUKPSPublicSoap12.java 37 | AQUMarshalGuid.java 38 | AQUStandardDateTimeConverter.java 39 | 40 | 41 | ExKsoap2-1.0.3.1.jar 42 | ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar 43 | 44 | 45 | -------------------------------------------------------------------------------- /Game Backend Homework -3/Homework -3.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Abstract/CampaingService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Abstract/CampaingService.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Abstract/Entity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Abstract/Entity.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Abstract/GameService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Abstract/GameService.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Abstract/GamerService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Abstract/GamerService.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Abstract/SaleService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Abstract/SaleService.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Concrete/CampaignManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Concrete/CampaignManager.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Concrete/GameManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Concrete/GameManager.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Concrete/GamerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Concrete/GamerManager.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Concrete/SaleManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Concrete/SaleManager.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Console/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Console/Main.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Entities/Campaign.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Entities/Campaign.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Entities/Game.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Entities/Game.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Entities/Gamer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Entities/Gamer.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Entities/Sale.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Entities/Sale.class -------------------------------------------------------------------------------- /Game Backend Homework -3/out/production/Homework -3/Utils/Valiadtion.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Game Backend Homework -3/out/production/Homework -3/Utils/Valiadtion.class -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Abstract/CampaingService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Campaign; 4 | 5 | public interface CampaingService { 6 | 7 | void add(Campaign campaign); 8 | void delete(Campaign campaign); 9 | void update(Campaign campaign); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Abstract/Entity.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | public interface Entity { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Abstract/GameService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Game; 4 | 5 | public interface GameService { 6 | 7 | void add(Game game); 8 | void delete(Game game); 9 | void update(Game game); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Abstract/GamerService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Gamer; 4 | 5 | public interface GamerService { 6 | void add(Gamer gamer); 7 | void delete(Gamer gamer); 8 | void update(Gamer gamer); 9 | } 10 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Abstract/SaleService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.*; 4 | 5 | public interface SaleService { 6 | 7 | void add(Sale sale, Game game, Gamer gamer); 8 | void delete(Sale sale, Game game, Gamer gamer); 9 | void update(Sale sale, Game game, Gamer gamer); 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Concrete/CampaignManager.java: -------------------------------------------------------------------------------- 1 | package Concrete; 2 | 3 | import Abstract.CampaingService; 4 | import Entities.Campaign; 5 | 6 | public class CampaignManager implements CampaingService { 7 | 8 | @Override 9 | public void add(Campaign campaign) { 10 | 11 | System.out.println(campaign.getCampaignName()+" "+"kampanya eklendi."); 12 | } 13 | 14 | @Override 15 | public void delete(Campaign campaign) { 16 | System.out.println(campaign.getCampaignName()+" "+"Adlı kampanya Silindi."); 17 | 18 | } 19 | 20 | @Override 21 | public void update(Campaign campaign) { 22 | System.out.println(campaign.getCampaignName()+" "+"Adlı kampanya güncellendi."); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Concrete/GameManager.java: -------------------------------------------------------------------------------- 1 | package Concrete; 2 | 3 | import Abstract.GameService; 4 | import Entities.Game; 5 | 6 | public class GameManager implements GameService { 7 | 8 | 9 | @Override 10 | public void add(Game game) { 11 | System.out.println(game.getGameName()+" "+"Adlı oyun eklendi"); 12 | } 13 | 14 | @Override 15 | public void delete(Game game) { 16 | System.out.println(game.getGameName()+" "+"Adlı oyun silindi"); 17 | 18 | } 19 | 20 | @Override 21 | public void update(Game game) { 22 | System.out.println(game.getGameName()+" "+"Adlı oyun güncellendi"); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Concrete/GamerManager.java: -------------------------------------------------------------------------------- 1 | package Concrete; 2 | 3 | import Abstract.GamerService; 4 | import Entities.Gamer; 5 | import Utils.Valiadtion; 6 | 7 | public class GamerManager implements GamerService { 8 | @Override 9 | public void add(Gamer gamer) { 10 | boolean result = Valiadtion.userChack(gamer); 11 | if(result){ 12 | System.out.println(gamer.getFirstName()+" "+"Adlı oyuncu eklendi"); 13 | } 14 | } 15 | @Override 16 | public void delete(Gamer gamer) { 17 | System.out.println(gamer.getFirstName()+" "+"Adlı oyuncu silindi"); 18 | 19 | } 20 | 21 | @Override 22 | public void update(Gamer gamer) { 23 | System.out.println(gamer.getFirstName()+" "+"Adlı oyuncu güncellendi"); 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Concrete/SaleManager.java: -------------------------------------------------------------------------------- 1 | package Concrete; 2 | 3 | import Abstract.SaleService; 4 | import Entities.*; 5 | 6 | 7 | public class SaleManager implements SaleService { 8 | 9 | 10 | @Override 11 | public void add(Sale sale, Game game, Gamer gamer) { 12 | System.out.println("Sayın"+" "+gamer.getFirstName()+" "+sale.getId()+" "+" İd'li Siparişiniz eklenmiştir."); 13 | } 14 | 15 | @Override 16 | public void delete(Sale sale, Game game, Gamer gamer) { 17 | System.out.println(sale.getId()+"'İd'li siparişiniz silinmiştir"); 18 | 19 | } 20 | 21 | @Override 22 | public void update(Sale sale, Game game, Gamer gamer) { 23 | System.out.println("Sayın "+gamer.getFirstName()+" "+sale.getId()+"İd'li Siparişiniz güncellenmiştir."); 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Console/Main.java: -------------------------------------------------------------------------------- 1 | package Console; 2 | 3 | import Concrete.CampaignManager; 4 | import Concrete.GameManager; 5 | import Concrete.GamerManager; 6 | import Concrete.SaleManager; 7 | import Entities.*; 8 | 9 | public class Main { 10 | 11 | public static void main(String[] args) { 12 | 13 | 14 | // Game - oyun 15 | Game game = new Game(); 16 | game.setGameName("Pubg"); 17 | game.setPrice(100); 18 | game.setId(1); 19 | 20 | // Gamer - oyuncu 21 | Gamer gamer = new Gamer(); 22 | gamer.setId(1); 23 | gamer.setFirstName("Tarık kaan"); 24 | gamer.setLastName("Koç"); 25 | gamer.setNationalId("49859342311"); 26 | gamer.setYearOfbirth(2001); 27 | 28 | // Sale - Satış 29 | Sale sale = new Sale(); 30 | sale.setGameId(1); 31 | sale.setGamerId(1); 32 | sale.setId(1321313); 33 | 34 | // Campaign - kampanya 35 | Campaign campaign = new Campaign(); 36 | campaign.setCampaignName("Sevgililer günü kampanyası"); 37 | campaign.setDiscount(25); 38 | campaign.setGameId(1); 39 | campaign.setId(1); 40 | 41 | GameManager gameManager = new GameManager(); 42 | gameManager.add(game); 43 | 44 | System.out.println("********************"); 45 | 46 | GamerManager gamerManager= new GamerManager(); 47 | gamerManager.add(gamer); 48 | System.out.println("********************"); 49 | 50 | SaleManager saleManager = new SaleManager(); 51 | saleManager.add(sale,game,gamer); 52 | System.out.println("********************"); 53 | 54 | CampaignManager campaignManager = new CampaignManager(); 55 | campaignManager.delete(campaign); 56 | System.out.println("********************"); 57 | 58 | } 59 | } -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Entities/Campaign.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import Abstract.Entity; 4 | 5 | public class Campaign implements Entity { 6 | 7 | private int Id; 8 | private int gameId; 9 | private String campaignName; 10 | private double discount; 11 | 12 | public Campaign(){ 13 | 14 | } 15 | public Campaign(int id, int gameId, String campaignName, double discount) { 16 | setId(id); 17 | this.setGameId(gameId); 18 | this.setCampaignName(campaignName); 19 | this.setDiscount(discount); 20 | } 21 | 22 | 23 | public int getId() { 24 | return Id; 25 | } 26 | 27 | public void setId(int id) { 28 | Id = id; 29 | } 30 | 31 | public int getGameId() { 32 | return gameId; 33 | } 34 | 35 | public void setGameId(int gameId) { 36 | this.gameId = gameId; 37 | } 38 | 39 | public String getCampaignName() { 40 | return campaignName; 41 | } 42 | 43 | public void setCampaignName(String campaignName) { 44 | this.campaignName = campaignName; 45 | } 46 | 47 | public double getDiscount() { 48 | return discount; 49 | } 50 | 51 | public void setDiscount(double discount) { 52 | this.discount = discount; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Entities/Game.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import Abstract.Entity; 4 | 5 | public class Game implements Entity { 6 | 7 | private int Id; 8 | private int price; 9 | private String gameName; 10 | 11 | public Game(){ 12 | 13 | } 14 | public Game(int id, int price, String gameName, String userName) { 15 | setId(id); 16 | this.setPrice(price); 17 | this.setGameName(gameName); 18 | } 19 | 20 | 21 | public int getId() { 22 | return Id; 23 | } 24 | 25 | public void setId(int id) { 26 | Id = id; 27 | } 28 | 29 | public int getPrice() { 30 | return price; 31 | } 32 | 33 | public void setPrice(int price) { 34 | this.price = price; 35 | } 36 | 37 | public String getGameName() { 38 | return gameName; 39 | } 40 | 41 | public void setGameName(String gameName) { 42 | this.gameName = gameName; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Entities/Gamer.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import Abstract.Entity; 4 | 5 | public class Gamer implements Entity { 6 | 7 | private int Id; 8 | private String nationalId; 9 | private String firstName; 10 | private String lastName; 11 | private int yearOfbirth; 12 | 13 | public Gamer(){ 14 | 15 | } 16 | public Gamer(int id, String nationalId, String firstName, String lastName, int yearOfbirth) { 17 | setId(id); 18 | this.setNationalId(nationalId); 19 | this.setFirstName(firstName); 20 | this.setLastName(lastName); 21 | this.setYearOfbirth(yearOfbirth); 22 | } 23 | 24 | public int getId() { 25 | return Id; 26 | } 27 | 28 | public void setId(int id) { 29 | Id = id; 30 | } 31 | 32 | public String getNationalId() { 33 | return nationalId; 34 | } 35 | 36 | public void setNationalId(String nationalId) { 37 | this.nationalId = nationalId; 38 | } 39 | 40 | public String getFirstName() { 41 | return firstName; 42 | } 43 | 44 | public void setFirstName(String firstName) { 45 | this.firstName = firstName; 46 | } 47 | 48 | public String getLastName() { 49 | return lastName; 50 | } 51 | 52 | public void setLastName(String lastName) { 53 | this.lastName = lastName; 54 | } 55 | 56 | public int getYearOfbirth() { 57 | return yearOfbirth; 58 | } 59 | 60 | public void setYearOfbirth(int yearOfbirth) { 61 | this.yearOfbirth = yearOfbirth; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Entities/Sale.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import Abstract.Entity; 4 | 5 | public class Sale implements Entity { 6 | private int Id; 7 | private int gameId; 8 | private int gamerId; 9 | 10 | public Sale(){ 11 | 12 | } 13 | public Sale(int id, int gameId, int gamerId) { 14 | setId(id); 15 | this.setGameId(gameId); 16 | this.setGamerId(gamerId); 17 | } 18 | 19 | public int getId() { 20 | return Id; 21 | } 22 | 23 | public void setId(int id) { 24 | Id = id; 25 | } 26 | 27 | public int getGameId() { 28 | return gameId; 29 | } 30 | 31 | public void setGameId(int gameId) { 32 | this.gameId = gameId; 33 | } 34 | 35 | public int getGamerId() { 36 | return gamerId; 37 | } 38 | 39 | public void setGamerId(int gamerId) { 40 | this.gamerId = gamerId; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Game Backend Homework -3/src/Utils/Valiadtion.java: -------------------------------------------------------------------------------- 1 | package Utils; 2 | 3 | import Entities.Gamer; 4 | 5 | public class Valiadtion { 6 | 7 | public static boolean userChack(Gamer gamer){ 8 | if(gamer.getFirstName().length()>2){ 9 | if(gamer.getNationalId().length()==11){ 10 | return true; 11 | } 12 | } 13 | return false; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Homework -1/Home Work - 1.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Homework -1/src/Category.java: -------------------------------------------------------------------------------- 1 | public class Category { 2 | 3 | int courseId; 4 | String detail; 5 | String coursePrice; 6 | 7 | public Category(int courseId,String detail,String coursePrice){ 8 | this.courseId=courseId; 9 | this.detail=detail; 10 | this.coursePrice=coursePrice; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Homework -1/src/Course.java: -------------------------------------------------------------------------------- 1 | public class Course { 2 | 3 | int CourseId; 4 | String CourseName; 5 | String CourseTeacher; 6 | 7 | public Course(int CourseId, String CourseName, String CourseTeacher ) { 8 | this.CourseId = CourseId; 9 | this.CourseName = CourseName; 10 | this.CourseTeacher = CourseTeacher; 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Homework -1/src/CourseManager.java: -------------------------------------------------------------------------------- 1 | public class CourseManager { 2 | 3 | public void Add(Course course) { 4 | System.out.println(course.CourseName+" Kursu Daha Sonra İzlenecekler listesine eklendi."); 5 | } 6 | public void Delete(Course course) { 7 | System.out.println(course.CourseName+" Kursu Daha Sonra İzlenecekler listesinden silindi."); 8 | } 9 | public void watchNow(Course course) { 10 | System.out.println(course.CourseName+" Şimdi Seyret."); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Homework -1/src/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | 3 | public static void main(String[] args) { 4 | 5 | Course course1 = new Course(1, "C# + ANGULAR","Engin Demiroð"); 6 | Course course2 = new Course(2, "JAVA + REACT","Engin Demiroð"); 7 | Course course3 = new Course(3, "Programlamaya Giriş için Temel Kurs","Engin Demirog"); 8 | Course[] coursies = {course1, course2, course3}; 9 | 10 | for (Course course : coursies) { 11 | System.out.println("Kurs Adı: "+ course.CourseName+ " Kurs Eğitmeni:"+ course.CourseTeacher); 12 | } 13 | System.out.println("****************************"); 14 | Category category1 = new Category(1,"2 Mohnts","Free"); 15 | Category category2 = new Category(2,"2 Mohnts","Free"); 16 | Category[] categories = {category1, category2}; 17 | for (Category category : categories) { 18 | System.out.println("Course Time :" +category.detail + " Course Price : "+ category.coursePrice); 19 | } 20 | 21 | System.out.println("****************************"); 22 | 23 | // İş( Yönetici veya yönelndirici ) Sınıfı - Manager ( work ) Class 24 | CourseManager courses = new CourseManager(); 25 | courses.Add(course1); 26 | courses.Add(course2); 27 | courses.Add(course3); 28 | 29 | System.out.println("****************************"); 30 | 31 | courses.Delete(course1); 32 | courses.Delete(course2); 33 | courses.Delete(course3); 34 | 35 | System.out.println("****************************"); 36 | 37 | courses.watchNow(course1); 38 | courses.watchNow(course2); 39 | courses.watchNow(course3); 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Homework -2/out/production/Homwork2-Day3/Instructor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -2/out/production/Homwork2-Day3/Instructor.class -------------------------------------------------------------------------------- /Homework -2/out/production/Homwork2-Day3/InstructorManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -2/out/production/Homwork2-Day3/InstructorManager.class -------------------------------------------------------------------------------- /Homework -2/out/production/Homwork2-Day3/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -2/out/production/Homwork2-Day3/Main.class -------------------------------------------------------------------------------- /Homework -2/out/production/Homwork2-Day3/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -2/out/production/Homwork2-Day3/Student.class -------------------------------------------------------------------------------- /Homework -2/out/production/Homwork2-Day3/StudentManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -2/out/production/Homwork2-Day3/StudentManager.class -------------------------------------------------------------------------------- /Homework -2/out/production/Homwork2-Day3/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -2/out/production/Homwork2-Day3/User.class -------------------------------------------------------------------------------- /Homework -2/out/production/Homwork2-Day3/UserManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -2/out/production/Homwork2-Day3/UserManager.class -------------------------------------------------------------------------------- /Homework -2/src/Instructor.java: -------------------------------------------------------------------------------- 1 | public class Instructor extends User { 2 | 3 | private String teacherPass; 4 | private String branch; 5 | 6 | public String getTeacherPass() { 7 | return teacherPass; 8 | } 9 | 10 | public void setTeacherPass(String teacherPass) { 11 | this.teacherPass = teacherPass; 12 | } 13 | 14 | public String getBranch() { 15 | return branch; 16 | } 17 | 18 | public void setBranch(String branch) { 19 | this.branch = branch; 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Homework -2/src/InstructorManager.java: -------------------------------------------------------------------------------- 1 | public class InstructorManager extends UserManager { 2 | 3 | public void addTeacher(Instructor Instructor ){ 4 | System.out.println("Eğitmen eklendi"); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Homework -2/src/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | 3 | public static void main(String[] args) { 4 | 5 | Student student = new Student(); 6 | 7 | student.setFirstName("Tarik kaan"); 8 | student.setLastName("koç"); 9 | student.setAge(19); 10 | student.setId(11); 11 | // *** GET = OKU --- SET = YAZ. -- (( get = getir )) 12 | student.setUserName("koc7"); 13 | student.setEmail("Tarikaan1koc@gmail.com"); 14 | student.setEpsiode("Software Eng"); 15 | 16 | Instructor egitmen = new Instructor(); 17 | 18 | egitmen.setFirstName("engin"); 19 | egitmen.setLastName("Demirog"); 20 | egitmen.setEmail("deneme@gmail.com"); 21 | egitmen.setBranch("programmer"); 22 | egitmen.setUserName("engin7"); 23 | egitmen.setTeacherPass("4129774Eng"); 24 | egitmen.setId(10); 25 | 26 | System.out.println("*************"); 27 | 28 | UserManager usermanager = new UserManager(); 29 | usermanager.add(student); 30 | 31 | System.out.println("*************"); 32 | 33 | InstructorManager InstructorManager = new InstructorManager(); 34 | InstructorManager.addTeacher(egitmen); 35 | 36 | System.out.println("*************"); 37 | 38 | StudentManager studentManager = new StudentManager(); 39 | studentManager.add(student); 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Homework -2/src/Student.java: -------------------------------------------------------------------------------- 1 | public class Student extends User { 2 | 3 | private int age; 4 | private String epsiode; 5 | 6 | public int getAge() { 7 | return age; 8 | } 9 | 10 | public void setAge(int age) { 11 | this.age = age; 12 | } 13 | 14 | public String getEpsiode() { 15 | return epsiode; 16 | } 17 | 18 | public void setEpsiode(String epsiode) { 19 | this.epsiode = epsiode; 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Homework -2/src/StudentManager.java: -------------------------------------------------------------------------------- 1 | public class StudentManager { 2 | 3 | public void add(Student student ){ 4 | 5 | System.out.println(student.getFirstName()+"Öğrenci eklendi."); 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Homework -2/src/User.java: -------------------------------------------------------------------------------- 1 | public class User { 2 | 3 | private int Id; 4 | private String userName; 5 | private String firstName; 6 | private String lastName; 7 | private String email; 8 | 9 | public int getId() { 10 | return Id; 11 | } 12 | 13 | public void setId(int id) { 14 | Id = id; 15 | } 16 | 17 | public String getUserName() { 18 | return userName; 19 | } 20 | 21 | public void setUserName(String userName) { 22 | this.userName = userName; 23 | } 24 | 25 | public String getFirstName() { 26 | return firstName; 27 | } 28 | 29 | public void setFirstName(String firstName) { 30 | this.firstName = firstName; 31 | } 32 | 33 | public String getLastName() { 34 | return lastName; 35 | } 36 | 37 | public void setLastName(String lastName) { 38 | this.lastName = lastName; 39 | } 40 | 41 | public String getEmail() { 42 | return email; 43 | } 44 | 45 | public void setEmail(String email) { 46 | this.email = email; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Homework -2/src/UserManager.java: -------------------------------------------------------------------------------- 1 | public class UserManager { 2 | 3 | public void add(User user ){ 4 | System.out.println("kullanıcı eklendi"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Homework -5/Homework -5.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/business/abstracts/AuthService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/business/abstracts/AuthService.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/business/abstracts/UsersService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/business/abstracts/UsersService.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/business/concretes/AuthManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/business/concretes/AuthManager.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/business/concretes/UsersManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/business/concretes/UsersManager.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/console/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/console/Main.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/core/GoogleApiServiceAdapter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/core/GoogleApiServiceAdapter.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/dateAccess/abstracts/UserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/dateAccess/abstracts/UserDao.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/dateAccess/concretes/MemoryUserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/dateAccess/concretes/MemoryUserDao.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/entities/abstracts/Entity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/entities/abstracts/Entity.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/entities/concretes/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/entities/concretes/User.class -------------------------------------------------------------------------------- /Homework -5/out/production/Homework -5/googleApi/GoogleApiService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -5/out/production/Homework -5/googleApi/GoogleApiService.class -------------------------------------------------------------------------------- /Homework -5/src/business/abstracts/AuthService.java: -------------------------------------------------------------------------------- 1 | package business.abstracts; 2 | 3 | import entities.concretes.User; 4 | 5 | public interface AuthService { 6 | void signIn(User user); 7 | void signUp(User user); 8 | void signWithGoogle(User user); 9 | void getVerifyState(User user,String kod); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Homework -5/src/business/abstracts/UsersService.java: -------------------------------------------------------------------------------- 1 | package business.abstracts; 2 | 3 | import entities.concretes.User; 4 | 5 | import java.util.List; 6 | 7 | public interface UsersService { 8 | 9 | void add(User user); 10 | void update(User user); 11 | void delete(User user); 12 | List getAllUsers(); 13 | User get (int id); 14 | List getAllMails(); 15 | boolean ifMailExists(User user); 16 | boolean ifPasswordExists(User user); 17 | } 18 | -------------------------------------------------------------------------------- /Homework -5/src/business/concretes/AuthManager.java: -------------------------------------------------------------------------------- 1 | package business.concretes; 2 | 3 | import business.abstracts.AuthService; 4 | import business.abstracts.UsersService; 5 | import core.GoogleApiServiceAdapter; 6 | import entities.concretes.User; 7 | 8 | public class AuthManager implements AuthService { 9 | 10 | private UsersService userService; 11 | 12 | public AuthManager(UsersService userService) { 13 | this.userService = userService; 14 | } 15 | 16 | @Override 17 | public void signIn(User user) { 18 | if(isVerify(user) && userService.ifMailExists(user) && userService.ifPasswordExists(user)){ 19 | System.out.println("Giriş Yapıldı"); 20 | } 21 | else{ 22 | System.out.println("Giriş Yapılmadı doğrulanmamış veya email ya da şifre uyuşmadı."); 23 | } 24 | 25 | } 26 | 27 | @Override 28 | public void signUp(User user) { 29 | userService.add(user); 30 | String code = randGenerator(user); 31 | System.out.println(code + " Doğrulama Kodunuz Gönderildi."); 32 | user.setVerifyCode(code); 33 | } 34 | 35 | @Override 36 | public void signWithGoogle(User user) { 37 | 38 | if(isVerify(user)){ 39 | if(!userService.ifMailExists(user)){ 40 | userService.add(user); 41 | user.setVerified(true); 42 | } 43 | else{ 44 | User user_ = userService.get(user.getId()); 45 | user_.setVerified(true); 46 | } 47 | GoogleApiServiceAdapter adapt = new GoogleApiServiceAdapter(); 48 | adapt.signWithGoogle(user.getUserMail(), user.getUserPassword()); 49 | return; 50 | 51 | } 52 | System.out.println("Doğrulunamadı"); 53 | 54 | 55 | 56 | } 57 | 58 | @Override 59 | public void getVerifyState(User user, String kod) { 60 | User verifyUser = userService.get(user.getId()); 61 | if(kod.equals(user.getVerifyCode())){ 62 | verifyUser.setVerified(true); 63 | System.out.println("Başarıyla Doğrulandı"); 64 | } 65 | } 66 | 67 | 68 | private String randGenerator(User user){ 69 | int gen = (int)Math.floor(Math.random() * 9999); 70 | return gen+""+user.getFirstName().substring(0,1) + ""+user.getLastName().substring(0,1); 71 | } 72 | 73 | 74 | private boolean isVerify(User user){ 75 | if(user.isVerified() && (user.getUserMail().isBlank() && user.getUserMail() == null) && (user.getUserPassword().isBlank() && user.getUserPassword() == null) ){ 76 | return false; 77 | } 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Homework -5/src/business/concretes/UsersManager.java: -------------------------------------------------------------------------------- 1 | package business.concretes; 2 | 3 | import business.abstracts.UsersService; 4 | import dateAccess.abstracts.UserDao; 5 | import entities.concretes.User; 6 | 7 | import java.util.List; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | public class UsersManager implements UsersService { 12 | 13 | private UserDao userDao; 14 | 15 | public UsersManager(UserDao userDao) { 16 | this.userDao = userDao; 17 | } 18 | 19 | 20 | @Override 21 | public void add(User user) { 22 | if(isValid(user) && !ifMailExists(user)){ 23 | userDao.add(user); 24 | System.out.println("Kullanıcı eklendi"); 25 | } 26 | } 27 | 28 | @Override 29 | public void update(User user) { 30 | userDao.update(user); 31 | } 32 | 33 | @Override 34 | public void delete(User user) { 35 | userDao.delete(user); 36 | } 37 | 38 | @Override 39 | public List getAllUsers() { 40 | return null; 41 | } 42 | 43 | @Override 44 | public User get(int id) { 45 | return userDao.get(id); 46 | } 47 | 48 | @Override 49 | public List getAllMails() { 50 | return userDao.getAllMails(); 51 | } 52 | 53 | @Override 54 | public boolean ifMailExists(User user) { 55 | return userDao.isMailMatched(user); 56 | } 57 | 58 | @Override 59 | public boolean ifPasswordExists(User user) { 60 | return userDao.isPasswordMatched(user); 61 | } 62 | 63 | 64 | private boolean isValid(User user){ 65 | String regex = "^(.+)@(.+)$"; 66 | Pattern pattern = Pattern.compile(regex); 67 | Matcher matcher = pattern.matcher(user.getUserMail()); 68 | 69 | if(!matcher.matches()){ 70 | System.out.println("E-Posta adresi hatalı ! "); 71 | return false; 72 | } 73 | else if(user.getFirstName().length()<2 && user.getLastName().length() <2 ) { 74 | System.out.println("Lütfen az 2 karakterden oluşan bir Ad / Soyad oluşturunuz."); 75 | return false; 76 | } 77 | else if(user.getUserPassword().length()<6) { 78 | System.out.println("Lütfen en az 6 karakterden oluşan bir parola oluşturunuz."); 79 | } 80 | return true; 81 | } 82 | 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Homework -5/src/console/Main.java: -------------------------------------------------------------------------------- 1 | package console; 2 | 3 | import business.concretes.AuthManager; 4 | import business.concretes.UsersManager; 5 | import dateAccess.concretes.MemoryUserDao; 6 | import entities.concretes.User; 7 | 8 | public class Main { 9 | 10 | public static void main(String[] args) { 11 | 12 | User kullanici1 = new User(); 13 | kullanici1.setFirstName("Tarık kaan"); 14 | kullanici1.setLastName("Koç"); 15 | kullanici1.setId(1); 16 | kullanici1.setUserMail("tarikkaan1koc@gmail.com"); 17 | kullanici1.setUserPassword("4129774tarik"); 18 | 19 | User kullanici2 = new User(); 20 | kullanici2.setFirstName("kerim"); 21 | kullanici2.setLastName("koç"); 22 | kullanici2.setId(2); 23 | kullanici2.setUserMail("kerim1koc@gmail.com"); 24 | kullanici2.setUserPassword("4129774kerim"); 25 | 26 | 27 | 28 | UsersManager userManager = new UsersManager(new MemoryUserDao()); 29 | 30 | AuthManager auth = new AuthManager(userManager); 31 | // auth.signUp(kullanici2); 32 | auth.signWithGoogle(kullanici2); 33 | auth.getVerifyState(kullanici2, kullanici2.getVerifyCode()); 34 | 35 | auth.signIn(kullanici2); 36 | userManager.update(kullanici2); 37 | 38 | 39 | 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Homework -5/src/core/GoogleApiServiceAdapter.java: -------------------------------------------------------------------------------- 1 | package core; 2 | 3 | import googleApi.GoogleApiService; 4 | 5 | public class GoogleApiServiceAdapter { 6 | public void signWithGoogle(String email,String password){ 7 | GoogleApiService api = new GoogleApiService(); 8 | api.sign(email,password); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Homework -5/src/dateAccess/abstracts/UserDao.java: -------------------------------------------------------------------------------- 1 | package dateAccess.abstracts; 2 | 3 | 4 | import entities.concretes.User; 5 | 6 | import java.util.List; 7 | 8 | public interface UserDao { 9 | 10 | void add(User user); 11 | void update(User user); 12 | void delete(User user); 13 | List getAllUsers(); 14 | User get (int id); 15 | List getAllMails(); 16 | boolean isMailMatched (User user); 17 | boolean isPasswordMatched (User user); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Homework -5/src/dateAccess/concretes/MemoryUserDao.java: -------------------------------------------------------------------------------- 1 | package dateAccess.concretes; 2 | 3 | import dateAccess.abstracts.UserDao; 4 | import entities.concretes.User; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class MemoryUserDao implements UserDao { 10 | 11 | private List users; 12 | 13 | public MemoryUserDao(){ 14 | this.users = new ArrayList(); 15 | } 16 | 17 | 18 | @Override 19 | public void add(User user) { 20 | users.add(user); 21 | } 22 | 23 | @Override 24 | public void update(User user) { 25 | 26 | System.out.println("Güncellendi :D"); 27 | 28 | 29 | } 30 | 31 | @Override 32 | public void delete(User user) { 33 | User deletedUser = users.stream().filter(x -> x.getId()==user.getId()).findFirst().get(); 34 | users.remove(deletedUser); 35 | } 36 | 37 | @Override 38 | public List getAllUsers() { 39 | 40 | return users; 41 | } 42 | 43 | @Override 44 | public User get(int id) { 45 | return users.stream().filter(userr -> userr.getId() == id ).findFirst().get(); 46 | } 47 | 48 | @Override 49 | public List getAllMails() { 50 | 51 | List emails = new ArrayList(); 52 | for (User don : users ) { 53 | emails.add(don.getUserMail()); 54 | } 55 | return emails; 56 | } 57 | 58 | @Override 59 | public boolean isMailMatched(User user) { 60 | return getAllMails().stream().anyMatch(mails -> mails.equals(user.getUserMail())); 61 | } 62 | 63 | @Override 64 | public boolean isPasswordMatched(User user) { 65 | return users.stream().anyMatch(users_ -> users_.getUserPassword().equals(user.getUserPassword())); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Homework -5/src/entities/abstracts/Entity.java: -------------------------------------------------------------------------------- 1 | package entities.abstracts; 2 | 3 | public interface Entity { 4 | } 5 | -------------------------------------------------------------------------------- /Homework -5/src/entities/concretes/User.java: -------------------------------------------------------------------------------- 1 | package entities.concretes; 2 | 3 | import entities.abstracts.Entity; 4 | 5 | public class User implements Entity { 6 | 7 | private int id; 8 | private String firstName; 9 | private String lastName; 10 | private String userMail; 11 | private String userPassword; 12 | private boolean isVerified = false; 13 | private String verifyCode = ""; 14 | 15 | public User(){ 16 | 17 | } 18 | 19 | public User(int id, String firstName, String lastName, String userMail, String userPassword) { 20 | 21 | this.setId(id); 22 | this.setFirstName(firstName); 23 | this.setLastName(lastName); 24 | this.setUserMail(userMail); 25 | this.setUserPassword(userPassword); 26 | 27 | } 28 | 29 | public int getId() { 30 | return id; 31 | } 32 | 33 | public void setId(int id) { 34 | this.id = id; 35 | } 36 | 37 | public String getFirstName() { 38 | return firstName; 39 | } 40 | 41 | public void setFirstName(String firstName) { 42 | this.firstName = firstName; 43 | } 44 | 45 | public String getLastName() { 46 | return lastName; 47 | } 48 | 49 | public void setLastName(String lastName) { 50 | this.lastName = lastName; 51 | } 52 | 53 | public String getUserMail() { 54 | return userMail; 55 | } 56 | 57 | public void setUserMail(String userMail) { 58 | this.userMail = userMail; 59 | } 60 | 61 | public String getUserPassword() { 62 | return userPassword; 63 | } 64 | 65 | public void setUserPassword(String userPassword) { 66 | this.userPassword = userPassword; 67 | } 68 | 69 | public boolean isVerified() { 70 | return isVerified; 71 | } 72 | 73 | public void setVerified(boolean verified) { 74 | isVerified = verified; 75 | } 76 | 77 | public String getVerifyCode() { 78 | return verifyCode; 79 | } 80 | 81 | public void setVerifyCode(String verifyCode) { 82 | this.verifyCode = verifyCode; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Homework -5/src/googleApi/GoogleApiService.java: -------------------------------------------------------------------------------- 1 | package googleApi; 2 | 3 | public class GoogleApiService { 4 | public void sign(String mail, String password){ 5 | System.out.println("Signed with google api services - "+ mail); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Homework -6/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | 5 | For further reference, please consider the following sections: 6 | 7 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 8 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/) 9 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/#build-image) 10 | * [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#using-boot-devtools) 11 | * [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-jpa-and-spring-data) 12 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-developing-web-applications) 13 | 14 | ### Guides 15 | 16 | The following guides illustrate how to use some features concretely: 17 | 18 | * [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) 19 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 20 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 21 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 22 | 23 | -------------------------------------------------------------------------------- /Homework -6/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | kodlamaio 12 | HrmsFinalProject 13 | 0.0.1-SNAPSHOT 14 | HrmsFinalProject 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.projectlombok 42 | lombok 43 | true 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | org.projectlombok 61 | lombok 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Homework -6/src/main/java/kodlamaio/hrmsfinalproject/HrmsFinalProjectApplication.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrmsfinalproject; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HrmsFinalProjectApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HrmsFinalProjectApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Homework -6/src/main/java/kodlamaio/hrmsfinalproject/api/controllers/JobTitlesController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrmsfinalproject.api.controllers; 2 | 3 | import kodlamaio.hrmsfinalproject.business.abstracts.JobTitleService; 4 | import kodlamaio.hrmsfinalproject.entities.concretes.JobTitle; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import java.util.List; 11 | 12 | @RestController 13 | @RequestMapping("/api/titles") 14 | public class JobTitlesController { 15 | 16 | private JobTitleService jobTitleService; 17 | 18 | @Autowired 19 | public JobTitlesController(JobTitleService jobTitleService) { 20 | this.jobTitleService = jobTitleService; 21 | } 22 | 23 | @GetMapping("/getAll") 24 | public ListgetAll(){ 25 | return this.jobTitleService.getAll(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Homework -6/src/main/java/kodlamaio/hrmsfinalproject/business/abstracts/JobTitleService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrmsfinalproject.business.abstracts; 2 | 3 | import kodlamaio.hrmsfinalproject.entities.concretes.JobTitle; 4 | 5 | import java.util.List; 6 | 7 | public interface JobTitleService { 8 | 9 | List getAll(); 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Homework -6/src/main/java/kodlamaio/hrmsfinalproject/business/concretes/JobTitleManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrmsfinalproject.business.concretes; 2 | 3 | import kodlamaio.hrmsfinalproject.business.abstracts.JobTitleService; 4 | import kodlamaio.hrmsfinalproject.dataaccess.abstracts.JobTitleDao; 5 | import kodlamaio.hrmsfinalproject.entities.concretes.JobTitle; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | 13 | public class JobTitleManager implements JobTitleService { 14 | 15 | private JobTitleDao jobTitleDao; 16 | 17 | @Autowired 18 | public JobTitleManager(JobTitleDao jobTitleDao) { 19 | this.jobTitleDao = jobTitleDao; 20 | } 21 | 22 | @Override 23 | public List getAll() { 24 | return this.jobTitleDao.findAll(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Homework -6/src/main/java/kodlamaio/hrmsfinalproject/dataaccess/abstracts/JobTitleDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrmsfinalproject.dataaccess.abstracts; 2 | 3 | import kodlamaio.hrmsfinalproject.entities.concretes.JobTitle; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface JobTitleDao extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Homework -6/src/main/java/kodlamaio/hrmsfinalproject/entities/concretes/JobTitle.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrmsfinalproject.entities.concretes; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import javax.persistence.*; 8 | 9 | @Data // (Lombok) Data ile get / set'lar oluşturulmaktadır. 10 | 11 | @AllArgsConstructor // Lombok İle parametreli contructor oluşturuluyor. 12 | @NoArgsConstructor // Lombok ile boş cns oluşturuluyor. 13 | 14 | @Entity 15 | @Table(name ="job_titles") //Veritabanındaki tablomuzun karşılığını göstermektedir. 16 | public class JobTitle { 17 | 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.IDENTITY) // 20 | 21 | @Column(name = "id") //Sutüun karşılığı 22 | private int id; 23 | 24 | @Column(name = "title") //Sutün karşılığı 25 | private String title; 26 | } 27 | -------------------------------------------------------------------------------- /Homework -6/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/hrms 5 | spring.datasource.username=postgres 6 | spring.datasource.password=4129774 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /Homework -6/src/test/java/kodlamaio/hrmsfinalproject/HrmsFinalProjectApplicationTests.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrmsfinalproject; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HrmsFinalProjectApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Homework -6/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/hrms 5 | spring.datasource.username=postgres 6 | spring.datasource.password=4129774 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /Homework -6/target/classes/kodlamaio/hrmsfinalproject/HrmsFinalProjectApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -6/target/classes/kodlamaio/hrmsfinalproject/HrmsFinalProjectApplication.class -------------------------------------------------------------------------------- /Homework -6/target/classes/kodlamaio/hrmsfinalproject/api/controllers/JobTitlesController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -6/target/classes/kodlamaio/hrmsfinalproject/api/controllers/JobTitlesController.class -------------------------------------------------------------------------------- /Homework -6/target/classes/kodlamaio/hrmsfinalproject/business/abstracts/JobTitleService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -6/target/classes/kodlamaio/hrmsfinalproject/business/abstracts/JobTitleService.class -------------------------------------------------------------------------------- /Homework -6/target/classes/kodlamaio/hrmsfinalproject/business/concretes/JobTitleManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -6/target/classes/kodlamaio/hrmsfinalproject/business/concretes/JobTitleManager.class -------------------------------------------------------------------------------- /Homework -6/target/classes/kodlamaio/hrmsfinalproject/dataaccess/abstracts/JobTitleDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -6/target/classes/kodlamaio/hrmsfinalproject/dataaccess/abstracts/JobTitleDao.class -------------------------------------------------------------------------------- /Homework -6/target/classes/kodlamaio/hrmsfinalproject/entities/concretes/JobTitle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -6/target/classes/kodlamaio/hrmsfinalproject/entities/concretes/JobTitle.class -------------------------------------------------------------------------------- /Homework -6/target/test-classes/kodlamaio/hrmsfinalproject/HrmsFinalProjectApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/Homework -6/target/test-classes/kodlamaio/hrmsfinalproject/HrmsFinalProjectApplicationTests.class -------------------------------------------------------------------------------- /Java Basics/Preparing for the Camp.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Java Basics/src/Arrays.java: -------------------------------------------------------------------------------- 1 | public class Arrays { 2 | public static void main(String[] args){ 3 | 4 | String[] student = new String[4]; 5 | 6 | student[0]="Tarik"; 7 | student[1]="Abdulhakim"; 8 | student[2]="Kaan"; 9 | student[3]="Ahmet"; 10 | 11 | for(String students: student){ 12 | System.out.println(students); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Java Basics/src/FirendsNumbers.java: -------------------------------------------------------------------------------- 1 | public class FirendsNumbers { 2 | public static void main(String[]args){ 3 | //220 ve 284. Kendileri hariç pozitif tam bölenlerinin toplamý birbirine eþit olan sayýlar. 4 | 5 | int number1 = 220; 6 | int number2 = 284; 7 | int total1 = 0; 8 | int total2 = 0; 9 | 10 | for(int i=1;imaximum){ 10 | maximum=number; 11 | } 12 | total=total+number; 13 | System.out.println(number); 14 | } 15 | 16 | System.out.println("********************"); 17 | 18 | System.out.println("Toplam : "+total); 19 | System.out.println("En büyük ondalıklı sayı : "+maximum); 20 | } 21 | } -------------------------------------------------------------------------------- /Java Basics/src/ReCapDemo3.java: -------------------------------------------------------------------------------- 1 | public class ReCapDemo3 { 2 | 3 | public static void main(String[]args){ 4 | 5 | int number = 26; 6 | int remender = number%2; 7 | boolean inPrime = false; 8 | 9 | if(number==1){ 10 | System.out.println("Sayı Asaldır"); 11 | return; 12 | } 13 | else if(number<1){ 14 | System.out.println("Lütfen0'dan büyükr bir rakam giriniz"); 15 | return; } 16 | 17 | for(int i=2;i 2 | 3 | JavaScript 4 | 5 | 6 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /advancedJavaScript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jscourse", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "dev": "lite-server" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "es6-module-loader": "^0.17.11", 14 | "traceur": "0.0.108" 15 | }, 16 | "devDependencies": { 17 | "lite-server": "^2.2.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /advancedJavaScript/src/app.js: -------------------------------------------------------------------------------- 1 | // var, let , const -veriables 2 | 3 | //Örnek1: // elesticSearch 4 | let number1 =10; 5 | number1 = "Tarık Kaan Koç" 6 | let student = {id:1,name: "Kaan"} 7 | // console.log(student) 8 | 9 | function save(puan=10, ogrenci) { 10 | //console.log(ogrenci.name+ " : "+ puan) 11 | } 12 | save(undefined,student); 13 | 14 | // Tip güvenli bir dil değil js. 15 | 16 | //Arry 17 | 18 | let students = ["Tarık kaan koc","Abdulhakim kaya","Furkan Zmn","Büşra","Ankara",{city:"istanbul"}] 19 | 20 | // console.log(students) 21 | 22 | let students2 = [student,{id:1, name: "Koç"}] 23 | // console.log(students2) 24 | 25 | // rest - (geriye kalan) 26 | let showProducts = function (id,...products) { 27 | console.log(id) 28 | console.log(products[0]) // 0. Elamanı okut. Çıktı: Elma 29 | } 30 | 31 | // typeof en son aldığı tipi okutur 32 | // console.log(typeof showProducts) 33 | //rest 34 | // showProducts(10,"elma","armut","karpuz"); 35 | 36 | //... spread verision 37 | // spread : ayrıştırmask 38 | 39 | let points= [1,2,3,4,50,4,60,14] 40 | console.log(...points) 41 | console.log(Math.max(...points)) 42 | console.log(..."ABC","D",..."EFG","H") 43 | 44 | // Destructring : parçalamak anlamına gelmektedir 45 | 46 | // Eliimizdeki array'n değerlerini değişkenklere atamak 47 | 48 | let populations = [10000,20000,30000,[40000,50000]] 49 | 50 | let [small,medium,high,[veryhigh,maximum]] = populations // Destructring 51 | 52 | console.log(small) 53 | console.log(medium) 54 | console.log(high) 55 | console.log(veryhigh) 56 | console.log(maximum) 57 | 58 | 59 | 60 | // Örnek 2 : Destrcutring 61 | 62 | function someFunction([small1],number) { 63 | console.log(small1) // Bana bir arry gelecek ve arry 'deki ilk değişkeni small1'e atayacam demektir. 64 | } 65 | 66 | someFunction(populations); // Çıktı : 10000 67 | 68 | let category = {id:1,name:"içecek"} 69 | console.log(category.id) // Java'da gibi getId olarak düşünüebilirsiniz 70 | console.log(category["name"]) // java'da gibi getName olarak düşünebilirsiniz. Çalışır. 71 | 72 | let {id,name} = category 73 | console.log(id) 74 | console.log(name) 75 | -------------------------------------------------------------------------------- /advancedJavaScript/src/oop/index.js: -------------------------------------------------------------------------------- 1 | class Customer{ 2 | // export = javada public 3 | 4 | // prototyping özelliği. Değerler aşağıdaki cunstructor 'da oluşturulur. 5 | constructor(id,customerNumber){ 6 | this.id = id 7 | this.customerNumber = customerNumber 8 | } 9 | } 10 | 11 | let customer = new Customer(1,"12345"); 12 | //prototyping 13 | customer.name = "Tarık Kaan Koç" 14 | console.log(customer.name) // insteanse'ye yapılan prototyping 15 | 16 | Customer.blabla = "Example" // Classa yapılan prototyping 17 | console.log(Customer.blabla) 18 | 19 | console.log(customer.customerNumber) 20 | 21 | class IndividualCustomer extends Customer{ 22 | cunstructor(firstName,id,customerNumber){ 23 | super(id,customerNumber) 24 | this.firstName = firstName 25 | } 26 | 27 | } 28 | 29 | class CorporateCustomer extends Customer{ 30 | cunstructor(companyName,id,customerNumber){ 31 | super(id,customerNumber) 32 | this.companyName = companyName 33 | } 34 | } -------------------------------------------------------------------------------- /inheritance/inheritance.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /inheritance/inheritance2/inheritance2.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/CustomerManager.java: -------------------------------------------------------------------------------- 1 | public class CustomerManager { 2 | public void Add(Logger logger) { 3 | System.out.println("Müşteri eklendi."); 4 | logger.log(); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/DatabaseLogger.java: -------------------------------------------------------------------------------- 1 | public class DatabaseLogger extends Logger { 2 | @Override //Javada yazmasakda olur. Ama kod okunurluğu için yazılır. 3 | public void log() { 4 | System.out.println("Database loglandı."); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/EmailLogger.java: -------------------------------------------------------------------------------- 1 | public class EmailLogger extends Logger { 2 | @Override //Javada yazmasakda olur. Ama kod okunurluğu için yazılır. 3 | public void log() { 4 | System.out.println("Email gönderildi."); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/FileLogger.java: -------------------------------------------------------------------------------- 1 | public class FileLogger extends Logger { 2 | 3 | @Override //Javada yazmasakda olur. Ama kod okunurluğu için yazılır. 4 | public void log() { 5 | System.out.println("File loglandı."); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/LogManager.java: -------------------------------------------------------------------------------- 1 | public class LogManager { 2 | public void log() { 3 | 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/Logger.java: -------------------------------------------------------------------------------- 1 | public class Logger { 2 | public void log() { 3 | 4 | 5 | 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/SmsLogger.java: -------------------------------------------------------------------------------- 1 | public class SmsLogger extends Logger { 2 | 3 | 4 | } 5 | -------------------------------------------------------------------------------- /inheritance/inheritance2/src/main.java: -------------------------------------------------------------------------------- 1 | public class main { 2 | public static void main(String[] args) { 3 | CustomerManager customerManager= new CustomerManager(); 4 | customerManager.Add(new EmailLogger()); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /inheritance/src/CorporateCustomer.java: -------------------------------------------------------------------------------- 1 | public class CorporateCustomer extends Customer{ 2 | String companyName; 3 | String tuxNumber; 4 | } 5 | -------------------------------------------------------------------------------- /inheritance/src/Customer.java: -------------------------------------------------------------------------------- 1 | public class Customer { 2 | int id; 3 | String customerNumber; 4 | } -------------------------------------------------------------------------------- /inheritance/src/CustomerManager.java: -------------------------------------------------------------------------------- 1 | public class CustomerManager { 2 | public void Add(Customer customer) { 3 | System.out.println(customer.customerNumber+ " kaydedildi."); 4 | } 5 | public void AddMultiple(Customer[] customers) { 6 | for (Customer customer : customers) { 7 | System.out.println(customer.customerNumber+ " kaydedildi."); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /inheritance/src/IndividualCustomer.java: -------------------------------------------------------------------------------- 1 | public class IndividualCustomer extends Customer { 2 | String firstName; 3 | String lastName; 4 | String nationalIdentity; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /inheritance/src/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | 3 | public static void main(String[] args) { 4 | IndividualCustomer tarik= new IndividualCustomer(); 5 | tarik.customerNumber="123"; 6 | 7 | CorporateCustomer abdulhakim =new CorporateCustomer(); 8 | abdulhakim.customerNumber="456"; 9 | 10 | Customer[] customers= { tarik , abdulhakim }; 11 | CustomerManager customerManager=new CustomerManager(); 12 | customerManager.AddMultiple(customers); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /interfaces/interfaces.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /interfaces/src/Customer.java: -------------------------------------------------------------------------------- 1 | public class Customer { 2 | 3 | private int Id; 4 | private String firstName; 5 | private String lastName; 6 | 7 | public Customer(String id, String firstName, String lastName){ 8 | this.Id = Id; 9 | this.firstName = firstName; 10 | this.lastName = lastName; 11 | } 12 | public int getId() { 13 | return Id; 14 | } 15 | 16 | public void setId(int id) { 17 | this.Id = Id; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public void setFirstName(String firstName) { 25 | this.firstName = firstName; 26 | } 27 | 28 | public String getLastName() { 29 | return lastName; 30 | } 31 | 32 | public void setLastName(String lastName) { 33 | this.lastName = lastName; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /interfaces/src/CustomerManager.java: -------------------------------------------------------------------------------- 1 | import jdk.jshell.execution.Util; 2 | 3 | public class CustomerManager { 4 | //localy - tightly coupled 5 | 6 | private Logger[] loggers; 7 | public CustomerManager(Logger[] loggers){ 8 | this.loggers = loggers; 9 | } 10 | 11 | public void add(Customer customer){ 12 | System.out.println("Müşetri Eklendi :"+ customer.getFirstName()); 13 | Utils.runLoggers(loggers, customer.getFirstName()); 14 | } 15 | 16 | public void delete(Customer customer){ 17 | System.out.println("Müşetri Silindi :"+ customer.getFirstName()); 18 | Utils.runLoggers(loggers,customer.getLastName()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /interfaces/src/DateBaseLogger.java: -------------------------------------------------------------------------------- 1 | public class DateBaseLogger implements Logger{ 2 | @Override 3 | public void log(String message){ 4 | System.out.println("DateBase Loglandı :"+message); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /interfaces/src/EmailLogger.java: -------------------------------------------------------------------------------- 1 | public class EmailLogger implements Logger{ 2 | 3 | public void log(String email){ 4 | System.out.println("DateBase Loglandı : "+email); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /interfaces/src/FileLogger.java: -------------------------------------------------------------------------------- 1 | public class FileLogger implements Logger{ 2 | @Override 3 | public void log(String message){ 4 | System.out.println("Dosyaya Loglandı :"+message); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /interfaces/src/Logger.java: -------------------------------------------------------------------------------- 1 | public interface Logger { 2 | void log (String message); 3 | 4 | 5 | } 6 | -------------------------------------------------------------------------------- /interfaces/src/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[]args){ 3 | 4 | Logger[] loggers = {new SmsLogger(),new EmailLogger(), new FileLogger()}; 5 | 6 | CustomerManager customerManager = new CustomerManager(loggers); 7 | 8 | Customer tarik = new Customer("1","Tarik kaan","koc"); 9 | customerManager.add(tarik); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /interfaces/src/SmsLogger.java: -------------------------------------------------------------------------------- 1 | public class SmsLogger implements Logger { 2 | @Override 3 | public void log(String message){ 4 | System.out.println("Sms Loglandı :"+message); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /interfaces/src/Utils.java: -------------------------------------------------------------------------------- 1 | public class Utils { 2 | 3 | public static void runLoggers(Logger[] loggers, String message){ 4 | for(Logger logger : loggers){ 5 | logger.log(message); 6 | } 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /intro/intro.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /intro/src/JavaVeriables.java: -------------------------------------------------------------------------------- 1 | public class JavaVeriables { 2 | 3 | public static void main(String[] args) { 4 | 5 | // PRINT SCREEN - EKRAN ÇIKTISI 6 | System.out.println("Hello World!"); 7 | 8 | //Primitive Data Types - İlkel veri tipleri 9 | 10 | byte age = 120; // -128 ve 127 arasında değerler alır. - It takes values between -128 and 127. 11 | short dear = -1300; //-32768 ve 32767 arasında değerler alır. - It takes values between -32768 and 32767. 12 | // -2,147,483,648 to 2,147,483,647 İNTEGER Data Type - TAMSAYI Veri türü 13 | int myAge = 21; 14 | long uzunSayilarİcin = 1313013; // Çok uzun sayıları tutmak için kullanılır - Used to hold very long numbers 15 | 16 | // DATA TYPES - VERİ TİPLERİ 17 | 18 | // The String data type is used to store a sequence of characters (text). 19 | // String veri türü, bir karakter dizisini (metini) saklamak için kullanılır. 20 | String myName = "Ibrahim"; 21 | 22 | // Sufficient for storing 6 to 7 decimal digits. 23 | //6-7 Ondalık basamağı olan sayıları depolar. 24 | float myFloatNumber = 5.99f; 25 | 26 | // Stores a single character/letter or ASCII values. 27 | // Tek bir karakter / harf veya ASCII değerleri depolar. 28 | char myNameFirstLetter = 'I'; 29 | 30 | //Stores true or false values. 31 | // Doğru veya yanlış değerleri depolar. 32 | boolean myBoolean = true; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /nLayeredDemo/nLayeredDemo.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/Console/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/Console/Main.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/Core/JLoggerManagerAdapter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/Core/JLoggerManagerAdapter.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/Core/LoggerService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/Core/LoggerService.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/JLogger/JLoggerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/JLogger/JLoggerManager.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/business/abstracts/ProductService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/business/abstracts/ProductService.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/business/concretes/ProductManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/business/concretes/ProductManager.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/dataAccess/abstracts/ProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/dataAccess/abstracts/ProductDao.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/dataAccess/concretes/AbcProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/dataAccess/concretes/AbcProductDao.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/dataAccess/concretes/HibernateProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/dataAccess/concretes/HibernateProductDao.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/entites/abstracts/Entity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/entites/abstracts/Entity.class -------------------------------------------------------------------------------- /nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/entites/concretes/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/nLayeredDemo/out/production/nLayeredDemo/nLayeredDemo/entites/concretes/Product.class -------------------------------------------------------------------------------- /nLayeredDemo/src/Console/Main.java: -------------------------------------------------------------------------------- 1 | package Console; 2 | 3 | import nLayeredDemo.Core.JLoggerManagerAdapter; 4 | import nLayeredDemo.business.abstracts.ProductService; 5 | import nLayeredDemo.business.concretes.ProductManager; 6 | import nLayeredDemo.dataAccess.concretes.AbcProductDao; 7 | import nLayeredDemo.entites.concretes.Product; 8 | 9 | public class Main { 10 | 11 | public static void main(String[] args) { 12 | 13 | //ToDo : Spring IOC İle çözülecek. // İnteface'ler somut sınıfları tutabilir. Bu yüzden referans ettik. 14 | ProductService productService = new ProductManager(new AbcProductDao() 15 | , new JLoggerManagerAdapter()); 16 | 17 | Product product = new Product(1,2,"elma",12,50); 18 | productService.add(product); 19 | 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/Core/JLoggerManagerAdapter.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.Core; 2 | 3 | import nLayeredDemo.JLogger.JLoggerManager; 4 | 5 | public class JLoggerManagerAdapter implements LoggerService { 6 | @Override 7 | public void logToSystem(String message) { 8 | JLoggerManager manager = new JLoggerManager(); 9 | manager.log(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/Core/LoggerService.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.Core; 2 | 3 | public interface LoggerService { 4 | void logToSystem(String message); 5 | } 6 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/JLogger/JLoggerManager.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.JLogger; 2 | 3 | public class JLoggerManager { 4 | public void log(String message){ 5 | System.out.println("J Logger ile loglandı : "+ message ); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/business/abstracts/ProductService.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.business.abstracts; 2 | 3 | import nLayeredDemo.entites.concretes.Product; 4 | 5 | import java.util.List; 6 | 7 | public interface ProductService { 8 | void add(Product product); 9 | List getAll(); 10 | } 11 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/business/concretes/ProductManager.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.business.concretes; 2 | 3 | import nLayeredDemo.Core.LoggerService; 4 | import nLayeredDemo.business.abstracts.ProductService; 5 | import nLayeredDemo.dataAccess.abstracts.ProductDao; 6 | import nLayeredDemo.entites.concretes.Product; 7 | 8 | import java.util.List; 9 | 10 | public class ProductManager implements ProductService { 11 | 12 | private ProductDao productDao; 13 | private LoggerService loggerService; 14 | 15 | public ProductManager(ProductDao productDao, LoggerService loggerService) { 16 | this.productDao = productDao; 17 | this.loggerService = loggerService; 18 | } 19 | 20 | @Override 21 | public void add(Product product) { 22 | if(product.getCategoryId()==1){ 23 | System.out.println("Bu kategoride ürün kabul edilmiyor."); 24 | return; 25 | } 26 | this.productDao.addProduct(product); 27 | this.loggerService.logToSystem("Ürün eklendi "+product.getProductName()); 28 | } 29 | 30 | @Override 31 | public List getAll() { 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/dataAccess/abstracts/ProductDao.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.dataAccess.abstracts; 2 | 3 | import nLayeredDemo.entites.concretes.Product; 4 | 5 | import java.util.List; 6 | 7 | public interface ProductDao { 8 | 9 | void addProduct(Product product); 10 | void updateProduct(Product product); 11 | void deleteProduct(Product product); 12 | Product get(int id); 13 | List getAll(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/dataAccess/concretes/AbcProductDao.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.dataAccess.concretes; 2 | 3 | import nLayeredDemo.dataAccess.abstracts.ProductDao; 4 | import nLayeredDemo.entites.concretes.Product; 5 | 6 | import java.util.List; 7 | 8 | public class AbcProductDao implements ProductDao { 9 | @Override 10 | public void addProduct(Product product) { 11 | System.out.println("Abc ile eklendi " + product.getProductName()); 12 | 13 | } 14 | 15 | @Override 16 | public void updateProduct(Product product) { 17 | 18 | } 19 | 20 | @Override 21 | public void deleteProduct(Product product) { 22 | 23 | } 24 | 25 | @Override 26 | public Product get(int id) { 27 | return null; 28 | } 29 | 30 | @Override 31 | public List getAll() { 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/dataAccess/concretes/HibernateProductDao.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.dataAccess.concretes; 2 | 3 | import nLayeredDemo.dataAccess.abstracts.ProductDao; 4 | import nLayeredDemo.entites.concretes.Product; 5 | 6 | import java.util.List; 7 | 8 | public class HibernateProductDao implements ProductDao { 9 | 10 | 11 | @Override 12 | public void addProduct(Product product) { 13 | System.out.println("Hibernate ile eklendi " + product.getProductName()); 14 | } 15 | 16 | @Override 17 | public void updateProduct(Product product) { 18 | 19 | } 20 | 21 | @Override 22 | public void deleteProduct(Product product) { 23 | 24 | } 25 | 26 | @Override 27 | public Product get(int id) { 28 | return null; 29 | } 30 | 31 | @Override 32 | public List getAll() { 33 | return null; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/entites/abstracts/Entity.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.entites.abstracts; 2 | 3 | public interface Entity { 4 | } 5 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/entites/concretes/Product.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.entites.concretes; 2 | 3 | import nLayeredDemo.entites.abstracts.Entity; 4 | 5 | public class Product implements Entity { 6 | 7 | private int id; 8 | private int categoryId; 9 | private String productName; 10 | private double unitPrice; 11 | private int unitsInstock; 12 | 13 | public Product(){ 14 | 15 | } 16 | 17 | public Product(int id, int categoryId, String productName, double unitPrice, int unitsInstock) { 18 | this.setId(id); 19 | this.setCategoryId(categoryId); 20 | this.setProductName(productName); 21 | this.setUnitPrice(unitPrice); 22 | this.setUnitsInstock(unitsInstock); 23 | } 24 | 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public int getCategoryId() { 34 | return categoryId; 35 | } 36 | 37 | public void setCategoryId(int categoryId) { 38 | this.categoryId = categoryId; 39 | } 40 | 41 | public String getProductName() { 42 | return productName; 43 | } 44 | 45 | public void setProductName(String productName) { 46 | this.productName = productName; 47 | } 48 | 49 | public double getUnitPrice() { 50 | return unitPrice; 51 | } 52 | 53 | public void setUnitPrice(double unitPrice) { 54 | this.unitPrice = unitPrice; 55 | } 56 | 57 | public int getUnitsInstock() { 58 | return unitsInstock; 59 | } 60 | 61 | public void setUnitsInstock(int unitsInstock) { 62 | this.unitsInstock = unitsInstock; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /northwind/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | 5 | For further reference, please consider the following sections: 6 | 7 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 8 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/) 9 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/#build-image) 10 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-developing-web-applications) 11 | * [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#using-boot-devtools) 12 | * [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-jpa-and-spring-data) 13 | 14 | ### Guides 15 | 16 | The following guides illustrate how to use some features concretely: 17 | 18 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 19 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 20 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 21 | * [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) 22 | 23 | -------------------------------------------------------------------------------- /northwind/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | com.example 12 | northwind 13 | 0.0.1-SNAPSHOT 14 | northwind 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.projectlombok 42 | lombok 43 | true 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | org.projectlombok 61 | lombok 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /northwind/src/main/java/com/company/Entites/concretes/Product.java: -------------------------------------------------------------------------------- 1 | package com.company.Entites.concretes; 2 | 3 | import lombok.Data; 4 | 5 | import javax.persistence.*; 6 | 7 | @Data 8 | @Entity // Varlık 9 | @Table(name="products") // Veritabanındaki products tablosunun karşılığı 10 | 11 | public class Product { 12 | 13 | @Id 14 | @GeneratedValue 15 | @Column(name="product_id") // Veri tabanındaki Column Karşılığı 16 | private int id; 17 | 18 | @Column(name="category_id") 19 | private int categoryId; 20 | 21 | @Column(name="product_name") 22 | private String productName; 23 | 24 | @Column(name="unit_price") 25 | private double UnitPrice; 26 | 27 | @Column(name="units_in_stock") 28 | private short unitsInStock; 29 | 30 | @Column(name="quantity_per_unit") 31 | private String quantityPerUnit; 32 | 33 | public Product() { 34 | 35 | } 36 | 37 | public Product(int id, int categoryId, String productName, double unitPrice, short unitsInStock, String quantityPerUnit) { 38 | this.id = id; 39 | this.categoryId = categoryId; 40 | this.productName = productName; 41 | UnitPrice = unitPrice; 42 | this.unitsInStock = unitsInStock; 43 | this.quantityPerUnit = quantityPerUnit; 44 | 45 | 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /northwind/src/main/java/com/company/NorthwindApplication.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class NorthwindApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(NorthwindApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /northwind/src/main/java/com/company/api/controllers/ProductsController.java: -------------------------------------------------------------------------------- 1 | package com.company.api.controllers; 2 | 3 | import com.company.Entites.concretes.Product; 4 | import com.company.bussines.abstracts.ProductSerivce; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import java.util.List; 11 | 12 | @RestController // Sen bir controller'sın ( birden fazla controller olabilir. ) 13 | @RequestMapping("/api/products") // Dış dünyadan bir istek gelirse bu controller çalışacak. 14 | public class ProductsController { 15 | 16 | private ProductSerivce productSerivce; 17 | 18 | 19 | @Autowired // Newliyor. arka planda 20 | public ProductsController(ProductSerivce productSerivce) { 21 | this.productSerivce = productSerivce; 22 | } 23 | 24 | 25 | 26 | 27 | @GetMapping("/getall") // misal sitede getAll diye bir istekte bulunsak : Bu api çalışır. 28 | public List getAll(){ 29 | return this.productSerivce.getAll(); 30 | } 31 | 32 | //notlar 33 | // istekler iki türlüdür. 1.) Bana veri ver 34 | // 2.) şu veriyi değiştir. 35 | 36 | } 37 | -------------------------------------------------------------------------------- /northwind/src/main/java/com/company/bussines/abstracts/ProductSerivce.java: -------------------------------------------------------------------------------- 1 | package com.company.bussines.abstracts; 2 | 3 | import com.company.Entites.concretes.Product; 4 | 5 | import java.util.List; 6 | 7 | public interface ProductSerivce { 8 | 9 | List getAll(); 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /northwind/src/main/java/com/company/bussines/concretes/ProductManager.java: -------------------------------------------------------------------------------- 1 | package com.company.bussines.concretes; 2 | 3 | import com.company.Entites.concretes.Product; 4 | import com.company.bussines.abstracts.ProductSerivce; 5 | import com.company.dataAccess.abstracts.ProdutDao; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service // Bu class service görevini görecek demektir. 12 | public class ProductManager implements ProductSerivce { 13 | 14 | private ProdutDao productDao; 15 | 16 | @Autowired 17 | public ProductManager(ProdutDao productDao) { 18 | this.productDao = productDao; 19 | 20 | } 21 | 22 | @Override 23 | public List getAll() { 24 | return this.productDao.findAll(); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /northwind/src/main/java/com/company/dataAccess/abstracts/ProdutDao.java: -------------------------------------------------------------------------------- 1 | package com.company.dataAccess.abstracts; 2 | 3 | import com.company.Entites.concretes.Product; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface ProdutDao extends JpaRepository { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /northwind/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=4129774 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /northwind/src/test/java/com/example/northwind/NorthwindApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.northwind; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class NorthwindApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /northwind/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=4129774 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /northwind/target/classes/com/company/Entites/concretes/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind/target/classes/com/company/Entites/concretes/Product.class -------------------------------------------------------------------------------- /northwind/target/classes/com/company/NorthwindApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind/target/classes/com/company/NorthwindApplication.class -------------------------------------------------------------------------------- /northwind/target/classes/com/company/api/controllers/ProductsController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind/target/classes/com/company/api/controllers/ProductsController.class -------------------------------------------------------------------------------- /northwind/target/classes/com/company/bussines/abstracts/ProductSerivce.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind/target/classes/com/company/bussines/abstracts/ProductSerivce.class -------------------------------------------------------------------------------- /northwind/target/classes/com/company/bussines/concretes/ProductManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind/target/classes/com/company/bussines/concretes/ProductManager.class -------------------------------------------------------------------------------- /northwind/target/classes/com/company/dataAccess/abstracts/ProdutDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind/target/classes/com/company/dataAccess/abstracts/ProdutDao.class -------------------------------------------------------------------------------- /northwind/target/test-classes/com/example/northwind/NorthwindApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind/target/test-classes/com/example/northwind/NorthwindApplicationTests.class -------------------------------------------------------------------------------- /northwind2/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | 5 | For further reference, please consider the following sections: 6 | 7 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 8 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/) 9 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/#build-image) 10 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-developing-web-applications) 11 | * [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#using-boot-devtools) 12 | * [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-jpa-and-spring-data) 13 | 14 | ### Guides 15 | 16 | The following guides illustrate how to use some features concretely: 17 | 18 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 19 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 20 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 21 | * [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) 22 | 23 | -------------------------------------------------------------------------------- /northwind2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | com.example 12 | northwind 13 | 0.0.1-SNAPSHOT 14 | northwind 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.projectlombok 42 | lombok 43 | true 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | io.springfox 52 | springfox-swagger2 53 | 2.9.2 54 | 55 | 56 | io.springfox 57 | springfox-swagger-ui 58 | 2.9.2 59 | 60 | 61 | 62 | 63 | 64 | 65 | org.springframework.boot 66 | spring-boot-maven-plugin 67 | 68 | 69 | 70 | org.projectlombok 71 | lombok 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/Entites/concretes/Product.java: -------------------------------------------------------------------------------- 1 | package com.company.Entites.concretes; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import javax.persistence.*; 8 | 9 | @Data 10 | @Entity // Varlık 11 | @AllArgsConstructor //Parametreli constructor 12 | @NoArgsConstructor // Parametresiz contructor 13 | @Table(name="products") // Veritabanındaki products tablosunun karşılığı 14 | 15 | public class Product { 16 | 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) 19 | @Column(name="product_id") // Veri tabanındaki Column Karşılığı 20 | private int id; 21 | 22 | @Column(name="category_id") 23 | private int categoryId; 24 | 25 | @Column(name="product_name") 26 | private String productName; 27 | 28 | @Column(name="unit_price") 29 | private double UnitPrice; 30 | 31 | @Column(name="units_in_stock") 32 | private short unitsInStock; 33 | 34 | @Column(name="quantity_per_unit") 35 | private String quantityPerUnit; 36 | 37 | } -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/NorthwindApplication.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.Bean; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.spi.DocumentationType; 8 | import springfox.documentation.spring.web.plugins.Docket; 9 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 10 | 11 | @SpringBootApplication 12 | @EnableSwagger2 13 | public class NorthwindApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(NorthwindApplication.class, args); 17 | } 18 | 19 | @Bean 20 | public Docket api() { 21 | return new Docket(DocumentationType.SWAGGER_2) 22 | .select() 23 | .apis(RequestHandlerSelectors.basePackage("com.company")) 24 | .build(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/api/controllers/ProductsController.java: -------------------------------------------------------------------------------- 1 | package com.company.api.controllers; 2 | 3 | import com.company.Entites.concretes.Product; 4 | import com.company.bussines.abstracts.ProductSerivce; 5 | import com.company.core.utilitis.results.DataResult; 6 | import com.company.core.utilitis.results.Result; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import java.util.List; 11 | 12 | @RestController // Sen bir controller'sın ( birden fazla controller olabilir. ) 13 | @RequestMapping("/api/products") // Dış dünyadan bir istek gelirse bu controller çalışacak. 14 | public class ProductsController { 15 | 16 | private ProductSerivce productSerivce; 17 | 18 | 19 | @Autowired // Newliyor. arka planda 20 | public ProductsController(ProductSerivce productSerivce) { 21 | this.productSerivce = productSerivce; 22 | } 23 | 24 | 25 | @GetMapping("/getall") // misal sitede getAll diye bir istekte bulunsak : Bu api çalışır. 26 | public DataResult> getAll(){ 27 | return this.productSerivce.getAll(); 28 | } 29 | 30 | 31 | @PostMapping("/add") 32 | public Result add(@RequestBody Product product){ 33 | return this.productSerivce.add(product); 34 | } 35 | 36 | //notlar 37 | // istekler iki türlüdür. 1.) Bana veri ver 38 | // 2.) şu veriyi değiştir. 39 | 40 | } 41 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/bussines/abstracts/ProductSerivce.java: -------------------------------------------------------------------------------- 1 | package com.company.bussines.abstracts; 2 | 3 | import com.company.Entites.concretes.Product; 4 | import com.company.core.utilitis.results.DataResult; 5 | import com.company.core.utilitis.results.Result; 6 | 7 | import java.util.List; 8 | 9 | public interface ProductSerivce { 10 | 11 | DataResult> getAll(); 12 | Result add(Product product); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/bussines/concretes/ProductManager.java: -------------------------------------------------------------------------------- 1 | package com.company.bussines.concretes; 2 | 3 | import com.company.Entites.concretes.Product; 4 | import com.company.bussines.abstracts.ProductSerivce; 5 | import com.company.core.utilitis.results.DataResult; 6 | import com.company.core.utilitis.results.Result; 7 | import com.company.core.utilitis.results.SuccessDataResult; 8 | import com.company.core.utilitis.results.SuccessResult; 9 | import com.company.dataAccess.abstracts.ProdutDao; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.util.List; 14 | 15 | @Service // Bu class service görevini görecek demektir. 16 | public class ProductManager implements ProductSerivce { 17 | 18 | private ProdutDao productDao; 19 | 20 | @Autowired 21 | public ProductManager(ProdutDao productDao) { 22 | this.productDao = productDao; 23 | 24 | } 25 | 26 | @Override 27 | public DataResult> getAll() { 28 | return new SuccessDataResult> 29 | (this.productDao.findAll(),"Data Listelendi"); 30 | 31 | } 32 | @Override 33 | public Result add(Product product) { 34 | this.productDao.save(product); 35 | return new SuccessResult("Ürün Eklendi."); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/core/utilitis/results/DataResult.java: -------------------------------------------------------------------------------- 1 | package com.company.core.utilitis.results; 2 | 3 | public class DataResult extends Result { 4 | 5 | private T data; 6 | public DataResult(T data ,boolean success, String message) { 7 | super(success, message); 8 | this.data = data; 9 | } 10 | 11 | public DataResult(T data ,boolean success) { 12 | super(success); 13 | this.data = data; 14 | } 15 | 16 | public T getData() { 17 | return this.data; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/core/utilitis/results/ErrorDataResult.java: -------------------------------------------------------------------------------- 1 | package com.company.core.utilitis.results; 2 | 3 | public class ErrorDataResult extends DataResult { 4 | 5 | public ErrorDataResult(T data,String message){ 6 | super(data,true,message); 7 | } 8 | 9 | public ErrorDataResult(T data){ 10 | super(data,true); 11 | } 12 | 13 | public ErrorDataResult(String message){ 14 | super(null,true,message); 15 | } 16 | 17 | public ErrorDataResult(){ 18 | super(null,true); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/core/utilitis/results/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package com.company.core.utilitis.results; 2 | 3 | public class ErrorResult extends Result{ 4 | 5 | public ErrorResult(){ 6 | super(false); 7 | } 8 | 9 | public ErrorResult(String message){ 10 | super(false,message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/core/utilitis/results/Result.java: -------------------------------------------------------------------------------- 1 | package com.company.core.utilitis.results; 2 | 3 | public class Result { // Bu class super type - Base class. 4 | 5 | private boolean success; 6 | private String message; 7 | 8 | public Result(boolean success){ 9 | this.success = success; 10 | } 11 | public Result(boolean success, String message){ 12 | this(success); 13 | this.message = message; 14 | } 15 | 16 | public boolean isSuccess(){ 17 | return this.success; 18 | } 19 | 20 | public String getMessage(){ 21 | return this.message; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/core/utilitis/results/SuccessDataResult.java: -------------------------------------------------------------------------------- 1 | package com.company.core.utilitis.results; 2 | 3 | public class SuccessDataResult extends DataResult{ 4 | 5 | public SuccessDataResult(T data,String message){ 6 | super(data,true,message); 7 | } 8 | 9 | public SuccessDataResult(T data){ 10 | super(data,true); 11 | } 12 | 13 | public SuccessDataResult(String message){ 14 | super(null,true,message); 15 | } 16 | 17 | public SuccessDataResult(){ 18 | super(null,true); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/core/utilitis/results/SuccessResult.java: -------------------------------------------------------------------------------- 1 | package com.company.core.utilitis.results; 2 | 3 | public class SuccessResult extends Result { 4 | 5 | 6 | public SuccessResult(){ 7 | super(true); 8 | } 9 | 10 | public SuccessResult(String message){ 11 | super(true,message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /northwind2/src/main/java/com/company/dataAccess/abstracts/ProdutDao.java: -------------------------------------------------------------------------------- 1 | package com.company.dataAccess.abstracts; 2 | 3 | import com.company.Entites.concretes.Product; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface ProdutDao extends JpaRepository { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /northwind2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=4129774 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /northwind2/src/test/java/com/example/northwind/NorthwindApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.northwind; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class NorthwindApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /northwind2/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=4129774 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/Entites/concretes/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/Entites/concretes/Product.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/NorthwindApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/NorthwindApplication.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/api/controllers/ProductsController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/api/controllers/ProductsController.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/bussines/abstracts/ProductSerivce.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/bussines/abstracts/ProductSerivce.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/bussines/concretes/ProductManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/bussines/concretes/ProductManager.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/core/utilitis/results/DataResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/core/utilitis/results/DataResult.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/core/utilitis/results/ErrorDataResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/core/utilitis/results/ErrorDataResult.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/core/utilitis/results/ErrorResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/core/utilitis/results/ErrorResult.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/core/utilitis/results/Result.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/core/utilitis/results/Result.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/core/utilitis/results/SuccessDataResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/core/utilitis/results/SuccessDataResult.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/core/utilitis/results/SuccessResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/core/utilitis/results/SuccessResult.class -------------------------------------------------------------------------------- /northwind2/target/classes/com/company/dataAccess/abstracts/ProdutDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/classes/com/company/dataAccess/abstracts/ProdutDao.class -------------------------------------------------------------------------------- /northwind2/target/test-classes/com/example/northwind/NorthwindApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarikKaanKoc/Java-React-Bootcamp/691d09a6d0ffc9062bc45525fad10f2d7510b8ea/northwind2/target/test-classes/com/example/northwind/NorthwindApplicationTests.class -------------------------------------------------------------------------------- /northwind3/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | kodlamaio 12 | northwind 13 | 0.0.1-SNAPSHOT 14 | northwind 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | io.springfox 47 | springfox-swagger2 48 | 2.9.2 49 | 50 | 51 | org.projectlombok 52 | lombok 53 | true 54 | 55 | 56 | io.springfox 57 | springfox-swagger-ui 58 | 2.9.2 59 | 60 | 61 | 62 | 63 | 64 | 65 | org.springframework.boot 66 | spring-boot-maven-plugin 67 | 68 | 69 | 70 | org.projectlombok 71 | lombok 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/NorthwindApplication.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.Bean; 6 | 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.spi.DocumentationType; 9 | import springfox.documentation.spring.web.plugins.Docket; 10 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 11 | 12 | @SpringBootApplication 13 | @EnableSwagger2 14 | public class NorthwindApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(NorthwindApplication.class, args); 18 | } 19 | 20 | @Bean 21 | public Docket api() { 22 | return new Docket(DocumentationType.SWAGGER_2) 23 | .select() 24 | .apis(RequestHandlerSelectors.basePackage("kodlamaio.northwind")) 25 | .build(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/api/controllers/ProductsController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.api.controllers; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import kodlamaio.northwind.business.abstracts.ProductService; 14 | import kodlamaio.northwind.core.utilities.results.DataResult; 15 | import kodlamaio.northwind.core.utilities.results.Result; 16 | import kodlamaio.northwind.entities.concretes.Product; 17 | 18 | @RestController 19 | @RequestMapping("/api/products") 20 | public class ProductsController { 21 | 22 | 23 | private ProductService productService; 24 | 25 | 26 | @Autowired 27 | public ProductsController(ProductService productService) { 28 | super(); 29 | this.productService = productService; 30 | } 31 | 32 | 33 | @GetMapping("/getall") 34 | public DataResult> getAll(){ 35 | return this.productService.getAll(); 36 | } 37 | 38 | @PostMapping("/add") 39 | public Result add(@RequestBody Product product) { 40 | return this.productService.add(product); 41 | } 42 | 43 | @GetMapping("/getByProductName") 44 | public DataResult getByProductName(@RequestParam String productName){ 45 | return this.productService.getByProductName(productName); 46 | } 47 | 48 | @GetMapping("/getByProductNameAndCategoryId") 49 | public DataResult 50 | getByProductNameAndCategoryId(@RequestParam("productName") String productName,@RequestParam("categoryId") int categoryId){ 51 | System.out.println(productName); 52 | System.out.println(categoryId); 53 | 54 | return this.productService.getByProductNameAndCategoryId 55 | (productName, categoryId); 56 | } 57 | 58 | @GetMapping("/getByProductNameContains") 59 | public DataResult> getByProductNameContains(@RequestParam String productName){ 60 | return this.productService.getByProductNameContains(productName); 61 | } 62 | 63 | @GetMapping("/getAllByPage") 64 | DataResult> getAll(int pageNo, int pageSize){ 65 | return this.productService.getAll(pageNo, pageSize); 66 | } 67 | 68 | @GetMapping("/getAllDesc") 69 | public DataResult> getAllSorted() { 70 | return this.productService.getAllSorted(); 71 | } 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/business/abstracts/ProductService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.Query; 6 | 7 | import kodlamaio.northwind.core.utilities.results.DataResult; 8 | import kodlamaio.northwind.core.utilities.results.Result; 9 | import kodlamaio.northwind.entities.concretes.Product; 10 | 11 | public interface ProductService { 12 | DataResult> getAll(); 13 | DataResult> getAllSorted(); 14 | DataResult> getAll(int pageNo, int pageSize); 15 | Result add(Product product); 16 | 17 | DataResult getByProductName(String productName); 18 | 19 | DataResult getByProductNameAndCategoryId(String productName, int categoryId); 20 | 21 | DataResult> getByProductNameOrCategoryId(String productName, int categoryId); 22 | 23 | DataResult> getByCategoryIdIn(List categories); 24 | 25 | DataResult> getByProductNameContains(String productName); 26 | 27 | DataResult> getByProductNameStartsWith(String productName); 28 | 29 | DataResult> getByNameAndCategory(String productName, int categoryId); 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/core/utilities/results/DataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class DataResult extends Result { 4 | 5 | private T data; 6 | public DataResult(T data, boolean success, String message) { 7 | super(success, message); 8 | this.data = data; 9 | } 10 | 11 | public DataResult(T data, boolean success) { 12 | super(success); 13 | this.data = data; 14 | } 15 | 16 | public T getData() { 17 | return this.data; 18 | } 19 | 20 | 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/core/utilities/results/ErrorDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class ErrorDataResult extends DataResult { 4 | 5 | public ErrorDataResult(T data, String message) { 6 | super(data, false ,message); 7 | } 8 | 9 | public ErrorDataResult(T data) { 10 | super(data,false); 11 | } 12 | 13 | public ErrorDataResult(String message) { 14 | super(null, false ,message); 15 | } 16 | 17 | public ErrorDataResult() { 18 | super(null, false); 19 | } 20 | 21 | } 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/core/utilities/results/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class ErrorResult extends Result{ 4 | public ErrorResult() { 5 | super(false); 6 | } 7 | 8 | public ErrorResult(String message) { 9 | super(false,message); 10 | } 11 | } -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/core/utilities/results/Result.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class Result { 4 | private boolean success; 5 | private String message; 6 | 7 | public Result(boolean success) { 8 | this.success = success; 9 | } 10 | 11 | public Result(boolean success,String message) { 12 | this(success); 13 | this.message = message; 14 | } 15 | 16 | public boolean isSuccess() { 17 | return this.success; 18 | } 19 | 20 | public String getMessage() { 21 | return this.message; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/core/utilities/results/SuccessDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class SuccessDataResult extends DataResult { 4 | 5 | public SuccessDataResult(T data, String message) { 6 | super(data, true ,message); 7 | } 8 | 9 | public SuccessDataResult(T data) { 10 | super(data,true); 11 | } 12 | 13 | public SuccessDataResult(String message) { 14 | super(null, true ,message); 15 | } 16 | 17 | public SuccessDataResult() { 18 | super(null, true); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/core/utilities/results/SuccessResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class SuccessResult extends Result{ 4 | public SuccessResult() { 5 | super(true); 6 | } 7 | 8 | public SuccessResult(String message) { 9 | super(true,message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/dataAccess/abstracts/ProductDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import kodlamaio.northwind.entities.concretes.Product; 9 | 10 | public interface ProductDao extends JpaRepository{ 11 | Product getByProductName(String productName); 12 | 13 | Product getByProductNameAndCategory_CategoryId(String productName, int categoryId); 14 | 15 | List getByProductNameOrCategory_CategoryId(String productName, int categoryId); 16 | 17 | List getByCategoryIn(List categories); 18 | 19 | List getByProductNameContains(String productName); 20 | 21 | List getByProductNameStartsWith(String productName); 22 | 23 | @Query("From Product where productName=:productName and category.categoryId=:categoryId") 24 | List getByNameAndCategory(String productName, int categoryId); 25 | 26 | //select * from products where product_name=bisey and categoryId=bisey 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/entities/concretes/Category.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.OneToMany; 9 | import javax.persistence.Table; 10 | 11 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 12 | 13 | import lombok.AllArgsConstructor; 14 | import lombok.Data; 15 | import lombok.NoArgsConstructor; 16 | 17 | @Data 18 | @AllArgsConstructor 19 | @NoArgsConstructor 20 | @Table(name="categories") 21 | @Entity 22 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","products"}) 23 | public class Category { 24 | @Id 25 | @Column(name="category_id") 26 | private int categoryId; 27 | 28 | @Column(name="category_name") 29 | private String categoryName; 30 | 31 | @OneToMany(mappedBy = "category") 32 | private List products; 33 | } 34 | -------------------------------------------------------------------------------- /northwind3/src/main/java/kodlamaio/northwind/entities/concretes/Product.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.entities.concretes; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | import lombok.AllArgsConstructor; 13 | import lombok.Data; 14 | import lombok.NoArgsConstructor; 15 | 16 | @Data 17 | @Entity 18 | @Table(name="products") 19 | @AllArgsConstructor 20 | @NoArgsConstructor 21 | public class Product { 22 | 23 | @Id 24 | @GeneratedValue(strategy = GenerationType.IDENTITY) 25 | @Column(name="product_id") 26 | private int id; 27 | 28 | //@Column(name="category_id") 29 | //private int categoryId; 30 | 31 | @Column(name="product_name") 32 | private String productName; 33 | 34 | @Column(name="unit_price") 35 | private double unitPrice; 36 | 37 | @Column(name="units_in_stock") 38 | private short unitsInStock; 39 | 40 | @Column(name="quantity_per_unit") 41 | private String quantityPerUnit; 42 | 43 | @ManyToOne() 44 | @JoinColumn(name="category_id") 45 | private Category category; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /northwind3/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=test 7 | spring.jpa.properties.javax.persistence.validation.mode = none -------------------------------------------------------------------------------- /northwind3/src/test/java/kodlamaio/northwind/NorthwindApplicationTests.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class NorthwindApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /northwind4/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | kodlamaio 12 | northwind 13 | 0.0.1-SNAPSHOT 14 | northwind 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | io.springfox 47 | springfox-swagger2 48 | 2.9.2 49 | 50 | 51 | org.projectlombok 52 | lombok 53 | true 54 | 55 | 56 | io.springfox 57 | springfox-swagger-ui 58 | 2.9.2 59 | 60 | 61 | org.springframework.boot 62 | spring-boot-starter-validation 63 | 64 | 65 | 66 | 67 | 68 | 69 | org.springframework.boot 70 | spring-boot-maven-plugin 71 | 72 | 73 | 74 | org.projectlombok 75 | lombok 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/NorthwindApplication.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.Bean; 6 | 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.spi.DocumentationType; 9 | import springfox.documentation.spring.web.plugins.Docket; 10 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 11 | 12 | @SpringBootApplication 13 | @EnableSwagger2 14 | public class NorthwindApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(NorthwindApplication.class, args); 18 | } 19 | 20 | @Bean 21 | public Docket api() { 22 | return new Docket(DocumentationType.SWAGGER_2) 23 | .select() 24 | .apis(RequestHandlerSelectors.basePackage("kodlamaio.northwind")) 25 | .build(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/api/controllers/ProductsController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.api.controllers; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import kodlamaio.northwind.business.abstracts.ProductService; 14 | import kodlamaio.northwind.core.utilities.results.DataResult; 15 | import kodlamaio.northwind.core.utilities.results.Result; 16 | import kodlamaio.northwind.entities.concretes.Product; 17 | import kodlamaio.northwind.entities.dtos.ProductWithCategoryDto; 18 | 19 | @RestController 20 | @RequestMapping("/api/products") 21 | public class ProductsController { 22 | 23 | 24 | private ProductService productService; 25 | 26 | 27 | @Autowired 28 | public ProductsController(ProductService productService) { 29 | super(); 30 | this.productService = productService; 31 | } 32 | 33 | 34 | @GetMapping("/getall") 35 | public DataResult> getAll(){ 36 | return this.productService.getAll(); 37 | } 38 | 39 | @GetMapping("/getProductWithCategoryDetails") 40 | public DataResult> getProductWithCategoryDetails(){ 41 | return this.productService.getProductWithCategoryDetails(); 42 | } 43 | 44 | @PostMapping("/add") 45 | public Result add(@RequestBody Product product) { 46 | return this.productService.add(product); 47 | } 48 | 49 | @GetMapping("/getByProductName") 50 | public DataResult getByProductName(@RequestParam String productName){ 51 | return this.productService.getByProductName(productName); 52 | } 53 | 54 | @GetMapping("/getByProductNameAndCategoryId") 55 | public DataResult 56 | getByProductNameAndCategoryId(@RequestParam("productName") String productName,@RequestParam("categoryId") int categoryId){ 57 | System.out.println(productName); 58 | System.out.println(categoryId); 59 | 60 | return this.productService.getByProductNameAndCategoryId 61 | (productName, categoryId); 62 | } 63 | 64 | @GetMapping("/getByProductNameContains") 65 | public DataResult> getByProductNameContains(@RequestParam String productName){ 66 | return this.productService.getByProductNameContains(productName); 67 | } 68 | 69 | @GetMapping("/getAllByPage") 70 | DataResult> getAll(int pageNo, int pageSize){ 71 | return this.productService.getAll(pageNo, pageSize); 72 | } 73 | 74 | @GetMapping("/getAllDesc") 75 | public DataResult> getAllSorted() { 76 | return this.productService.getAllSorted(); 77 | } 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/api/controllers/UsersController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import javax.validation.Valid; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.web.bind.MethodArgumentNotValidException; 11 | import org.springframework.web.bind.annotation.ExceptionHandler; 12 | import org.springframework.web.bind.annotation.PostMapping; 13 | import org.springframework.web.bind.annotation.RequestBody; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.ResponseStatus; 16 | import org.springframework.web.bind.annotation.RestController; 17 | 18 | import kodlamaio.northwind.business.abstracts.UserService; 19 | import kodlamaio.northwind.core.entities.User; 20 | import kodlamaio.northwind.core.utilities.results.ErrorDataResult; 21 | 22 | import org.springframework.validation.FieldError; 23 | import org.springframework.http.HttpStatus; 24 | 25 | @RestController 26 | @RequestMapping(value="/api/users") 27 | public class UsersController { 28 | 29 | private UserService userService; 30 | 31 | @Autowired 32 | public UsersController(UserService userService) { 33 | super(); 34 | this.userService = userService; 35 | } 36 | 37 | @PostMapping(value="/add") 38 | public ResponseEntity add(@Valid @RequestBody User user) { 39 | 40 | return ResponseEntity.ok(this.userService.add(user)) ; 41 | } 42 | 43 | 44 | @ExceptionHandler(MethodArgumentNotValidException.class) 45 | @ResponseStatus(HttpStatus.BAD_REQUEST) 46 | public ErrorDataResult handleValidationException 47 | (MethodArgumentNotValidException exceptions){ 48 | Map validationErrors = new HashMap(); 49 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 50 | validationErrors.put(fieldError.getField(), fieldError.getDefaultMessage()); 51 | } 52 | 53 | ErrorDataResult errors 54 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 55 | return errors; 56 | } 57 | 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/business/abstracts/ProductService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.northwind.core.utilities.results.DataResult; 6 | import kodlamaio.northwind.core.utilities.results.Result; 7 | import kodlamaio.northwind.entities.concretes.Product; 8 | import kodlamaio.northwind.entities.dtos.ProductWithCategoryDto; 9 | 10 | public interface ProductService { 11 | DataResult> getAll(); 12 | DataResult> getAllSorted(); 13 | DataResult> getAll(int pageNo, int pageSize); 14 | Result add(Product product); 15 | 16 | DataResult getByProductName(String productName); 17 | 18 | DataResult getByProductNameAndCategoryId(String productName, int categoryId); 19 | 20 | DataResult> getByProductNameOrCategoryId(String productName, int categoryId); 21 | 22 | DataResult> getByCategoryIdIn(List categories); 23 | 24 | DataResult> getByProductNameContains(String productName); 25 | 26 | DataResult> getByProductNameStartsWith(String productName); 27 | 28 | DataResult> getByNameAndCategory(String productName, int categoryId); 29 | 30 | DataResult> getProductWithCategoryDetails(); 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/business/abstracts/UserService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.business.abstracts; 2 | 3 | import kodlamaio.northwind.core.entities.User; 4 | import kodlamaio.northwind.core.utilities.results.DataResult; 5 | import kodlamaio.northwind.core.utilities.results.Result; 6 | 7 | public interface UserService { 8 | Result add(User user); 9 | DataResult findByEmail(String email); 10 | } 11 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/business/concretes/UserManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.business.concretes; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import kodlamaio.northwind.business.abstracts.UserService; 7 | import kodlamaio.northwind.core.dataAccess.UserDao; 8 | import kodlamaio.northwind.core.entities.User; 9 | import kodlamaio.northwind.core.utilities.results.DataResult; 10 | import kodlamaio.northwind.core.utilities.results.Result; 11 | import kodlamaio.northwind.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.northwind.core.utilities.results.SuccessResult; 13 | 14 | @Service 15 | public class UserManager implements UserService{ 16 | 17 | private UserDao userDao; 18 | 19 | @Autowired 20 | public UserManager(UserDao userDao) { 21 | super(); 22 | this.userDao = userDao; 23 | } 24 | 25 | @Override 26 | public Result add(User user) { 27 | this.userDao.save(user); 28 | return new SuccessResult("Kullanıcı eklendi"); 29 | } 30 | 31 | @Override 32 | public DataResult findByEmail(String email) { 33 | return new SuccessDataResult(this.userDao.findByEmail(email) 34 | ,"Kullanıcı bulundu"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/dataAccess/UserDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.dataAccess; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import kodlamaio.northwind.core.entities.User; 6 | 7 | public interface UserDao extends JpaRepository{ 8 | User findByEmail(String email); 9 | } 10 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/entities/User.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.entities; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | import javax.validation.constraints.Email; 10 | import javax.validation.constraints.NotBlank; 11 | 12 | import com.sun.istack.NotNull; 13 | 14 | import lombok.AllArgsConstructor; 15 | import lombok.Data; 16 | import lombok.NoArgsConstructor; 17 | 18 | @Entity 19 | @Data 20 | @Table(name="users") 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | public class User { 24 | @Id 25 | @GeneratedValue(strategy= GenerationType.IDENTITY) 26 | @Column(name="id") 27 | private int id; 28 | 29 | @Column(name="email") 30 | @Email 31 | @NotBlank 32 | @NotNull 33 | private String email; 34 | 35 | @Column(name="password") 36 | @NotBlank 37 | @NotNull 38 | private String password; 39 | } 40 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/utilities/results/DataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class DataResult extends Result { 4 | 5 | private T data; 6 | public DataResult(T data, boolean success, String message) { 7 | super(success, message); 8 | this.data = data; 9 | } 10 | 11 | public DataResult(T data, boolean success) { 12 | super(success); 13 | this.data = data; 14 | } 15 | 16 | public T getData() { 17 | return this.data; 18 | } 19 | 20 | 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/utilities/results/ErrorDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class ErrorDataResult extends DataResult { 4 | 5 | public ErrorDataResult(T data, String message) { 6 | super(data, false ,message); 7 | } 8 | 9 | public ErrorDataResult(T data) { 10 | super(data,false); 11 | } 12 | 13 | public ErrorDataResult(String message) { 14 | super(null, false ,message); 15 | } 16 | 17 | public ErrorDataResult() { 18 | super(null, false); 19 | } 20 | 21 | } 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/utilities/results/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class ErrorResult extends Result{ 4 | public ErrorResult() { 5 | super(false); 6 | } 7 | 8 | public ErrorResult(String message) { 9 | super(false,message); 10 | } 11 | } -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/utilities/results/Result.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class Result { 4 | private boolean success; 5 | private String message; 6 | 7 | public Result(boolean success) { 8 | this.success = success; 9 | } 10 | 11 | public Result(boolean success,String message) { 12 | this(success); 13 | this.message = message; 14 | } 15 | 16 | public boolean isSuccess() { 17 | return this.success; 18 | } 19 | 20 | public String getMessage() { 21 | return this.message; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/utilities/results/SuccessDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class SuccessDataResult extends DataResult { 4 | 5 | public SuccessDataResult(T data, String message) { 6 | super(data, true ,message); 7 | } 8 | 9 | public SuccessDataResult(T data) { 10 | super(data,true); 11 | } 12 | 13 | public SuccessDataResult(String message) { 14 | super(null, true ,message); 15 | } 16 | 17 | public SuccessDataResult() { 18 | super(null, true); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/core/utilities/results/SuccessResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class SuccessResult extends Result{ 4 | public SuccessResult() { 5 | super(true); 6 | } 7 | 8 | public SuccessResult(String message) { 9 | super(true,message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/dataAccess/abstracts/ProductDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import kodlamaio.northwind.entities.concretes.Product; 9 | import kodlamaio.northwind.entities.dtos.ProductWithCategoryDto; 10 | 11 | public interface ProductDao extends JpaRepository{ 12 | Product getByProductName(String productName); 13 | 14 | Product getByProductNameAndCategory_CategoryId(String productName, int categoryId); 15 | 16 | List getByProductNameOrCategory_CategoryId(String productName, int categoryId); 17 | 18 | List getByCategoryIn(List categories); 19 | 20 | List getByProductNameContains(String productName); 21 | 22 | List getByProductNameStartsWith(String productName); 23 | 24 | @Query("From Product where productName=:productName and category.categoryId=:categoryId") 25 | List getByNameAndCategory(String productName, int categoryId); 26 | 27 | @Query("Select new kodlamaio.northwind.entities.dtos.ProductWithCategoryDto" 28 | + "(p.id, p.productName, c.categoryName) " 29 | + "From Category c Inner Join c.products p") 30 | List getProductWithCategoryDetails(); 31 | 32 | //select p.productId,p.productName, c.categoryName from Category c inner join Product p 33 | //on c.categoryId = p.categoryId 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/entities/concretes/Category.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.OneToMany; 9 | import javax.persistence.Table; 10 | 11 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 12 | 13 | import lombok.AllArgsConstructor; 14 | import lombok.Data; 15 | import lombok.NoArgsConstructor; 16 | 17 | @Data 18 | @AllArgsConstructor 19 | @NoArgsConstructor 20 | @Table(name="categories") 21 | @Entity 22 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","products"}) 23 | public class Category { 24 | @Id 25 | @Column(name="category_id") 26 | private int categoryId; 27 | 28 | @Column(name="category_name") 29 | private String categoryName; 30 | 31 | @OneToMany(mappedBy = "category") 32 | private List products; 33 | } 34 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/entities/concretes/Product.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.entities.concretes; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | import lombok.AllArgsConstructor; 13 | import lombok.Data; 14 | import lombok.NoArgsConstructor; 15 | 16 | @Data 17 | @Entity 18 | @Table(name="products") 19 | @AllArgsConstructor 20 | @NoArgsConstructor 21 | public class Product { 22 | 23 | @Id 24 | @GeneratedValue(strategy = GenerationType.IDENTITY) 25 | @Column(name="product_id") 26 | private int id; 27 | 28 | //@Column(name="category_id") 29 | //private int categoryId; 30 | 31 | @Column(name="product_name") 32 | private String productName; 33 | 34 | @Column(name="unit_price") 35 | private double unitPrice; 36 | 37 | @Column(name="units_in_stock") 38 | private short unitsInStock; 39 | 40 | @Column(name="quantity_per_unit") 41 | private String quantityPerUnit; 42 | 43 | @ManyToOne() 44 | @JoinColumn(name="category_id") 45 | private Category category; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /northwind4/src/main/java/kodlamaio/northwind/entities/dtos/ProductWithCategoryDto.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.entities.dtos; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class ProductWithCategoryDto { 11 | private int id; 12 | private String productName; 13 | private String categoryName; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /northwind4/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=test 7 | spring.jpa.properties.javax.persistence.validation.mode = none -------------------------------------------------------------------------------- /northwind4/src/test/java/kodlamaio/northwind/NorthwindApplicationTests.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class NorthwindApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /oopintro/oopintro.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /oopintro/src/Category.java: -------------------------------------------------------------------------------- 1 | public class Category { 2 | 3 | int id; 4 | String name; 5 | } 6 | -------------------------------------------------------------------------------- /oopintro/src/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | 3 | public static void main(String[] args) { 4 | 5 | // ******** Class'lar referans tiptir ********* 6 | 7 | Product product1 = new Product(1, "Lenovo V14", 15000, "16 GB Ram"); // Örnelk oluşturma. 8 | // Referans oluţturma => instance 9 | 10 | Product product2 = new Product(); 11 | product2.id = 2; 12 | product2.name = "Lenovo V15"; 13 | product2.unitPrice = 16000; 14 | product2.detail = "32 GB Ram"; 15 | 16 | Product product3 = new Product(); 17 | product3.id = 3; 18 | product3.name = "HP 5"; 19 | product3.unitPrice = 10000; 20 | product3.detail = "8 GB Ram"; 21 | 22 | Product[] products={product1,product2,product3}; 23 | for (Product product : products) { // "products" dizisi içinde "product" tüm Product objelerini döndürüyoruz. 24 | 25 | System.out.println(product.name); 26 | 27 | } 28 | 29 | System.out.println(products.length); // Dizinin uzunluđu 30 | 31 | // CATEGORY 32 | Category category1 = new Category(); 33 | category1.id= 1; 34 | category1.name = "Bilgisayar"; 35 | 36 | Category category2 = new Category(); 37 | category2.id = 2; 38 | category2.name = "Ev/Bahçe"; 39 | 40 | // PRODUCT MANAGER - iş Sınıfı 41 | ProductManager productManager = new ProductManager(); 42 | productManager.addToCart(product1); 43 | productManager.addToCart(product2); 44 | productManager.addToCart(product3); 45 | 46 | productManager.getCategory(category1); 47 | 48 | productManager.saveProduct(product2); 49 | 50 | Product product5=new Product("lkajsdhksjad"); 51 | System.out.println(product5); 52 | 53 | //Product product6=new Product(); 54 | 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /oopintro/src/Product.java: -------------------------------------------------------------------------------- 1 | public class Product { 2 | 3 | // constructor - Yapıcı 4 | // 1 constructor çalışmak zorunda, bu yapıda birden fazla constructor var yalnızca 1'i çalışıyor ! 5 | // this --> ilgili class ( bu class'taki demek.) 6 | // final, sadece constructor'da set edilebilir demek. 7 | 8 | int id; 9 | String name; 10 | double unitPrice; 11 | String detail; 12 | public Product() { 13 | System.out.println("Böyle bir ürün bulunamadı"); 14 | } 15 | public Product(String a) { 16 | System.out.println("Girdiğini id değeri = "+a); 17 | } 18 | public Product(int id, String name, double unitPrice,String detail){ 19 | 20 | this.id = id; 21 | this.name = name; 22 | this.unitPrice = unitPrice; 23 | this.detail = detail; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /oopintro/src/ProductManager.java: -------------------------------------------------------------------------------- 1 | public class ProductManager { 2 | public void addToCart(Product product) { 3 | System.out.println(product.name + " Sepete eklendi" ); 4 | } 5 | 6 | public void getCategory(Category category) { 7 | System.out.println(category.name + " categorisini başarıyla getirdi"); 8 | } 9 | public void saveProduct(Product product){ 10 | System.out.println(product.name+" --> ürün kaydedildi"); 11 | } 12 | 13 | //nesne --- koşul 14 | //class(object) --- manager(yönetici) 15 | 16 | // OOP --> Object Oriented Programming(nesne yönelimli programlama) 17 | 18 | // --> örnekler <-- 19 | // öğrenci - ders çalışır, 20 | // öğretmen - ders anlatır 21 | 22 | 23 | } 24 | --------------------------------------------------------------------------------