123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- package main
- import (
- "baize-demo/project/server_ds/application"
- DEATH "github.com/vrecan/death"
- "syscall"
- )
- // Version
- // curl -X GET "http://localhost:31000/example/api/version"
- // Configuration
- // curl -X POST -H "Content-Type: application/json" -d '{"scope": "global", "group":"test", "value":"test-value"}' "http://localhost:31000/example/api/configuration/create"
- // curl -X GET "http://localhost:31000/example/api/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/api/configuration/delete"
- // Class
- // curl -X POST -H "Content-Type: application/json" -d '{"name":"test", "studentNum": 10}' "http://localhost:31000/example/api/v1/class/create"
- // curl -X PUT -H "Content-Type: application/json" -d '{"id":"2639839b3c224a00922472bf28e86b9a", "name":"test-new"}' "http://localhost:31000/example/api/v1/class/update"
- // curl -X GET "http://localhost:31000/example/api/v1/class/query?name=test-new&pageNo=1&pageSize=1"
- // curl -X GET "http://localhost:31000/example/api/v1/class/get?id=2639839b3c224a00922472bf28e86b9a"
- // curl -X DELETE "http://localhost:31000/example/api/v1/class/delete?id=2639839b3c224a00922472bf28e86b9a"
- // curl -X GET "http://localhost:31000/example/api/operateLog/query?resource=Class"
- // Student
- // curl -X POST -H "Content-Type: application/json" -d '{"name":"test"}' "http://localhost:31000/example/api/v1/student/create"
- // curl -X PUT -H "Content-Type: application/json" -d '{"id":"d9332801b46c4f0c99fdd381954313d6", "name":"test-new"}' "http://localhost:31000/example/api/v1/student/update"
- // curl -X GET "http://localhost:31000/example/api/v1/student/query?name=test-new&pageNo=1&pageSize=1"
- // curl -X GET "http://localhost:31000/example/api/v1/student/get?id=d9332801b46c4f0c99fdd381954313d6"
- // curl -X DELETE "http://localhost:31000/example/api/v1/student/delete?id=d9332801b46c4f0c99fdd381954313d6"
- // Family
- // curl -X POST -H "Content-Type: application/json" -d '{"father":"father", "mother": "mother"}' "http://localhost:31000/example/api/v1/family/create"
- // curl -X PUT -H "Content-Type: application/json" -d '{"id":"85ffbfbef27b42879382b47718c7a99e", "father":"new-father", "mother": "new-mother"}' "http://localhost:31000/example/api/v1/family/update"
- // curl -X GET "http://localhost:31000/example/api/v1/family/query?father=new-father&pageNo=0&pageSize=0"
- // curl -X GET "http://localhost:31000/example/api/v1/family/get?id=85ffbfbef27b42879382b47718c7a99e"
- // curl -X DELETE "http://localhost:31000/example/api/v1/family/delete?id=85ffbfbef27b42879382b47718c7a99e"
- // Identity
- // curl -X POST -H "Content-Type: application/json" -d '{"name":"test"}' "http://localhost:31000/example/api/v1/identity/create"
- // curl -X PUT -H "Content-Type: application/json" -d '{"id":"6e12ee71397746b8920fa94e5f229366", "name":"test-new"}' "http://localhost:31000/example/api/v1/identity/update"
- // curl -X GET "http://localhost:31000/example/api/v1/identity/query?name=test-new&pageNo=1&pageSize=1"
- // curl -X GET "http://localhost:31000/example/api/v1/identity/get?id=6e12ee71397746b8920fa94e5f229366"
- // curl -X DELETE "http://localhost:31000/example/api/v1/identity/delete?id=6e12ee71397746b8920fa94e5f229366"
- // Class-Student
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"82f03353db3545058c135f15c9a86edb", "studentIds": ["eec8c4def70d44e1ba234c089db40d17"]}' "http://localhost:31000/example/api/v1/class/student/update"
- // curl -X GET "http://localhost:31000/example/api/v1/class/student/query?id=82f03353db3545058c135f15c9a86edb"
- // Student-Class
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"eec8c4def70d44e1ba234c089db40d17", "classId": "82f03353db3545058c135f15c9a86edb"}' "http://localhost:31000/example/api/v1/student/class/update"
- // curl -X GET "http://localhost:31000/example/api/v1/student/class/query?id=eec8c4def70d44e1ba234c089db40d17"
- // curl -X GET "http://localhost:31000/example/api/v1/student/class/queryWith?name=test"
- // Student-Family
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"eec8c4def70d44e1ba234c089db40d17", "familyId": "f21a273d8b144616925e3931ec2e47b5"}' "http://localhost:31000/example/api/v1/student/family/update"
- // curl -X GET "http://localhost:31000/example/api/v1/student/family/query?id=eec8c4def70d44e1ba234c089db40d17"
- // curl -X GET "http://localhost:31000/example/api/v1/student/family/queryWith?name=test"
- // Family-Student
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"f21a273d8b144616925e3931ec2e47b5", "studentId": "eec8c4def70d44e1ba234c089db40d17"}' "http://localhost:31000/example/api/v1/family/student/update"
- // curl -X GET "http://localhost:31000/example/api/v1/family/student/query?id=f21a273d8b144616925e3931ec2e47b5"
- // curl -X GET "http://localhost:31000/example/api/v1/family/student/queryWith?father=father"
- // Student-Identity
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"eec8c4def70d44e1ba234c089db40d17", "identityIds": ["a36d5c24f5214e7fa4c3e92f2f73ec1f"]}' "http://localhost:31000/example/api/v1/student/identity/update"
- // curl -X GET "http://localhost:31000/example/api/v1/student/identity/query?id=eec8c4def70d44e1ba234c089db40d17"
- // Identity-Student
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"a36d5c24f5214e7fa4c3e92f2f73ec1f", "studentIds": ["eec8c4def70d44e1ba234c089db40d17"]}' "http://localhost:31000/example/api/v1/identity/student/update"
- // curl -X GET "http://localhost:31000/example/api/v1/identity/student/query?id=a36d5c24f5214e7fa4c3e92f2f73ec1f"
- // Student-Hobby
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"eec8c4def70d44e1ba234c089db40d17", "hobbyIds": ["42b305bb292c4082a3e91a2967f11111"]}' "http://localhost:31000/example/api/v1/student/hobby/update"
- // curl -X GET "http://localhost:31000/example/api/v1/student/hobby/query?id=eec8c4def70d44e1ba234c089db40d17"
- // Hobby-Student
- // curl -X POST -H "Content-Type: application/json" -d '{"id":"42b305bb292c4082a3e91a2967f11111", "studentIds": ["eec8c4def70d44e1ba234c089db40d17"]}' "http://localhost:31000/example/api/v1/hobby/student/update"
- // curl -X GET "http://localhost:31000/example/api/v1/hobby/student/query?id=42b305bb292c4082a3e91a2967f11111"
- // Sql Executor
- // curl -X POST -H 'Content-Type: application/json' -d '{"sql": "SELECT * FROM test.sql_execute_logs", "executorId": "guest-00254b4a7102429db35e6edc8e", "executorName": "test"}' "http://localhost:31000/example/api/sql/execute"
- // curl -X GET "http://localhost:31000/example/api/sql/execute/log?sql=SELECT&executorId=guest-00254b4a7102429db35e6edc8e&executorName=te&startExecuteTime=2024-05-30%2012:03:45"
- 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()
- }
|