|
|
@@ -2,10 +2,10 @@ package main
|
|
|
|
|
|
import (
|
|
|
"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/binding"
|
|
|
"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/infrastructure"
|
|
|
"git.sxidc.com/go-framework/baize/infrastructure/database/data_service"
|
|
|
@@ -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 PUT -H "Content-Type: application/json" -d '{"id":"9270f37031874ff985d34bff3ff5b23b", "name":"test-new"}' "http://localhost:10100/test/v1/class/update"
|
|
|
+// curl -X PUT -H "Content-Type: application/json" -d '{"id":"92cede40e5464ff79541418a7fc738ec", "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/get?id=9270f37031874ff985d34bff3ff5b23b"
|
|
|
-// curl -X DELETE "http://localhost:10100/test/v1/class/9270f37031874ff985d34bff3ff5b23b/delete"
|
|
|
+// curl -X GET "http://localhost:10100/test/v1/class/get?id=92cede40e5464ff79541418a7fc738ec"
|
|
|
+// curl -X DELETE "http://localhost:10100/test/v1/class/92cede40e5464ff79541418a7fc738ec/delete"
|
|
|
|
|
|
type CreateClassJsonBody struct {
|
|
|
Name string `json:"name" binding:"required" assign:"toField:Name"`
|
|
|
@@ -107,14 +107,11 @@ func main() {
|
|
|
DBExecutorType: binding.DBExecutorDataService,
|
|
|
DomainPath: "/class",
|
|
|
CreateJsonBody: &CreateClassJsonBody{},
|
|
|
- CreateNeedTx: false,
|
|
|
DeleteQueryParams: &DeleteClassPathParams{},
|
|
|
- DeleteNeedTx: false,
|
|
|
UpdateJsonBody: &UpdateClassJsonBody{},
|
|
|
- UpdateNeedTx: true,
|
|
|
QueryParams: &QueryClassesQueryParams{},
|
|
|
GetByIDQueryParams: &GetClassQueryParams{},
|
|
|
- })
|
|
|
+ }, entity.WithUpdateTx[ClassInfo](), entity.WithDeleteTx[ClassInfo]())
|
|
|
|
|
|
go func() {
|
|
|
err := app.Start()
|