|
|
@@ -9,10 +9,10 @@ import (
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
|
+ "github.com/miniflux/miniflux/http/handler"
|
|
|
"github.com/miniflux/miniflux/integration"
|
|
|
"github.com/miniflux/miniflux/logger"
|
|
|
"github.com/miniflux/miniflux/model"
|
|
|
- "github.com/miniflux/miniflux/server/core"
|
|
|
"github.com/miniflux/miniflux/storage"
|
|
|
)
|
|
|
|
|
|
@@ -129,7 +129,7 @@ type Controller struct {
|
|
|
}
|
|
|
|
|
|
// Handler handles Fever API calls
|
|
|
-func (c *Controller) Handler(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) Handler(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
switch {
|
|
|
case request.HasQueryParam("groups"):
|
|
|
c.handleGroups(ctx, request, response)
|
|
|
@@ -174,7 +174,7 @@ The “Sparks” super group is not included in this response and is composed of
|
|
|
is_spark equal to 1.
|
|
|
|
|
|
*/
|
|
|
-func (c *Controller) handleGroups(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleGroups(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Fetching groups for userID=%d", userID)
|
|
|
|
|
|
@@ -224,7 +224,7 @@ should be limited to feeds with an is_spark equal to 0.
|
|
|
|
|
|
For the “Sparks” super group the items should be limited to feeds with an is_spark equal to 1.
|
|
|
*/
|
|
|
-func (c *Controller) handleFeeds(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleFeeds(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Fetching feeds for userID=%d", userID)
|
|
|
|
|
|
@@ -277,7 +277,7 @@ A PHP/HTML example:
|
|
|
|
|
|
echo '<img src="data:'.$favicon['data'].'">';
|
|
|
*/
|
|
|
-func (c *Controller) handleFavicons(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleFavicons(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Fetching favicons for userID=%d", userID)
|
|
|
|
|
|
@@ -330,7 +330,7 @@ Three optional arguments control determine the items included in the response.
|
|
|
(added in API version 2)
|
|
|
|
|
|
*/
|
|
|
-func (c *Controller) handleItems(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleItems(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
var result itemsResponse
|
|
|
|
|
|
userID := ctx.UserID()
|
|
|
@@ -414,7 +414,7 @@ with the remote Fever installation.
|
|
|
A request with the unread_item_ids argument will return one additional member:
|
|
|
unread_item_ids (string/comma-separated list of positive integers)
|
|
|
*/
|
|
|
-func (c *Controller) handleUnreadItems(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleUnreadItems(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Fetching unread items for userID=%d", userID)
|
|
|
|
|
|
@@ -445,7 +445,7 @@ with the remote Fever installation.
|
|
|
|
|
|
saved_item_ids (string/comma-separated list of positive integers)
|
|
|
*/
|
|
|
-func (c *Controller) handleSavedItems(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleSavedItems(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Fetching saved items for userID=%d", userID)
|
|
|
|
|
|
@@ -473,7 +473,7 @@ func (c *Controller) handleSavedItems(ctx *core.Context, request *core.Request,
|
|
|
as=? where ? is replaced with read, saved or unsaved
|
|
|
id=? where ? is replaced with the id of the item to modify
|
|
|
*/
|
|
|
-func (c *Controller) handleWriteItems(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleWriteItems(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Receiving mark=item call for userID=%d", userID)
|
|
|
|
|
|
@@ -527,7 +527,7 @@ func (c *Controller) handleWriteItems(ctx *core.Context, request *core.Request,
|
|
|
id=? where ? is replaced with the id of the feed or group to modify
|
|
|
before=? where ? is replaced with the Unix timestamp of the the local client’s most recent items API request
|
|
|
*/
|
|
|
-func (c *Controller) handleWriteFeeds(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleWriteFeeds(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Receiving mark=feed call for userID=%d", userID)
|
|
|
|
|
|
@@ -567,7 +567,7 @@ func (c *Controller) handleWriteFeeds(ctx *core.Context, request *core.Request,
|
|
|
id=? where ? is replaced with the id of the feed or group to modify
|
|
|
before=? where ? is replaced with the Unix timestamp of the the local client’s most recent items API request
|
|
|
*/
|
|
|
-func (c *Controller) handleWriteGroups(ctx *core.Context, request *core.Request, response *core.Response) {
|
|
|
+func (c *Controller) handleWriteGroups(ctx *handler.Context, request *handler.Request, response *handler.Response) {
|
|
|
userID := ctx.UserID()
|
|
|
logger.Debug("[Fever] Receiving mark=group call for userID=%d", userID)
|
|
|
|