1.8 KiB
1.8 KiB
build
./build.zsh
diff
diff tmp/ogent/ogent.go ent/ogent/ogent.go
< "os"
---
< var password = os.Getenv("PASS")
< var token = os.Getenv("TOKEN")
---
< if req.Password == password {
< b.SetOwnerID(req.Owner)
< } else {
< b.SetOwnerID(0)
< }
< //b.SetOwnerID(req.Owner)
---
> b.SetOwnerID(req.Owner)
< //if v, ok := req.Owner.Get(); ok {
< // b.SetOwnerID(v)
< //}
< if v, ok := req.Token.Get(); ok {
< if v == token {
< b.SetToken(v)
< if v, ok := req.Owner.Get(); ok {
< b.SetOwnerID(v)
< }
< }
---
< //err := h.client.Card.DeleteOneID(params.ID).Exec(ctx)
< err := h.client.Card.DeleteOneID(0).Exec(ctx)
---
> err := h.client.Ue.DeleteOneID(params.ID).Exec(ctx)
< //b.SetUsername(req.Username)
< if req.Password == password {
< b.SetUsername(req.Username)
< } else {
< b.SetUsername("")
< }
northflank
- ports : http, 8080, dns=api.syui.ai
- env : PASS=xxx, TOKEN=xxx
- cmd-override : /bin/api
- volumes : /app/data
api
get
$ curl -sL $api/users/2
$ curl -sL "$api/users?itemsPerPage=2000"
$ curl -sL "$api/users/$uid/card?itemsPerPage=2550"
post
$ curl -X POST -H "Content-Type: application/json" -d "{\"username\":\"$name\",\"password\":\"$pass\",\"did\":\"$did\"}" $api/users
$ curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$uid,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\"}" $api/cards
patch
$ curl -X PATCH -H "Content-Type: application/json" -d "{\"author\":\"$username\", \"count\":$count,\"token\":\"$token\"}" $api/cards/$cid
$ curl -X PATCH -H "Content-Type: application/json" -d "{\"model\":true,\"model_limit\": 1,\"token\":\"$token\"}" -s $api/users/$uid
delete
$ curl -X DELETE -H "Content-Type: application/json" -d "{'owner':\"$uid\"}" $api/cards/$cid