Skip to content

Commit

Permalink
Merge pull request #71 from HanRiverMeetup/issue-70
Browse files Browse the repository at this point in the history
#70 카테고리 목록을 불러오는 API 작성
  • Loading branch information
leemy0102 authored Aug 21, 2018
2 parents 147e65b + 3c4ac59 commit 4e5386a
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ private User submitFacebookLogin(String accessToken, String user_id)
return userInfo;
}


public User faceBookUserInfoValidate(String accessToken, String user_id)
throws Exception {
BufferedReader in = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.hangang.HangangRiver.meeting.dao;

import com.hangang.HangangRiver.meeting.model.Activity;

import java.util.List;

public interface ActivityMapper {
List<Activity> getAllActivities();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.hangang.HangangRiver.meeting.model.Comment;

public interface CommentMapper {
public void insert(Comment comment);
public void delete(int comment_seq);
public List<Comment> selectCommentList(int meeting_seq);
void insert(Comment comment);
void delete(int comment_seq);
List<Comment> selectCommentList(int meeting_seq);
}
31 changes: 31 additions & 0 deletions src/main/java/com/hangang/HangangRiver/meeting/model/Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.hangang.HangangRiver.meeting.model;

public class Activity {
private int activity_seq;
private String name;
private String description;

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public int getActivity_seq() {
return activity_seq;
}

public void setActivity_seq(int activity_seq) {
this.activity_seq = activity_seq;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.hangang.HangangRiver.meeting.service;

import com.hangang.HangangRiver.meeting.dao.ActivityMapper;
import com.hangang.HangangRiver.meeting.model.Activity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActivityService {
@Autowired
public ActivityMapper activityMapper;

public List<Activity> getAllActivities() {
return activityMapper.getAllActivities();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.hangang.HangangRiver.meeting.web;

import com.hangang.HangangRiver.meeting.model.Activity;
import com.hangang.HangangRiver.meeting.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/activity")
public class ActivityController {
@Autowired
ActivityService activityService;

@GetMapping("/all")
private ResponseEntity<List<Activity>> getAllActivities() {
return ResponseEntity.ok().body(activityService.getAllActivities());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hangang.HangangRiver.meeting.dao.ActivityMapper">
<select id="getAllActivities" resultType="com.hangang.HangangRiver.meeting.model.Activity">
SELECT *
FROM activity
</select>
</mapper>

0 comments on commit 4e5386a

Please sign in to comment.