Lattice Hub 文档
HTTP OpenAPI鉴权

用户

用户 CRUD 与 Token / 密码管理。

用户 CRUD 与 Token / 密码管理。

默认 Base URL:http://127.0.0.1:8090。管理面接口需 Authorization(登录返回的 token)。

鉴权 · 用户

用户 CRUD 与 Token/密码管理。

GET/auth/v1/users需要鉴权

查询用户

查询用户。

  • Authorizationheader · string必填

    登录返回的 token。

  • idquery · string可选

    id

  • namequery · string可选

    name

  • offsetquery · integer可选

    offset

  • limitquery · integer可选

    limit

请求示例
curl -sS -X GET 'http://127.0.0.1:8090/auth/v1/users' \
  -H "Authorization: $TOKEN"
响应示例
{
  "code": 200000,
  "info": "execute success"
}
POST/auth/v1/users需要鉴权

创建用户

创建用户。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · User[]必填

    请求体为 User 的 JSON 数组;下列为单条字段。

  • idbody · string可选

    id

  • namebody · string可选

    name

  • passwordbody · string可选

    password

  • ownerbody · string可选

    owner

  • sourcebody · string可选

    source

  • auth_tokenbody · string可选

    auth_token

  • token_enablebody · bool可选

    token_enable

  • commentbody · string可选

    comment

  • user_typebody · string可选

    user_type

  • mobilebody · string可选

    mobile

  • emailbody · string可选

    email

  • metadatabody · map<string,string>可选

    metadata

  • codebody · uint32必填

    业务码。

  • infobody · string可选

    提示信息。

  • Userbody · User可选

    实体字段。

    • idbody · string可选

      id

    • namebody · string可选

      name

    • passwordbody · string可选

      password

    • ownerbody · string可选

      owner

    • sourcebody · string可选

      source

    • auth_tokenbody · string可选

      auth_token

    • token_enablebody · bool可选

      token_enable

    • commentbody · string可选

      comment

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

    • user_typebody · string可选

      user_type

    • mobilebody · string可选

      mobile

    • emailbody · string可选

      email

    • metadatabody · map<string,string>可选

      metadata

请求示例
curl -sS -X POST 'http://127.0.0.1:8090/auth/v1/users' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
响应示例
{
  "code": 200000,
  "info": "execute success"
}
PUT/auth/v1/users需要鉴权

更新用户

更新用户。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · User[]必填

    请求体为 User 的 JSON 数组;下列为单条字段。

  • idbody · string可选

    id

  • namebody · string可选

    name

  • passwordbody · string可选

    password

  • ownerbody · string可选

    owner

  • sourcebody · string可选

    source

  • auth_tokenbody · string可选

    auth_token

  • token_enablebody · bool可选

    token_enable

  • commentbody · string可选

    comment

  • user_typebody · string可选

    user_type

  • mobilebody · string可选

    mobile

  • emailbody · string可选

    email

  • metadatabody · map<string,string>可选

    metadata

  • codebody · uint32必填

    业务码。

  • infobody · string可选

    提示信息。

  • Userbody · User可选

    实体字段。

    • idbody · string可选

      id

    • namebody · string可选

      name

    • passwordbody · string可选

      password

    • ownerbody · string可选

      owner

    • sourcebody · string可选

      source

    • auth_tokenbody · string可选

      auth_token

    • token_enablebody · bool可选

      token_enable

    • commentbody · string可选

      comment

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

    • user_typebody · string可选

      user_type

    • mobilebody · string可选

      mobile

    • emailbody · string可选

      email

    • metadatabody · map<string,string>可选

      metadata

请求示例
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/users' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
响应示例
{
  "code": 200000,
  "info": "execute success"
}
POST/auth/v1/users/delete需要鉴权

删除用户

删除用户。

  • Authorizationheader · string必填

    登录返回的 token。

  • (body)body · User[]必填

    请求体为 User 的 JSON 数组;下列为单条字段。

  • idbody · string可选

    id

  • namebody · string可选

    name

  • passwordbody · string可选

    password

  • ownerbody · string可选

    owner

  • sourcebody · string可选

    source

  • auth_tokenbody · string可选

    auth_token

  • token_enablebody · bool可选

    token_enable

  • commentbody · string可选

    comment

  • user_typebody · string可选

    user_type

  • mobilebody · string可选

    mobile

  • emailbody · string可选

    email

  • metadatabody · map<string,string>可选

    metadata

  • codebody · uint32必填

    业务码。

  • infobody · string可选

    提示信息。

  • Userbody · User可选

    实体字段。

    • idbody · string可选

      id

    • namebody · string可选

      name

    • passwordbody · string可选

      password

    • ownerbody · string可选

      owner

    • sourcebody · string可选

      source

    • auth_tokenbody · string可选

      auth_token

    • token_enablebody · bool可选

      token_enable

    • commentbody · string可选

      comment

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

    • user_typebody · string可选

      user_type

    • mobilebody · string可选

      mobile

    • emailbody · string可选

      email

    • metadatabody · map<string,string>可选

      metadata

请求示例
curl -sS -X POST 'http://127.0.0.1:8090/auth/v1/users/delete' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
响应示例
{
  "code": 200000,
  "info": "execute success"
}
PUT/auth/v1/user/password需要鉴权

修改密码

修改密码。

  • Authorizationheader · string必填

    登录返回的 token。

  • idbody · string可选

    id

  • old_passwordbody · string可选

    old_password

  • new_passwordbody · string可选

    new_password

  • codebody · uint32必填

    业务码。

  • infobody · string可选

    提示信息。

  • ModifyUserPasswordbody · ModifyUserPassword可选

    实体字段。

    • idbody · string可选

      id

    • old_passwordbody · string可选

      old_password

    • new_passwordbody · string可选

      new_password

请求示例
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/user/password' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
响应示例
{
  "code": 200000,
  "info": "execute success"
}
GET/auth/v1/user/token需要鉴权

获取用户 Token

获取用户 Token。

  • Authorizationheader · string必填

    登录返回的 token。

  • idquery · string必填

    id

请求示例
curl -sS -X GET 'http://127.0.0.1:8090/auth/v1/user/token' \
  -H "Authorization: $TOKEN"
响应示例
{
  "code": 200000,
  "info": "execute success"
}
PUT/auth/v1/user/token/enable需要鉴权

启用/禁用用户 Token

启用/禁用用户 Token。

  • Authorizationheader · string必填

    登录返回的 token。

  • idbody · string可选

    id

  • namebody · string可选

    name

  • passwordbody · string可选

    password

  • ownerbody · string可选

    owner

  • sourcebody · string可选

    source

  • auth_tokenbody · string可选

    auth_token

  • token_enablebody · bool可选

    token_enable

  • commentbody · string可选

    comment

  • user_typebody · string可选

    user_type

  • mobilebody · string可选

    mobile

  • emailbody · string可选

    email

  • metadatabody · map<string,string>可选

    metadata

  • codebody · uint32必填

    业务码。

  • infobody · string可选

    提示信息。

  • Userbody · User可选

    实体字段。

    • idbody · string可选

      id

    • namebody · string可选

      name

    • passwordbody · string可选

      password

    • ownerbody · string可选

      owner

    • sourcebody · string可选

      source

    • auth_tokenbody · string可选

      auth_token

    • token_enablebody · bool可选

      token_enable

    • commentbody · string可选

      comment

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

    • user_typebody · string可选

      user_type

    • mobilebody · string可选

      mobile

    • emailbody · string可选

      email

    • metadatabody · map<string,string>可选

      metadata

请求示例
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/user/token/enable' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
响应示例
{
  "code": 200000,
  "info": "execute success"
}
PUT/auth/v1/user/token/refresh需要鉴权

刷新用户 Token

刷新用户 Token。

  • Authorizationheader · string必填

    登录返回的 token。

  • idbody · string可选

    id

  • namebody · string可选

    name

  • passwordbody · string可选

    password

  • ownerbody · string可选

    owner

  • sourcebody · string可选

    source

  • auth_tokenbody · string可选

    auth_token

  • token_enablebody · bool可选

    token_enable

  • commentbody · string可选

    comment

  • user_typebody · string可选

    user_type

  • mobilebody · string可选

    mobile

  • emailbody · string可选

    email

  • metadatabody · map<string,string>可选

    metadata

  • codebody · uint32必填

    业务码。

  • infobody · string可选

    提示信息。

  • Userbody · User可选

    实体字段。

    • idbody · string可选

      id

    • namebody · string可选

      name

    • passwordbody · string可选

      password

    • ownerbody · string可选

      owner

    • sourcebody · string可选

      source

    • auth_tokenbody · string可选

      auth_token

    • token_enablebody · bool可选

      token_enable

    • commentbody · string可选

      comment

    • ctimebody · string可选

      ctime

    • mtimebody · string可选

      mtime

    • user_typebody · string可选

      user_type

    • mobilebody · string可选

      mobile

    • emailbody · string可选

      email

    • metadatabody · map<string,string>可选

      metadata

请求示例
curl -sS -X PUT 'http://127.0.0.1:8090/auth/v1/user/token/refresh' \
  -H "Authorization: $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[]'
响应示例
{
  "code": 200000,
  "info": "execute success"
}

On this page