This API uses github.com/syariatifaris/arkeus
framework
Run migration files on files/migration
go get github.com/syariatifaris/newsfeed
dep ensure -v
-
GET:
news/gets/{status}
: Get all news by status, i.e: all (for all news), published, or etc. -
POST:
news/gets/topics
: Get all by topics (OR operand), i.e:politik
,teknologi
Request:
{ "topics": ["teknologi"] }
Response:
{ "data": [ { "news_id": 13, "title": "Flagship terbaru dari Samsung", "html_content": "Samsung mengeluarkan", "status": "published", "is_valid": 1 } ], "status": 200 }
-
POST:
news/add
. Add news by its topicRequest:
{ "news":{ "title": "Flagship terbaru dari Samsung", "html_content": "Samsung mengeluarkan", "status": "published" }, "topics": ["teknologi"] }
Response:
{ "data": { "news": { "news_id": 13, "title": "Flagship terbaru dari Samsung", "html_content": "Samsung mengeluarkan", "status": "published" }, "topics": [ "teknologi" ] }, "status": 200 }