1
0

add handle

This commit is contained in:
2023-06-21 10:17:52 +09:00
parent 9d1f0f73c1
commit e9516ac4cd
18 changed files with 663 additions and 176 deletions

View File

@ -20,9 +20,9 @@ n=$((n - 1))
if [ -n "$1" ];then
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
if [ "ai" = "$1" ] || [ "yui" = "$1" ];then
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"token\":\"$token\", \"luck_at\": \"$now_at\", \"luck\": 7, \"like\":0}" -s $host/users/$id
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"token\":\"$token\", \"luck_at\": \"$now_at\", \"luck\": 7, \"like\":0,\"aiten\":1000}" -s $host/users/$id
else
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"ten_su\": 0, \"luck_at\": \"$now_at\", \"ten\":false,\"ten_at\": \"$updated_at_n\",\"token\": \"$token\",\"ten_kai\" : 0}" -s $host/users/$id
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"ten_su\": 0, \"luck_at\": \"$updated_at_n\", \"ten\":false, \"ten_at\": \"$updated_at_n\",\"token\": \"$token\",\"ten_kai\" : 0, \"aiten\":0}" -s $host/users/$id
fi
exit
fi

View File

@ -34,6 +34,7 @@ curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\"}" -s $ho
echo "\ntest token (yes token)"
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\",\"token\":\"$token\"}" -s $host/users/$id
read
## delete
echo "\ntest delete"
data=`curl -sL https://api.syui.ai/users/$id/card`

View File

@ -484,6 +484,9 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
if v, ok := req.Delete.Get(); ok {
b.SetDelete(v)
}
if v, ok := req.Handle.Get(); ok {
b.SetHandle(v)
}
if v, ok := req.Token.Get(); ok {
b.SetToken(v)
}
@ -614,7 +617,9 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
if v, ok := req.Delete.Get(); ok {
b.SetDelete(v)
}
if v, ok := req.Handle.Get(); ok {
b.SetHandle(v)
}
if v, ok := req.UpdatedAt.Get(); ok {
b.SetUpdatedAt(v)
}

21
tmp/user_did.zsh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/zsh
username=$1
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`
pass=`cat ~/.config/atr/api_card.json|jq -r .password`
host_users="$host/users?itemsPerPage=255"
data=`curl -sL "$host_users"|jq .`
nd=`date +"%Y%m%d"`
nd=20230101
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
echo username did
read
curl -X PATCH -H "Content-Type: application/json" -d "{\"did\":\"$2\",\"token\":\"$token\"}" -s $host/users/$id