Code Monkey home page Code Monkey logo

ggum_backend's Introduction

서버

DB

  1. 인스턴스 세팅
  2. RDS (Relative Database Service) 인스턴스 생성
  3. 생성한 DB 인스턴스 정보 : 링크 에서 직접 확인 가능
    1. 마스터 암호 : hongik45
    2. 마스터 사용자 이름 admin
    3. DB 인스턴스 식별자 (이름) : honggumDB
    4. 포트 : 3306
    5. host (엔드포인트) : honggumdb.capnwelofgc3.ap-northeast-2.rds.amazonaws.com

user

'/users/login'

[POST] http://43.200.185.250:5000/users/login
request{
	"student_number" : "C111075"
	"password": "1234"
}

return { 
    "msg": "로그인 성공",
    "id" : result[1],
    "username" : result[2]

	또는

    "msg": "사용자 조회 실패",
}

'/users/register'

 [POST] http://43.200.185.250:5000/users/register
{
	"name": "HYEJIN",
	"student_number" : "C111075",
	"cohort": 47,
	"password":"1234"
}
  
return {
    "msg": "사용자 등록 성공"
}

diary

'/diaries/ { string : date }'

ex) http://127.0.0.1:5000/diaries/2024-01-17

[GET]  date를 입력받아 해당 날짜에 등록된 diary 의 {id, title, user_name} 을 반환.
request { 없음 }
return {
               [ "diary_id" : id {int 타입}
                "title" : "제목",
                "user_name" : "사용자 이름,
		] 의 리스트
            }
[POST] new_diary 를 DB에 추가하고 새로 생성한 diary의 id를 반환한다. date는 위와 같이 path 파라미터로 넘겨줌

request {
	"user_id" : 1,
	"title": "2024새해 첫운동",
	"content": "2024년이다 난 24살이다 "
}
return {
            "msg": "diary created successfully",
            "diary id": new_diary_id
        }

'/diaries/ { string : date }/{ int : user_id }'

[PUT] 특정 날짜에 특정 사용자가 작성한 diary 내용을 수정
request {
	id: #수정할 diary 선택
	user_id: #작성자만 수졍 가능하도록 확인
	title:
	content:
}
return{
            "msg": "일기 수정 완료"
            }
[DELETE]  특정 날짜에 특정 사용자가 작성한 diary를 삭제
request { 없음 }
return {
            "msg": "일기 삭제 완료"
            }

notice

'/notices'

[GET] 최근 n개 공지를 반환, , http://127.0.0.1:5000/notice?count=n 꼴로 요청

[POST]
request {
	user_id: 
	title :
	content :
}
return {
            "notice_id list": [
        11,
        10,
        9,
        8,
        7
    ]
    }

'/notices/{ int : notice_id }'

[PUT]
request {
	user_id : # 작성자만 수정 가능하도록 확인 위함 
	title : 
	content :
}
	#last_edit_at 업데이트 필요

return{
	'msg' : '작성자와 일치하지 않습니다 / 공지 수정 완료'
}
[DELETE]
request {
	user_id: #작성자만 삭제 가능하도록 확인
}
return{
	'msg' : '작성자와 일치하지 않습니다 / 공지 삭제 완료'
}

survey

'/surveys'

[POST]
request {
        'survey_date':
        'user_id':
        'title': 
        'description'
}
return {
        'msg': 투표 등록 완료,
        'id': new_id
    }
[GET] 활성화중인 survey를 로드
return {
        survey ids : [
		    3,
		    7,
		    8,
		    9,
		    10,
		    11,
		    12
		]
}

'/surveys/ { int : survey_id }'

[GET] 해당 survey의 정보를 로드
return {
	"desc": "테스트공지3입니다",
    "survey date": "Thu, 18 Jan 2024 00:00:00 GMT",
    "title": "테스트공지3"
    }
[PUT] 투표 게시글 수정
request{
        "survey_date:
        "user_id":
        "title": 
        "description"
        "isactive"
중 수정 원하는 항목
}
[DELETE] 투표 게시글 삭제
request {
         "user_id" : 1
}

'/surveys/ { int : survey_id } /participant'

[POST] survey에 attendee 등록
request { "attendee_id" : 1 }
return { "msg" } 

[GET ] 해당 survey에 참석한 attendee를 로드
{ id 리스트}

[DELETE] 해당 survey 에 투표한 attendee를 삭제
request  {
    "attendee_id" : 3
}
return {
    "msg": "투표 취소 완료"
}


[DELETE] 투표취소
request { 'user_id' : id}
return { 'msg' : "투표글 삭제 완료/ 작성자와 일치하지 않습니다" } 

ggum_backend's People

Contributors

phj0407 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.