Skip to content

hiblue02/stock-timeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

stock-timeline

하고 싶었던 것

  • 주식 가격, 일자와 관련된 기록(설명)을 입력하고, 그래프로 보여주는 어플리케이션을 만들고 싶었다.

구현한 것

메인

stock-timeline-main.png

주식 차트 목록

stock-timeline-chart-list.png

GET / charts 주식 차트 목록 조회
Parameters
  • None
Responses
  • http code: 200
  • content-type: application/json;charset=UTF-8
  • response:
      [{"id":1,"title":"example1234","updateDateTime":"2024-09-19T23:46:25.303502"}] 
GET / charts/download 주식 차트 샘플 다운로드
Parameters
  • None
Responses
  • http code: 200
  • content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • response: None
GET / charts/{chartId}/download 주식 차트 다운로드
Parameters
  • chartId (Long)
Responses
  • http code: 200
  • content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • response: None

주식 차트 등록/수정

stock-timeline-chart-create.png

POST / charts/upload 주식 차트 엑셀파일 등록
Parameters
  • title (String)
  • file (MultipartFile)
Responses
  • http code: 200
  • content-type: None
  • response: None
POST / charts/{chartId}/upload 주식 차트 엑셀파일 재등록
Parameters
  • chartId (Long)
  • title (String)
  • file (MultipartFile)
Responses
  • http code: 200
  • content-type: None
  • response: None

주식 차트 그래프 보기

stock-timeline-graph.png

GET / charts/{chartId}/day 일간 차트 조회
Parameters
  • chartId (Long)
Responses
  • http code: 200

  • content-type: application/json

  • response :

    [
        {
            "date": "2024-01-01",
            "price": 20000.0,
            "description": "Sample day record"
        },
        {  
            "date": "2024-01-02",
            "price": 10000.0,
            "description": "Sample day record"
        },
        {
            "date": "2024-01-03",
            "price": 22348.0,
            "description": "Sample day record"
        }
    ]
GET / charts/{chartId}/day 일간 차트 조회
Parameters
  • chartId (Long)
Responses
  • http code: 200

  • content-type: application/json

  • response :

    [
        {
            "date": "2024-01-01",
            "price": 20000.0,
            "description": "Sample day record"
        },
        {  
            "date": "2024-01-02",
            "price": 10000.0,
            "description": "Sample day record"
        },
        {
            "date": "2024-01-03",
            "price": 22348.0,
            "description": "Sample day record"
        }
    ]
GET / charts/{chartId}/week 주간 차트 조회
Parameters
  • chartId (Long)
Responses
  • http code: 200
  • content-type: application/json
  • response :
    [
      {
        "date": "2024-01-01",
        "price": 20000.0,
        "description": "Sample week record"
      },
      {
        "date": "2024-01-08",
        "price": 10000.0,
        "description": "Sample week record"
      },
      {
        "date": "2024-01-15",
        "price": 22348.0,
        "description": "Sample week record"
      }
    ]
GET / charts/{chartId}/month 월간 차트 조회
Parameters
  • chartId (Long)
Responses
  • http code: 200
  • content-type: application/json
  • response :
    [
      {
        "date": "2024-01-01",
        "price": 20000.0,
        "description": "Sample month record"
      },
      {
        "date": "2024-02-01",
        "price": 10000.0,
        "description": "Sample month record"
      },
      {
        "date": "2024-03-01",
        "price": 22348.0,
        "description": "Sample month record"
      }
    ]

새롭게 알게 된 것: CORS - Cross-Origin Resource Sharing

프론트엔드 서버와 백엔드 서버를 따로 구성하면, 백엔드 서버에서 다른 주소의 요청을 받을 수 있도록 설정해야 한다.

같은 출처(주소)가 같은 곳에 대한 요청만 허용하는 것이 기본 설정이기 때문이다.

스프링 웹 서블릿에서는 CorsResitory로 설정할 수 있다.

@Configuration
class WebMnbConfig : WebMvcConfigurer {

    override fun addCorsMappings(registry: CorsRegistry) {
        registry.addMapping("/**")
            .allowedOrigins("*")
            .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
        super.addCorsMappings(registry)
    }
}

사용 기술 스택

ui

Flutter(Dart)

server

JPA, Kotiln, H2 Database, SpringBoot, Gradle

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors