Giter Site home page Giter Site logo

20th-android-team-2-be's People

Contributors

icechoco avatar kimyubi avatar toastmeister1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

icechoco

20th-android-team-2-be's Issues

์ ˆ์•ฝ(Product)์„ ์ˆ˜์ •ํ•˜๋Š” API ๊ตฌํ˜„

์ ˆ์•ฝ ์ˆ˜์ • API ํ˜ธ์ถœ -- ์ˆ˜์ • ์„ฑ๊ณต
์ ˆ์•ฝ ์ˆ˜์ • APIํ˜ธ์ถœ (์ž˜๋ชป๋œ userId๋ฅผ ์ค€ ๊ฒฝ์šฐ) -- ์ˆ˜์ • ์‹คํŒจ (์‚ฌ์šฉ์ž ์ •๋ณด ์—†์Œ)
์ ˆ์•ฝ ์ˆ˜์ • API ํ˜ธ์ถœ(์ž˜๋ชป๋œ productId๋ฅผ ์ค€ ๊ฒฝ์šฐ) -- ์ˆ˜์ • ์‹คํŒจ(์ ˆ์•ฝ ์ •๋ณด ์—†์Œ)

์ ˆ์•ฝ(Product)์„ ์‚ญ์ œํ•˜๋Š” API ๊ตฌํ˜„

userId์™€ productId๊ฐ€ ์ผ์น˜ํ•  ๋•Œ --์‚ญ์ œ ์„ฑ๊ณต
์ ˆ์•ฝ์„ ๋งŒ๋“  ์‚ฌ๋žŒ์˜ userId์™€ ํ˜„์žฌ ์ ˆ์•ฝ์„ ์‚ญ์ œํ•˜๋ ค๋Š” ์‚ฌ์šฉ์ž ์•„์ด๋””๊ฐ€ ๋‹ค๋ฅผ ๋•Œ --์‚ญ์ œ ์‹คํŒจ: ์‚ฌ์šฉ์ž ์ •๋ณด ์—†์Œ
์ด๋ฏธ ์‚ญ์ œํ•œ ์ ˆ์•ฝ์— ๋Œ€ํ•ด ์‚ญ์ œ ์š”์ฒญ์„ ํ• ๋•Œ --์‚ญ์ œ ์‹คํŒจ: ์ ˆ์•ฝ ์ •๋ณด ์—†์Œ
productId๊ฐ€ ์ผ์น˜ํ•˜๋Š” ์ ˆ์•ฝ์ด ์—†์„ ๋•Œ --์‚ญ์ œ ์‹คํŒจ: ์ ˆ์•ฝ ์ •๋ณด ์—†์Œ

์ ˆ์•ฝ์„ ๋“ฑ๋กํ•˜๋Š” API ๊ตฌํ˜„

  • ProductController
  • ProductService
  • CreateProductRequest (DTO)
  • implementation 'org.springframework.boot:spring-boot-starter-validation' ์˜์กด์„ฑ ์ถ”๊ฐ€
  • ExceptionController (์œ ํšจ์„ฑ ๊ฒ€์ฆ์— ์‹คํŒจํ•œ RequestDTO์˜ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ํด๋ž˜์Šค)
    ๊ตฌํ˜„

์ž์ฒด SSL ์ธ์ฆ์„œ๋ฅผ ํ™œ์šฉํ•œ Http โ†’ Https๋กœ ์ „ํ™˜

[๊ตฌํ˜„ ํ•„์š”]

  • Http๋ฅผ Https๋กœ ์ „ํ™˜ํ•˜๊ธฐ
  • Http ์š”์ฒญ Https๋กœ redirect ํ•˜๊ธฐ

[๋น„๊ณ ]

  • ๊ณต์ธ SSL ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰๋ฐ›๊ธฐ ์œ„ํ•ด์„œ๋Š” ์œ ํšจํ•œ ๋„๋ฉ”์ธ์ด ํ•„์š”ํ•จ
    • ๋„๋ฉ”์ธ ๊ตฌ๋งค์— ๋Œ€ํ•ด์„œ๋Š” ์ถ”ํ›„ ๋…ผ์˜
    • ๋„๋ฉ”์ธ ๊ตฌ๋งค ์™„๋ฃŒ๋˜๋ฉด ๊ณต์ธ SSL ์ธ์ฆ์„œ ์‚ฌ์šฉ์œผ๋กœ ๋ณ€๊ฒฝํ•„์š”
  • ํ˜„์žฌ๋Š” ๋„๋ฉ”์ธ์ด ์—†์œผ๋ฏ€๋กœ ์ž์ฒด SSL ์ธ์ฆ์„œ๋ฅผ ์ด์šฉํ•œ Https ์‚ฌ์šฉ์œผ๋กœ ๊ตฌํ˜„

์ ˆ์•ฝ (Product) ๊ธฐ๋Šฅ ๊ตฌํ˜„

์ ˆ์•ฝ (Product) ๊ธฐ๋Šฅ ๊ตฌํ˜„

API ๊ฐœ๋ฐœ

  • ์ ˆ์•ฝ ๋ฆฌ์ŠคํŠธ ์ „์ฒด ์กฐํšŒ
  • ์ ˆ์•ฝ ๋“ฑ๋ก
  • ์ ˆ์•ฝ ์ˆ˜์ •
  • ์ ˆ์•ฝ ์‚ญ์ œ

ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ž‘์„ฑ

  • ProductController ํ…Œ์ŠคํŠธ ์ฝ”๋“œ
  • ProductService ํ…Œ์ŠคํŠธ ์ฝ”๋“œ

image

์ ˆ์•ฝ ๋ชฉ๋ก์„ ์กฐํšŒํ•˜๋Š” API ๊ตฌํ˜„

์ ˆ์•ฝ (Product)๋ฅผ ๋“ฑ๋กํ•˜์ง€ ์•Š์•„ ์ ˆ์•ฝ ๋ฆฌ์ŠคํŠธ๊ฐ€ ๋น„์–ด์žˆ๋Š” ๊ฒฝ์šฐ
ํ•ด๋‹น userId๋กœ ๋œ ์‚ฌ์šฉ์ž๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ
ํ•ด๋‹น userId๋กœ ๋œ ์‚ฌ์šฉ์ž๊ฐ€ ์กด์žฌํ•˜๊ณ  ์ ˆ์•ฝ ๋ฆฌ์ŠคํŠธ๋„ ๋น„์–ด์žˆ์ง€ ์•Š์€ ๊ฒฝ์šฐ๋กœ ๋‚˜๋ˆ„์–ด ์ž‘์—…

์š”์ฒญ์— ๋Œ€ํ•œ ์ ‘๊ทผ ๊ด€๋ฆฌ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

์š”์ฒญ์— ๋Œ€ํ•œ ์ ‘๊ทผ ๊ด€๋ฆฌ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

  • ์•„๋ž˜ 4๊ฐœ๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋“  ์š”์ฒญ์€ ์ธ์ฆ์ •๋ณด๋ฅผ ์ฒดํฌํ•œ๋‹ค
    • "/api/oauth/", "/api/token/", "/h2-console/", "/swagger-resources/"
  • ๋งŒ์•ฝ ์ ‘๊ทผํ•œ ์‚ฌ์šฉ์ž๊ฐ€ ๊ถŒํ•œ์ด ์—†์œผ๋ฉด(์ฆ‰, ํ† ํฐ์ด ์œ ํšจํ•˜์ง€ ์•Š๊ฑฐ๋‚˜ ์‚ฌ์šฉ์ž ์ •๋ณด๊ฐ€ ์—†์œผ๋ฉด) ์š”์ฒญ์„ ๊ฑฐ๋ถ€ํ•œ๋‹ค.
    • 401, Token not found
    • 401, Access Token expired
    • 401, Invalid Access Token
    • ๊ทธ ์™ธ 403 ๋ฐ˜ํ™˜

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.