Skip to content

Commit

Permalink
Merge pull request #60 from gloddy-dev/fix/group
Browse files Browse the repository at this point in the history
[FIX]: 그룹 관련 네이밍 수정
  • Loading branch information
jihwan2da authored Jul 29, 2023
2 parents 5020495 + 4885335 commit c197f83
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/gloddy/server/group/domain/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class Group extends BaseTimeEntity {
@Column(name = "school")
private String school;

@Column(name = "file_url")
private String fileUrl;
@Column(name = "image_url")
private String imageUrl;

@Column(name = "title")
private String title;
Expand All @@ -56,10 +56,10 @@ public class Group extends BaseTimeEntity {
private GroupMemberVOs groupMemberVOs = GroupMemberVOs.empty();

@Builder
public Group(User captain, String fileUrl, String title, String content, GroupDateTime dateTime,
public Group(User captain, String imageUrl, String title, String content, GroupDateTime dateTime,
GroupPlace place, int maxUser, String school) {
this.captain = captain;
this.fileUrl = fileUrl;
this.imageUrl = imageUrl;
this.title = title;
this.content = content;
this.dateTime = dateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class GroupRequest {
@Getter
@Setter
public static class Create {
private String fileUrl;
private String imageUrl;
private String title;
private String content;
private LocalDate meetDate;
Expand Down
22 changes: 12 additions & 10 deletions src/main/java/com/gloddy/server/group/domain/dto/GroupResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@ public static class GetGroups {
@Getter
@AllArgsConstructor
public static class GetGroup {
Long groupId;
String imageUrl;
String title;
String content;
private Long groupId;
private String imageUrl;
private String title;
private String content;
// List<String> memberProfiles;
int memberCount;
String place;
String meetDate;
private int memberCount;
private int maxUser;
private String place;
private String meetDate;

public static GetGroup from(Group group) {
return new GetGroup(
group.getId(),
group.getFileUrl(),
group.getImageUrl(),
group.getTitle(),
group.getContent(),
group.getMemberCount(),
group.getMaxUser(),
group.getPlace().getName(),
dateToStringForGroupPreview(group.getMeetDate())
);
Expand All @@ -62,7 +64,7 @@ public static class GetGroupDetail {
private String title;
private String fileUrl;
private String content;
private int countParticipants;
private int memberCount;
private String meetDate;
private String startTime;
private String endTime;
Expand All @@ -88,7 +90,7 @@ public static class GetParticipatedGroup {
public static GetParticipatedGroup from(GroupMember groupMember) {
return new GetParticipatedGroup(
groupMember.getGroup().getId(),
groupMember.getGroup().getFileUrl(),
groupMember.getGroup().getImageUrl(),
groupMember.getGroup().getTitle(),
groupMember.getGroup().getContent(),
groupMember.getGroup().getMemberCount(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static GetGroupDetail mapToGetGroupDetailFrom(User user, Group group, Gro
groupChecker.isMyGroup(user, group),
groupChecker.isGroupCaptain(user, group),
group.getTitle(),
group.getFileUrl(),
group.getImageUrl(),
group.getContent(),
group.getMemberCount(),
group.getMeetDate().toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public Group getGroupFrom(User captain, GroupRequest.Create request) {
GroupPlace place = getGroupPlace(request.getPlace(), request.getPlace_latitude(), request.getPlace_longitude());
return Group.builder()
.captain(captain)
.fileUrl(request.getFileUrl())
.imageUrl(request.getImageUrl())
.title(request.getTitle())
.content(request.getContent())
.dateTime(dateTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ private GetGroup generateGroupDto(Scrap scrap) {
Group group = scrap.getGroup();
return new GetGroup(
group.getId(),
group.getFileUrl(),
group.getImageUrl(),
group.getTitle(),
group.getContent(),
Math.toIntExact(groupUserCountService.countUserInGroup(group.getId())),
group.getMemberCount(),
group.getMaxUser(),
group.getPlace().getName(),
group.getMeetDate().toString()
);
Expand Down

0 comments on commit c197f83

Please sign in to comment.