Skip to content

Commit

Permalink
Merge pull request #19 from RoadRomeo1/code_refractor_nov_25
Browse files Browse the repository at this point in the history
Code refractor nov 25
  • Loading branch information
RoadRomeo1 authored Nov 25, 2023
2 parents 62de091 + 22d1240 commit 3befda2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/example/manager/controller/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import javax.validation.Valid;

@RestController
@RequestMapping(value = UrlMapper.globalUrl + UrlMapper.addressUrl)
@RequestMapping(value = UrlMapper.GLOBAL_URL + UrlMapper.ADDRESS_URL)
public class Address {

@Autowired
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/example/manager/controller/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.swagger.annotations.ApiResponse;

@RestController
@RequestMapping(value = UrlMapper.globalUrl + UrlMapper.dataUrl)
@RequestMapping(value = UrlMapper.GLOBAL_URL + UrlMapper.DATA_URL)
public class Person {

@Autowired
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/example/manager/data/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ public Person(Long id, @NotBlank(message = "First Name can not be empty") String
private Set<Address> address;

@OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "project_id", referencedColumnName = "id")
@JoinColumn(name = "person_id", referencedColumnName = "id")
private Set<Project> project;

@OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "education_id", referencedColumnName = "id")
@JoinColumn(name = "person_id", referencedColumnName = "id")
private Set<Education> education;

@OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "experience_id", referencedColumnName = "id")
@JoinColumn(name = "person_id", referencedColumnName = "id")
private Set<Experience> experience;

}
6 changes: 3 additions & 3 deletions src/main/java/com/example/manager/mapping/UrlMapper.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.example.manager.mapping;

public class UrlMapper {
public final static String globalUrl = "/api/v1/manage/";
public final static String dataUrl = "data";
public final static String addressUrl = "address";
public final static String GLOBAL_URL = "/api/v1/manage/";
public final static String DATA_URL = "data";
public final static String ADDRESS_URL = "address";

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class AddressTest {
@Autowired
ResponseFormat response;

String uri = UrlMapper.globalUrl + UrlMapper.addressUrl;
String uri = UrlMapper.GLOBAL_URL + UrlMapper.ADDRESS_URL;

@Test
void testGetAllAddress() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class PersonTest {
@Autowired
ResponseFormat response;

String uri = UrlMapper.globalUrl + UrlMapper.dataUrl;
String uri = UrlMapper.GLOBAL_URL + UrlMapper.DATA_URL;

@Test
void testGetAllData() throws Exception{
Expand Down

0 comments on commit 3befda2

Please sign in to comment.