NESOY / Snack-BE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snack News - BE

Build Status codecovCodacy Badge

WIKI

How to Run? ๐Ÿš€

SPRING_PROFILES_ACTIVE=dev ./gradlew clean bootRun  # DEV

API spec

Admin API

  • News ์ƒ์„ฑ
    • /admin/api/news (POST)

      {
          "title" : "NEWS TITLE", // ํ•„์ˆ˜
          "content" : "NEWS CONTENT", // ํ•„์ˆ˜
          "categoryId" : 1, // ํ•„์ˆ˜
          "topicIds" : [1, 2],
          "tagIds" : [1],
          "link" : "https://snack-link.com"
      }
  • News ๋ฆฌ์ŠคํŠธ ์กฐํšŒ
    • /admin/api/news/{page} (GET)

    • response ํ˜•์‹์€ ๋‹ค์Œ ์ด์Šˆ๋ฅผ ์ฐธ์กฐ

News API

  • ๋‹จ์ผ News ์กฐํšŒ
    • /api/news/{id} (GET)

  • ์กฐ๊ฑด์— ๋งž๋Š” News ๋ฆฌ์ŠคํŠธ ์กฐํšŒ
    • /api/news (GET)

      • ํ•„์ˆ˜ parameter: startDateTime, endDateTime
        • ๋‚ ์งœ ๊ฐ’์ด ์—†๊ฑฐ๋‚˜ ๋ถ€์ ์ ˆํ•  ์‹œ ์˜ˆ์™ธ ๋ฐœ์ƒ
        • ๋‚ ์งœ ๊ฐ’ ์กฐ๊ฑด: startDateTime์€ ์›”์š”์ผ, ๋‘ ๋‚ ์งœ์˜ ์ฐจ๋Š” ์ผ์ฃผ์ผ ์ดํ•˜, ๋‘ ๋‚ ์งœ๋Š” ๊ฐ™์€ ๋‹ฌ
      • ์˜ต์…˜ parameter: categoryId, topicIds, tagIds
    • ์š”์ฒญ ์˜ˆ)
      {
          http://{host}:{port}/api/news
          ?startDateTime=2019-07-01T00:00
          &endDateTime=2019-08-31T00:00
          &categoryId=1
          &topicIds=1,2
          &tagIds=1
      }
      
  • ์ฐธ๊ณ : startDateTime ๋‹น์ผ ๊ธฐ์ค€์˜ ๊ฐ€๊นŒ์šด ์›”์š”์ผ, endDateTime์€ ๋‹น์ผ์ด ๋””ํดํŠธ ๊ฐ’ ์ž…๋‹ˆ๋‹ค. (ํ•„์ˆ˜๋กœ ๋ณ€๊ฒฝ๋ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.)

Category API

  • ์ „์ฒด Category ๋ฆฌ์ŠคํŠธ ์กฐํšŒ
    • /api/category (GET)

Topic API

  • Topic ์ƒ์„ฑ
    • /api/topic (POST)

      {
          "name" : "์ฟ ํŒก", // ํ•„์ˆ˜
          "type" : "CORP" // ์ž…๋ ฅ ๊ถŒ์žฅ (๊ธฐ๋ณธ๊ฐ’ NONE)
      }
  • Topic ๋ฆฌ์ŠคํŠธ ์กฐํšŒ
    • /api/topic/{type} (GET)
      /api/topic/{type}?sort={ordering} (GET)

    • {type}: corp, person, field...
    • {ordering}: name(๊ธฐ๋ณธ๊ฐ’), id.
  • Topic ์ˆ˜์ •
    • /api/topic (PUT)

          {
              "id" : 4, // ํ•„์ˆ˜
              "name" : "๋”ฅ๋Ÿฌ๋‹", // ํ•„์ˆ˜
              "type" : "FIELD" // ํ•„์ˆ˜
          }

Tag API

  • Tag ์ƒ์„ฑ
    • /api/tag (POST)

          {
              "title" : "WEEKLY" // ํ•„์ˆ˜
          }
  • Tag ๋ฆฌ์ŠคํŠธ ์กฐํšŒ
    • /api/tag (GET)

  • Tag ์ˆ˜์ •
    • /api/tag (PUT)

          {
              "id" : 3, // ํ•„์ˆ˜
              "title" : "RECOMMEND" // ํ•„์ˆ˜
          }

About


Languages

Language:Java 68.6%Language:TSQL 28.1%Language:Shell 3.2%Language:JavaScript 0.1%