Skip to content

Commit

Permalink
Merge pull request #104 from HanRiverMeetup/issue-103
Browse files Browse the repository at this point in the history
#103 타임라인 모델에 닉네임 값 추가
  • Loading branch information
leemy0102 authored Sep 18, 2018
2 parents d439f57 + b0f32d0 commit 84b4d63
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ public class AccessController {
private ResponseEntity<User> login(HttpServletRequest request, @RequestBody User user)
throws Exception {

// User retUser = submitFacebookLogin(user.getAccess_token(), user);
//
// if(retUser == null) {
// throw new LoginValidateException();
// }
//
// return ResponseEntity.ok().body(retUser);

if(isValidFacebookUser(user.getAccess_token(), user.getUser_id())) {
User loginedUser = userLogin(user);

Expand Down Expand Up @@ -69,16 +61,6 @@ private ResponseEntity<User> register(HttpServletRequest request, @RequestBody U
throw new NotExistFacebookUserException();

}
//
// private User submitFacebookLogin(String accessToken, User user)
// throws Exception {
// if (isValidFacebookUser(accessToken, user.getUser_id())){
// facebookUser.setFcm_token(user.getFcm_token());
// return checkUserInfo(facebookUser);
// }
//
// throw new NotExistFacebookUserException();
// }

public boolean isValidFacebookUser(String accessToken, String userID)
throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface TimeLineMapper {
int insert(TimeLine timeLine);
void delete(int timeLine_seq);
List<TimeLineForm> selectTimeLineList(TimeLineForm timeLineForm);
List<TimeLineForm> selectTimeLineListWithOffset(@Param("creation_time") String meeting_time,
List<TimeLineForm> selectTimeLineListWithOffset(@Param("creation_time") String creation_time,
@Param("offset") Integer offset,
@Param("limit") Integer limit);
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ public String toString() {
return "TimeLine [timeline_seq=" + timeline_seq + ", user_id=" + user_id + ", location=" + location
+ ", imageurl=" + imageurl + ", content=" + content + ", creation_time=" + creation_time + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public class TimeLineForm extends TimeLine {
private String startTime;
private String endTime;
private String nickname;

public String getStartTime() {
return startTime;
Expand All @@ -20,6 +21,14 @@ public void setEndTime(String endTime) {
this.endTime = endTime;
}

public String getNickname() {
return nickname;
}

public void setNickname(String nickname) {
this.nickname = nickname;
}

@Override
public String toString() {
return "MeetingDetailForm [startTime=" + startTime + ", endTime=" + endTime + "]";
Expand Down
23 changes: 19 additions & 4 deletions src/main/resources/com/hangang/HangangRiver/TimeLineMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,29 @@
</if>
</select>

<!--<select id="selectTimeLineListWithOffset" resultType="com.hangang.HangangRiver.timeline.model.TimeLineForm">-->
<!--SELECT-->
<!--*-->
<!--FROM-->
<!--timeline-->
<!--WHERE-->
<!--DATE(#{creation_time}) = DATE(creation_time)-->
<!--ORDER BY-->
<!--creation_time DESC LIMIT #{limit} OFFSET #{offset}-->
<!--</select>-->

<select id="selectTimeLineListWithOffset" resultType="com.hangang.HangangRiver.timeline.model.TimeLineForm">
SELECT
*
t1.*, t2.nickname
FROM
timeline
hanriver_meeting.timeline t1
LEFT JOIN
hanriver_meeting.user t2
ON
t1.user_id = t2.user_id
WHERE
DATE(#{creation_time}) = DATE(creation_time)
DATE(#{creation_time}) = DATE(t1.creation_time)
ORDER BY
creation_time DESC LIMIT #{limit} OFFSET #{offset}
t1.creation_time DESC LIMIT #{limit} OFFSET #{offset}
</select>
</mapper>

0 comments on commit 84b4d63

Please sign in to comment.