summaryrefslogtreecommitdiffstats
path: root/golang/api/handlers/editing.go
blob: b0c006cb1ef0ae7f614101799ccc4f09072f2549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

package handlers

import (
    "github.com/go-pg/pg"
    //"github.com/go-openapi/swag"
    "github.com/go-openapi/runtime/middleware"
    //log "github.com/sirupsen/logrus"

	//"git.archive.org/bnewbold/fatcat/golang/gen/models"
	"git.archive.org/bnewbold/fatcat/golang/gen/restapi/operations"
)

type Editor struct {
    Id          int64
    Username    string
    IsAdmin     bool
    ActiveEditgroupId   int64
    ActiveEditgroup     *Editgroup
}

type Editgroup struct {
    Id              int64
    ExtraJson       string
    EditorId        int64
    Editor          *Editor
    Description     string
}

type Changelog struct {
    Id              int64
    EditgroupId     int64
    Editgroup       *Editgroup
    Timestamp       string // XXX: timestamp
}

func GetOrCreateEditgroup() Editgroup {
    // XXX
    eg := Editgroup{}
    return eg
}

func NewGetEditorUsernameHandler(db *pg.DB) operations.GetEditorUsernameHandler {
    return &getEditorUsername{db: db}
}
type getEditorUsername struct {
    db *pg.DB
}
func (d *getEditorUsername) Handle(params operations.GetEditorUsernameParams) middleware.Responder {
    return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
}


func NewGetEditorUsernameChangelogHandler(db *pg.DB) operations.GetEditorUsernameChangelogHandler {
    return &getEditorUsernameChangelog{db: db}
}
type getEditorUsernameChangelog struct {
    db *pg.DB
}
func (d *getEditorUsernameChangelog) Handle(params operations.GetEditorUsernameChangelogParams) middleware.Responder {
    return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
}

func NewGetEditgroupIDHandler(db *pg.DB) operations.GetEditgroupIDHandler {
    return &getEditgroupID{db: db}
}
type getEditgroupID struct {
    db *pg.DB
}
func (d *getEditgroupID) Handle(params operations.GetEditgroupIDParams) middleware.Responder {
    return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
}

/*
func NewGetEditgroupIDHandler(db *pg.DB) operations.GetEditgroupIDHandler {
    return &getEditgroupID{db: db}
}
type getCreatorID struct {
    db *pg.DB
}
func (d *getCreatorID) Handle(params operations.GetEditgroupIDParams) middleware.Responder {
    return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
}
*/

func NewPostEditgroupHandler(db *pg.DB) operations.PostEditgroupHandler {
    return &postEditgroup{db: db}
}
type postEditgroup struct {
    db *pg.DB
}
func (d *postEditgroup) Handle(params operations.PostEditgroupParams) middleware.Responder {
    return middleware.NotImplemented("operation .PostEditgroupID has not yet been implemented")
}

func NewPostEditgroupIDAcceptHandler(db *pg.DB) operations.PostEditgroupIDAcceptHandler {
    return &postEditgroupIDAccept{db: db}
}
type postEditgroupIDAccept struct {
    db *pg.DB
}
func (d *postEditgroupIDAccept) Handle(params operations.PostEditgroupIDAcceptParams) middleware.Responder {
    return middleware.NotImplemented("operation .PostEditgroupIDAcceptID has not yet been implemented")
}