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
package crm
/*
Hello! This file is auto-generated from `docs/src/spec.json`.
For development:
In order to update the generated files, edit this file under the location,
add your struct fields, imports, API definitions and whatever you want, and:
1. run [spec](https://github.com/titpetric/spec) in the same folder,
2. run `./_gen.php` in this folder.
You may edit `module.go`, `module.util.go` or `module_test.go` to
implement your API calls, helper functions and tests. The file `module.go`
is only generated the first time, and will not be overwritten if it exists.
*/
import (
"net/http"
"github.com/titpetric/factory/resputil"
)
func (mh *ModuleHandlers) List(w http.ResponseWriter, r *http.Request) {
params := moduleListRequest{}.new()
resputil.JSON(w, params.Fill(r), func() (interface{}, error) { return mh.Module.List(params) })
}
func (mh *ModuleHandlers) Edit(w http.ResponseWriter, r *http.Request) {
params := moduleEditRequest{}.new()
resputil.JSON(w, params.Fill(r), func() (interface{}, error) { return mh.Module.Edit(params) })
}
func (mh *ModuleHandlers) ContentList(w http.ResponseWriter, r *http.Request) {
params := moduleContentListRequest{}.new()
resputil.JSON(w, params.Fill(r), func() (interface{}, error) { return mh.Module.ContentList(params) })
}
func (mh *ModuleHandlers) ContentEdit(w http.ResponseWriter, r *http.Request) {
params := moduleContentEditRequest{}.new()
resputil.JSON(w, params.Fill(r), func() (interface{}, error) { return mh.Module.ContentEdit(params) })
}
func (mh *ModuleHandlers) ContentDelete(w http.ResponseWriter, r *http.Request) {
params := moduleContentDeleteRequest{}.new()
resputil.JSON(w, params.Fill(r), func() (interface{}, error) { return mh.Module.ContentDelete(params) })
}