From ba8d73aa8c30559a6550902335ca71c9e3b83d85 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 8 Jul 2018 10:00:17 +0200 Subject: [PATCH] update structure --- {root => controller}/authi.go | 0 {root => controller}/db/db.go | 0 {root => controller}/i.go | 2 +- cmd/test/main.go => main.go | 2 +- root/user/posti.go | 32 ------------------------------- root/useri.go | 36 ----------------------------------- 6 files changed, 2 insertions(+), 70 deletions(-) rename {root => controller}/authi.go (100%) rename {root => controller}/db/db.go (100%) rename {root => controller}/i.go (98%) rename cmd/test/main.go => main.go (93%) delete mode 100644 root/user/posti.go delete mode 100644 root/useri.go diff --git a/root/authi.go b/controller/authi.go similarity index 100% rename from root/authi.go rename to controller/authi.go diff --git a/root/db/db.go b/controller/db/db.go similarity index 100% rename from root/db/db.go rename to controller/db/db.go diff --git a/root/i.go b/controller/i.go similarity index 98% rename from root/i.go rename to controller/i.go index 82bbe53..2b5cc21 100644 --- a/root/i.go +++ b/controller/i.go @@ -1,7 +1,7 @@ package main import ( - "git.xdrm.io/example/aicra/root/db" + "git.xdrm.io/example/aicra/controller/db" e "git.xdrm.io/go/aicra/err" i "git.xdrm.io/go/aicra/implement" ) diff --git a/cmd/test/main.go b/main.go similarity index 93% rename from cmd/test/main.go rename to main.go index 7677cb2..fc95f82 100644 --- a/cmd/test/main.go +++ b/main.go @@ -1,4 +1,4 @@ -package main +package aicraserver import ( "git.xdrm.io/go/aicra" diff --git a/root/user/posti.go b/root/user/posti.go deleted file mode 100644 index 3797460..0000000 --- a/root/user/posti.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "fmt" - e "git.xdrm.io/go/aicra/err" - i "git.xdrm.io/go/aicra/implement" -) - -func Get(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("GET /user/post\n") - r.Set("method_test", "Get") - r.Err = e.Upload - return *r -} -func Post(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("POST /user/post\n") - r.Set("method_test", "Post") - r.Err = e.Download - return *r -} -func Put(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("PUT /user/post\n") - r.Set("method_test", "Put") - r.Err = e.MissingDownloadHeaders - return *r -} -func Delete(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("DELETE /user/post\n") - r.Set("method_test", "Delete") - r.Err = e.MissingDownloadBody - return *r -} diff --git a/root/useri.go b/root/useri.go deleted file mode 100644 index c81bd48..0000000 --- a/root/useri.go +++ /dev/null @@ -1,36 +0,0 @@ -package main - -import ( - "fmt" - e "git.xdrm.io/go/aicra/err" - i "git.xdrm.io/go/aicra/implement" -) - -func Get(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("GET /user\n") - r.Set("method_test", "Get") - r.Set("received_data", d) - r.Err = e.Upload - return *r -} -func Post(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("POST /user\n") - r.Set("method_test", "Post") - r.Set("received_data", d) - r.Err = e.Download - return *r -} -func Put(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("PUT /user\n") - r.Set("method_test", "Put") - r.Set("received_data", d) - r.Err = e.MissingDownloadHeaders - return *r -} -func Delete(d i.Arguments, r *i.Response) i.Response { - fmt.Printf("DELETE /user\n") - r.Set("method_test", "Delete") - r.Set("received_data", d) - r.Err = e.MissingDownloadBody - return *r -}