feedback

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllHandlers

type AllHandlers struct {
	// contains filtered or unexported fields
}

AllHandlers contains multiple feedback HTTP handlers

func Handlers

func Handlers(ideaService IdeaService) AllHandlers

Handlers handles feedback based page

func (AllHandlers) Details

func (h AllHandlers) Details() app.HandlerFunc

Details shows details of given Idea by id

func (AllHandlers) List

func (h AllHandlers) List() app.HandlerFunc

List all tenant ideas

func (AllHandlers) PostComment

func (h AllHandlers) PostComment() app.HandlerFunc

PostComment creates a new comment on given idea

func (AllHandlers) PostIdea

func (h AllHandlers) PostIdea() app.HandlerFunc

PostIdea creates a new idea on current tenant

type Comment

type Comment struct {
	ID        int       `json:"id"`
	Content   string    `json:"content"`
	CreatedOn time.Time `json:"createdOn"`
	User      app.User  `json:"user"`
}

Comment represents an user comment on an idea

type Idea

type Idea struct {
	ID          int       `json:"id"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	CreatedOn   time.Time `json:"createdOn"`
	User        app.User  `json:"user"`
}

Idea represents an idea on a tenant board

type IdeaService

type IdeaService interface {
	GetByID(tenantID, ideaID int) (*Idea, error)
	GetCommentsByIdeaID(tenantID, ideaID int) ([]*Comment, error)
	GetAll(tenantID int) ([]*Idea, error)
	Save(tenantID, userID int, title, description string) (*Idea, error)
	AddComment(userID, ideaID int, content string) (int, error)
}

IdeaService contains read and write operations for ideas

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL