跳到主要内容

User

Definition

user.json
{
"id": 0,
"ref": 0,
"outKey": "",
"firstName": "",
"lastName": "",
"avatarUrl": "",
"photoUrl": "",
"password": "",
"rememberToken": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Users

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_filter=""
_orderBy=""
_page=1
_pageSize=10

curl -X GET "${baseUrl}/user/?_filter=${_filter}&_orderBy=${_orderBy}&_page=${_page}&_pageSize=${_pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get User

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X GET "${baseUrl}/user/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply User.ID

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

curl -X POST "${baseUrl}/apply/user/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create User

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

curl -X POST "${baseUrl}/user/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @user.json
信息
user.json
{
"ref": 0,
"outKey": "",
"firstName": "",
"lastName": "",
"avatarUrl": "",
"photoUrl": "",
"status": 0,
}
提示

success status: 201

Update User

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X PUT "${baseUrl}/user/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @user.json
信息
user.json
{
"ref": 0,
"outKey": "",
"firstName": "",
"lastName": "",
"avatarUrl": "",
"photoUrl": "",
"status": 0,
}

Patch User

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X PATCH "${baseUrl}/user/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: ref,outKey,firstName,lastName,avatarUrl,photoUrl,status" \
-d @user.json
信息
user.json
{
"ref": 0,
"outKey": "",
"firstName": "",
"lastName": "",
"avatarUrl": "",
"photoUrl": "",
"status": 0,
}

Update User Status

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X PATCH "${baseUrl}/user/${_id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @user.json
信息
user.json
{
"status": 0
}

Destroy User

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X DELETE "${baseUrl}/user/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Applications

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X GET "${baseUrl}/user/${_id}/application/?_filter=${_filter}&_orderBy=${_orderBy}&_page=${_page}&_pageSize=${_pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X POST "${baseUrl}/user/${_id}/application/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X DELETE "${baseUrl}/user/${_id}/application/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"

Get ApplicationUser

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0
_applicationID=0

curl -X GET "${baseUrl}/user/${_id}/application/${_applicationID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Update ApplicationUser

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0
_applicationID=0

curl -X PUT "${baseUrl}/user/${_id}/application/${_applicationID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @applicationUser.json
信息
applicationUser.json
{
"right": 0,
}

Get Roles

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X GET "${baseUrl}/user/${_id}/role/?_filter=${_filter}&_orderBy=${_orderBy}&_page=${_page}&_pageSize=${_pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X POST "${baseUrl}/user/${_id}/role/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X DELETE "${baseUrl}/user/${_id}/role/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"