|
@@ -2,10 +2,10 @@ package main
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"git.sxidc.com/go-framework/baize"
|
|
"git.sxidc.com/go-framework/baize"
|
|
|
- "git.sxidc.com/go-framework/baize/ convenient/entity"
|
|
|
|
|
"git.sxidc.com/go-framework/baize/application"
|
|
"git.sxidc.com/go-framework/baize/application"
|
|
|
"git.sxidc.com/go-framework/baize/binding"
|
|
"git.sxidc.com/go-framework/baize/binding"
|
|
|
"git.sxidc.com/go-framework/baize/binding/request"
|
|
"git.sxidc.com/go-framework/baize/binding/request"
|
|
|
|
|
+ "git.sxidc.com/go-framework/baize/convenient/entity"
|
|
|
"git.sxidc.com/go-framework/baize/domain"
|
|
"git.sxidc.com/go-framework/baize/domain"
|
|
|
"git.sxidc.com/go-framework/baize/infrastructure"
|
|
"git.sxidc.com/go-framework/baize/infrastructure"
|
|
|
"git.sxidc.com/go-framework/baize/infrastructure/database/operations"
|
|
"git.sxidc.com/go-framework/baize/infrastructure/database/operations"
|
|
@@ -15,10 +15,10 @@ import (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// curl -X POST -H "Content-Type: application/json" -d '{"name":"test", "studentNum": 10}' "http://localhost:10100/test/v1/class/create"
|
|
// curl -X POST -H "Content-Type: application/json" -d '{"name":"test", "studentNum": 10}' "http://localhost:10100/test/v1/class/create"
|
|
|
-// curl -X PUT -H "Content-Type: application/json" -d '{"id":"f4fac01661704c5985bfc009f0fe6c3e", "name":"test-new"}' "http://localhost:10100/test/v1/class/update"
|
|
|
|
|
|
|
+// curl -X PUT -H "Content-Type: application/json" -d '{"id":"1a8d5cf5c4574430903e7cfcf2f13e4f", "name":"test-new"}' "http://localhost:10100/test/v1/class/update"
|
|
|
// curl -X GET "http://localhost:10100/test/v1/class/query?name=test-new&pageNo=1&pageSize=1"
|
|
// curl -X GET "http://localhost:10100/test/v1/class/query?name=test-new&pageNo=1&pageSize=1"
|
|
|
-// curl -X GET "http://localhost:10100/test/v1/class/get?id=f4fac01661704c5985bfc009f0fe6c3e"
|
|
|
|
|
-// curl -X DELETE "http://localhost:10100/test/v1/class/f4fac01661704c5985bfc009f0fe6c3e/delete"
|
|
|
|
|
|
|
+// curl -X GET "http://localhost:10100/test/v1/class/get?id=1a8d5cf5c4574430903e7cfcf2f13e4f"
|
|
|
|
|
+// curl -X DELETE "http://localhost:10100/test/v1/class/1a8d5cf5c4574430903e7cfcf2f13e4f/delete"
|
|
|
|
|
|
|
|
type CreateClassJsonBody struct {
|
|
type CreateClassJsonBody struct {
|
|
|
Name string `json:"name" binding:"required" assign:"toField:Name"`
|
|
Name string `json:"name" binding:"required" assign:"toField:Name"`
|
|
@@ -152,11 +152,8 @@ func main() {
|
|
|
DBExecutorType: binding.DBExecutorOperations,
|
|
DBExecutorType: binding.DBExecutorOperations,
|
|
|
DomainPath: "/class",
|
|
DomainPath: "/class",
|
|
|
CreateJsonBody: &CreateClassJsonBody{},
|
|
CreateJsonBody: &CreateClassJsonBody{},
|
|
|
- CreateNeedTx: true,
|
|
|
|
|
DeleteQueryParams: &DeleteClassPathParams{},
|
|
DeleteQueryParams: &DeleteClassPathParams{},
|
|
|
- DeleteNeedTx: false,
|
|
|
|
|
UpdateJsonBody: &UpdateClassJsonBody{},
|
|
UpdateJsonBody: &UpdateClassJsonBody{},
|
|
|
- UpdateNeedTx: false,
|
|
|
|
|
QueryParams: &QueryClassesQueryParams{},
|
|
QueryParams: &QueryClassesQueryParams{},
|
|
|
GetByIDQueryParams: &GetClassQueryParams{},
|
|
GetByIDQueryParams: &GetClassQueryParams{},
|
|
|
}, entity.WithCreateTx[ClassInfo]())
|
|
}, entity.WithCreateTx[ClassInfo]())
|