diff --git a/2022-10-13-20-27-53.png b/2022-10-13-20-27-53.png new file mode 100644 index 0000000000000000000000000000000000000000..2a02b456ce2c6c7c48ab21cd52e9b79ff0e885ed Binary files /dev/null and b/2022-10-13-20-27-53.png differ diff --git a/2022-10-13-20-28-19.png b/2022-10-13-20-28-19.png new file mode 100644 index 0000000000000000000000000000000000000000..4335cf96bf686c133816d5cef12fcf48cabafdbf Binary files /dev/null and b/2022-10-13-20-28-19.png differ diff --git a/belajarbelajar/build.gradle b/belajarbelajar/build.gradle index ae74c874310b82917b2cfe6f630e9c43ec2534a5..6dfb47f86c38fc80a267719f6cb08b56d6550ca1 100644 --- a/belajarbelajar/build.gradle +++ b/belajarbelajar/build.gradle @@ -22,6 +22,8 @@ dependencies { compileOnly("org.projectlombok:lombok:1.18.24") annotationProcessor('org.projectlombok:lombok:1.18.24') implementation 'org.springframework.boot:spring-boot-starter-validation:2.7.3' + implementation 'com.fasterxml.jackson.core:jackson-databind' + implementation 'org.springframework.boot:spring-boot-starter-webflux' } tasks.named('test') { diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/CourseModel.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/CourseModel.java index 2472fa3006752091124530b302fcd8063110e9d7..c9cd34b01808765c3132f52828191c3d62cf3f9d 100644 --- a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/CourseModel.java +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/CourseModel.java @@ -1,5 +1,6 @@ package apap.tutorial.belajarbelajar.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @@ -17,6 +18,7 @@ import java.util.List; @AllArgsConstructor @NoArgsConstructor @Entity +@JsonIgnoreProperties(value={"listPenyelenggara"}, allowSetters = true) @Table(name = "course") public class CourseModel { @Id diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/PengajarModel.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/PengajarModel.java index 0564f2b3d413db06deaaa0f5a00c81f22e2080b9..a1049acdac3c1c4f85ff4302b6d73bc0b7494547 100644 --- a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/PengajarModel.java +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/model/PengajarModel.java @@ -1,5 +1,6 @@ package apap.tutorial.belajarbelajar.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @@ -18,6 +19,7 @@ import java.util.List; @AllArgsConstructor @NoArgsConstructor @Entity +@JsonIgnoreProperties(value={"course"}, allowSetters = true) @Table(name = "pengajar") public class PengajarModel implements Serializable{ @Id @@ -33,6 +35,10 @@ public class PengajarModel implements Serializable{ @Column(name = "is_pengajar_universitas", nullable = false) private Boolean isPengajarUniversitas; +// @NotNull + @Column(name = "gender_pengajar") + private Boolean genderPengajar; + @ManyToOne(fetch = FetchType.EAGER, optional = false) @JoinColumn(name = "code", referencedColumnName = "code", nullable = false) @OnDelete(action = OnDeleteAction.CASCADE) diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/CourseDetail.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/CourseDetail.java new file mode 100644 index 0000000000000000000000000000000000000000..e1f20f8dc2a692eb2edd69e81de543981e1f7946 --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/CourseDetail.java @@ -0,0 +1,20 @@ +package apap.tutorial.belajarbelajar.rest; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class CourseDetail { + private String status; + + @JsonProperty("course-license") + private Integer courseLicense; + + @JsonProperty("valid-until") + private Date validUntil; +} diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/GenderizeDetail.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/GenderizeDetail.java new file mode 100644 index 0000000000000000000000000000000000000000..de0079208716f17bae33a940902dde36d3215394 --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/GenderizeDetail.java @@ -0,0 +1,23 @@ +package apap.tutorial.belajarbelajar.rest; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class GenderizeDetail { + private String status; + + @JsonProperty("gender") + private String gender; + + @JsonProperty("probability") + private Double probability; + + @JsonProperty("count") + private Integer count; +} \ No newline at end of file diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/Setting.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/Setting.java new file mode 100644 index 0000000000000000000000000000000000000000..18c23c65b64b5835fcf9661a5c195f4800966ae9 --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/rest/Setting.java @@ -0,0 +1,6 @@ +package apap.tutorial.belajarbelajar.rest; + +public class Setting { + final public static String courseUrl = "https://77431479-0b90-454a-9394-bbc8c1cc4110.mock.pstmn.io"; + final public static String genderizeUrl = "https://api.genderize.io"; +} diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/restcontroller/CourseRestController.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/restcontroller/CourseRestController.java new file mode 100644 index 0000000000000000000000000000000000000000..870c29de560c6bd0c1471b9f4da4be1266c10b4b --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/restcontroller/CourseRestController.java @@ -0,0 +1,95 @@ +package apap.tutorial.belajarbelajar.restcontroller; + +import java.util.List; +import java.util.NoSuchElementException; +import javax.validation.Valid; + +import apap.tutorial.belajarbelajar.rest.CourseDetail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.server.ResponseStatusException; +import apap.tutorial.belajarbelajar.model.CourseModel; +import apap.tutorial.belajarbelajar.service.CourseRestService; +import reactor.core.publisher.Mono; + +@RestController +@RequestMapping("/api/v1") +public class CourseRestController { + @Autowired + private CourseRestService courseRestService; + + @PostMapping(value = "/course/add") + private CourseModel createCourse(@Valid @RequestBody CourseModel course, BindingResult bindingResult){ + if(bindingResult.hasFieldErrors()){ + throw new ResponseStatusException( + HttpStatus.BAD_REQUEST, "Request body has invalid type or missing field." + ); + } else { + return courseRestService.createCourse(course); + } + } + + //Retrieve + @GetMapping(value = "/course/{code}") + private CourseModel retrieveCourse(@PathVariable("code") String code){ + try { + return courseRestService.getCourseByCode(code); + } catch (NoSuchElementException e){ + throw new ResponseStatusException( + HttpStatus.NOT_FOUND, "Code course " + code + " not found" + ); + } + } + + //Delete + @DeleteMapping(value = "/course/{code}") + private ResponseEntity deleteCourse(@PathVariable("code") String code){ + try { + courseRestService.deleteCourse(code); + return ResponseEntity.ok("Course with code " + code + " has been deleted succesfully"); + } catch (NoSuchElementException e){ + throw new ResponseStatusException( + HttpStatus.NOT_FOUND, "Code course " + code + " not found" + ); + } catch (UnsupportedOperationException e){ + throw new ResponseStatusException( + HttpStatus.BAD_REQUEST, "Course is still open or has pengajar" + ); + } + } + //Update + @PutMapping(value = "/course/{code}") + private CourseModel updateCourse(@PathVariable("code") String code, @RequestBody CourseModel course) { + try { + return courseRestService.updateCourse(code, course); + } catch (NoSuchElementException e){ + throw new ResponseStatusException( + HttpStatus.NOT_FOUND, "Code Course " + code + " not found" + ); + } + } + //Retrieve List All + @GetMapping(value = "/list-course") + private List<CourseModel> retrieveListCourse(){ + return courseRestService.retrieveListCourse(); + } + + @GetMapping(value = "/course/{code}/status") + private Mono<String> getStatus(@PathVariable("code") String code) { + return courseRestService.getStatus(code); + } + @GetMapping(value = "/full") + private Mono<CourseDetail> postStatus() { + return courseRestService.postStatus(); + } +} diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/restcontroller/PengajarRestController.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/restcontroller/PengajarRestController.java new file mode 100644 index 0000000000000000000000000000000000000000..ce4a8e4b308481bc009e14fbc39d673e068b28c3 --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/restcontroller/PengajarRestController.java @@ -0,0 +1,111 @@ +package apap.tutorial.belajarbelajar.restcontroller; + +import apap.tutorial.belajarbelajar.model.PengajarModel; +import apap.tutorial.belajarbelajar.rest.CourseDetail; +import apap.tutorial.belajarbelajar.service.CourseRestService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.server.ResponseStatusException; +import apap.tutorial.belajarbelajar.model.CourseModel; +import apap.tutorial.belajarbelajar.service.PengajarRestService; +import reactor.core.publisher.Mono; + +import javax.validation.Valid; +import java.util.List; +import java.util.NoSuchElementException; + +@RestController +@RequestMapping("/api/v1") +public class PengajarRestController { + @Autowired + private PengajarRestService pengajarRestService; + + @PostMapping(value = "/pengajar") + private PengajarModel createPengajar(@Valid @RequestBody PengajarModel pengajar, BindingResult bindingResult){ + if(bindingResult.hasFieldErrors()){ + throw new ResponseStatusException( + HttpStatus.BAD_REQUEST, "Request body has invalid type or missing field." + ); + } + return pengajarRestService.createPengajar(pengajar); + } + + //Retrieve + @GetMapping(value = "/pengajar/{noPengajar}") + private PengajarModel retrievePengajar(@PathVariable("noPengajar") Long noPengajar){ + try { + return pengajarRestService.getPengajarByNoPengajar(noPengajar); + } catch (NoSuchElementException e){ + throw new ResponseStatusException( + HttpStatus.NOT_FOUND, "No Pengajar " + noPengajar.toString() + " not found" + ); + } + } + + //Delete + @DeleteMapping(value = "/pengajar/{noPengajar}") + private ResponseEntity deletePengajar(@PathVariable("noPengajar") Long noPengajar){ + try { + pengajarRestService.deletePengajar(noPengajar); + return ResponseEntity.ok("Pengajar sudah terhapus"); + } catch (NoSuchElementException e){ + throw new ResponseStatusException( + HttpStatus.NOT_FOUND, "No Pengajar " + noPengajar.toString() + " not found" + ); + } catch (UnsupportedOperationException e){ + throw new ResponseStatusException( + HttpStatus.BAD_REQUEST, "Course is still open" + ); + } + } + //Update + @PutMapping(value = "/pengajar/{noPengajar}") + private PengajarModel updatePengajar(@PathVariable("noPengajar") Long noPengajar, @Valid @RequestBody PengajarModel pengajar) { + try { + return pengajarRestService.updatePengajar(noPengajar, pengajar); + } catch (NoSuchElementException e){ + throw new ResponseStatusException( + HttpStatus.NOT_FOUND, "No Pengajar " + noPengajar.toString() + " not found" + ); + } + } + //Retrieve List All + @GetMapping(value = "/list-pengajar") + private List<PengajarModel> retrieveListPengajar(){ + return pengajarRestService.retrieveListPengajar(); + } + + //Set Gender + @GetMapping("/pengajar/jenis-kelamin/{noPengajar}") + private PengajarModel setGenderPengajar(@PathVariable("noPengajar") Long noPengajar) { + try { + return pengajarRestService.setGenderPengajar(noPengajar); + } catch (NoSuchElementException e) { + throw new ResponseStatusException( + HttpStatus.NOT_FOUND, "No pengajar" + noPengajar.toString() + " not found" + ); + } catch (UnsupportedOperationException e) { + throw new ResponseStatusException( + HttpStatus.BAD_REQUEST, "Course is still open" + ); + } + } +// @GetMapping(value = "/pengajar/{code}/status") +// private Mono<String> getStatus(@PathVariable("code") String code) { +// return courseRestService.getStatus(code); +// } +// @GetMapping(value = "/full") +// private Mono<CourseDetail> postStatus() { +// return courseRestService.postStatus(); +// } +} \ No newline at end of file diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/CourseRestService.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/CourseRestService.java new file mode 100644 index 0000000000000000000000000000000000000000..600ccd25d50f4f42f9bf7c96a24afb489cc4c6a2 --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/CourseRestService.java @@ -0,0 +1,16 @@ +package apap.tutorial.belajarbelajar.service; +import java.util.List; +import apap.tutorial.belajarbelajar.model.CourseModel; +import apap.tutorial.belajarbelajar.rest.CourseDetail; +import reactor.core.publisher.Mono; + +public interface CourseRestService { + CourseModel createCourse(CourseModel course); + List<CourseModel> retrieveListCourse(); + CourseModel getCourseByCode(String code); + CourseModel updateCourse(String code, CourseModel courseUpdate); + void deleteCourse(String code); + Mono<String> getStatus(String code); + Mono<CourseDetail> postStatus(); +} + diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/CourseRestServiceImpl.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/CourseRestServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..f35e5099bb084638ca668744b768f3916b4f3b25 --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/CourseRestServiceImpl.java @@ -0,0 +1,100 @@ +package apap.tutorial.belajarbelajar.service; + +import java.time.LocalDateTime; +import java.util.NoSuchElementException; +import java.util.List; +import java.util.Optional; + +import javax.transaction.Transactional; + +import apap.tutorial.belajarbelajar.rest.CourseDetail; +import apap.tutorial.belajarbelajar.rest.Setting; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import apap.tutorial.belajarbelajar.repository.CourseDb; +import apap.tutorial.belajarbelajar.model.CourseModel; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; + +@Service +@Transactional +public class CourseRestServiceImpl implements CourseRestService{ + + private final WebClient webClient; + + public CourseRestServiceImpl(WebClient.Builder webClientBuilder){ + this.webClient = webClientBuilder.baseUrl(Setting.courseUrl).build(); + } + + @Autowired + private CourseDb courseDb; + + @Override + public CourseModel createCourse(CourseModel course){ + return courseDb.save(course); + } + @Override + public List<CourseModel> retrieveListCourse(){ + return courseDb.findAll(); + } + + @Override + public CourseModel getCourseByCode(String code){ + Optional<CourseModel> course = courseDb.findByCode(code); + if (course.isPresent()){ + return course.get(); + } else { + throw new NoSuchElementException(); + } + } + + @Override + public CourseModel updateCourse(String code, CourseModel courseUpdate){ + CourseModel course = getCourseByCode(code); + course.setNameCourse(courseUpdate.getNameCourse()); + course.setDescription(courseUpdate.getDescription()); + course.setJumlahSks(courseUpdate.getJumlahSks()); + course.setTanggalDimulai(courseUpdate.getTanggalDimulai()); + course.setTanggalBerakhir(courseUpdate.getTanggalBerakhir()); + return courseDb.save(course); + } + @Override + public void deleteCourse(String code){ + CourseModel course = getCourseByCode(code); + if (isClosed(course.getTanggalDimulai(), course.getTanggalBerakhir())){ + courseDb.delete(course); + } else{ + throw new UnsupportedOperationException(); + } + } + + public boolean isClosed(LocalDateTime tanggalDimulai, LocalDateTime tanggalBerakhir){ + LocalDateTime now = LocalDateTime.now(); + if (now.isBefore(tanggalDimulai) || now.isAfter(tanggalBerakhir)){ + return true; + } + return false; + } + + @Override + public Mono<String> getStatus(String code) { + return this.webClient.get().uri("/rest/course/" + code + "/status") + .retrieve() + .bodyToMono(String.class); + } + + @Override + public Mono<CourseDetail> postStatus() { + MultiValueMap<String, String> data = new LinkedMultiValueMap(); + data.add("code", "APAP"); + data.add("nameCourse", "Arsitektur PAP"); + return this.webClient.post().uri("/rest/course/full") + .syncBody(data) + .retrieve() + .bodyToMono(CourseDetail.class); + } +} + diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/PengajarRestService.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/PengajarRestService.java new file mode 100644 index 0000000000000000000000000000000000000000..f29b59bd97a71f81b27900fa55c4585e7d09a642 --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/PengajarRestService.java @@ -0,0 +1,18 @@ +package apap.tutorial.belajarbelajar.service; +import java.util.List; +import apap.tutorial.belajarbelajar.model.PengajarModel; +//import apap.tutorial.belajarbelajar.rest.CourseDetail; +//import reactor.core.publisher.Mono; + +public interface PengajarRestService { + PengajarModel createPengajar(PengajarModel pengajar); + List<PengajarModel> retrieveListPengajar(); + PengajarModel getPengajarByNoPengajar(Long noPengajar); + PengajarModel updatePengajar(Long noPengajar, PengajarModel pengajarUpdate); + void deletePengajar(Long noPengajar); + PengajarModel setGenderPengajar(Long noPengajar); + +// Mono<String> getStatus(Long noPengajar); +// Mono<CourseDetail> postStatus(); +} + diff --git a/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/PengajarRestServiceImpl.java b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/PengajarRestServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..a7da8e4414ee354b26e1301aa925bbfbb01dc4ee --- /dev/null +++ b/belajarbelajar/src/main/java/apap/tutorial/belajarbelajar/service/PengajarRestServiceImpl.java @@ -0,0 +1,117 @@ +package apap.tutorial.belajarbelajar.service; + +import java.time.LocalDateTime; +import java.util.NoSuchElementException; +import java.util.List; +import java.util.Optional; + +import javax.transaction.Transactional; + +import apap.tutorial.belajarbelajar.model.CourseModel; +import apap.tutorial.belajarbelajar.repository.PengajarDb; +//import apap.tutorial.belajarbelajar.rest.pengajarDetail; +import apap.tutorial.belajarbelajar.rest.GenderizeDetail; +import apap.tutorial.belajarbelajar.rest.Setting; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import apap.tutorial.belajarbelajar.repository.PengajarDb; +import apap.tutorial.belajarbelajar.model.PengajarModel; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; + +@Service +@Transactional +public class PengajarRestServiceImpl implements PengajarRestService{ + + private final WebClient webClient; + + public PengajarRestServiceImpl(WebClient.Builder webClientBuilder){ + this.webClient = webClientBuilder.baseUrl(Setting.genderizeUrl).build(); + } + + @Autowired + private PengajarDb pengajarDb; + + @Override + public PengajarModel createPengajar(PengajarModel pengajar){ + return pengajarDb.save(pengajar); + } + @Override + public List<PengajarModel> retrieveListPengajar(){ + return pengajarDb.findAll(); + } + + @Override + public PengajarModel getPengajarByNoPengajar(Long noPengajar){ + Optional<PengajarModel> pengajar = pengajarDb.findByNoPengajar(noPengajar); + if (pengajar.isPresent()){ + return pengajar.get(); + } else { + throw new NoSuchElementException(); + } + } + + @Override + public PengajarModel updatePengajar(Long noPengajar, PengajarModel pengajarUpdate){ + PengajarModel pengajar = getPengajarByNoPengajar(noPengajar); + pengajar.setNamaPengajar(pengajarUpdate.getNamaPengajar()); + pengajar.setIsPengajarUniversitas(pengajarUpdate.getIsPengajarUniversitas()); + pengajar.setCourse(pengajarUpdate.getCourse()); + return pengajarDb.save(pengajar); + } + @Override + public void deletePengajar(Long noPengajar){ + PengajarModel pengajar = getPengajarByNoPengajar(noPengajar); + CourseModel course = pengajar.getCourse(); + if (isClosed(course.getTanggalDimulai(), course.getTanggalBerakhir())){ + pengajarDb.delete(pengajar); + } else{ + throw new UnsupportedOperationException(); + } + } + + public boolean isClosed(LocalDateTime tanggalDimulai, LocalDateTime tanggalBerakhir){ + LocalDateTime now = LocalDateTime.now(); + if (now.isBefore(tanggalDimulai) || now.isAfter(tanggalBerakhir)){ + return true; + } + return false; + } + + @Override + public PengajarModel setGenderPengajar(Long noPengajar) { + PengajarModel pengajar = getPengajarByNoPengajar(noPengajar); + CourseModel course = pengajar.getCourse(); + if (!isClosed(course.getTanggalDimulai(), course.getTanggalBerakhir())) { throw new UnsupportedOperationException();} + String firstName = pengajar.getNamaPengajar().split(" ")[0]; + Mono<GenderizeDetail> formatAPI = this.webClient.get().uri("/?name=" + firstName).retrieve().bodyToMono(GenderizeDetail.class); + + boolean booleanGender = formatAPI.block().getGender().equals("female"); + pengajar.setGenderPengajar(booleanGender); + updatePengajar(noPengajar, pengajar); + + return getPengajarByNoPengajar(noPengajar); + } + +// @Override +// public Mono<String> getStatus(String code) { +// return this.webClient.get().uri("/rest/pengajar/" + code + "/status") +// .retrieve() +// .bodyToMono(String.class); +// } +// +// @Override +// public Mono<pengajarDetail> postStatus() { +// MultiValueMap<String, String> data = new LinkedMultiValueMap(); +// data.add("code", "APAP"); +// data.add("namepengajar", "Arsitektur PAP"); +// return this.webClient.post().uri("/rest/pengajar/full") +// .syncBody(data) +// .retrieve() +// .bodyToMono(pengajarDetail.class); +// } +} + diff --git a/belajarbelajar/src/main/resources/application.properties b/belajarbelajar/src/main/resources/application.properties index 9be6051e081b0d6bde7187c1cb54fe1470398e90..38030bd44cba42021801cb2e5ad4289f4adfd05a 100644 --- a/belajarbelajar/src/main/resources/application.properties +++ b/belajarbelajar/src/main/resources/application.properties @@ -14,3 +14,5 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialec #pembuatan database (create || create drop || validate || update) spring.jpa.hibernate.ddl-auto=update + +server.port=2020 diff --git a/singidol/.gitignore b/singidol/.gitignore deleted file mode 100644 index c2065bc26202b2d072aca3efc3d1c2efad3afcbf..0000000000000000000000000000000000000000 --- a/singidol/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -HELP.md -.gradle -build/ -!gradle/wrapper/gradle-wrapper.jar -!**/src/main/**/build/ -!**/src/test/**/build/ - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ diff --git a/singidol/build.gradle b/singidol/build.gradle deleted file mode 100644 index b58f253260a049154deec4c53696aa8bb2d47579..0000000000000000000000000000000000000000 --- a/singidol/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'org.springframework.boot' version '2.7.4' - id 'io.spring.dependency-management' version '1.0.14.RELEASE' - id 'java' -} - -group = 'apap.tugasindividu' -version = '0.0.1-SNAPSHOT' -sourceCompatibility = '11' - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - implementation 'org.springframework.boot:spring-boot-starter-web' - developmentOnly 'org.springframework.boot:spring-boot-devtools' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'mysql:mysql-connector-java:5.1.6' - compileOnly("org.projectlombok:lombok:1.18.24") - annotationProcessor('org.projectlombok:lombok:1.18.24') - implementation 'org.springframework.boot:spring-boot-starter-validation:2.7.3' -} - -tasks.named('test') { - useJUnitPlatform() -} diff --git a/singidol/gradle/wrapper/gradle-wrapper.jar b/singidol/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e5832f090a2944b7473328c07c9755baa3196..0000000000000000000000000000000000000000 Binary files a/singidol/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/singidol/gradle/wrapper/gradle-wrapper.properties b/singidol/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 8049c684f04fdf584869d8eed0bc9168b401e403..0000000000000000000000000000000000000000 --- a/singidol/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/singidol/gradlew b/singidol/gradlew deleted file mode 100644 index a69d9cb6c20655813e44515156e7253a2a239138..0000000000000000000000000000000000000000 --- a/singidol/gradlew +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/singidol/gradlew.bat b/singidol/gradlew.bat deleted file mode 100644 index f127cfd49d4024c3e1e0d08ba56399221b4fb25d..0000000000000000000000000000000000000000 --- a/singidol/gradlew.bat +++ /dev/null @@ -1,91 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/singidol/settings.gradle b/singidol/settings.gradle deleted file mode 100644 index 5b955c31c0173c32ef9efae683e32ed7f4511bfc..0000000000000000000000000000000000000000 --- a/singidol/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'singidol' diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/SingidolApplication.java b/singidol/src/main/java/apap/tugasindividu/singidol/SingidolApplication.java deleted file mode 100644 index b0e5eee6db3ca793f1d674216193bcec741bd04e..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/SingidolApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package apap.tugasindividu.singidol; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class SingidolApplication { - - public static void main(String[] args) { - SpringApplication.run(SingidolApplication.class, args); - } - -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/controller/BaseController.java b/singidol/src/main/java/apap/tugasindividu/singidol/controller/BaseController.java deleted file mode 100644 index 3c92e535e87aa20a321acf9c685ff0adb50e7e46..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/controller/BaseController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.controller; - -public class BaseController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/controller/IdolController.java b/singidol/src/main/java/apap/tugasindividu/singidol/controller/IdolController.java deleted file mode 100644 index b9c7188717bc4116077769fa0ea7fd4fc939fb97..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/controller/IdolController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.controller; - -public class IdolController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/controller/KonserController.java b/singidol/src/main/java/apap/tugasindividu/singidol/controller/KonserController.java deleted file mode 100644 index 3951cc0f0e50f373940508e43900e93df13a11c4..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/controller/KonserController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.controller; - -public class KonserController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/controller/TiketController.java b/singidol/src/main/java/apap/tugasindividu/singidol/controller/TiketController.java deleted file mode 100644 index 21f1862b92a1109ca1fdd898eefc527f0420e103..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/controller/TiketController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.controller; - -public class TiketController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/controller/TipeController.java b/singidol/src/main/java/apap/tugasindividu/singidol/controller/TipeController.java deleted file mode 100644 index 9b5f899b24205fe91561e43e00f85b1ea6cc2a31..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/controller/TipeController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.controller; - -public class TipeController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/model/IdolModel.java b/singidol/src/main/java/apap/tugasindividu/singidol/model/IdolModel.java deleted file mode 100644 index f49f7e09c043f348a8e7f3c1d8b4e7e7202ec44c..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/model/IdolModel.java +++ /dev/null @@ -1,56 +0,0 @@ -package apap.tugasindividu.singidol.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.springframework.format.annotation.DateTimeFormat; - -import javax.persistence.*; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.time.LocalDateTime; -import java.util.List; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -@Entity -@Table(name = "idol") -public class IdolModel { - @Id - @Size(max = 30) - private String idolID; - - @NotNull - @Size(max = 30) - @Column(name = "nama_idol", nullable = false) - private String namaIdol; - - @NotNull - @Size(max = 30) - @Column(name = "asal_negara", nullable = false) - private String asalNegara; - - @NotNull - @Column(name = "jumlah_angoota", nullable = false) - private Integer jumlahAnggota; - - @NotNull - @Column(nullable = false) - @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm") - private LocalDateTime tanggalDebut; - -// @NotNull -// @Column(nullable = false) -// @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm") -// private LocalDateTime tanggalBerakhir; - - @OneToMany(mappedBy = "idol", fetch = FetchType.LAZY, cascade = CascadeType.ALL) - private List<PengajarModel> listPengajar; - - @ManyToMany - @JoinTable(name = "penyelenggara_course", joinColumns = @JoinColumn(name = "code"), inverseJoinColumns = @JoinColumn(name = "no_penyelenggara")) - List<PenyelenggaraModel> listPenyelenggara; -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/model/KonserController.java b/singidol/src/main/java/apap/tugasindividu/singidol/model/KonserController.java deleted file mode 100644 index 591cfe7a3901a45d69797992e97ceb1281dea3b0..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/model/KonserController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.model; - -public class KonserController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/model/TiketController.java b/singidol/src/main/java/apap/tugasindividu/singidol/model/TiketController.java deleted file mode 100644 index 6bc2483e254ea55d90778dfdcf999c356d8ed89c..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/model/TiketController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.model; - -public class TiketController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/model/TipeController.java b/singidol/src/main/java/apap/tugasindividu/singidol/model/TipeController.java deleted file mode 100644 index 15b5b5c937ebdcafbee013fd0023ac5a4490317f..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/model/TipeController.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.model; - -public class TipeController { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/repository/IdolDb.java b/singidol/src/main/java/apap/tugasindividu/singidol/repository/IdolDb.java deleted file mode 100644 index aa1df43e2bb0cf0a47b81114ecd65807fed4d4a0..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/repository/IdolDb.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.repository; - -public class IdolDb { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/repository/KonserDb.java b/singidol/src/main/java/apap/tugasindividu/singidol/repository/KonserDb.java deleted file mode 100644 index 2d810724b0bb33e437c7af973875c0296378624e..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/repository/KonserDb.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.repository; - -public class KonserDb { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/repository/TiketDb.java b/singidol/src/main/java/apap/tugasindividu/singidol/repository/TiketDb.java deleted file mode 100644 index 94e562a504a2e5bfbbd1e23c6d0589593c3c3a40..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/repository/TiketDb.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.repository; - -public class TiketDb { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/repository/TipeDb.java b/singidol/src/main/java/apap/tugasindividu/singidol/repository/TipeDb.java deleted file mode 100644 index bd17d437593cdb1dacaaf86099032bcdbdb3eadd..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/repository/TipeDb.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.repository; - -public class TipeDb { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/IdolService.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/IdolService.java deleted file mode 100644 index 4f7d707ebdc06a77dc7c0859e9398d388cef4fd4..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/IdolService.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class IdolService { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/IdolServiceImpl.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/IdolServiceImpl.java deleted file mode 100644 index 151ef3e61f06dc78a59626a397b37eca18463cde..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/IdolServiceImpl.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class IdolServiceImpl { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/KonserService.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/KonserService.java deleted file mode 100644 index 31ffefd9a236532646add60c3db1495c942e912a..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/KonserService.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class KonserService { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/KonserServiceImpl.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/KonserServiceImpl.java deleted file mode 100644 index 7773a062d093a68db454be5d502aff74c2ac3091..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/KonserServiceImpl.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class KonserServiceImpl { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/TiketService.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/TiketService.java deleted file mode 100644 index db2642affe337985548a5dcf8cff8d9d7d372e33..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/TiketService.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class TiketService { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/TiketServiceImpl.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/TiketServiceImpl.java deleted file mode 100644 index 16ab0d5a2d1d5c166c683151bff0ec44aba67448..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/TiketServiceImpl.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class TiketServiceImpl { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/TipeService.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/TipeService.java deleted file mode 100644 index 8f9ca92450e42c4bff248c2605d0d8df51fb8cc7..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/TipeService.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class TipeService { -} diff --git a/singidol/src/main/java/apap/tugasindividu/singidol/service/TipeServiceImpl.java b/singidol/src/main/java/apap/tugasindividu/singidol/service/TipeServiceImpl.java deleted file mode 100644 index 4497c1e26295f29f08dcbc6352f007b124438f2d..0000000000000000000000000000000000000000 --- a/singidol/src/main/java/apap/tugasindividu/singidol/service/TipeServiceImpl.java +++ /dev/null @@ -1,4 +0,0 @@ -package apap.tugasindividu.singidol.service; - -public class TipeServiceImpl { -} diff --git a/singidol/src/main/resources/application.properties b/singidol/src/main/resources/application.properties deleted file mode 100644 index 1c852cfce21faa075e86dcdb6f280a6de38000bf..0000000000000000000000000000000000000000 --- a/singidol/src/main/resources/application.properties +++ /dev/null @@ -1,16 +0,0 @@ -#konfigurasi untuk koneksi MySQL -spring.sql.init.platform=mysql -spring.datasource.driver-class-name=com.mysql.jdbc.Driver - -#sesuaikan NAMA_DATABASE dengan nama database anda -spring.datasource.url=jdbc:mysql://localhost:3306/singidol?useSSL=false&serverTimezone=Asia/Jakarta - -#sesuaikan dengan NAMA dan PASSWORD mysql anda -spring.datasource.username=root -spring.datasource.password= - -#optimize query untuk db MySQL -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect - -#pembuatan database (create || create drop || validate || update) -spring.jpa.hibernate.ddl-auto=create diff --git a/singidol/src/main/resources/templates/error/404.html b/singidol/src/main/resources/templates/error/404.html deleted file mode 100644 index 5c2de6bc7268ef3a144950dcfcd11b088c3668f1..0000000000000000000000000000000000000000 --- a/singidol/src/main/resources/templates/error/404.html +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html lang="en" xmlns:th="http://thymeleaf.org"> -<head> - <meta charset="UTF-8"> - <title>404 not found</title> - <object th:include="fragments/fragment :: css" th:remove="tag"></object> - <object th:include="fragments/fragment :: js" th:remove="tag"></object> - -</head> -<body> -<nav th:replace="fragments/fragment :: navbar"></nav> -<div class="container-fluid"> - <h2>Halaman tidak ditemukan</h2> - <a th:href="@{/}">Kembali ke home</a> -</div> -</body> -</html> diff --git a/singidol/src/main/resources/templates/fragments/fragment.html b/singidol/src/main/resources/templates/fragments/fragment.html deleted file mode 100644 index 5b40d2b3393be4676222a81b39d269befaf9d89a..0000000000000000000000000000000000000000 --- a/singidol/src/main/resources/templates/fragments/fragment.html +++ /dev/null @@ -1,66 +0,0 @@ -<!DOCTYPE html> -<html lang="en" xmlns:th="https://thymeleaf.org"> - -<head> - <meta charset="UTF-8"> - <title>Singidol</title> - - <head th:fragment="css"> - <link rel="stylesheet" th:href="@{/css/bootstrap.min.css/}"/> - </head> - - <head th:fragment="js"> - <script - src="https://code.jquery.com/jquery-3.4.1.min.js" - integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFIBw8HfCJo=" - crossorigin="anonymous" - ></script> - <script src="https://getbootstrap.com/docs/4.1/assets/js/vendor/popper.min.js"></script> - <script th:src="@{/js/bootstrap.min.js/}"></script> - </head> -</head> - -<body> -<nav th:fragment="navbar" class="navbar navbar-expand-lg navbar-light bg-light"> - <a class="navbar-brand font-weight-bold text-primary" href="#">Singidol</a> - <button - class="navbar-toggler" - type="button" - data-toggle="collapse" - data-target="#navbarNavAltMarkup" - aria-controls="navbarNavAltMarkup" - aria-expanded="false" - aria-label="Toggle navigation" - > - <span class="navbar-toggler-icon"></span> - </button> - - <div class="collapse navbar-collapse"> - <ul class="navbar-nav mr-auto"> - <li th:classappend="${#httpServletRequest.getRequestURI() == '/' ? 'nav-item active':'nav-item'}"> - <a class="nav-item nav-link text-secondary" th:href="@{/}"> - Konser <span class="sr-only">(current)</span> - </a> - </li> - <li th:classappend="${#httpServletRequest.getRequestURI().startsWith('/tiket/viewall') == '/' ? 'nav-item active':'nav-item'}"> - <a class="nav-item nav-link text-secondary" th:href="@{/tiket/viewall}"> - Tiket <span class="sr-only">(current)</span> - </a> - </li> - <li th:classappend="${#httpServletRequest.getRequestURI().startsWith('/idol/viewall') == '/' ? 'nav-item active':'nav-item'}"> - <a class="nav-item nav-link text-secondary" th:href="@{/idol/viewall}"> - Idol <span class="sr-only">(current)</span> - </a> - </li> - </ul> - - <form class="form-inline my-2 my-lg-0" th:action="@{/tiket/view/}" method="GET"> - <input class="form-control mr-sm-2" type="search" - name="code" placeholder="Code Course" aria-label="Search"> - <button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button> - </form> - </div> -</nav> -</body> - -</html> \ No newline at end of file diff --git a/singidol/src/test/java/apap/tugasindividu/singidol/SingidolApplicationTests.java b/singidol/src/test/java/apap/tugasindividu/singidol/SingidolApplicationTests.java deleted file mode 100644 index e0c7ca2522f080be256d610bdfcbf2d938464aec..0000000000000000000000000000000000000000 --- a/singidol/src/test/java/apap/tugasindividu/singidol/SingidolApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package apap.tugasindividu.singidol; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class SingidolApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/tutorial-6/git-reset/abc.txt b/tutorial-6/git-reset/abc.txt new file mode 100644 index 0000000000000000000000000000000000000000..04f3f4a95fdd36cf4a7ecb9d9d3cb0bf0c874553 --- /dev/null +++ b/tutorial-6/git-reset/abc.txt @@ -0,0 +1 @@ +this is first line from abc file \ No newline at end of file diff --git a/tutorial-6/index.html b/tutorial-6/index.html index c75148bfbc681044dc26544e40fba6374f24bc5d..6b4d15d2764df10a7e41a06318627d5413377f69 100644 --- a/tutorial-6/index.html +++ b/tutorial-6/index.html @@ -5,6 +5,7 @@ <title>Tutorial 6</title> </head> <body> + <p>Body from feat/tutorial-6-advancedgit-1</p> <p>Body from tut6-for-merge</p> </body> <footer>