add handle
This commit is contained in:
@ -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
|
||||
|
@ -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`
|
||||
|
@ -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
21
tmp/user_did.zsh
Executable 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
|
Reference in New Issue
Block a user