| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package main
- import (
- "git.sxidc.com/go-framework/baize/examples/examples/project/application"
- DEATH "github.com/vrecan/death"
- "syscall"
- )
- // Version
- // curl -X GET "http://localhost:31000/example/version"
- // Configuration
- // curl -X POST -H "Content-Type: application/json" -d '{"scope": "global", "group":"test", "value":"test-value"}' "http://localhost:31000/example/v1/configuration/create"
- // curl -X GET "http://localhost:31000/example/v1/configuration/values?scope=global&group=test&pageNo=1&pageSize=1"
- // curl -X POST -H "Content-Type: application/json" -d '{"scope": "global", "group":"test"}' "http://localhost:31000/example/v1/configuration/delete"
- // Class
- // curl -X POST -H "Content-Type: application/json" -d '{"name":"test", "studentNum": 10}' "http://localhost:31000/example/v1/class/create"
- // curl -X PUT -H "Content-Type: application/json" -d '{"id":"3ca731da91cc42c9b9f413c1b493133d", "name":"test-new"}' "http://localhost:31000/example/v1/class/update"
- // curl -X GET "http://localhost:31000/example/v1/class/query?name=test-new&pageNo=1&pageSize=1"
- // curl -X GET "http://localhost:31000/example/v1/class/get?id=3ca731da91cc42c9b9f413c1b493133d"
- // curl -X DELETE "http://localhost:31000/example/v1/class/3ca731da91cc42c9b9f413c1b493133d/delete"
- // Student
- // curl -X POST -H "Content-Type: application/json" -d '{"name":"test"}' "http://localhost:31000/example/v1/student/create"
- // curl -X PUT -H "Content-Type: application/json" -d '{"id":"6e12ee71397746b8920fa94e5f229366", "name":"test-new"}' "http://localhost:31000/example/v1/student/update"
- // curl -X GET "http://localhost:31000/example/v1/student/query?name=test-new&pageNo=1&pageSize=1"
- // curl -X GET "http://localhost:31000/example/v1/student/get?id=6e12ee71397746b8920fa94e5f229366"
- // curl -X DELETE "http://localhost:31000/example/v1/student/6e12ee71397746b8920fa94e5f229366/delete"
- // Family
- // curl -X POST -H "Content-Type: application/json" -d '{"father":"father", "mother": "mother"}' "http://localhost:31000/example/v1/family/create"
- // curl -X PUT -H "Content-Type: application/json" -d '{"id":"8a3af91da12c4a3eb040ffb535693f1a", "father":"new-father", "mother": "new-mother"}' "http://localhost:31000/example/v1/family/update"
- // curl -X GET "http://localhost:31000/example/v1/family/query?father=new-father&pageNo=0&pageSize=0"
- // curl -X GET "http://localhost:31000/example/v1/family/get?id=8a3af91da12c4a3eb040ffb535693f1a"
- // curl -X DELETE "http://localhost:31000/example/v1/family/8a3af91da12c4a3eb040ffb535693f1a/delete"
- // Student-Family
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"fc3e96926aac46268ae783c4ad675d43", "familyId": "ed86bbb59a80429eb654d7f9f13ff116"}' "http://localhost:31000/example/v1/student/family/update"
- // curl -X GET "http://localhost:31000/example/v1/student/family/query?id=fc3e96926aac46268ae783c4ad675d43"
- // Family-Student
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"ed86bbb59a80429eb654d7f9f13ff116", "studentId": "fc3e96926aac46268ae783c4ad675d43"}' "http://localhost:31000/example/v1/family/student/update"
- // curl -X GET "http://localhost:31000/example/v1/family/student/query?id=ed86bbb59a80429eb654d7f9f13ff116"
- func main() {
- application.NewApp()
- defer application.DestroyApp()
- go func() {
- err := application.Start()
- if err != nil {
- panic(err)
- }
- }()
- defer func() {
- err := application.Finish()
- if err != nil {
- panic(err)
- }
- }()
- death := DEATH.NewDeath(syscall.SIGINT, syscall.SIGTERM)
- _ = death.WaitForDeath()
- }
|