Skip to content

Commit

Permalink
api/news: prototype v2 controller
Browse files Browse the repository at this point in the history
  • Loading branch information
babygoat committed Jul 28, 2020
1 parent 3f6b2f1 commit c864622
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions news/controller.go
@@ -0,0 +1,32 @@
package news

import "github.com/gin-gonic/gin"

type newsStorage interface {
GetMetaOfPosts() ([]Post, error)
GetFullPosts() ([]Post, error)
GetMetaOfTopics() ([]Topic, error)
GetFullOfTopics() ([]Topic, error)

Count() (int, error)
}

type newsController struct {
Storage newsStorage
}

func NewController(s newsStorage) *newsController {
return &newsController{s}
}

func (nc *newsController) GetPosts(c *gin.Context) {
}

func (nc *newsController) GetAPost(c *gin.Context) {
}

func (nc *newsController) GetTopics(c *gin.Context) {
}

func (nc *newsController) GetATopic(c *gin.Context) {
}

0 comments on commit c864622

Please sign in to comment.