diff --git a/Procfile b/Procfile index 26a0787..3b13075 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: bin/t +web: bin/api diff --git a/build.zsh b/build.zsh index 6fa36fe..904964e 100755 --- a/build.zsh +++ b/build.zsh @@ -6,7 +6,18 @@ su=5000 go generate ./... cp -rf $d/ent/openapi.json $d/tmp/ -sed -i '' "s/255/$su/g" $d/ent/ogent/oas_parameters_gen.go -sed -i '' "s/255/$su/g" $d/ent/openapi.json + +case $OSTYPE in + darwin*) + sed -i '' "s/255/$su/g" $d/ent/ogent/oas_parameters_gen.go + sed -i '' "s/255/$su/g" $d/ent/openapi.json + ;; + linux*) + sed -i "s/255/$su/g" $d/ent/ogent/oas_parameters_gen.go + sed -i "s/255/$su/g" $d/ent/openapi.json + ;; +esac cp -rf $d/tmp/ogent ent/ +#PASS=`cat token.json|jq -r .password` TOKEN=`cat token.json|jq -r .token` go build +#PASS=`cat token.json|jq -r .password` TOKEN=`cat token.json|jq -r .token` go run -mod=mod main.go diff --git a/docs/wiki.md b/docs/wiki.md new file mode 100644 index 0000000..c8dfe72 --- /dev/null +++ b/docs/wiki.md @@ -0,0 +1,133 @@ +### build + +```sh +$ vim ent/entc.go +$ vim ent/schema/users.go +$ go generate ./... +$ go build +$ ./card + +$ go generate ./... +$ PASS=`cat ./token.json|jq -r .password` TOKEN=`cat ./token.json|jq -r .token` go run -mod=mod main.go +$ curl -X POST -H "Content-Type: application/json" -d "{\"username\":\"syui\",\"password\":\"$pass\"}" localhost:8080/users +$ curl -X POST -H "Content-Type: application/json" -d "{\"owner\":1,\"password\":\"$pass\"}" localhost:8080/cards +$ curl -X POST -H "Content-Type: application/json" -d "{\"owner\":1,\"card\":1,\"cp\":11,\"status\":\"normal\",\"password\":\"$pass\"}" localhost:8080/cards +$ curl localhost:8080/users +$ curl localhost:8080/cards +$ curl localhost:8080/users/1 +$ curl localhost:8080/users/1/card +``` + +### use + +```sh +$ curl -X POST -H "Content-Type: application/json" -d '{"username":"syui",\"password\":\"$pass\"}' https://api.syui.ai/users + +# onconflict +$ !! + +$ curl -sL https://api.syui.ai/users/1 +``` + +```sh +# item select +$ curl -sL "https://api.syui.ai/users?itemsPerPage=255" +$ curl -sL "https://api.syui.ai/cards?itemsPerPage=255" +$ curl -sL "https://api.syui.ai/users/1/card?itemsPerPage=255" +``` + +### ref + +```sh +$ vim ./ent/ogent/ogent.go +// 新規登録の停止 +// CreateUsers handles POST /users-slice requests. +func (h *OgentHandler) CreateUsers(ctx context.Context, req CreateUsersReq) (CreateUsersRes, error) { + b := h.client.Users.Create() + //b.SetUser(req.User) + b.SetUser("syui") +} + +// 削除の無効 +// DeleteUsers handles DELETE /users-slice/{id} requests. +func (h *OgentHandler) DeleteUsers(ctx context.Context, params DeleteUsersParams) (DeleteUsersRes, error) { + if params.ID != 1 { +err := h.client.Users.DeleteOneID(params.ID).Exec(ctx) + } + return new(DeleteUsersNoContent), nil +} + +// 要素の書き換えの禁止 +// UpdateUsers handles PATCH /users-slice/{id} requests. +func (h *OgentHandler) UpdateUsers(ctx context.Context, req UpdateUsersReq, params UpdateUsersParams) (UpdateUsersRes, error) { + b := h.client.Users.UpdateOneID(params.ID) + // Add all fields. + //if v, ok := req.Hp.Get(); ok { + // b.SetHp(v) + //} +``` + +### link + +- https://entgo.io/ja/blog/2022/02/15/generate-rest-crud-with-ent-and-ogen/ + +- https://github.com/ariga/ogent/blob/main/example/todo/ent/entc.go + +- https://github.com/ent/ent/blob/master/dialect/sql/schema/postgres_test.go + +- https://github.com/go-kratos/beer-shop/tree/main/app/catalog/service/internal/data/ent + + +### update + +```sh +$ curl --dump-header - 'https://api.syui.ai/users' -H 'Origin: https://card.syui.ai'|less +``` + +> ent/ogent/oas_response_encoders_gen.go + +```go +func encodeCreateGroupResponse(response CreateGroupRes, w http.ResponseWriter, span trace.Span) error { + w.Header().Set("Access-Control-Allow-Origin", "https://card.syui.ai") + switch response := response.(type) { + w.Header().Set("Access-Control-Allow-Origin", "https://card.syui.ai") +``` + +### northflank + +#### backup sqlite + +- `cron`, `repo(private)`, `pass(token)` + +```sh +#!/bin/zsh + +pass=password +/usr/bin/northflank exec service --project $project --service $service --cmd "/app/data/api/backup.sh $pass" + +function f(){ + rm /app/data/api/backup.sh + echo '#!/bin/bash + pass=$1 + git config --global user.email syui@syui.ai + git config --global user.name syui + cp -rf /app/data/new.sqlite /app/data/api/latest.sqlite + cp -rf /app/data/new.sqlite /app/data/api/`date '+%w'`.sqlite + cd /app/data/api + git remote add origin https://$pass@github.com/ai/api + git add . + git commit -m backup + git push origin main + git remote rm origin + ' >> /app/data/api/backup.sh + chmod +x /app/data/api/backup.sh +} +``` + +#### setting + +- ports : http, 8080, dns=api.syui.ai +- env : PASS=xxx, TOKEN=xxx +- cmd-override : /bin/api +- volumes : /app/data + diff --git a/ent/card.go b/ent/card.go index 8901be2..f46858a 100644 --- a/ent/card.go +++ b/ent/card.go @@ -3,10 +3,10 @@ package ent import ( + "api/ent/card" + "api/ent/user" "fmt" "strings" - "t/ent/card" - "t/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/ent/card/where.go b/ent/card/where.go index 85f82ed..12ee43d 100644 --- a/ent/card/where.go +++ b/ent/card/where.go @@ -3,7 +3,7 @@ package card import ( - "t/ent/predicate" + "api/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/ent/card_create.go b/ent/card_create.go index b6e7906..fccf027 100644 --- a/ent/card_create.go +++ b/ent/card_create.go @@ -3,11 +3,11 @@ package ent import ( + "api/ent/card" + "api/ent/user" "context" "errors" "fmt" - "t/ent/card" - "t/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/card_delete.go b/ent/card_delete.go index 6682804..d5c599e 100644 --- a/ent/card_delete.go +++ b/ent/card_delete.go @@ -3,9 +3,9 @@ package ent import ( + "api/ent/card" + "api/ent/predicate" "context" - "t/ent/card" - "t/ent/predicate" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/card_query.go b/ent/card_query.go index 2151949..e7fea7a 100644 --- a/ent/card_query.go +++ b/ent/card_query.go @@ -3,12 +3,12 @@ package ent import ( + "api/ent/card" + "api/ent/predicate" + "api/ent/user" "context" "fmt" "math" - "t/ent/card" - "t/ent/predicate" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/card_update.go b/ent/card_update.go index 8824aab..86d66dd 100644 --- a/ent/card_update.go +++ b/ent/card_update.go @@ -3,12 +3,12 @@ package ent import ( + "api/ent/card" + "api/ent/predicate" + "api/ent/user" "context" "errors" "fmt" - "t/ent/card" - "t/ent/predicate" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/client.go b/ent/client.go index 8788c10..d8f8762 100644 --- a/ent/client.go +++ b/ent/client.go @@ -8,12 +8,12 @@ import ( "fmt" "log" - "t/ent/migrate" + "api/ent/migrate" - "t/ent/card" - "t/ent/group" - "t/ent/ue" - "t/ent/user" + "api/ent/card" + "api/ent/group" + "api/ent/ue" + "api/ent/user" "entgo.io/ent" "entgo.io/ent/dialect" diff --git a/ent/ent.go b/ent/ent.go index ecd2707..9910b37 100644 --- a/ent/ent.go +++ b/ent/ent.go @@ -3,14 +3,14 @@ package ent import ( + "api/ent/card" + "api/ent/group" + "api/ent/ue" + "api/ent/user" "context" "errors" "fmt" "reflect" - "t/ent/card" - "t/ent/group" - "t/ent/ue" - "t/ent/user" "entgo.io/ent" "entgo.io/ent/dialect/sql" diff --git a/ent/enttest/enttest.go b/ent/enttest/enttest.go index 9ddd3d3..8486b44 100644 --- a/ent/enttest/enttest.go +++ b/ent/enttest/enttest.go @@ -3,12 +3,12 @@ package enttest import ( + "api/ent" "context" - "t/ent" // required by schema hooks. - _ "t/ent/runtime" + _ "api/ent/runtime" - "t/ent/migrate" + "api/ent/migrate" "entgo.io/ent/dialect/sql/schema" ) diff --git a/ent/group.go b/ent/group.go index 3fa14d1..8d8df48 100644 --- a/ent/group.go +++ b/ent/group.go @@ -3,9 +3,9 @@ package ent import ( + "api/ent/group" "fmt" "strings" - "t/ent/group" "entgo.io/ent/dialect/sql" ) diff --git a/ent/group/where.go b/ent/group/where.go index c3a2806..a90c84f 100644 --- a/ent/group/where.go +++ b/ent/group/where.go @@ -3,7 +3,7 @@ package group import ( - "t/ent/predicate" + "api/ent/predicate" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/group_create.go b/ent/group_create.go index a3ef377..ee575c1 100644 --- a/ent/group_create.go +++ b/ent/group_create.go @@ -3,11 +3,11 @@ package ent import ( + "api/ent/group" + "api/ent/user" "context" "errors" "fmt" - "t/ent/group" - "t/ent/user" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" diff --git a/ent/group_delete.go b/ent/group_delete.go index 10161fa..0a7049d 100644 --- a/ent/group_delete.go +++ b/ent/group_delete.go @@ -3,9 +3,9 @@ package ent import ( + "api/ent/group" + "api/ent/predicate" "context" - "t/ent/group" - "t/ent/predicate" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/group_query.go b/ent/group_query.go index 7f3b189..0d44bde 100644 --- a/ent/group_query.go +++ b/ent/group_query.go @@ -3,13 +3,13 @@ package ent import ( + "api/ent/group" + "api/ent/predicate" + "api/ent/user" "context" "database/sql/driver" "fmt" "math" - "t/ent/group" - "t/ent/predicate" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/group_update.go b/ent/group_update.go index 94bb7c8..574bb44 100644 --- a/ent/group_update.go +++ b/ent/group_update.go @@ -3,12 +3,12 @@ package ent import ( + "api/ent/group" + "api/ent/predicate" + "api/ent/user" "context" "errors" "fmt" - "t/ent/group" - "t/ent/predicate" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/hook/hook.go b/ent/hook/hook.go index 2da55e8..269aa33 100644 --- a/ent/hook/hook.go +++ b/ent/hook/hook.go @@ -3,9 +3,9 @@ package hook import ( + "api/ent" "context" "fmt" - "t/ent" ) // The CardFunc type is an adapter to allow the use of ordinary diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index 1ed4e83..0c0d345 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -129,7 +129,7 @@ var ( {Name: "ten_post", Type: field.TypeString, Nullable: true}, {Name: "ten_get", Type: field.TypeString, Nullable: true}, {Name: "ten_at", Type: field.TypeTime, Nullable: true}, - {Name: "next", Type: field.TypeString, Nullable: true, Default: "20240213"}, + {Name: "next", Type: field.TypeString, Nullable: true, Default: "20240220"}, {Name: "room", Type: field.TypeInt, Nullable: true}, {Name: "model", Type: field.TypeBool, Nullable: true}, {Name: "model_at", Type: field.TypeTime, Nullable: true}, diff --git a/ent/mutation.go b/ent/mutation.go index d6cb5a4..2baff0e 100644 --- a/ent/mutation.go +++ b/ent/mutation.go @@ -3,15 +3,15 @@ package ent import ( + "api/ent/card" + "api/ent/group" + "api/ent/predicate" + "api/ent/ue" + "api/ent/user" "context" "errors" "fmt" "sync" - "t/ent/card" - "t/ent/group" - "t/ent/predicate" - "t/ent/ue" - "t/ent/user" "time" "entgo.io/ent" diff --git a/ent/ogent/ogent.go b/ent/ogent/ogent.go index 612544b..fbeb4a6 100644 --- a/ent/ogent/ogent.go +++ b/ent/ogent/ogent.go @@ -6,11 +6,11 @@ import ( "context" "net/http" - "t/ent" - "t/ent/card" - "t/ent/group" - "t/ent/ue" - "t/ent/user" + "api/ent" + "api/ent/card" + "api/ent/group" + "api/ent/ue" + "api/ent/user" "os" "github.com/go-faster/jx" ) diff --git a/ent/ogent/responses.go b/ent/ogent/responses.go index 9160f5d..84fdcc0 100644 --- a/ent/ogent/responses.go +++ b/ent/ogent/responses.go @@ -2,7 +2,7 @@ package ogent -import "t/ent" +import "api/ent" func NewCardCreate(e *ent.Card) *CardCreate { if e == nil { diff --git a/ent/runtime.go b/ent/runtime.go index 7f9450b..16e53fb 100644 --- a/ent/runtime.go +++ b/ent/runtime.go @@ -3,11 +3,11 @@ package ent import ( - "t/ent/card" - "t/ent/group" - "t/ent/schema" - "t/ent/ue" - "t/ent/user" + "api/ent/card" + "api/ent/group" + "api/ent/schema" + "api/ent/ue" + "api/ent/user" "time" ) diff --git a/ent/runtime/runtime.go b/ent/runtime/runtime.go index c48ce31..880917e 100644 --- a/ent/runtime/runtime.go +++ b/ent/runtime/runtime.go @@ -2,7 +2,7 @@ package runtime -// The schema-stitching logic is generated in t/ent/runtime.go +// The schema-stitching logic is generated in api/ent/runtime.go const ( Version = "v0.11.10" // Version of ent codegen. diff --git a/ent/ue.go b/ent/ue.go index 459a685..57801f2 100644 --- a/ent/ue.go +++ b/ent/ue.go @@ -3,10 +3,10 @@ package ent import ( + "api/ent/ue" + "api/ent/user" "fmt" "strings" - "t/ent/ue" - "t/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/ent/ue/where.go b/ent/ue/where.go index 7ee84d7..2f1f157 100644 --- a/ent/ue/where.go +++ b/ent/ue/where.go @@ -3,7 +3,7 @@ package ue import ( - "t/ent/predicate" + "api/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/ent/ue_create.go b/ent/ue_create.go index dd0eba5..bff03e5 100644 --- a/ent/ue_create.go +++ b/ent/ue_create.go @@ -3,11 +3,11 @@ package ent import ( + "api/ent/ue" + "api/ent/user" "context" "errors" "fmt" - "t/ent/ue" - "t/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/ue_delete.go b/ent/ue_delete.go index 98f3dc5..0cfb9e5 100644 --- a/ent/ue_delete.go +++ b/ent/ue_delete.go @@ -3,9 +3,9 @@ package ent import ( + "api/ent/predicate" + "api/ent/ue" "context" - "t/ent/predicate" - "t/ent/ue" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/ue_query.go b/ent/ue_query.go index 240b74e..c5f8af8 100644 --- a/ent/ue_query.go +++ b/ent/ue_query.go @@ -3,12 +3,12 @@ package ent import ( + "api/ent/predicate" + "api/ent/ue" + "api/ent/user" "context" "fmt" "math" - "t/ent/predicate" - "t/ent/ue" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/ue_update.go b/ent/ue_update.go index 649304c..318636a 100644 --- a/ent/ue_update.go +++ b/ent/ue_update.go @@ -3,12 +3,12 @@ package ent import ( + "api/ent/predicate" + "api/ent/ue" + "api/ent/user" "context" "errors" "fmt" - "t/ent/predicate" - "t/ent/ue" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/user.go b/ent/user.go index 9bae624..73ca2cb 100644 --- a/ent/user.go +++ b/ent/user.go @@ -3,9 +3,9 @@ package ent import ( + "api/ent/user" "fmt" "strings" - "t/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/ent/user/where.go b/ent/user/where.go index 1f1154b..4a4e5a2 100644 --- a/ent/user/where.go +++ b/ent/user/where.go @@ -3,7 +3,7 @@ package user import ( - "t/ent/predicate" + "api/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/ent/user_create.go b/ent/user_create.go index 0b46208..02b3347 100644 --- a/ent/user_create.go +++ b/ent/user_create.go @@ -3,12 +3,12 @@ package ent import ( + "api/ent/card" + "api/ent/ue" + "api/ent/user" "context" "errors" "fmt" - "t/ent/card" - "t/ent/ue" - "t/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/user_delete.go b/ent/user_delete.go index 3ae1ce7..e5baebc 100644 --- a/ent/user_delete.go +++ b/ent/user_delete.go @@ -3,9 +3,9 @@ package ent import ( + "api/ent/predicate" + "api/ent/user" "context" - "t/ent/predicate" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/user_query.go b/ent/user_query.go index 3833ac4..d2da861 100644 --- a/ent/user_query.go +++ b/ent/user_query.go @@ -3,14 +3,14 @@ package ent import ( + "api/ent/card" + "api/ent/predicate" + "api/ent/ue" + "api/ent/user" "context" "database/sql/driver" "fmt" "math" - "t/ent/card" - "t/ent/predicate" - "t/ent/ue" - "t/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/ent/user_update.go b/ent/user_update.go index 463de22..880d654 100644 --- a/ent/user_update.go +++ b/ent/user_update.go @@ -3,13 +3,13 @@ package ent import ( + "api/ent/card" + "api/ent/predicate" + "api/ent/ue" + "api/ent/user" "context" "errors" "fmt" - "t/ent/card" - "t/ent/predicate" - "t/ent/ue" - "t/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/go.mod b/go.mod index 61d185e..fab473f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ -module t +module api -go 1.19 +go 1.21 //replace ariga.io/ogent => ../../ diff --git a/go.sum b/go.sum index ded570b..06bf920 100644 --- a/go.sum +++ b/go.sum @@ -1,26 +1,17 @@ -ariga.io/atlas v0.9.1 h1:EpoPMnwsQG0vn9c0sYExpwSYtr7bvuSUXzQclU2pMjc= -ariga.io/atlas v0.9.1/go.mod h1:T230JFcENj4ZZzMkZrXFDSkv+2kXkUgpJ5FQQ5hMcKU= ariga.io/atlas v0.9.2-0.20230303073438-03a4779a6338 h1:8kmSV3mbQKn0niZ/EdE11uhFvFKiW1VlaqVBIYOyahM= ariga.io/atlas v0.9.2-0.20230303073438-03a4779a6338/go.mod h1:T230JFcENj4ZZzMkZrXFDSkv+2kXkUgpJ5FQQ5hMcKU= -ariga.io/entviz v0.0.0-20230125130633-6c9be8e08c7c h1:7FbOjKKWKqD7FZXQq3qWcRlvGFO1LGYvVZIWQ2D9Evs= ariga.io/entviz v0.0.0-20230125130633-6c9be8e08c7c/go.mod h1:wArXZPqbbWBcOmkqwmIF6hIcW+3T1NLDde0iRhW6an8= ariga.io/ogent v0.0.0-20230309073626-8dc564a6a73e h1:8mxC+4Y7pVKgfoUJIMdChrS95d+TcJ6xuhw49nVYIAY= ariga.io/ogent v0.0.0-20230309073626-8dc564a6a73e/go.mod h1:95vCbvAYAW6NsWUrSL23k2SQykuf/yjellmwV1X+svI= entgo.io/contrib v0.3.5 h1:wY85TgRp3j5ix/SZ9IE6Ob5lObHFmVUYH0ZFw1D5Hzc= entgo.io/contrib v0.3.5/go.mod h1:R5HiFszVD8OVOZKFGRbqYogRxK7z1ruzWyEEesjQwE0= -entgo.io/ent v0.11.9 h1:dbbCkAiPVTRBIJwoZctiSYjB7zxQIBOzVSU5H9VYIQI= -entgo.io/ent v0.11.9/go.mod h1:KWHOcDZn1xk3mz3ipWdKrQpMvwqa/9B69TUuAPP9W6g= entgo.io/ent v0.11.10 h1:iqn32ybY5HRW3xSAyMNdNKpZhKgMf1Zunsej9yPKUI8= entgo.io/ent v0.11.10/go.mod h1:mzTZ0trE+jCQw/fnzijbm5Mck/l8Gbg7gC/+L1COyzM= -github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= -github.com/Khan/genqlient v0.5.0 h1:TMZJ+tl/BpbmGyIBiXzKzUftDhw4ZWxQZ+1ydn0gyII= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dlclark/regexp2 v1.8.0 h1:rJD5HeGIT/2b5CDk63FVCwZA3qgYElfg+oQK7uH5pfE= github.com/dlclark/regexp2 v1.8.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= @@ -41,10 +32,7 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -52,48 +40,32 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/hcl/v2 v2.15.0 h1:CPDXO6+uORPjKflkWCCwoWc9uRp+zSIPcCQ+BrxV7m8= github.com/hashicorp/hcl/v2 v2.15.0/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= -github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= -github.com/kyokomi/lottery v1.2.0 h1:oW9YxYv5j/nu/Kkf8K5tu7Vn8dAoZTjluDxihTPX/68= github.com/kyokomi/lottery v1.2.0/go.mod h1:TkKpJrFrOJNHpblUqYu0bAQWil3NMwKMBluHyqFfU6Y= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/mazen160/go-random v0.0.0-20210308102632-d2b501c85c03 h1:iM7JTVzKOYKWjzhGcgHAgFVQt5QfiHIVrRUaWPfh0Q4= github.com/mazen160/go-random v0.0.0-20210308102632-d2b501c85c03/go.mod h1:APoDd0B2pYeB5kU/g7Mw14mFsljp5HfzrC7arsKbi8U= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/ogen-go/ogen v0.59.0 h1:9aSSZ1KCLJIcRyjkO7IHrG0vAI6l1BO877LwTbMcX+k= github.com/ogen-go/ogen v0.59.0/go.mod h1:0MHLcWEbxwdvR+R9E05paQSRh/2vHtVSJgKqmwYyW8M= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/vektah/gqlparser/v2 v2.4.5 h1:C02NsyEsL4TXJB7ndonqTfuQOL4XPIu0aAWugdmTgmc= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY= github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= @@ -105,7 +77,6 @@ go.opentelemetry.io/otel/trace v1.13.0 h1:CBgRZ6ntv+Amuj1jDsMhZtlAPT6gbyIRdaIzFh go.opentelemetry.io/otel/trace v1.13.0/go.mod h1:muCvmmO9KKpvuXSf3KKAXXB2ygNYHQ+ZfI5X08d3tds= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= @@ -148,10 +119,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/icon/card.png b/icon/card.png new file mode 100644 index 0000000..1b089bf Binary files /dev/null and b/icon/card.png differ diff --git a/main.go b/main.go index 382e82b..e217553 100644 --- a/main.go +++ b/main.go @@ -5,8 +5,8 @@ import ( "log" "net/http" - "t/ent" - "t/ent/ogent" + "api/ent" + "api/ent/ogent" "entgo.io/ent/dialect" _ "github.com/mattn/go-sqlite3" "entgo.io/ent/dialect/sql/schema" diff --git a/readme.md b/readme.md index 3f07c99..e8f3393 100644 --- a/readme.md +++ b/readme.md @@ -1,94 +1,15 @@ -### build +## ai `api` + + + +- name : ai `api` +- host : [card.syui.ai](https://card.syui.ai) ```sh -$ vim ent/entc.go -$ vim ent/schema/users.go -$ go generate ./... -$ go build -$ ./card - -$ go generate ./... -$ PASS=`cat ./token.json|jq -r .password` TOKEN=`cat ./token.json|jq -r .token` go run -mod=mod main.go -$ curl -X POST -H "Content-Type: application/json" -d "{\"username\":\"syui\",\"password\":\"$pass\"}" localhost:8080/users -$ curl -X POST -H "Content-Type: application/json" -d "{\"owner\":1,\"password\":\"$pass\"}" localhost:8080/cards -$ curl -X POST -H "Content-Type: application/json" -d "{\"owner\":1,\"card\":1,\"cp\":11,\"status\":\"normal\",\"password\":\"$pass\"}" localhost:8080/cards -$ curl localhost:8080/users -$ curl localhost:8080/cards -$ curl localhost:8080/users/1 -$ curl localhost:8080/users/1/card -``` - -### use - -```sh -$ curl -X POST -H "Content-Type: application/json" -d '{"username":"syui",\"password\":\"$pass\"}' https://api.syui.ai/users - -# onconflict -$ !! - $ curl -sL https://api.syui.ai/users/1 ``` -```sh -# item select -$ curl -sL "https://api.syui.ai/users?itemsPerPage=255" -$ curl -sL "https://api.syui.ai/cards?itemsPerPage=255" -$ curl -sL "https://api.syui.ai/users/1/card?itemsPerPage=255" -``` +## link -### ref +- https://github.com/ariga/ogent -```sh -$ vim ./ent/ogent/ogent.go -// 新規登録の停止 -// CreateUsers handles POST /users-slice requests. -func (h *OgentHandler) CreateUsers(ctx context.Context, req CreateUsersReq) (CreateUsersRes, error) { - b := h.client.Users.Create() - //b.SetUser(req.User) - b.SetUser("syui") -} - -// 削除の無効 -// DeleteUsers handles DELETE /users-slice/{id} requests. -func (h *OgentHandler) DeleteUsers(ctx context.Context, params DeleteUsersParams) (DeleteUsersRes, error) { - if params.ID != 1 { -err := h.client.Users.DeleteOneID(params.ID).Exec(ctx) - } - return new(DeleteUsersNoContent), nil -} - -// 要素の書き換えの禁止 -// UpdateUsers handles PATCH /users-slice/{id} requests. -func (h *OgentHandler) UpdateUsers(ctx context.Context, req UpdateUsersReq, params UpdateUsersParams) (UpdateUsersRes, error) { - b := h.client.Users.UpdateOneID(params.ID) - // Add all fields. - //if v, ok := req.Hp.Get(); ok { - // b.SetHp(v) - //} -``` - -### link - -- https://entgo.io/ja/blog/2022/02/15/generate-rest-crud-with-ent-and-ogen/ - -- https://github.com/ariga/ogent/blob/main/example/todo/ent/entc.go - -- https://github.com/ent/ent/blob/master/dialect/sql/schema/postgres_test.go - -- https://github.com/go-kratos/beer-shop/tree/main/app/catalog/service/internal/data/ent - - -### update - -```sh -$ curl --dump-header - 'https://api.syui.ai/users' -H 'Origin: https://card.syui.ai'|less -``` - -> ent/ogent/oas_response_encoders_gen.go - -```go -func encodeCreateGroupResponse(response CreateGroupRes, w http.ResponseWriter, span trace.Span) error { - w.Header().Set("Access-Control-Allow-Origin", "https://card.syui.ai") - switch response := response.(type) { - w.Header().Set("Access-Control-Allow-Origin", "https://card.syui.ai") -``` diff --git a/run.zsh b/run.zsh deleted file mode 100755 index dc3e192..0000000 --- a/run.zsh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh -d=${0:a:h} -PASS=`cat token.json|jq -r .password` go run -mod=mod main.go diff --git a/tmp/card_account_change.zsh b/scpt/card_account_change.zsh similarity index 100% rename from tmp/card_account_change.zsh rename to scpt/card_account_change.zsh diff --git a/tmp/card_account_change_fix.zsh b/scpt/card_account_change_fix.zsh similarity index 100% rename from tmp/card_account_change_fix.zsh rename to scpt/card_account_change_fix.zsh diff --git a/tmp/card_account_delete.zsh b/scpt/card_account_delete.zsh similarity index 100% rename from tmp/card_account_delete.zsh rename to scpt/card_account_delete.zsh diff --git a/tmp/card_account_select_delete.zsh b/scpt/card_account_select_delete.zsh similarity index 100% rename from tmp/card_account_select_delete.zsh rename to scpt/card_account_select_delete.zsh diff --git a/tmp/card_add.zsh b/scpt/card_add.zsh similarity index 100% rename from tmp/card_add.zsh rename to scpt/card_add.zsh diff --git a/tmp/card_add_16.zsh b/scpt/card_add_16.zsh similarity index 100% rename from tmp/card_add_16.zsh rename to scpt/card_add_16.zsh diff --git a/tmp/card_add_45.zsh b/scpt/card_add_45.zsh similarity index 100% rename from tmp/card_add_45.zsh rename to scpt/card_add_45.zsh diff --git a/tmp/card_add_book1.zsh b/scpt/card_add_book1.zsh similarity index 100% rename from tmp/card_add_book1.zsh rename to scpt/card_add_book1.zsh diff --git a/tmp/card_add_change.zsh b/scpt/card_add_change.zsh similarity index 100% rename from tmp/card_add_change.zsh rename to scpt/card_add_change.zsh diff --git a/tmp/card_author_first.zsh b/scpt/card_author_first.zsh similarity index 100% rename from tmp/card_author_first.zsh rename to scpt/card_author_first.zsh diff --git a/scpt/card_day.zsh b/scpt/card_day.zsh new file mode 100755 index 0000000..eff9ea5 --- /dev/null +++ b/scpt/card_day.zsh @@ -0,0 +1,23 @@ +#!/bin/zsh + +case $OSTYPE in + darwin*) + alias date="/opt/homebrew/bin/gdate" + ;; +esac +host=https://api.syui.ai +token=`cat ~/.config/atr/api_card.json|jq -r .token` +host_users="$host/users?itemsPerPage=2550" +data=`curl -sL "$host_users"|jq .` +nd=`date +"%Y%m%d"` + +n=`echo $data|jq length` +n=$((n - 1)) + +for ((i=0;i<=$n;i++)) +do + name=`echo $data|jq ".[$i]"|jq -r .username` + id=`echo $data|jq ".[$i]"|jq -r .id` + echo "{\"next\":\"$nd\"} -s $host/users/$id" + curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\",\"token\":\"$token\"}" -s $host/users/$id +done diff --git a/scpt/card_delete.zsh b/scpt/card_delete.zsh new file mode 100755 index 0000000..8f01d94 --- /dev/null +++ b/scpt/card_delete.zsh @@ -0,0 +1,23 @@ +#!/bin/zsh + +if [ -z "$1" ];then + exit +fi +echo delete-id +read +id=$1 +data=`curl -sL "https://api.syui.ai/users/$id/card?itemsPerPage=2550"` +token=`cat ~/.config/atr/api_card.json|jq -r .token` +pass=`cat ~/.config/atr/api_card.json|jq -r .password` + +n=`echo $data|jq length` + +n=$((n - 1)) + +for ((i=0;i<=$n;i++)) +do + card_id=`echo $data|jq -r ".[$i].id"` + echo $card + curl -X DELETE -H "Content-Type: application/json" -d "{\"owner\":$id,\"password\":\"$pass\"}" https://api.syui.ai/cards/$card_id +done +#curl -X DELETE -H "Content-Type: application/json" https://api.syui.ai/users/$id diff --git a/tmp/card_did_change.zsh b/scpt/card_did_change.zsh similarity index 100% rename from tmp/card_did_change.zsh rename to scpt/card_did_change.zsh diff --git a/tmp/card_fav_first.zsh b/scpt/card_fav_first.zsh similarity index 100% rename from tmp/card_fav_first.zsh rename to scpt/card_fav_first.zsh diff --git a/tmp/card_fav_second.zsh b/scpt/card_fav_second.zsh similarity index 100% rename from tmp/card_fav_second.zsh rename to scpt/card_fav_second.zsh diff --git a/scpt/card_limit.zsh b/scpt/card_limit.zsh new file mode 100755 index 0000000..220209b --- /dev/null +++ b/scpt/card_limit.zsh @@ -0,0 +1,24 @@ +#!/bin/zsh + +case $OSTYPE in + darwin*) + alias date="/opt/homebrew/bin/gdate" + ;; +esac +host=https://api.syui.ai +token=`cat ~/.config/atr/api_card.json|jq -r .token` +host_users="$host/users?itemsPerPage=2550" +updated_at_n=`date --iso-8601=seconds -d '1 days ago'` +#updated_at_n=`date --iso-8601=seconds` +data=`curl -sL "$host_users"|jq .` + +n=`echo $data|jq length` +n=$((n - 1)) + +for ((i=0;i<=$n;i++)) +do + name=`echo $data|jq ".[$i]"|jq -r .username` + id=`echo $data|jq ".[$i]"|jq -r .id` + echo "{\"updated_at\":\"$updated_at_n\"} -s $host/users/$id" + curl -X PATCH -H "Content-Type: application/json" -d "{\"raid_at\": \"$updated_at_n\",\"updated_at\":\"$updated_at_n\",\"token\":\"$token\",\"ten_at\":\"$updated_at_n\"}" -s $host/users/$id +done diff --git a/tmp/card_limit_all.zsh b/scpt/card_limit_all.zsh similarity index 100% rename from tmp/card_limit_all.zsh rename to scpt/card_limit_all.zsh diff --git a/tmp/card_limit_loop.zsh b/scpt/card_limit_loop.zsh similarity index 100% rename from tmp/card_limit_loop.zsh rename to scpt/card_limit_loop.zsh diff --git a/tmp/card_limit_select.zsh b/scpt/card_limit_select.zsh similarity index 100% rename from tmp/card_limit_select.zsh rename to scpt/card_limit_select.zsh diff --git a/tmp/card_search.zsh b/scpt/card_search.zsh similarity index 100% rename from tmp/card_search.zsh rename to scpt/card_search.zsh diff --git a/tmp/card_sqlite.zsh b/scpt/card_sqlite.zsh similarity index 100% rename from tmp/card_sqlite.zsh rename to scpt/card_sqlite.zsh diff --git a/tmp/card_test.zsh b/scpt/card_test.zsh similarity index 100% rename from tmp/card_test.zsh rename to scpt/card_test.zsh diff --git a/tmp/game_account.zsh b/scpt/game_account.zsh similarity index 100% rename from tmp/game_account.zsh rename to scpt/game_account.zsh diff --git a/tmp/model_account.zsh b/scpt/model_account.zsh similarity index 100% rename from tmp/model_account.zsh rename to scpt/model_account.zsh diff --git a/tmp/model_account_all.zsh b/scpt/model_account_all.zsh similarity index 100% rename from tmp/model_account_all.zsh rename to scpt/model_account_all.zsh diff --git a/tmp/t.zsh b/scpt/t.zsh similarity index 100% rename from tmp/t.zsh rename to scpt/t.zsh diff --git a/tmp/test.zsh b/scpt/test.zsh similarity index 100% rename from tmp/test.zsh rename to scpt/test.zsh diff --git a/tmp/ue_add_test.zsh b/scpt/ue_add_test.zsh similarity index 100% rename from tmp/ue_add_test.zsh rename to scpt/ue_add_test.zsh diff --git a/tmp/user_did.zsh b/scpt/user_did.zsh similarity index 100% rename from tmp/user_did.zsh rename to scpt/user_did.zsh diff --git a/tmp/user_json.zsh b/scpt/user_json.zsh similarity index 100% rename from tmp/user_json.zsh rename to scpt/user_json.zsh diff --git a/tmp/ogent/ogent.go b/tmp/ogent/ogent.go index 612544b..fbeb4a6 100644 --- a/tmp/ogent/ogent.go +++ b/tmp/ogent/ogent.go @@ -6,11 +6,11 @@ import ( "context" "net/http" - "t/ent" - "t/ent/card" - "t/ent/group" - "t/ent/ue" - "t/ent/user" + "api/ent" + "api/ent/card" + "api/ent/group" + "api/ent/ue" + "api/ent/user" "os" "github.com/go-faster/jx" )