├── README.md
├── homeWork_1
├── .classpath
├── .gitignore
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
└── src
│ └── homeWork_1
│ ├── Course.java
│ ├── CourseManager.java
│ ├── Main.java
│ ├── Person.java
│ └── PersonManager.java
├── homeWork_2
├── .idea
│ ├── .gitignore
│ ├── description.html
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── project-template.xml
│ ├── uiDesigner.xml
│ └── vcs.xml
├── homeWork_2.iml
├── out
│ └── production
│ │ └── homeWork_2
│ │ └── com
│ │ └── ersozyazilim
│ │ ├── Main.class
│ │ ├── Models
│ │ ├── Instructor.class
│ │ ├── Student.class
│ │ └── User.class
│ │ └── Services
│ │ ├── InstructorManager.class
│ │ ├── StudentManager.class
│ │ └── UserManager.class
└── src
│ └── com
│ └── ersozyazilim
│ ├── Main.java
│ ├── Models
│ ├── Instructor.java
│ ├── Student.java
│ └── User.java
│ └── Services
│ ├── InstructorManager.java
│ ├── StudentManager.java
│ └── UserManager.java
├── homeWork_3
├── .idea
│ ├── .gitignore
│ ├── description.html
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── project-template.xml
│ ├── uiDesigner.xml
│ └── vcs.xml
├── homeWork_3.iml
├── out
│ └── production
│ │ └── homeWork_3
│ │ └── com
│ │ └── ersozyazilim
│ │ ├── Main.class
│ │ ├── adapters
│ │ └── MernisServiceAdapter.class
│ │ ├── entities
│ │ ├── Customer.class
│ │ ├── CustomerCheckService.class
│ │ ├── CustomerService.class
│ │ └── Entity.class
│ │ └── managers
│ │ ├── BaseCustomerManager.class
│ │ ├── CustomerCheckManager.class
│ │ ├── NeroCustomerManager.class
│ │ └── StarbucksCustomerManager.class
└── src
│ └── com
│ └── ersozyazilim
│ ├── Main.java
│ ├── adapters
│ └── MernisServiceAdapter.java
│ ├── entities
│ ├── Customer.java
│ ├── CustomerCheckService.java
│ ├── CustomerService.java
│ └── Entity.java
│ └── managers
│ ├── BaseCustomerManager.java
│ ├── CustomerCheckManager.java
│ ├── NeroCustomerManager.java
│ └── StarbucksCustomerManager.java
├── homeWork_4
├── .idea
│ ├── .gitignore
│ ├── description.html
│ ├── discord.xml
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── project-template.xml
│ ├── uiDesigner.xml
│ └── vcs.xml
├── homeWork_4.iml
├── out
│ └── production
│ │ └── homeWork_4
│ │ └── com
│ │ └── ersozyazilim
│ │ ├── Main.class
│ │ ├── Utils.class
│ │ ├── entites
│ │ ├── Campaign.class
│ │ ├── Entity.class
│ │ ├── Game.class
│ │ └── User.class
│ │ ├── logSystem
│ │ ├── DatabaseLogger.class
│ │ ├── Logger.class
│ │ └── SmsLogger.class
│ │ └── managers
│ │ ├── CampaignManager.class
│ │ ├── CampaignService.class
│ │ ├── GameManager.class
│ │ ├── GameService.class
│ │ ├── UserCheckService.class
│ │ ├── UserManager.class
│ │ ├── UserService.class
│ │ └── adapters
│ │ └── EdevletServiceAdapter.class
└── src
│ └── com
│ └── ersozyazilim
│ ├── Main.java
│ ├── Utils.java
│ ├── entites
│ ├── Campaign.java
│ ├── Entity.java
│ ├── Game.java
│ └── User.java
│ ├── logSystem
│ ├── DatabaseLogger.java
│ ├── Logger.java
│ └── SmsLogger.java
│ └── managers
│ ├── CampaignManager.java
│ ├── CampaignService.java
│ ├── GameManager.java
│ ├── GameService.java
│ ├── UserCheckService.java
│ ├── UserManager.java
│ ├── UserService.java
│ └── adapters
│ └── EdevletServiceAdapter.java
├── homeWork_5
├── .idea
│ ├── .gitignore
│ ├── compiler.xml
│ ├── discord.xml
│ ├── jarRepositories.xml
│ ├── misc.xml
│ ├── uiDesigner.xml
│ └── vcs.xml
├── pom.xml
├── src
│ └── main
│ │ └── eTicaret
│ │ ├── Main.java
│ │ ├── business
│ │ ├── abstracts
│ │ │ └── UserService.java
│ │ └── concretes
│ │ │ └── UserManager.java
│ │ ├── core
│ │ ├── AuthService.java
│ │ ├── GoogleAuthAdapter.java
│ │ └── Utils.java
│ │ ├── dataAccess
│ │ ├── abstracts
│ │ │ └── UserDao.java
│ │ └── concretes
│ │ │ └── HibernateUserDao.java
│ │ ├── entities
│ │ ├── abstracts
│ │ │ └── Entity.java
│ │ └── concretes
│ │ │ └── User.java
│ │ └── googleAuth
│ │ └── GoogleAuth.java
└── target
│ └── classes
│ ├── Main.class
│ ├── business
│ ├── abstracts
│ │ └── UserService.class
│ └── concretes
│ │ └── UserManager.class
│ ├── core
│ ├── AuthService.class
│ ├── GoogleAuthAdapter.class
│ └── Utils.class
│ ├── dataAccess
│ ├── abstracts
│ │ └── UserDao.class
│ └── concretes
│ │ └── HibernateUserDao.class
│ ├── entities
│ ├── abstracts
│ │ └── Entity.class
│ └── concretes
│ │ └── User.class
│ └── googleAuth
│ └── GoogleAuth.class
├── homeWork_6
├── .gitignore
├── .mvn
│ └── wrapper
│ │ ├── MavenWrapperDownloader.java
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── hrms.sql
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── ersozyazilim
│ │ │ └── homework_6
│ │ │ ├── HomeWork6Application.java
│ │ │ ├── api
│ │ │ └── controllers
│ │ │ │ └── JobListController.java
│ │ │ ├── business
│ │ │ ├── abstracts
│ │ │ │ └── JobListService.java
│ │ │ └── concretes
│ │ │ │ └── JobListManager.java
│ │ │ ├── dataAccess
│ │ │ └── abstracts
│ │ │ │ └── JobListDao.java
│ │ │ └── entites
│ │ │ └── concretes
│ │ │ └── JobList.java
│ └── resources
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── example
│ └── homework_6
│ └── HomeWork6ApplicationTests.java
├── interfaces
├── .idea
│ ├── .gitignore
│ ├── description.html
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── project-template.xml
│ └── vcs.xml
├── interfaces.iml
├── out
│ └── production
│ │ └── interfaces
│ │ └── com
│ │ └── ersozyazilim
│ │ ├── Customer.class
│ │ ├── CustomerManager.class
│ │ ├── DatabaseLogger.class
│ │ ├── EmailLogger.class
│ │ ├── FileLogger.class
│ │ ├── Logger.class
│ │ ├── Main.class
│ │ ├── SmsLogger.class
│ │ └── Utils.class
└── src
│ └── com
│ └── ersozyazilim
│ ├── Customer.java
│ ├── CustomerManager.java
│ ├── DatabaseLogger.java
│ ├── EmailLogger.java
│ ├── FileLogger.java
│ ├── Logger.java
│ ├── Main.java
│ ├── SmsLogger.java
│ └── Utils.java
├── intro
├── .classpath
├── .gitignore
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
└── src
│ └── intro
│ └── Main.java
├── nLayeredDemo
├── .idea
│ ├── .gitignore
│ ├── compiler.xml
│ ├── discord.xml
│ ├── jarRepositories.xml
│ ├── misc.xml
│ ├── uiDesigner.xml
│ └── vcs.xml
├── pom.xml
├── src
│ └── main
│ │ └── nLayeredDemo
│ │ ├── Main.java
│ │ ├── business
│ │ ├── abstracts
│ │ │ └── ProductService.java
│ │ └── concretes
│ │ │ └── ProductManager.java
│ │ ├── core
│ │ ├── LoggerService.java
│ │ └── jLoggerManagerAdapter.java
│ │ ├── dataAccess
│ │ ├── abstracts
│ │ │ └── ProductDao.java
│ │ └── concretes
│ │ │ ├── AbcProductDao.java
│ │ │ └── HibernateProductDao.java
│ │ ├── entities
│ │ ├── abstracts
│ │ │ └── Entity.java
│ │ └── concretes
│ │ │ └── Product.java
│ │ └── jLogger
│ │ └── jLoggerManager.java
└── target
│ └── classes
│ ├── Main.class
│ ├── business
│ ├── abstracts
│ │ └── ProductService.class
│ └── concretes
│ │ └── ProductManager.class
│ ├── core
│ ├── LoggerService.class
│ └── jLoggerManagerAdapter.class
│ ├── dataAccess
│ ├── abstracts
│ │ └── ProductDao.class
│ └── concretes
│ │ ├── AbcProductDao.class
│ │ └── HibernateProductDao.class
│ ├── entities
│ ├── abstracts
│ │ └── Entity.class
│ └── concretes
│ │ └── Product.class
│ └── jLogger
│ └── jLoggerManager.class
└── oopIntro
├── .classpath
├── .gitignore
├── .idea
├── .gitignore
├── misc.xml
├── modules.xml
└── vcs.xml
├── .project
├── .settings
└── org.eclipse.jdt.core.prefs
├── oopIntro.iml
└── src
└── oopIntro
├── Category.java
├── Main.java
├── Product.java
└── ProductManager.java
/README.md:
--------------------------------------------------------------------------------
1 | # Java-Kamp
2 | Engin Demiroğ Java Kamp İçeriği
3 |
--------------------------------------------------------------------------------
/homeWork_1/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/homeWork_1/.gitignore:
--------------------------------------------------------------------------------
1 | /bin/
2 |
--------------------------------------------------------------------------------
/homeWork_1/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | homeWork_1
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/homeWork_1/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=15
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=15
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13 | org.eclipse.jdt.core.compiler.release=enabled
14 | org.eclipse.jdt.core.compiler.source=15
15 |
--------------------------------------------------------------------------------
/homeWork_1/src/homeWork_1/Course.java:
--------------------------------------------------------------------------------
1 | package homeWork_1;
2 |
3 | public class Course {
4 |
5 | int id;
6 | String courseName;
7 | String courseCategory;
8 | double coursePrice;
9 |
10 | public Course(int id,String courseName,String courseCategory,double coursePrice) {
11 | this.id = id;
12 | this.courseName = courseName;
13 | this.courseCategory = courseCategory;
14 | this.coursePrice = coursePrice;//test
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/homeWork_1/src/homeWork_1/CourseManager.java:
--------------------------------------------------------------------------------
1 | package homeWork_1;
2 |
3 | public class CourseManager {
4 | public void addCourse(Course course) {
5 | //İş kodları
6 | System.out.println(course.courseName+" Adlı Kurs Eklendi!");
7 | }
8 |
9 | public void delCourse(Course course) {
10 | //İş kodları
11 | System.out.println(course.courseName+" Adlı Kurs Silindi!");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/homeWork_1/src/homeWork_1/Main.java:
--------------------------------------------------------------------------------
1 | package homeWork_1;
2 |
3 | import java.util.Iterator;
4 |
5 | public class Main {
6 |
7 | public static void main(String[] args) {
8 |
9 | PersonManager personManager = new PersonManager();
10 | CourseManager courseManager = new CourseManager();
11 |
12 | Person person1 = new Person("Efe Temel ERSÖZ",17,2000);
13 | Course course1 = new Course(1, "Java Kampı", "Yazılım Geliştirme", 0);
14 |
15 | personManager.addPerson(person1);
16 | personManager.delPerson(person1);
17 |
18 | courseManager.addCourse(course1);
19 | courseManager.delCourse(course1);
20 |
21 | Person[] persons = {person1};
22 | Course[] courses = {course1};
23 |
24 | for(Person person:persons) {
25 | System.out.println(person.name);
26 | }
27 |
28 | for(Course course:courses) {
29 | System.out.println(course.courseName);
30 | }
31 |
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/homeWork_1/src/homeWork_1/Person.java:
--------------------------------------------------------------------------------
1 | package homeWork_1;
2 |
3 | public class Person {
4 |
5 | String name;
6 | int age;
7 | double salary;
8 |
9 | public Person(String name,int age,double salary) {
10 | this.name = name;
11 | this.age = age;
12 | this.salary = salary;
13 | }
14 |
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/homeWork_1/src/homeWork_1/PersonManager.java:
--------------------------------------------------------------------------------
1 | package homeWork_1;
2 |
3 | public class PersonManager {
4 |
5 | public void addPerson(Person person) {
6 | //İş kodları
7 | System.out.println(person.name+" Adlı Personel Eklendi!");
8 | }
9 |
10 | public void delPerson(Person person) {
11 | //İş kodları
12 | System.out.println(person.name+" Adlı Personel Silindi!");
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/homeWork_2/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/homeWork_2/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple Java application that includes a class with main()
method
--------------------------------------------------------------------------------
/homeWork_2/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_2/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/homeWork_2/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/homeWork_2/.idea/project-template.xml:
--------------------------------------------------------------------------------
1 |
2 | IJ_BASE_PACKAGE
3 |
--------------------------------------------------------------------------------
/homeWork_2/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/homeWork_2/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_2/homeWork_2.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Main.class
--------------------------------------------------------------------------------
/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Models/Instructor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Models/Instructor.class
--------------------------------------------------------------------------------
/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Models/Student.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Models/Student.class
--------------------------------------------------------------------------------
/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Models/User.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Models/User.class
--------------------------------------------------------------------------------
/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Services/InstructorManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Services/InstructorManager.class
--------------------------------------------------------------------------------
/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Services/StudentManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Services/StudentManager.class
--------------------------------------------------------------------------------
/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Services/UserManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_2/out/production/homeWork_2/com/ersozyazilim/Services/UserManager.class
--------------------------------------------------------------------------------
/homeWork_2/src/com/ersozyazilim/Main.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 | import com.ersozyazilim.Models.Instructor;
3 | import com.ersozyazilim.Models.Student;
4 | import com.ersozyazilim.Models.User;
5 | import com.ersozyazilim.Services.InstructorManager;
6 | import com.ersozyazilim.Services.StudentManager;
7 | import com.ersozyazilim.Services.UserManager;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | public class Main {
13 |
14 | public static void main(String[] args) {
15 |
16 | Student efe = new Student(1,"efetemel","Efe Temel","ERSÖZ","123321",836,"11/C",null);
17 | Student burak = new Student(2,"burak","lewendev","burak","123321",836,"11/C",null);
18 |
19 | Instructor engin = new Instructor(3,"engin","Engin","Demiroğ","123321",012345,"Proggraming Language",160000);
20 |
21 | List users = new ArrayList<>();
22 | users.add(efe);
23 |
24 | UserManager userManager = new UserManager();
25 | userManager.addUsers(users);
26 |
27 | StudentManager studentManager = new StudentManager();
28 | studentManager.addExam(burak,"Ödev");
29 |
30 | UserManager studentManager1 = new InstructorManager();
31 |
32 | InstructorManager instructorManager = new InstructorManager();
33 | instructorManager.addSalary(engin,16000);
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/homeWork_2/src/com/ersozyazilim/Models/Instructor.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.Models;
2 |
3 | public class Instructor extends User{
4 | private int instructorNumber;
5 | private String instructorCategory;
6 | int salary;
7 |
8 | public Instructor(int id, String username, String firstName, String lastName, String password,int instructorNumber,String instructorCategory,int salary) {
9 | super(id, username, firstName, lastName, password);
10 | this.instructorNumber = instructorNumber;
11 | this.instructorCategory = instructorCategory;
12 | this.salary = salary;
13 | }
14 |
15 | public int getInstructorNumber() {
16 | return instructorNumber;
17 | }
18 |
19 | public void setInstructorNumber(int instructorNumber) {
20 | this.instructorNumber = instructorNumber;
21 | }
22 |
23 | public String getInstructorCategory() {
24 | return instructorCategory;
25 | }
26 |
27 | public void setInstructorCategory(String instructorCategory) {
28 | this.instructorCategory = instructorCategory;
29 | }
30 |
31 | public int getSalary() {
32 | return salary;
33 | }
34 |
35 | public void setSalary(int salary) {
36 | this.salary = salary;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/homeWork_2/src/com/ersozyazilim/Models/Student.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.Models;
2 |
3 | public class Student extends User{
4 | private int number;
5 | private String classNumber;
6 | private String exam;
7 |
8 | public Student(int id, String username, String firstName, String lastName, String password,int number,String classNumber,String exam) {
9 | super(id, username, firstName, lastName, password);
10 | this.number = number;
11 | this.classNumber = classNumber;
12 | this.exam = exam;
13 | }
14 |
15 | public int getNumber() {
16 | return number;
17 | }
18 |
19 | public void setNumber(int number) {
20 | this.number = number;
21 | }
22 |
23 | public String getClassNumber() {
24 | return classNumber;
25 | }
26 |
27 | public void setClassNumber(String classNumber) {
28 | this.classNumber = classNumber;
29 | }
30 |
31 | public String getExam() {
32 | return exam;
33 | }
34 |
35 | public void setExam(String exam) {
36 | this.exam = exam;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/homeWork_2/src/com/ersozyazilim/Models/User.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.Models;
2 |
3 | public class User {
4 | private int id;
5 | private String username;
6 | private String firstName;
7 | private String lastName;
8 | private String password;
9 |
10 | public User(int id, String username, String firstName, String lastName, String password) {
11 | this.id = id;
12 | this.username = username;
13 | this.firstName = firstName;
14 | this.lastName = lastName;
15 | this.password = password;
16 | }
17 |
18 | public int getId() {
19 | return id;
20 | }
21 |
22 | public void setId(int id) {
23 | this.id = id;
24 | }
25 |
26 | public String getUsername() {
27 | return username;
28 | }
29 |
30 | public void setUsername(String username) {
31 | this.username = username;
32 | }
33 |
34 | public String getFirstName() {
35 | return firstName;
36 | }
37 |
38 | public void setFirstName(String firstName) {
39 | this.firstName = firstName;
40 | }
41 |
42 | public String getLastName() {
43 | return lastName;
44 | }
45 |
46 | public void setLastName(String lastName) {
47 | this.lastName = lastName;
48 | }
49 |
50 | public String getPassword() {
51 | return password;
52 | }
53 |
54 | public void setPassword(String password) {
55 | this.password = password;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/homeWork_2/src/com/ersozyazilim/Services/InstructorManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.Services;
2 |
3 | import com.ersozyazilim.Models.Instructor;
4 | import com.ersozyazilim.Models.Student;
5 |
6 | public class InstructorManager extends UserManager{
7 |
8 | public void addSalary(Instructor instructor, int salary){
9 | System.out.println(instructor.getUsername()+" adlı eğitmen maaşı düzenlendi!");
10 | }
11 |
12 | public void delSalary(Instructor instructor,int salary){
13 | System.out.println(instructor.getUsername()+" adlı eğitmen maaşı sıfırlandı!");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/homeWork_2/src/com/ersozyazilim/Services/StudentManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.Services;
2 |
3 | import com.ersozyazilim.Models.Student;
4 | import com.ersozyazilim.Models.User;
5 |
6 | public class StudentManager extends UserManager {
7 |
8 |
9 | public void addExam(Student student, String exam){
10 | System.out.println(student.getUsername()+" Adlı öğrenciye ödev eklendi!");
11 | }
12 |
13 | public void delExam(Student student){
14 | System.out.println(student.getUsername()+" Adlı öğrenciye ödev silindi!");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/homeWork_2/src/com/ersozyazilim/Services/UserManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.Services;
2 |
3 | import com.ersozyazilim.Models.User;
4 |
5 | import java.util.List;
6 |
7 | public class UserManager {
8 |
9 |
10 |
11 | public void addUser(User user){
12 | System.out.println(user.getUsername()+" Adlı kullanıcı eklendi!");
13 | }
14 |
15 | public void addUsers(List users){
16 | for (User user:users){
17 | System.out.println(user.getUsername()+" Adlı kullanıcı eklendi!");
18 | }
19 | }
20 |
21 | public void delUser(User user){
22 | System.out.println(user.getUsername()+" Adlı kullanıcı silindi!");
23 | }
24 |
25 | public void delUsers(List users){
26 | for (User user:users){
27 | System.out.println(user.getUsername()+" Adlı kullanıcı silindi!");
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/homeWork_3/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/homeWork_3/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple Java application that includes a class with main()
method
--------------------------------------------------------------------------------
/homeWork_3/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_3/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/homeWork_3/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/homeWork_3/.idea/project-template.xml:
--------------------------------------------------------------------------------
1 |
2 | IJ_BASE_PACKAGE
3 |
--------------------------------------------------------------------------------
/homeWork_3/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/homeWork_3/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_3/homeWork_3.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/Main.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/adapters/MernisServiceAdapter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/adapters/MernisServiceAdapter.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/Customer.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/Customer.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/CustomerCheckService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/CustomerCheckService.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/CustomerService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/CustomerService.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/Entity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/entities/Entity.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/BaseCustomerManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/BaseCustomerManager.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/CustomerCheckManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/CustomerCheckManager.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/NeroCustomerManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/NeroCustomerManager.class
--------------------------------------------------------------------------------
/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/StarbucksCustomerManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_3/out/production/homeWork_3/com/ersozyazilim/managers/StarbucksCustomerManager.class
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/Main.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | import com.ersozyazilim.adapters.MernisServiceAdapter;
4 | import com.ersozyazilim.managers.BaseCustomerManager;
5 | import com.ersozyazilim.managers.StarbucksCustomerManager;
6 | import com.ersozyazilim.entities.Customer;
7 |
8 | import java.util.Date;
9 |
10 | public class Main {
11 |
12 | public static void main(String[] args) {
13 | BaseCustomerManager customerManager = new StarbucksCustomerManager(new MernisServiceAdapter());
14 | customerManager.save(new Customer(1,"Efe Temel","ERSÖZ",new Date(2004,02,27),"1111111111"));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/adapters/MernisServiceAdapter.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.adapters;
2 |
3 | import com.ersozyazilim.entities.Customer;
4 | import com.ersozyazilim.entities.CustomerCheckService;
5 |
6 | public class MernisServiceAdapter implements CustomerCheckService {
7 | @Override
8 | public boolean CheckIfRealPerson(Customer customer) {
9 | return false;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/entities/Customer.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entities;
2 |
3 | import java.util.Date;
4 |
5 | public class Customer implements Entity {
6 | private int id;
7 | private String firstName;
8 | private String lastName;
9 | private Date DateOfBird;
10 | private String NationalityId;
11 |
12 | public Customer(int id, String firstName, String lastName, Date dateOfBird, String nationalityId) {
13 | this.id = id;
14 | this.firstName = firstName;
15 | this.lastName = lastName;
16 | DateOfBird = dateOfBird;
17 | NationalityId = nationalityId;
18 | }
19 |
20 | public int getId() {
21 | return id;
22 | }
23 |
24 | public void setId(int id) {
25 | this.id = id;
26 | }
27 |
28 | public String getFirstName() {
29 | return firstName;
30 | }
31 |
32 | public void setFirstName(String firstName) {
33 | this.firstName = firstName;
34 | }
35 |
36 | public String getLastName() {
37 | return lastName;
38 | }
39 |
40 | public void setLastName(String lastName) {
41 | this.lastName = lastName;
42 | }
43 |
44 | public Date getDateOfBird() {
45 | return DateOfBird;
46 | }
47 |
48 | public void setDateOfBird(Date dateOfBird) {
49 | DateOfBird = dateOfBird;
50 | }
51 |
52 | public String getNationalityId() {
53 | return NationalityId;
54 | }
55 |
56 | public void setNationalityId(String nationalityId) {
57 | NationalityId = nationalityId;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/entities/CustomerCheckService.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entities;
2 |
3 | public interface CustomerCheckService {
4 | boolean CheckIfRealPerson(Customer customer);
5 | }
6 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/entities/CustomerService.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entities;
2 |
3 | public interface CustomerService {
4 | void save(Customer customer);
5 | }
6 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/entities/Entity.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entities;
2 |
3 | public interface Entity {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/managers/BaseCustomerManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entities.Customer;
4 | import com.ersozyazilim.entities.CustomerService;
5 |
6 | public abstract class BaseCustomerManager implements CustomerService {
7 | @Override
8 | public void save(Customer customer) {
9 | System.out.println("Veri tabanına kayıt edildi! => "+customer.getFirstName()+" "+customer.getLastName());
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/managers/CustomerCheckManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entities.Customer;
4 | import com.ersozyazilim.entities.CustomerCheckService;
5 |
6 | public class CustomerCheckManager implements CustomerCheckService {
7 | @Override
8 | public boolean CheckIfRealPerson(Customer customer) {
9 | return true;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/managers/NeroCustomerManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | public class NeroCustomerManager extends BaseCustomerManager {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/homeWork_3/src/com/ersozyazilim/managers/StarbucksCustomerManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entities.Customer;
4 | import com.ersozyazilim.entities.CustomerCheckService;
5 |
6 | public class StarbucksCustomerManager extends BaseCustomerManager{
7 |
8 | private CustomerCheckService customerCheckService;
9 |
10 | public StarbucksCustomerManager(CustomerCheckService customerCheckService) {
11 | this.customerCheckService = customerCheckService;
12 | }
13 |
14 | @Override
15 | public void save(Customer customer) {
16 | if(customerCheckService.CheckIfRealPerson(customer)){
17 | super.save(customer);
18 | }
19 | else{
20 | System.out.println("Kullanıcı bulunamadı!");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple Java application that includes a class with main()
method
--------------------------------------------------------------------------------
/homeWork_4/.idea/discord.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/project-template.xml:
--------------------------------------------------------------------------------
1 |
2 | IJ_BASE_PACKAGE
3 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/homeWork_4/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_4/homeWork_4.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/Main.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/Utils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/Utils.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/Campaign.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/Campaign.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/Entity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/Entity.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/Game.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/Game.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/User.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/entites/User.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/logSystem/DatabaseLogger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/logSystem/DatabaseLogger.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/logSystem/Logger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/logSystem/Logger.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/logSystem/SmsLogger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/logSystem/SmsLogger.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/CampaignManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/CampaignManager.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/CampaignService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/CampaignService.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/GameManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/GameManager.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/GameService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/GameService.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/UserCheckService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/UserCheckService.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/UserManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/UserManager.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/UserService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/UserService.class
--------------------------------------------------------------------------------
/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/adapters/EdevletServiceAdapter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_4/out/production/homeWork_4/com/ersozyazilim/managers/adapters/EdevletServiceAdapter.class
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/Main.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | import com.ersozyazilim.entites.Campaign;
4 | import com.ersozyazilim.entites.Game;
5 | import com.ersozyazilim.entites.User;
6 | import com.ersozyazilim.logSystem.DatabaseLogger;
7 | import com.ersozyazilim.logSystem.Logger;
8 | import com.ersozyazilim.logSystem.SmsLogger;
9 | import com.ersozyazilim.managers.CampaignManager;
10 | import com.ersozyazilim.managers.GameManager;
11 | import com.ersozyazilim.managers.UserManager;
12 | import com.ersozyazilim.managers.adapters.EdevletServiceAdapter;
13 |
14 | import java.util.Date;
15 |
16 | public class Main {
17 |
18 | public static void main(String[] args) {
19 | Logger[] loggers = {new DatabaseLogger(),new SmsLogger()};
20 | UserManager userManager = new UserManager(loggers, new EdevletServiceAdapter());
21 | User user = new User(1, "efetemel", "Efe Temel","ERSÖZ","123321","ersozyazilim@gmail.com",500,"11111111111",new Date(2004,02,27));
22 | userManager.register(user); // Kullanıcı kayıtı
23 | Game game = new Game(1,"Minecraft",80);
24 | GameManager gameManager = new GameManager(loggers);
25 | gameManager.addGame(game);
26 | Campaign campaign = new Campaign(1,"Yılbaşı Kampanyası",18);
27 | CampaignManager campaignManager = new CampaignManager();
28 | campaignManager.addCampaign(campaign);
29 | gameManager.sell(game,user,campaign); // Kampanyalı satış
30 | gameManager.sell(game,user); // Düz kampanyasız satış
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/Utils.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | import com.ersozyazilim.logSystem.Logger;
4 |
5 | public class Utils {
6 | public static void setLog(Logger[] loggers, String message){
7 | for(Logger loger : loggers){
8 | loger.log(message);
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/entites/Campaign.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entites;
2 |
3 | public class Campaign implements Entity{
4 | private int id;
5 | private String campaignName;
6 | private int campaignRate;
7 |
8 | public Campaign(int id, String campaignName, int campaignRate) {
9 | this.id = id;
10 | this.campaignName = campaignName;
11 | this.campaignRate = campaignRate;
12 | }
13 |
14 | public int getId() {
15 | return id;
16 | }
17 |
18 | public void setId(int id) {
19 | this.id = id;
20 | }
21 |
22 | public String getCampaignName() {
23 | return campaignName;
24 | }
25 |
26 | public void setCampaignName(String campaignName) {
27 | this.campaignName = campaignName;
28 | }
29 |
30 | public int getCampaignRate() {
31 | return campaignRate;
32 | }
33 |
34 | public void setCampaignRate(int campaignRate) {
35 | this.campaignRate = campaignRate;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/entites/Entity.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entites;
2 |
3 | public interface Entity {
4 | }
5 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/entites/Game.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entites;
2 |
3 | public class Game implements Entity{
4 |
5 | private int id;
6 | private String gameName;
7 | private double gamePrice;
8 |
9 | public Game(int id, String gameName, double gamePrice) {
10 | this.id = id;
11 | this.gameName = gameName;
12 | this.gamePrice = gamePrice;
13 | }
14 |
15 | public int getId() {
16 | return id;
17 | }
18 |
19 | public void setId(int id) {
20 | this.id = id;
21 | }
22 |
23 | public String getGameName() {
24 | return gameName;
25 | }
26 |
27 | public void setGameName(String gameName) {
28 | this.gameName = gameName;
29 | }
30 |
31 | public double getGamePrice() {
32 | return gamePrice;
33 | }
34 |
35 | public void setGamePrice(double gamePrice) {
36 | this.gamePrice = gamePrice;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/entites/User.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.entites;
2 |
3 | import java.util.Date;
4 |
5 | public class User implements Entity {
6 |
7 | private int id;
8 | private String username;
9 | private String firstName;
10 | private String lastName;
11 | private String password;
12 | private String email;
13 | private double money;
14 | private String nationalityId;
15 | private Date dateOfBird;
16 |
17 | public User(int id, String username, String firstName, String lastName, String password, String email, double money, String nationalityId, Date dateOfBird) {
18 | this.id = id;
19 | this.username = username;
20 | this.firstName = firstName;
21 | this.lastName = lastName;
22 | this.password = password;
23 | this.email = email;
24 | this.money = money;
25 | this.nationalityId = nationalityId;
26 | this.dateOfBird = dateOfBird;
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 getUsername() {
38 | return username;
39 | }
40 |
41 | public void setUsername(String username) {
42 | this.username = username;
43 | }
44 |
45 | public String getFirstName() {
46 | return firstName;
47 | }
48 |
49 | public void setFirstName(String firstName) {
50 | this.firstName = firstName;
51 | }
52 |
53 | public String getLastName() {
54 | return lastName;
55 | }
56 |
57 | public void setLastName(String lastName) {
58 | this.lastName = lastName;
59 | }
60 |
61 | public String getPassword() {
62 | return password;
63 | }
64 |
65 | public void setPassword(String password) {
66 | this.password = password;
67 | }
68 |
69 | public String getEmail() {
70 | return email;
71 | }
72 |
73 | public void setEmail(String email) {
74 | this.email = email;
75 | }
76 |
77 | public double getMoney() {
78 | return money;
79 | }
80 |
81 | public void setMoney(double money) {
82 | this.money = money;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/logSystem/DatabaseLogger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.logSystem;
2 |
3 | public class DatabaseLogger implements Logger {
4 | @Override
5 | public void log(String message) {
6 | System.out.println("[LOGGER] Database'e loglandı > "+message);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/logSystem/Logger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.logSystem;
2 |
3 | public interface Logger {
4 | void log(String message);
5 | }
6 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/logSystem/SmsLogger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.logSystem;
2 |
3 | public class SmsLogger implements Logger {
4 | @Override
5 | public void log(String message) {
6 | System.out.println("[LOGGER] Sms'e gönderildi > "+message);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/CampaignManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entites.Campaign;
4 |
5 | public class CampaignManager implements CampaignService{
6 |
7 | @Override
8 | public void addCampaign(Campaign campaign) {
9 | System.out.println(campaign.getCampaignName()+" Adlı kampanya eklendi");
10 | }
11 |
12 | @Override
13 | public void delCampaign(Campaign campaign) {
14 | System.out.println(campaign.getCampaignName()+" Adlı kampanya silindi");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/CampaignService.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entites.Campaign;
4 |
5 | public interface CampaignService {
6 | void addCampaign(Campaign campaign);
7 | void delCampaign(Campaign campaign);
8 | }
9 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/GameManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.Utils;
4 | import com.ersozyazilim.entites.Campaign;
5 | import com.ersozyazilim.entites.Game;
6 | import com.ersozyazilim.entites.User;
7 | import com.ersozyazilim.logSystem.Logger;
8 |
9 | public class GameManager implements GameService{
10 |
11 | private Logger[] loggers;
12 |
13 | public GameManager(Logger[] loggers) {
14 | this.loggers = loggers;
15 | }
16 |
17 | @Override
18 | public void sell(Game game, User user) {
19 | if(user.getMoney() >= game.getGamePrice()){
20 | System.out.println(user.getUsername()+" "+game.getGameName()+" Adlı oyunu "+game.getGamePrice()+" fiyata satın aldı.");
21 | Utils.setLog(loggers,user.getUsername()+" "+game.getGameName()+" Adlı oyunu "+game.getGamePrice()+" fiyata satın aldı.");
22 | }
23 | else{
24 | System.out.println(user.getUsername()+" "+game.getGameName()+" Adlı oyunu "+game.getGamePrice()+" almaya parası yetersiz.");
25 | }
26 |
27 | }
28 |
29 | @Override
30 | public void sell(Game game, User user, Campaign campaign) {
31 |
32 | double price = game.getGamePrice() * campaign.getCampaignRate() / 100;
33 | if(user.getMoney() >= price) {
34 | System.out.println(user.getUsername() + " " + game.getGameName() + " Adlı oyunu " + price + " %" + campaign.getCampaignRate() +" "+campaign.getCampaignName()+" indirimli fiyata satın aldı.");
35 | Utils.setLog(loggers, user.getUsername() + " " + game.getGameName() + " Adlı oyunu " + price + " %" + campaign.getCampaignRate() +" "+campaign.getCampaignName()+" indirimli fiyata satın aldı.");
36 | }
37 | else{
38 | System.out.println(user.getUsername()+" "+game.getGameName()+" Adlı oyunu "+price+" almaya parası yetersiz.");
39 | }
40 | }
41 |
42 | @Override
43 | public void addGame(Game game) {
44 | System.out.println(game.getGameName()+" Adlı oyun eklendi.");
45 | Utils.setLog(loggers, game.getGameName()+" Adlı oyun eklendi.");
46 | }
47 |
48 | @Override
49 | public void delGame(Game game) {
50 | System.out.println(game.getGameName()+" Adlı oyun silindi.");
51 | Utils.setLog(loggers, game.getGameName()+" Adlı oyun silindi.");
52 | }
53 |
54 | @Override
55 | public void updateGame(Game game) {
56 | System.out.println(game.getGameName()+" Adlı oyun güncellendi.");
57 | Utils.setLog(loggers, game.getGameName()+" Adlı oyun güncellendi.");
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/GameService.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entites.Campaign;
4 | import com.ersozyazilim.entites.Game;
5 | import com.ersozyazilim.entites.User;
6 |
7 | public interface GameService {
8 | void sell(Game game, User user);
9 | void sell(Game game, User user, Campaign campaign);
10 | void addGame(Game game);
11 | void delGame(Game game);
12 | void updateGame(Game game);
13 | }
14 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/UserCheckService.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entites.User;
4 |
5 | public interface UserCheckService {
6 | boolean checkIfRealUser(User user);
7 | }
8 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/UserManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.Utils;
4 | import com.ersozyazilim.entites.User;
5 | import com.ersozyazilim.logSystem.Logger;
6 |
7 | public class UserManager implements UserService {
8 |
9 | private Logger[] loggers;
10 | private UserCheckService userCheckService;
11 |
12 | public UserManager(Logger[] loggers, UserCheckService userCheckService) {
13 | this.loggers = loggers;
14 | this.userCheckService = userCheckService;
15 | }
16 |
17 | @Override
18 | public void register(User user) {
19 | if(userCheckService.checkIfRealUser(user)){
20 | System.out.println(user.getUsername()+" Sisteme kayıt oldu.");
21 | Utils.setLog(loggers,user.getUsername()+" Sisteme kayıt oldu.");
22 | }
23 | else{
24 | System.out.println(user.getUsername()+" Bilgileriniz geçersiz.");
25 | Utils.setLog(loggers,user.getUsername()+" Bilgileriniz geçersiz.");
26 | }
27 | }
28 |
29 | @Override
30 | public void login(User user) {
31 | System.out.println("Başarıyla giriş yapıldı.");
32 | }
33 |
34 | @Override
35 | public void update(User user) {
36 | System.out.println("Başarıyla güncelleme yapıldı.");
37 | }
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/UserService.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers;
2 |
3 | import com.ersozyazilim.entites.User;
4 |
5 | public interface UserService {
6 | void register(User user);
7 | void login(User user);
8 | void update(User user);
9 | }
10 |
--------------------------------------------------------------------------------
/homeWork_4/src/com/ersozyazilim/managers/adapters/EdevletServiceAdapter.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.managers.adapters;
2 |
3 | import com.ersozyazilim.entites.User;
4 | import com.ersozyazilim.managers.UserCheckService;
5 |
6 | public class EdevletServiceAdapter implements UserCheckService {
7 | @Override
8 | public boolean checkIfRealUser(User user) {
9 | return true;//hocam referans yok :D
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/homeWork_5/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/homeWork_5/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/homeWork_5/.idea/discord.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_5/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/homeWork_5/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/homeWork_5/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/homeWork_5/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/homeWork_5/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.ersozyazilim
8 | homeWork_5
9 | 1.0-SNAPSHOT
10 |
11 |
12 | 16
13 | 16
14 |
15 |
16 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/Main.java:
--------------------------------------------------------------------------------
1 | import business.concretes.UserManager;
2 | import core.GoogleAuthAdapter;
3 | import dataAccess.concretes.HibernateUserDao;
4 | import entities.concretes.User;
5 |
6 | public class Main {
7 |
8 | public static void main(String[] args){
9 | UserManager userManager = new UserManager(new HibernateUserDao());
10 | User user1 = new User(1,"Efe Temel","ERSÖZ","ersozyazilim@gmail.com","123321",false);
11 | User user2 = new User(1,"E","ERSÖZ","aaersozyazilim@gmail.com","123321",false);
12 | userManager.registerUser(user1,new GoogleAuthAdapter());
13 | userManager.confirmEmail(user1.getEmail());
14 | userManager.confirmEmail(user1.getEmail());
15 | userManager.loginUser(user1);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/business/abstracts/UserService.java:
--------------------------------------------------------------------------------
1 | package business.abstracts;
2 |
3 | import core.AuthService;
4 | import entities.concretes.User;
5 |
6 | import java.util.List;
7 | import java.util.function.Predicate;
8 |
9 | public interface UserService {
10 | void registerUser(User user);
11 | void registerUser(User user, AuthService authService);
12 | void updateUser(User user);
13 | void deleteUser(User user);
14 | void loginUser(User user);
15 | void loginUser(User user,AuthService authService);
16 | void confirmEmail(String email);
17 | User getUser(Predicate userPredicate);
18 | List getAllUser();
19 | }
20 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/business/concretes/UserManager.java:
--------------------------------------------------------------------------------
1 | package business.concretes;
2 |
3 | import business.abstracts.UserService;
4 | import core.AuthService;
5 | import core.GoogleAuthAdapter;
6 | import core.Utils;
7 | import dataAccess.abstracts.UserDao;
8 | import entities.concretes.User;
9 |
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 | import java.util.function.Predicate;
14 | import java.util.regex.Matcher;
15 | import java.util.regex.Pattern;
16 |
17 | public class UserManager implements UserService {
18 |
19 | private UserDao dao;
20 |
21 | public UserManager(UserDao dao) {
22 | this.dao = dao;
23 | }
24 |
25 | @Override
26 | public void registerUser(User user) {
27 | //İş kodları
28 | if (Utils.userValidation(user) && !checkIfUser(user)){
29 | this.dao.addUser(user);
30 | Utils.sendEmail(user.getEmail(),"Epostanızı onaylamak için tıklayınız.");
31 | }
32 | else if(!Utils.userValidation(user)){
33 | System.out.println("Kullanıcı bilgileri uygunsuz.");
34 | }
35 | else{
36 | System.out.println("Sistemde böyle bir eposta zaten kayıtlı.");
37 | }
38 |
39 | }
40 |
41 | @Override
42 | public void registerUser(User user,AuthService authService) {
43 | //İş kodları
44 |
45 | if (Utils.userValidation(user) && !checkIfUser(user) && authService.registerAuth(user)){
46 | this.dao.addUser(user);
47 | System.out.println("Servis kullanılanarak kayıt oldu.");
48 | Utils.sendEmail(user.getEmail(),"Epostanızı onaylamak için tıklayınız.");
49 | }
50 | else if(!Utils.userValidation(user)){
51 | System.out.println("Kullanıcı bilgileri uygunsuz.");
52 | }
53 | else{
54 | System.out.println("Sistemde böyle bir eposta zaten kayıtlı.");
55 | }
56 | }
57 |
58 | @Override
59 | public void updateUser(User user) {
60 | //İş kodları
61 | if (Utils.userValidation(user)){
62 | this.dao.updateUser(user);
63 | }
64 | }
65 |
66 | @Override
67 | public void deleteUser(User user) {
68 | //İş kodları
69 | this.dao.deleteUser(user);
70 | }
71 |
72 | @Override
73 | public void loginUser(User user) {
74 | if(dao.getUser(user1 -> user.getEmail() == user1.getEmail()) != null){
75 | System.out.println("Sisteme başarıyla giriş yaptınız.");
76 | }
77 | else{
78 | System.out.println("Eposta veya şifre yanlış lütfen tekrar deneyiniz.");
79 | }
80 | }
81 |
82 | @Override
83 | public void loginUser(User user,AuthService authService) {
84 | if(dao.getUser(user1 -> user.getEmail() == user1.getEmail()) != null && authService.loginAuth(user)){
85 | System.out.println("Sisteme başarıyla giriş yaptınız.");
86 | }
87 | else{
88 | System.out.println("Eposta veya şifre yanlış lütfen tekrar deneyiniz.");
89 | }
90 | }
91 |
92 | @Override
93 | public void confirmEmail(String email) {
94 | User realUser = dao.getUser(dbUser -> dbUser.getEmail() == email);
95 | if(realUser.isConfirmed()){
96 | System.out.println("Eposta zaten onaylanmış!");
97 | }
98 | else{
99 | realUser.setConfirmed(true);
100 | System.out.println("Epostanız onaylandı");
101 | }
102 | }
103 |
104 | @Override
105 | public User getUser(Predicate userPredicate) {
106 | return dao.getUser(userPredicate);
107 | }
108 |
109 | @Override
110 | public List getAllUser() {
111 | return null;
112 | }
113 |
114 |
115 |
116 | public boolean checkIfUser(User user){
117 |
118 | User realUser = dao.getUser(dbUser -> dbUser.getEmail() == user.getEmail());
119 | if (realUser != null){
120 | return true;
121 | }
122 | else {
123 | return false;
124 | }
125 | }
126 |
127 |
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/core/AuthService.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 | import entities.concretes.User;
4 |
5 | public interface AuthService {
6 | boolean loginAuth(User user);
7 | boolean registerAuth(User user);
8 | }
9 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/core/GoogleAuthAdapter.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 | import entities.concretes.User;
4 | import googleAuth.GoogleAuth;
5 |
6 | public class GoogleAuthAdapter implements AuthService{
7 |
8 | private GoogleAuth googleAuth = new GoogleAuth();
9 |
10 | @Override
11 | public boolean loginAuth(User user) {
12 | return googleAuth.loginGoogle(user.getEmail());
13 | }
14 |
15 | @Override
16 | public boolean registerAuth(User user) {
17 | return googleAuth.registerGoogle(user.getEmail());
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/core/Utils.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 | import entities.concretes.User;
4 |
5 | import java.util.regex.Matcher;
6 | import java.util.regex.Pattern;
7 |
8 | public class Utils {
9 |
10 |
11 | public static boolean userValidation(User user){
12 | final Pattern VALID_EMAIL_ADDRESS_REGEX =
13 | Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
14 | Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(user.getEmail());
15 | if (user.getPassword().length() >= 6 && user.getFirstName().length() > 2 && user.getLastName().length() > 2 && matcher.matches()){
16 | return true;
17 | }
18 | else{
19 | return false;
20 | }
21 |
22 | }
23 |
24 | public static void sendEmail(String email,String message) {
25 | System.out.println("[EmailGöndermeServisi] --> "+email +" hesabına "+message+" eposta gönderildi.");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/dataAccess/abstracts/UserDao.java:
--------------------------------------------------------------------------------
1 | package dataAccess.abstracts;
2 |
3 | import entities.concretes.User;
4 |
5 | import java.util.List;
6 | import java.util.function.Predicate;
7 |
8 | public interface UserDao {
9 | void addUser(User user);
10 | void updateUser(User user);
11 | void deleteUser(User user);
12 | User getUser(Predicate predicate);
13 | List getAllUser();
14 | }
15 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/dataAccess/concretes/HibernateUserDao.java:
--------------------------------------------------------------------------------
1 | package dataAccess.concretes;
2 |
3 | import dataAccess.abstracts.UserDao;
4 | import entities.concretes.User;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 | import java.util.function.Predicate;
9 |
10 | public class HibernateUserDao implements UserDao {
11 |
12 | List users = new ArrayList<>();
13 |
14 | @Override
15 | public void addUser(User user) {
16 | users.add(user);
17 | System.out.println(user.getFirstName()+" "+user.getLastName()+" Adlı kullanıcı eklendi.");
18 | }
19 |
20 | @Override
21 | public void updateUser(User user) {
22 | System.out.println(user.getFirstName()+" "+user.getLastName()+" Adlı kullanıcı güncellendi.");
23 | }
24 |
25 | @Override
26 | public void deleteUser(User user) {
27 | System.out.println(user.getFirstName()+" "+user.getLastName()+" Adlı kullanıcı silindi.");
28 | }
29 |
30 | @Override
31 | public User getUser(Predicate userPredicate) {
32 |
33 | try{
34 | User user = getAllUser().stream().filter(userPredicate).toList().get(0);
35 | return user;
36 | }
37 | catch (Exception e){
38 | return null;
39 | }
40 |
41 | }
42 |
43 | @Override
44 | public List getAllUser() {
45 | return users;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/entities/abstracts/Entity.java:
--------------------------------------------------------------------------------
1 | package entities.abstracts;
2 |
3 | public interface Entity {
4 | }
5 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/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 email;
11 | private String password;
12 | private boolean isConfirmed;
13 |
14 | public User() {
15 | }
16 |
17 | public User(int id, String firstName, String lastName, String email, String password,boolean isConfirmed) {
18 | this.id = id;
19 | this.firstName = firstName;
20 | this.lastName = lastName;
21 | this.email = email;
22 | this.password = password;
23 | this.isConfirmed = isConfirmed;
24 | }
25 |
26 | public int getId() {
27 | return id;
28 | }
29 |
30 | public void setId(int id) {
31 | this.id = id;
32 | }
33 |
34 | public String getFirstName() {
35 | return firstName;
36 | }
37 |
38 | public void setFirstName(String firstName) {
39 | this.firstName = firstName;
40 | }
41 |
42 | public String getLastName() {
43 | return lastName;
44 | }
45 |
46 | public void setLastName(String lastName) {
47 | this.lastName = lastName;
48 | }
49 |
50 | public String getEmail() {
51 | return email;
52 | }
53 |
54 | public void setEmail(String email) {
55 | this.email = email;
56 | }
57 |
58 | public String getPassword() {
59 | return password;
60 | }
61 |
62 | public void setPassword(String password) {
63 | this.password = password;
64 | }
65 |
66 | public boolean isConfirmed() {
67 | return isConfirmed;
68 | }
69 |
70 | public void setConfirmed(boolean confirmed) {
71 | isConfirmed = confirmed;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/homeWork_5/src/main/eTicaret/googleAuth/GoogleAuth.java:
--------------------------------------------------------------------------------
1 | package googleAuth;
2 |
3 | import entities.concretes.User;
4 |
5 | public class GoogleAuth {
6 | public boolean loginGoogle(String email){
7 | return true;
8 | }
9 | public boolean registerGoogle(String email){
10 | return true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/homeWork_5/target/classes/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/Main.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/business/abstracts/UserService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/business/abstracts/UserService.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/business/concretes/UserManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/business/concretes/UserManager.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/core/AuthService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/core/AuthService.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/core/GoogleAuthAdapter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/core/GoogleAuthAdapter.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/core/Utils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/core/Utils.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/dataAccess/abstracts/UserDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/dataAccess/abstracts/UserDao.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/dataAccess/concretes/HibernateUserDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/dataAccess/concretes/HibernateUserDao.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/entities/abstracts/Entity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/entities/abstracts/Entity.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/entities/concretes/User.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/entities/concretes/User.class
--------------------------------------------------------------------------------
/homeWork_5/target/classes/googleAuth/GoogleAuth.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_5/target/classes/googleAuth/GoogleAuth.class
--------------------------------------------------------------------------------
/homeWork_6/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/homeWork_6/.mvn/wrapper/MavenWrapperDownloader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2007-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import java.net.*;
18 | import java.io.*;
19 | import java.nio.channels.*;
20 | import java.util.Properties;
21 |
22 | public class MavenWrapperDownloader {
23 |
24 | private static final String WRAPPER_VERSION = "0.5.6";
25 | /**
26 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
27 | */
28 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
29 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
30 |
31 | /**
32 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
33 | * use instead of the default one.
34 | */
35 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
36 | ".mvn/wrapper/maven-wrapper.properties";
37 |
38 | /**
39 | * Path where the maven-wrapper.jar will be saved to.
40 | */
41 | private static final String MAVEN_WRAPPER_JAR_PATH =
42 | ".mvn/wrapper/maven-wrapper.jar";
43 |
44 | /**
45 | * Name of the property which should be used to override the default download url for the wrapper.
46 | */
47 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
48 |
49 | public static void main(String args[]) {
50 | System.out.println("- Downloader started");
51 | File baseDirectory = new File(args[0]);
52 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
53 |
54 | // If the maven-wrapper.properties exists, read it and check if it contains a custom
55 | // wrapperUrl parameter.
56 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
57 | String url = DEFAULT_DOWNLOAD_URL;
58 | if (mavenWrapperPropertyFile.exists()) {
59 | FileInputStream mavenWrapperPropertyFileInputStream = null;
60 | try {
61 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
62 | Properties mavenWrapperProperties = new Properties();
63 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
64 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
65 | } catch (IOException e) {
66 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
67 | } finally {
68 | try {
69 | if (mavenWrapperPropertyFileInputStream != null) {
70 | mavenWrapperPropertyFileInputStream.close();
71 | }
72 | } catch (IOException e) {
73 | // Ignore ...
74 | }
75 | }
76 | }
77 | System.out.println("- Downloading from: " + url);
78 |
79 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
80 | if (!outputFile.getParentFile().exists()) {
81 | if (!outputFile.getParentFile().mkdirs()) {
82 | System.out.println(
83 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
84 | }
85 | }
86 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
87 | try {
88 | downloadFileFromURL(url, outputFile);
89 | System.out.println("Done");
90 | System.exit(0);
91 | } catch (Throwable e) {
92 | System.out.println("- Error downloading");
93 | e.printStackTrace();
94 | System.exit(1);
95 | }
96 | }
97 |
98 | private static void downloadFileFromURL(String urlString, File destination) throws Exception {
99 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
100 | String username = System.getenv("MVNW_USERNAME");
101 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
102 | Authenticator.setDefault(new Authenticator() {
103 | @Override
104 | protected PasswordAuthentication getPasswordAuthentication() {
105 | return new PasswordAuthentication(username, password);
106 | }
107 | });
108 | }
109 | URL website = new URL(urlString);
110 | ReadableByteChannel rbc;
111 | rbc = Channels.newChannel(website.openStream());
112 | FileOutputStream fos = new FileOutputStream(destination);
113 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
114 | fos.close();
115 | rbc.close();
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/homeWork_6/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/homeWork_6/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/homeWork_6/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/homeWork_6/hrms.sql:
--------------------------------------------------------------------------------
1 |
2 | CREATE TABLE public.users
3 | (
4 | id integer NOT NULL,
5 | email text COLLATE pg_catalog."default" NOT NULL,
6 | password text COLLATE pg_catalog."default" NOT NULL,
7 | CONSTRAINT users_pkey PRIMARY KEY (id)
8 | )
9 |
10 | TABLESPACE pg_default;
11 |
12 | ALTER TABLE public.users
13 | OWNER to postgres;
14 |
15 | CREATE TABLE public.employers
16 | (
17 | -- Inherited from table public.users: id integer NOT NULL,
18 | -- Inherited from table public.users: email text COLLATE pg_catalog."default" NOT NULL,
19 | -- Inherited from table public.users: password text COLLATE pg_catalog."default" NOT NULL,
20 | company_name text COLLATE pg_catalog."default" NOT NULL,
21 | company_web_site text COLLATE pg_catalog."default" NOT NULL,
22 | company_phone_number text COLLATE pg_catalog."default" NOT NULL,
23 | is_email_verified boolean NOT NULL
24 | )
25 | INHERITS (public.users)
26 | TABLESPACE pg_default;
27 |
28 | ALTER TABLE public.employers
29 | OWNER to postgres;
30 |
31 | CREATE TABLE public.job_seekers
32 | (
33 | -- Inherited from table public.users: id integer NOT NULL,
34 | -- Inherited from table public.users: email text COLLATE pg_catalog."default" NOT NULL,
35 | -- Inherited from table public.users: password text COLLATE pg_catalog."default" NOT NULL,
36 | first_name text COLLATE pg_catalog."default" NOT NULL,
37 | last_name text COLLATE pg_catalog."default" NOT NULL,
38 | identity_number text COLLATE pg_catalog."default" NOT NULL,
39 | date_of_birth date NOT NULL,
40 | is_email_verified boolean NOT NULL
41 | )
42 | INHERITS (public.users)
43 | TABLESPACE pg_default;
44 |
45 | ALTER TABLE public.job_seekers
46 | OWNER to postgres;
47 |
48 | CREATE TABLE public.system_personal
49 | (
50 | -- Inherited from table public.users: id integer NOT NULL,
51 | -- Inherited from table public.users: email text COLLATE pg_catalog."default" NOT NULL,
52 | -- Inherited from table public.users: password text COLLATE pg_catalog."default" NOT NULL,
53 | job_name text COLLATE pg_catalog."default" NOT NULL
54 | )
55 | INHERITS (public.users)
56 | TABLESPACE pg_default;
57 |
58 | ALTER TABLE public.system_personal
59 | OWNER to postgres;
60 |
61 | CREATE TABLE public.job_list
62 | (
63 | id integer NOT NULL,
64 | job_name text COLLATE pg_catalog."default" NOT NULL,
65 | CONSTRAINT job_list_pkey PRIMARY KEY (id)
66 | )
67 |
68 | TABLESPACE pg_default;
69 |
70 | ALTER TABLE public.job_list
71 | OWNER to postgres;
--------------------------------------------------------------------------------
/homeWork_6/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # https://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /etc/mavenrc ] ; then
40 | . /etc/mavenrc
41 | fi
42 |
43 | if [ -f "$HOME/.mavenrc" ] ; then
44 | . "$HOME/.mavenrc"
45 | fi
46 |
47 | fi
48 |
49 | # OS specific support. $var _must_ be set to either true or false.
50 | cygwin=false;
51 | darwin=false;
52 | mingw=false
53 | case "`uname`" in
54 | CYGWIN*) cygwin=true ;;
55 | MINGW*) mingw=true;;
56 | Darwin*) darwin=true
57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59 | if [ -z "$JAVA_HOME" ]; then
60 | if [ -x "/usr/libexec/java_home" ]; then
61 | export JAVA_HOME="`/usr/libexec/java_home`"
62 | else
63 | export JAVA_HOME="/Library/Java/Home"
64 | fi
65 | fi
66 | ;;
67 | esac
68 |
69 | if [ -z "$JAVA_HOME" ] ; then
70 | if [ -r /etc/gentoo-release ] ; then
71 | JAVA_HOME=`java-config --jre-home`
72 | fi
73 | fi
74 |
75 | if [ -z "$M2_HOME" ] ; then
76 | ## resolve links - $0 may be a link to maven's home
77 | PRG="$0"
78 |
79 | # need this for relative symlinks
80 | while [ -h "$PRG" ] ; do
81 | ls=`ls -ld "$PRG"`
82 | link=`expr "$ls" : '.*-> \(.*\)$'`
83 | if expr "$link" : '/.*' > /dev/null; then
84 | PRG="$link"
85 | else
86 | PRG="`dirname "$PRG"`/$link"
87 | fi
88 | done
89 |
90 | saveddir=`pwd`
91 |
92 | M2_HOME=`dirname "$PRG"`/..
93 |
94 | # make it fully qualified
95 | M2_HOME=`cd "$M2_HOME" && pwd`
96 |
97 | cd "$saveddir"
98 | # echo Using m2 at $M2_HOME
99 | fi
100 |
101 | # For Cygwin, ensure paths are in UNIX format before anything is touched
102 | if $cygwin ; then
103 | [ -n "$M2_HOME" ] &&
104 | M2_HOME=`cygpath --unix "$M2_HOME"`
105 | [ -n "$JAVA_HOME" ] &&
106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107 | [ -n "$CLASSPATH" ] &&
108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109 | fi
110 |
111 | # For Mingw, ensure paths are in UNIX format before anything is touched
112 | if $mingw ; then
113 | [ -n "$M2_HOME" ] &&
114 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
115 | [ -n "$JAVA_HOME" ] &&
116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117 | fi
118 |
119 | if [ -z "$JAVA_HOME" ]; then
120 | javaExecutable="`which javac`"
121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
122 | # readlink(1) is not available as standard on Solaris 10.
123 | readLink=`which readlink`
124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
125 | if $darwin ; then
126 | javaHome="`dirname \"$javaExecutable\"`"
127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
128 | else
129 | javaExecutable="`readlink -f \"$javaExecutable\"`"
130 | fi
131 | javaHome="`dirname \"$javaExecutable\"`"
132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
133 | JAVA_HOME="$javaHome"
134 | export JAVA_HOME
135 | fi
136 | fi
137 | fi
138 |
139 | if [ -z "$JAVACMD" ] ; then
140 | if [ -n "$JAVA_HOME" ] ; then
141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
142 | # IBM's JDK on AIX uses strange locations for the executables
143 | JAVACMD="$JAVA_HOME/jre/sh/java"
144 | else
145 | JAVACMD="$JAVA_HOME/bin/java"
146 | fi
147 | else
148 | JAVACMD="`which java`"
149 | fi
150 | fi
151 |
152 | if [ ! -x "$JAVACMD" ] ; then
153 | echo "Error: JAVA_HOME is not defined correctly." >&2
154 | echo " We cannot execute $JAVACMD" >&2
155 | exit 1
156 | fi
157 |
158 | if [ -z "$JAVA_HOME" ] ; then
159 | echo "Warning: JAVA_HOME environment variable is not set."
160 | fi
161 |
162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
163 |
164 | # traverses directory structure from process work directory to filesystem root
165 | # first directory with .mvn subdirectory is considered project base directory
166 | find_maven_basedir() {
167 |
168 | if [ -z "$1" ]
169 | then
170 | echo "Path not specified to find_maven_basedir"
171 | return 1
172 | fi
173 |
174 | basedir="$1"
175 | wdir="$1"
176 | while [ "$wdir" != '/' ] ; do
177 | if [ -d "$wdir"/.mvn ] ; then
178 | basedir=$wdir
179 | break
180 | fi
181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
182 | if [ -d "${wdir}" ]; then
183 | wdir=`cd "$wdir/.."; pwd`
184 | fi
185 | # end of workaround
186 | done
187 | echo "${basedir}"
188 | }
189 |
190 | # concatenates all lines of a file
191 | concat_lines() {
192 | if [ -f "$1" ]; then
193 | echo "$(tr -s '\n' ' ' < "$1")"
194 | fi
195 | }
196 |
197 | BASE_DIR=`find_maven_basedir "$(pwd)"`
198 | if [ -z "$BASE_DIR" ]; then
199 | exit 1;
200 | fi
201 |
202 | ##########################################################################################
203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
204 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
205 | ##########################################################################################
206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
207 | if [ "$MVNW_VERBOSE" = true ]; then
208 | echo "Found .mvn/wrapper/maven-wrapper.jar"
209 | fi
210 | else
211 | if [ "$MVNW_VERBOSE" = true ]; then
212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
213 | fi
214 | if [ -n "$MVNW_REPOURL" ]; then
215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
216 | else
217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
218 | fi
219 | while IFS="=" read key value; do
220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
221 | esac
222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
223 | if [ "$MVNW_VERBOSE" = true ]; then
224 | echo "Downloading from: $jarUrl"
225 | fi
226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
227 | if $cygwin; then
228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
229 | fi
230 |
231 | if command -v wget > /dev/null; then
232 | if [ "$MVNW_VERBOSE" = true ]; then
233 | echo "Found wget ... using wget"
234 | fi
235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
236 | wget "$jarUrl" -O "$wrapperJarPath"
237 | else
238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
239 | fi
240 | elif command -v curl > /dev/null; then
241 | if [ "$MVNW_VERBOSE" = true ]; then
242 | echo "Found curl ... using curl"
243 | fi
244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
245 | curl -o "$wrapperJarPath" "$jarUrl" -f
246 | else
247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
248 | fi
249 |
250 | else
251 | if [ "$MVNW_VERBOSE" = true ]; then
252 | echo "Falling back to using Java to download"
253 | fi
254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
255 | # For Cygwin, switch paths to Windows format before running javac
256 | if $cygwin; then
257 | javaClass=`cygpath --path --windows "$javaClass"`
258 | fi
259 | if [ -e "$javaClass" ]; then
260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
261 | if [ "$MVNW_VERBOSE" = true ]; then
262 | echo " - Compiling MavenWrapperDownloader.java ..."
263 | fi
264 | # Compiling the Java class
265 | ("$JAVA_HOME/bin/javac" "$javaClass")
266 | fi
267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
268 | # Running the downloader
269 | if [ "$MVNW_VERBOSE" = true ]; then
270 | echo " - Running MavenWrapperDownloader.java ..."
271 | fi
272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
273 | fi
274 | fi
275 | fi
276 | fi
277 | ##########################################################################################
278 | # End of extension
279 | ##########################################################################################
280 |
281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
282 | if [ "$MVNW_VERBOSE" = true ]; then
283 | echo $MAVEN_PROJECTBASEDIR
284 | fi
285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
286 |
287 | # For Cygwin, switch paths to Windows format before running java
288 | if $cygwin; then
289 | [ -n "$M2_HOME" ] &&
290 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
291 | [ -n "$JAVA_HOME" ] &&
292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
293 | [ -n "$CLASSPATH" ] &&
294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
295 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
297 | fi
298 |
299 | # Provide a "standardized" way to retrieve the CLI args that will
300 | # work with both Windows and non-Windows executions.
301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
302 | export MAVEN_CMD_LINE_ARGS
303 |
304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
305 |
306 | exec "$JAVACMD" \
307 | $MAVEN_OPTS \
308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
311 |
--------------------------------------------------------------------------------
/homeWork_6/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
124 |
125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127 | )
128 |
129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131 | if exist %WRAPPER_JAR% (
132 | if "%MVNW_VERBOSE%" == "true" (
133 | echo Found %WRAPPER_JAR%
134 | )
135 | ) else (
136 | if not "%MVNW_REPOURL%" == "" (
137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
138 | )
139 | if "%MVNW_VERBOSE%" == "true" (
140 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
141 | echo Downloading from: %DOWNLOAD_URL%
142 | )
143 |
144 | powershell -Command "&{"^
145 | "$webclient = new-object System.Net.WebClient;"^
146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148 | "}"^
149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150 | "}"
151 | if "%MVNW_VERBOSE%" == "true" (
152 | echo Finished downloading %WRAPPER_JAR%
153 | )
154 | )
155 | @REM End of extension
156 |
157 | @REM Provide a "standardized" way to retrieve the CLI args that will
158 | @REM work with both Windows and non-Windows executions.
159 | set MAVEN_CMD_LINE_ARGS=%*
160 |
161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
162 | if ERRORLEVEL 1 goto error
163 | goto end
164 |
165 | :error
166 | set ERROR_CODE=1
167 |
168 | :end
169 | @endlocal & set ERROR_CODE=%ERROR_CODE%
170 |
171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
175 | :skipRcPost
176 |
177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
179 |
180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
181 |
182 | exit /B %ERROR_CODE%
183 |
--------------------------------------------------------------------------------
/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 | com.ersozyazilim
12 | homeWork_6
13 | 0.0.1-SNAPSHOT
14 | homeWork_6
15 | Demo project for Spring Boot
16 |
17 | 16
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/com/ersozyazilim/homework_6/HomeWork6Application.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.homework_6;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class HomeWork6Application {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(HomeWork6Application.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/homeWork_6/src/main/java/com/ersozyazilim/homework_6/api/controllers/JobListController.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.homework_6.api.controllers;
2 |
3 | import com.ersozyazilim.homework_6.business.abstracts.JobListService;
4 | import com.ersozyazilim.homework_6.entites.concretes.JobList;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.web.bind.annotation.*;
7 |
8 | import java.util.List;
9 |
10 | @RestController
11 | @RequestMapping("/api/joblist")
12 | public class JobListController {
13 |
14 | private JobListService jobListService;
15 |
16 | @Autowired
17 | public JobListController(JobListService jobListService) {
18 | this.jobListService = jobListService;
19 | }
20 |
21 | @GetMapping("/getall")
22 | public List getAll(){
23 | return this.jobListService.getAll();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/homeWork_6/src/main/java/com/ersozyazilim/homework_6/business/abstracts/JobListService.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.homework_6.business.abstracts;
2 |
3 | import com.ersozyazilim.homework_6.entites.concretes.JobList;
4 |
5 | import java.util.List;
6 |
7 | public interface JobListService {
8 | List getAll();
9 | }
10 |
--------------------------------------------------------------------------------
/homeWork_6/src/main/java/com/ersozyazilim/homework_6/business/concretes/JobListManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.homework_6.business.concretes;
2 |
3 | import com.ersozyazilim.homework_6.business.abstracts.JobListService;
4 | import com.ersozyazilim.homework_6.dataAccess.abstracts.JobListDao;
5 | import com.ersozyazilim.homework_6.entites.concretes.JobList;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.List;
10 | @Service
11 | public class JobListManager implements JobListService {
12 |
13 | private JobListDao jobListDao;
14 |
15 | @Autowired
16 | public JobListManager(JobListDao jobListDao) {
17 | this.jobListDao = jobListDao;
18 | }
19 |
20 | @Override
21 | public List getAll() {
22 | return this.jobListDao.findAll();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/homeWork_6/src/main/java/com/ersozyazilim/homework_6/dataAccess/abstracts/JobListDao.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.homework_6.dataAccess.abstracts;
2 |
3 | import com.ersozyazilim.homework_6.entites.concretes.JobList;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | public interface JobListDao extends JpaRepository {
7 | }
8 |
--------------------------------------------------------------------------------
/homeWork_6/src/main/java/com/ersozyazilim/homework_6/entites/concretes/JobList.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim.homework_6.entites.concretes;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import javax.persistence.*;
8 |
9 | @Data
10 | @AllArgsConstructor
11 | @NoArgsConstructor
12 | @Entity
13 | public class JobList {
14 | @Id
15 | @Column(name = "id")
16 | private int id;
17 |
18 | @Column(name = "job_name")
19 | private String jobName;
20 | }
21 |
--------------------------------------------------------------------------------
/homeWork_6/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.datasource.url=jdbc:postgresql://localhost:5432/hrms
2 | spring.datasource.username=postgres
3 | spring.datasource.password=123321
4 | spring.jpa.show-sql=true
5 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
6 | spring.jpa.properties.hibernate.format_sql=true
7 | spring.jackson.serialization.fail-on-empty-beans=false
--------------------------------------------------------------------------------
/homeWork_6/src/test/java/com/example/homework_6/HomeWork6ApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.homework_6;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class HomeWork6ApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/interfaces/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/interfaces/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple Java application that includes a class with main()
method
--------------------------------------------------------------------------------
/interfaces/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/interfaces/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/interfaces/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/interfaces/.idea/project-template.xml:
--------------------------------------------------------------------------------
1 |
2 | IJ_BASE_PACKAGE
3 |
--------------------------------------------------------------------------------
/interfaces/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/interfaces/interfaces.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/Customer.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/Customer.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/CustomerManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/CustomerManager.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/DatabaseLogger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/DatabaseLogger.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/EmailLogger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/EmailLogger.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/FileLogger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/FileLogger.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/Logger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/Logger.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/Main.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/SmsLogger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/SmsLogger.class
--------------------------------------------------------------------------------
/interfaces/out/production/interfaces/com/ersozyazilim/Utils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/interfaces/out/production/interfaces/com/ersozyazilim/Utils.class
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/Customer.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public class Customer {
4 | private int id;
5 | private String firstName;
6 | private String lastName;
7 |
8 | public Customer(){
9 |
10 | }
11 |
12 | public Customer(int id, String firstName, String lastName) {
13 | this.id = id;
14 | this.firstName = firstName;
15 | this.lastName = lastName;
16 | }
17 |
18 | public int getId() {
19 | return id;
20 | }
21 |
22 | public void setId(int id) {
23 | this.id = id;
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 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/CustomerManager.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public class CustomerManager {
4 |
5 | private Logger[] loggers;
6 |
7 | public CustomerManager(Logger[] loggers) {
8 | this.loggers = loggers;
9 | }
10 |
11 | //loosly - tightly coupled
12 | public void add(Customer customer){
13 | System.out.println("Müşteri eklendi "+customer.getFirstName());
14 | Utils.runLoggers(loggers,customer.getFirstName());
15 | }
16 |
17 | public void delete(Customer customer){
18 | System.out.println("Müşteri silindi "+customer.getFirstName());
19 | Utils.runLoggers(loggers,customer.getFirstName());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/DatabaseLogger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public class DatabaseLogger implements Logger{
4 |
5 | @Override
6 | public void log(String message) {
7 | System.out.println("Database loglandı : "+message);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/EmailLogger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public class EmailLogger implements Logger{
4 | @Override
5 | public void log(String message) {
6 | System.out.println("Email gönderildi "+message);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/FileLogger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public class FileLogger implements Logger{
4 | @Override
5 | public void log(String message) {
6 | System.out.println("Dosyaya loglandı : "+message);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/Logger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public interface Logger {
4 | void log(String message);
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/Main.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 | import java.util.Scanner;
6 |
7 | public class Main {
8 |
9 | public static void main(String[] args) {
10 | Logger[] loggers = {new FileLogger(),new DatabaseLogger()};
11 | CustomerManager customerManager = new CustomerManager(loggers);
12 | Customer engin = new Customer(1,"Engin","Demiroğ");
13 | customerManager.add(engin);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/SmsLogger.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public class SmsLogger implements Logger{
4 | @Override
5 | public void log(String message) {
6 | System.out.println("Sms gönderildi : "+message);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/interfaces/src/com/ersozyazilim/Utils.java:
--------------------------------------------------------------------------------
1 | package com.ersozyazilim;
2 |
3 | public class Utils {
4 | public static void runLoggers(Logger[] loggers,String message){
5 | for (Logger logger:loggers){
6 | logger.log(message);
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/intro/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/intro/.gitignore:
--------------------------------------------------------------------------------
1 | /bin/
2 |
--------------------------------------------------------------------------------
/intro/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | intro
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/intro/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=15
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=15
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13 | org.eclipse.jdt.core.compiler.release=enabled
14 | org.eclipse.jdt.core.compiler.source=15
15 |
--------------------------------------------------------------------------------
/intro/src/intro/Main.java:
--------------------------------------------------------------------------------
1 | package intro;
2 |
3 | public class Main {
4 |
5 | public static void main(String[] args) {
6 |
7 | //camelCase.
8 |
9 | String internetSubeButonu ="İnternet Şubeye Gir";
10 |
11 | double dolarDun = 8.15;
12 | double dolarBugun = 8.18;
13 |
14 | int vade = 36;
15 |
16 | boolean dustuMu = false;
17 |
18 | System.out.println(internetSubeButonu);
19 |
20 | if(dolarBugundolarDun){
23 | System.out.println("Dolar yükseldi resmi");
24 | }else {
25 | System.out.println("Dolar aynı kaldı");
26 | }
27 |
28 | System.out.println("---------IEnumerable olmayan-----------");
29 |
30 | String kredi1= "Hızlı kredi";
31 | String kredi2= "Mutlu emekli kredisi";
32 | String kredi3= "Konut kredisi";
33 | String kredi4= "Çiftçi kredisi";
34 | String kredi5= "Msb kredisi";
35 |
36 | System.out.println(kredi1);
37 | System.out.println(kredi2);
38 | System.out.println(kredi3);
39 | System.out.println(kredi4);
40 | System.out.println(kredi5);
41 |
42 | System.out.println("---------IEnumerable olan-----------");
43 |
44 |
45 | String[] krediler={"Hızlı kredi","Mutlu emekli kredisi","Konut kredisi","Çiftçi kredisi","Msb kredisi","Meb kredisi"};
46 |
47 | System.out.println("---------For index-----------");
48 |
49 | for (int i = 0; i < krediler.length; i++) {
50 | System.out.println(krediler[i]);
51 | }
52 |
53 | System.out.println("---------Foreach-----------");
54 |
55 | for (String kredi : krediler) {
56 | System.out.println(kredi);
57 | }
58 |
59 | int sayi1 = 10;
60 | int sayi2 = 20;
61 | sayi1 = sayi2;
62 | System.out.println(sayi1);
63 |
64 |
65 | int[] sayilar1 = {1,2,3,4,5};
66 | int[] sayilar2 = {10,20,30,40,50};
67 |
68 | sayilar1=sayilar2;
69 | sayilar2[0] = 100;
70 | System.out.println(sayilar1[0]);
71 |
72 | String sehir1 = "Ankara";
73 | String sehir2 = "İstanbul";
74 | sehir1=sehir2;
75 | sehir2= "İzmir";
76 | System.out.println(sehir1);
77 |
78 |
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/nLayeredDemo/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/nLayeredDemo/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/nLayeredDemo/.idea/discord.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/nLayeredDemo/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/nLayeredDemo/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/nLayeredDemo/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/nLayeredDemo/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/nLayeredDemo/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.ersozyazilim
8 | nLayeredDemo
9 | 1.0-SNAPSHOT
10 |
11 |
12 | 16
13 | 16
14 |
15 |
16 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/Main.java:
--------------------------------------------------------------------------------
1 | import business.abstracts.ProductService;
2 | import business.concretes.ProductManager;
3 | import core.jLoggerManagerAdapter;
4 | import dataAccess.concretes.AbcProductDao;
5 | import dataAccess.concretes.HibernateProductDao;
6 | import entities.concretes.Product;
7 |
8 | public class Main {
9 | public static void main(String[] args){
10 | //ToDo Spring IoC ile çözülecek
11 | ProductService productService = new ProductManager(new AbcProductDao(),new jLoggerManagerAdapter());
12 | Product product = new Product(1,2,"elma",12,50);
13 | productService.add(product);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/business/abstracts/ProductService.java:
--------------------------------------------------------------------------------
1 | package business.abstracts;
2 |
3 | import entities.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/main/nLayeredDemo/business/concretes/ProductManager.java:
--------------------------------------------------------------------------------
1 | package business.concretes;
2 |
3 | import business.abstracts.ProductService;
4 | import core.LoggerService;
5 | import dataAccess.abstracts.ProductDao;
6 | import entities.concretes.Product;
7 | import jLogger.jLoggerManager;
8 |
9 | import java.util.List;
10 |
11 | public class ProductManager implements ProductService {
12 |
13 | private ProductDao dao;
14 | private LoggerService loggerService;
15 |
16 | public ProductManager(ProductDao dao,LoggerService loggerService) {
17 | this.dao = dao;
18 | this.loggerService = loggerService;
19 | }
20 |
21 | @Override
22 | public void add(Product product) {
23 | //İş kodları
24 | if (product.getCategoryID() == 1){
25 | System.out.println("Bu kategoride ürün kabul edilmiyor!");
26 | return;
27 | }
28 | this.dao.add(product);
29 | this.loggerService.logToSystem("Ürün sisteme eklendi "+product.getName());
30 | }
31 |
32 | @Override
33 | public List getAll() {
34 | return null;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/core/LoggerService.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 | public interface LoggerService {
4 | void logToSystem(String message);
5 | }
6 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/core/jLoggerManagerAdapter.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 | import 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/main/nLayeredDemo/dataAccess/abstracts/ProductDao.java:
--------------------------------------------------------------------------------
1 | package dataAccess.abstracts;
2 |
3 | import entities.concretes.Product;
4 |
5 | import java.util.List;
6 |
7 | public interface ProductDao {
8 | void add(Product product);
9 | void update(Product product);
10 | void delete(Product product);
11 | Product get(int id);
12 | List getAll();
13 | }
14 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/dataAccess/concretes/AbcProductDao.java:
--------------------------------------------------------------------------------
1 | package dataAccess.concretes;
2 |
3 | import dataAccess.abstracts.ProductDao;
4 | import entities.concretes.Product;
5 |
6 | import java.util.List;
7 |
8 | public class AbcProductDao implements ProductDao {
9 | @Override
10 | public void add(Product product) {
11 | System.out.println("Abc ile eklendi : "+product.getName());
12 | }
13 |
14 | @Override
15 | public void update(Product product) {
16 |
17 | }
18 |
19 | @Override
20 | public void delete(Product product) {
21 |
22 | }
23 |
24 | @Override
25 | public Product get(int id) {
26 | return null;
27 | }
28 |
29 | @Override
30 | public List getAll() {
31 | return null;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/dataAccess/concretes/HibernateProductDao.java:
--------------------------------------------------------------------------------
1 | package dataAccess.concretes;
2 |
3 | import dataAccess.abstracts.ProductDao;
4 | import entities.concretes.Product;
5 |
6 | import java.util.List;
7 |
8 | public class HibernateProductDao implements ProductDao {
9 |
10 | @Override
11 | public void add(Product product) {
12 | System.out.println("Hibernate ile eklendi : "+product.getName());
13 | }
14 |
15 | @Override
16 | public void update(Product product) {
17 | System.out.println("Hibernate ile güncellendi : "+product.getName());
18 | }
19 |
20 | @Override
21 | public void delete(Product product) {
22 | System.out.println("Hibernate ile silindi : "+product.getName());
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/main/nLayeredDemo/entities/abstracts/Entity.java:
--------------------------------------------------------------------------------
1 | package entities.abstracts;
2 |
3 | public interface Entity {
4 | }
5 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/entities/concretes/Product.java:
--------------------------------------------------------------------------------
1 | package entities.concretes;
2 |
3 | import entities.abstracts.Entity;
4 |
5 | public class Product implements Entity {
6 | private int id;
7 | private int categoryID;
8 | private String name;
9 | private double unitPrice;
10 | private int unitInStock;
11 |
12 | public Product() {
13 | }
14 |
15 | public Product(int id, int categoryID, String name, double unitPrice, int unitInStock) {
16 | this.id = id;
17 | this.categoryID = categoryID;
18 | this.name = name;
19 | this.unitPrice = unitPrice;
20 | this.unitInStock = unitInStock;
21 | }
22 |
23 | public int getId() {
24 | return id;
25 | }
26 |
27 | public void setId(int id) {
28 | this.id = id;
29 | }
30 |
31 | public int getCategoryID() {
32 | return categoryID;
33 | }
34 |
35 | public void setCategoryID(int categoryID) {
36 | this.categoryID = categoryID;
37 | }
38 |
39 | public String getName() {
40 | return name;
41 | }
42 |
43 | public void setName(String name) {
44 | this.name = name;
45 | }
46 |
47 | public double getUnitPrice() {
48 | return unitPrice;
49 | }
50 |
51 | public void setUnitPrice(double unitPrice) {
52 | this.unitPrice = unitPrice;
53 | }
54 |
55 | public int getUnitInStock() {
56 | return unitInStock;
57 | }
58 |
59 | public void setUnitInStock(int unitInStock) {
60 | this.unitInStock = unitInStock;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/nLayeredDemo/src/main/nLayeredDemo/jLogger/jLoggerManager.java:
--------------------------------------------------------------------------------
1 | package jLogger;
2 |
3 | public class jLoggerManager {
4 | public void log(String message){
5 | System.out.println("J Logger ile loglandı");
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/Main.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/business/abstracts/ProductService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/business/abstracts/ProductService.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/business/concretes/ProductManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/business/concretes/ProductManager.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/core/LoggerService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/core/LoggerService.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/core/jLoggerManagerAdapter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/core/jLoggerManagerAdapter.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/dataAccess/abstracts/ProductDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/dataAccess/abstracts/ProductDao.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/dataAccess/concretes/AbcProductDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/dataAccess/concretes/AbcProductDao.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/dataAccess/concretes/HibernateProductDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/dataAccess/concretes/HibernateProductDao.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/entities/abstracts/Entity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/entities/abstracts/Entity.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/entities/concretes/Product.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/entities/concretes/Product.class
--------------------------------------------------------------------------------
/nLayeredDemo/target/classes/jLogger/jLoggerManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/efetemel/Java-Kamp/c4cbe4681e5d9a59323dfbe302cb305ccb5b69a1/nLayeredDemo/target/classes/jLogger/jLoggerManager.class
--------------------------------------------------------------------------------
/oopIntro/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/oopIntro/.gitignore:
--------------------------------------------------------------------------------
1 | /bin/
2 |
--------------------------------------------------------------------------------
/oopIntro/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/oopIntro/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/oopIntro/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/oopIntro/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/oopIntro/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | oopIntro
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/oopIntro/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=15
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=15
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13 | org.eclipse.jdt.core.compiler.release=enabled
14 | org.eclipse.jdt.core.compiler.source=15
15 |
--------------------------------------------------------------------------------
/oopIntro/oopIntro.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/oopIntro/src/oopIntro/Category.java:
--------------------------------------------------------------------------------
1 | package oopIntro;
2 |
3 | public class Category {
4 | int id;
5 | String name;
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/oopIntro/src/oopIntro/Main.java:
--------------------------------------------------------------------------------
1 | package oopIntro;
2 |
3 | public class Main {
4 |
5 | public static void main(String[] args) {
6 |
7 | Product product1 = new Product(1,"Lenovo V14",15000,"16 GB Ram",10,13500); //Referans oluşturma, instance
8 |
9 | Product product2 = new Product();
10 | product2.setId(2);
11 | product2.setName("Lenovo V15");
12 | product2.setDetail("16 GB Ram");
13 | product2.setDiscount(10);
14 | product2.setUnitPrice(16000);
15 |
16 | Product product3 = new Product();
17 |
18 |
19 | Product[] products = {product1,product2,product3};
20 |
21 | for(Product product : products) {
22 | System.out.println(product.name);
23 | }
24 |
25 | System.out.println(products.length);
26 |
27 | Category category1 = new Category();
28 | category1.id = 1;
29 | category1.name = "Bilgisayar";
30 |
31 | Category category2 = new Category();
32 | category2.id = 2;
33 | category2.name = "Ev/Bahçe";
34 |
35 | ProductManager productManager = new ProductManager();
36 |
37 | productManager.addToCart(product1);
38 | productManager.addToCart(product2);
39 | productManager.addToCart(product3);
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/oopIntro/src/oopIntro/Product.java:
--------------------------------------------------------------------------------
1 | package oopIntro;
2 |
3 | public class Product {
4 | //encapsulation
5 | private int id;
6 | private String name;
7 | private double unitPrice;
8 | private String detail;
9 | private double discount;
10 | private double unitPriceAfterDiscount;
11 |
12 | public Product() {
13 | }
14 |
15 | public Product(int id, String name, double unitPrice, String detail, double discount, double unitPriceAfterDiscount) {
16 | this.id = id;
17 | this.name = name;
18 | this.unitPrice = unitPrice;
19 | this.detail = detail;
20 | this.discount = discount;
21 | this.unitPriceAfterDiscount = unitPriceAfterDiscount;
22 | }
23 |
24 | public int getId() {
25 | return id;
26 | }
27 |
28 | public void setId(int id) {
29 | this.id = id;
30 | }
31 |
32 | public String getName() {
33 | return name;
34 | }
35 |
36 | public void setName(String name) {
37 | this.name = name;
38 | }
39 |
40 | public double getUnitPrice() {
41 | return unitPrice;
42 | }
43 |
44 | public void setUnitPrice(double unitPrice) {
45 | this.unitPrice = unitPrice;
46 | }
47 |
48 | public String getDetail() {
49 | return detail;
50 | }
51 |
52 | public void setDetail(String detail) {
53 | this.detail = detail;
54 | }
55 |
56 | public double getDiscount() {
57 | return discount;
58 | }
59 |
60 | public void setDiscount(double discount) {
61 | this.discount = discount;
62 | }
63 |
64 | public double getUnitPriceAfterDiscount() {
65 | return this.unitPrice - (this.unitPrice * this.discount / 100);
66 | }
67 |
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/oopIntro/src/oopIntro/ProductManager.java:
--------------------------------------------------------------------------------
1 | package oopIntro;
2 |
3 | public class ProductManager {
4 | public void addToCart(Product product) {
5 | System.out.println("Sepete eklendi :"+product.name);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------