Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
Variable name changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jueun275 committed May 11, 2020
1 parent 00fbcc0 commit 551466e
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class GroupEntity extends BaseTimeEntity{
private UserEntity gMstUserFK;

@Column(name = "GROUP_NM")
private String groupName;
private String groupNm;

@Column(name = "GROUP_PB_ST" )
private Boolean groupState;
Expand All @@ -50,23 +50,23 @@ public class GroupEntity extends BaseTimeEntity{

@Builder
public GroupEntity(UserEntity gMstUserFK,
String groupName,
String groupNm,
Boolean groupState,
String groupPic,
String groupEx) {

this.gMstUserFK = gMstUserFK;
this.groupName = groupName;
this.groupNm = groupNm;
this.groupState = groupState;
this.groupPic = groupPic;
this.groupEx = groupEx;
}

public void updateGroupInfo(String groupName,
public void updateGroupInfo(String groupNm,
Boolean groupState,
String groupPic,
String groupEx) {
this.groupName = groupName;
this.groupNm = groupNm;
this.groupState = groupState;
this.groupPic = groupPic;
this.groupEx = groupEx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@Repository
public interface GroupRepository extends JpaRepository<GroupEntity, Long> {
List<GroupEntity> findByGroupNameLike(String gName);//findByContentLike
List<GroupEntity> findByGroupNmLike(String groupNm);//findByContentLike
GroupEntity findByGroupCd(Long groupCd);
List<GroupEntity> findAllByGroupState(boolean state);
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public Long deleteGroup(@PathVariable Long groupCd) {
return groupCd;
}

@GetMapping("findGroup/{groupName}")
public List<GroupResponseDto> findAllGroup(@PathVariable String groupName) {
return groupService.findGroupByName(groupName);
@GetMapping("findGroup/{groupNm}")
public List<GroupResponseDto> findAllGroup(@PathVariable String groupNm) {
return groupService.findGroupByName(groupNm);
}

@GetMapping("{groupCd}")
Expand All @@ -81,10 +81,10 @@ List<GroupResponseDto> findAllGroup() {
}


@GetMapping("group/{userId}")
public List<GroupResponseDto> findUserGroup(@PathVariable Long userId) {
@GetMapping("group/{userCd}")
public List<GroupResponseDto> findUserGroup(@PathVariable Long userCd) {

return groupService.findUserGroups(userId);
return groupService.findUserGroups(userCd);
}

@GetMapping("member/{groupCd}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public GroupApplyResponseDto(GroupApplyEntity entity)
this.userNm = entity.getUserFK().getUserNm();
this.userId = entity.getUserFK().getUserId();
this.userPic= entity.getUserFK().getUserPic();
this.groupNm = entity.getGroupFK().getGroupName();
this.groupNm = entity.getGroupFK().getGroupNm();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public GroupResponseDto(GroupEntity entity)
{
this.groupCd = entity.getGroupCd();
this.userCd = entity.getGMstUserFK().getUserCd();
this.groupNm = entity.getGroupName();
this.groupNm = entity.getGroupNm();
this.groupState = entity.getGroupState();
this.groupEx = entity.getGroupEx();
this.groupPic = entity.getGroupPic();
Expand All @@ -32,7 +32,7 @@ public GroupResponseDto(GroupEntity entity, UserEntity user)
{
this.groupCd = entity.getGroupCd();
this.userCd = entity.getGMstUserFK().getUserCd();
this.groupNm = entity.getGroupName();
this.groupNm = entity.getGroupNm();
this.groupState = entity.getGroupState();
this.groupEx = entity.getGroupEx();
this.groupPic = entity.getGroupPic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public GroupEntity toEntity(UserEntity user, String url){
return GroupEntity.builder()
.gMstUserFK(user)
.groupEx(groupEx)
.groupName(groupNm)
.groupNm(groupNm)
.groupState(groupState)
.groupPic(url)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public Long updateGroupInfo(Long id, @RequestBody GroupUpdateRequestDto groupDto
}

@Transactional
public Long changGroupMaster(Long UserId, Long groupCd) {
public Long changGroupMaster(Long userCd, Long groupCd) {
GroupEntity groupEntity = groupRepository.findById(groupCd)
.orElseThrow(() -> new IllegalArgumentException("해당 그룹이 없습니다. id=" + groupCd));

UserEntity User = userService.findEntity(UserId);
UserEntity User = userService.findEntity(userCd);
groupEntity.updateGroupMaster(User);

return groupCd;
Expand Down Expand Up @@ -90,7 +90,7 @@ public List<GroupResponseDto> findAllGroup(){

@Transactional(readOnly = true)
public List<GroupResponseDto> findGroupByName(String groupName){
return groupRepository.findByGroupNameLike("%"+groupName+"%").stream()
return groupRepository.findByGroupNmLike("%"+groupName+"%").stream()
.map(GroupResponseDto::new)
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void cleanUp()

groupRepository.save(GroupEntity.builder()
.gMstUserFK(null)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(null)
.groupEx(groupEx)
Expand All @@ -51,7 +51,7 @@ public void cleanUp()
//then
GroupEntity groupEntity = groupList.get(0);
assertThat(groupEntity.getGroupEx()).isEqualTo(groupEx);
assertThat(groupEntity.getGroupName()).isEqualTo(groupName);
assertThat(groupEntity.getGroupNm()).isEqualTo(groupName);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void tearDown() throws Exception{

GroupEntity groupEntity = groupRepository.save( GroupEntity.builder()
.gMstUserFK(saveUser)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(groupPic)
.groupEx(groupEx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void tearDown() throws Exception{

List<GroupEntity> all = groupRepository.findAll();
assertThat(all.get(0).getGroupEx()).isEqualTo(groupEx);
assertThat(all.get(0).getGroupName()).isEqualTo(groupName);
assertThat(all.get(0).getGroupNm()).isEqualTo(groupName);
}


Expand All @@ -113,7 +113,7 @@ public void tearDown() throws Exception{

GroupEntity groupEntity = groupRepository.save( GroupEntity.builder()
.gMstUserFK(saveUser)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(groupPic)
.groupEx(groupEx)
Expand Down Expand Up @@ -141,7 +141,7 @@ public void tearDown() throws Exception{

List<GroupEntity> all = groupRepository.findAll();
assertThat(all.get(0).getGroupEx()).isEqualTo(groupEx2);
assertThat(all.get(0).getGroupName()).isEqualTo(groupName);
assertThat(all.get(0).getGroupNm()).isEqualTo(groupName);
}

@Test
Expand All @@ -160,13 +160,13 @@ public void tearDown() throws Exception{

GroupEntity groupEntity = groupRepository.save( GroupEntity.builder()
.gMstUserFK(saveUser)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(groupPic)
.groupEx(groupEx)
.build());

Long groupId = groupEntity.getGroupCd();
Long groupCd = groupEntity.getGroupCd();


UserEntity changeUser = userRepository.save(UserEntity.builder()
Expand All @@ -175,7 +175,7 @@ public void tearDown() throws Exception{
.userNm("테스트 유저222222")
.build());

String url = "http://localhost:" + port + "group/changeMaster/" + groupId;
String url = "http://localhost:" + port + "group/changeMaster/" + groupCd;
Long userCd = changeUser.getUserCd();
//when
ResponseEntity<Long> responseEntity = restTemplate.postForEntity(url,userCd,Long.class);
Expand All @@ -186,7 +186,7 @@ public void tearDown() throws Exception{

List<GroupEntity> all = groupRepository.findAll();
assertThat(all.get(0).getGMstUserFK().getUserCd()).isEqualTo(changeUser.getUserCd());
assertThat(all.get(0).getGroupName()).isEqualTo(groupName);
assertThat(all.get(0).getGroupNm()).isEqualTo(groupName);
}

@Test
Expand All @@ -206,15 +206,15 @@ public void tearDown() throws Exception{

GroupEntity groupEntity = groupRepository.save(GroupEntity.builder()
.gMstUserFK(saveUser)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(groupPic)
.groupEx(groupEx)
.build());

GroupEntity groupEntity2 = groupRepository.save(GroupEntity.builder()
.gMstUserFK(saveUser)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(groupPic)
.groupEx(groupEx)
Expand Down Expand Up @@ -249,7 +249,7 @@ public void tearDown() throws Exception{

GroupEntity groupEntity = groupRepository.save(GroupEntity.builder()
.gMstUserFK(saveUser)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(groupPic)
.groupEx(groupEx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void tearDown() throws Exception {

GroupEntity groupEntity = groupRepository.save(GroupEntity.builder()
.gMstUserFK(saveUser)
.groupName(groupName)
.groupNm(groupName)
.groupState(true)
.groupPic(groupPic)
.groupEx(groupEx)
Expand Down

0 comments on commit 551466e

Please sign in to comment.