API Docs
YMS API
Get Authorization

默认模块

YMS SaaS 平台基础 API - 仅包含核心功能

Base URLs:

Authentication

  • HTTP Authentication, scheme: bearer

Auth Management/Level 1

POST Login by Password

POST /auth/yms/login-by-password

Body 请求参数

{
  "username": "string",
  "password": "string",
  "tenantId": "string"
}

请求参数

名称位置类型必选说明
X-Tenant-IDheaderstringnone
Item-Time-Zoneheaderstringnone
Authorizationheaderstringnone
bodybodyUserLoginCmdnone

返回示例

200 Response

{
  "code": 0,
  "msg": "",
  "success": false,
  "data": {
    "refreshToken": "",
    "accessToken": "",
    "idToken": "",
    "userProfile": {
      "userId": "",
      "userName": "",
      "admin": false,
      "tenantId": "",
      "yardList": [
        {
          "yardId": "",
          "yardName": "",
          "timezone": ""
        }
      ],
      "yardIds": [
        ""
      ],
      "defaultYardId": ""
    },
    "userDetail": {
      "email": "",
      "firstName": "",
      "lastName": "",
      "userName": "",
      "userPermissions": [
        {
          "id": 0,
          "name": "",
          "parentId": 0,
          "title": ""
        }
      ]
    },
    "tenants": [
      {
        "tenantId": "",
        "tenantName": "",
        "unisCompany": false,
        "yards": [
          {
            "yardId": "",
            "yardName": "",
            "timezone": ""
          }
        ]
      }
    ],
    "tenantUserProfilesMap": {
      "": {
        "userId": "",
        "userName": "",
        "admin": false,
        "tenantId": "",
        "yardList": [
          {
            "yardId": "",
            "yardName": "",
            "timezone": ""
          }
        ],
        "yardIds": [
          ""
        ],
        "defaultYardId": ""
      }
    }
  }
}

返回结果

状态码状态码含义说明数据模型
200OK (opens in a new tab)noneRUserLoginView

数据模型

YardIsolatedView

{
  "yardId": "string",
  "yardName": "string",
  "timezone": "string"
}
 

属性

名称类型必选约束中文名说明
yardIdstringfalsenonenone
yardNamestringfalsenonenone
timezonestringfalsenonenone

UserProfileView

{
  "userId": "string",
  "userName": "string",
  "admin": true,
  "tenantId": "string",
  "yardList": [
    {
      "yardId": "string",
      "yardName": "string",
      "timezone": "string"
    }
  ],
  "yardIds": [
    "string"
  ],
  "defaultYardId": "string"
}
 

属性

名称类型必选约束中文名说明
userIdstringfalsenoneUnique identifier for the user in the system
userNamestringfalsenoneDisplay name of the user as shown in the interface
adminbooleanfalsenoneAdministrative privilege status indicating whether the user has system admin rights (true/false)
tenantIdstringfalsenoneTenant identifier that the user belongs to for multi-tenant isolation
yardList[YardIsolatedView]falsenoneDetailed list of yards the user has access to with complete yard information and isolation settings
yardIds[string]falsenoneSimple list of yard identifiers that the user has access to, used for quick reference
defaultYardIdstringfalsenoneDefault yard identifier that is automatically selected for this user when logging in

UserLoginView

{
  "refreshToken": "string",
  "accessToken": "string",
  "idToken": "string",
  "userProfile": {
    "userId": "string",
    "userName": "string",
    "admin": true,
    "tenantId": "string",
    "yardList": [
      {
        "yardId": "string",
        "yardName": "string",
        "timezone": "string"
      }
    ],
    "yardIds": [
      "string"
    ],
    "defaultYardId": "string"
  },
  "userDetail": {
    "email": "string",
    "firstName": "string",
    "lastName": "string",
    "userName": "string",
    "userPermissions": [
      {
        "id": 0,
        "name": "string",
        "parentId": 0,
        "title": "string"
      }
    ]
  },
  "tenants": "Collections.emptyList()",
  "tenantUserProfilesMap": "Collections.emptyMap()"
}
 

属性

名称类型必选约束中文名说明
refreshTokenstringfalsenoneJWT refresh token used to obtain new access tokens
accessTokenstringfalsenoneJWT access token for authenticating API requests
idTokenstringfalsenoneJWT ID token containing user identity information
userProfileUserProfileViewfalsenoneBasic user profile information including name, email, etc.
userDetailUserDetailViewfalsenoneDetailed user information including preferences and settings
tenants[Tenant]falsenoneList of tenant organizations that the user has access to
tenantUserProfilesMapMapUserProfileViewfalsenoneMap of user profiles for each tenant, keyed by tenant ID

RUserLoginView

{
  "code": 0,
  "msg": "string",
  "success": true,
  "data": {
    "refreshToken": "string",
    "accessToken": "string",
    "idToken": "string",
    "userProfile": {
      "userId": "string",
      "userName": "string",
      "admin": true,
      "tenantId": "string",
      "yardList": [
        {
          "yardId": "string",
          "yardName": "string",
          "timezone": "string"
        }
      ],
      "yardIds": [
        "string"
      ],
      "defaultYardId": "string"
    },
    "userDetail": {
      "email": "string",
      "firstName": "string",
      "lastName": "string",
      "userName": "string",
      "userPermissions": [
        {
          "id": 0,
          "name": "string",
          "parentId": 0,
          "title": "string"
        }
      ]
    },
    "tenants": "Collections.emptyList()",
    "tenantUserProfilesMap": "Collections.emptyMap()"
  }
}
 

属性

名称类型必选约束中文名说明
codeinteger(int64)falsenonenone
msgstringfalsenonenone
successbooleanfalsenonenone
dataUserLoginViewfalsenonenone

UserLoginCmd

{
  "username": "string",
  "password": "string",
  "tenantId": "string"
}
 

属性

名称类型必选约束中文名说明
usernamestringtruenonenone
passwordstringtruenonenone
tenantIdstringfalsenonenone

PermissionDTO

{
  "id": 0,
  "name": "string",
  "parentId": 0,
  "title": "string"
}
 

属性

名称类型必选约束中文名说明
idinteger(int64)falsenonenone
namestringfalsenonenone
parentIdinteger(int64)falsenonenone
titlestringfalsenonenone

UserDetailView

{
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "userName": "string",
  "userPermissions": [
    {
      "id": 0,
      "name": "string",
      "parentId": 0,
      "title": "string"
    }
  ]
}
 

属性

名称类型必选约束中文名说明
emailstringfalsenonenone
firstNamestringfalsenonenone
lastNamestringfalsenonenone
userNamestringfalsenonenone
userPermissions[PermissionDTO]falsenonenone

key

{
  "userId": "string",
  "userName": "string",
  "admin": true,
  "tenantId": "string",
  "yardList": [
    {
      "yardId": "string",
      "yardName": "string",
      "timezone": "string"
    }
  ],
  "yardIds": [
    "string"
  ],
  "defaultYardId": "string"
}
 

属性

名称类型必选约束中文名说明
userIdstringfalsenoneUnique identifier for the user in the system
userNamestringfalsenoneDisplay name of the user as shown in the interface
adminbooleanfalsenoneAdministrative privilege status indicating whether the user has system admin rights (true/false)
tenantIdstringfalsenoneTenant identifier that the user belongs to for multi-tenant isolation
yardList[YardIsolatedView]falsenoneDetailed list of yards the user has access to with complete yard information and isolation settings
yardIds[string]falsenoneSimple list of yard identifiers that the user has access to, used for quick reference
defaultYardIdstringfalsenoneDefault yard identifier that is automatically selected for this user when logging in

YardInfo

{
  "yardId": "string",
  "yardName": "string",
  "timezone": "string"
}
 

属性

名称类型必选约束中文名说明
yardIdstringfalsenoneUnique yard identifier
yardNamestringfalsenoneHuman-readable yard name for display
timezonestringfalsenoneTimezone identifier of the yard, e.g., "America/Los_Angeles"

Tenant

{
  "tenantId": "string",
  "tenantName": "string",
  "unisCompany": true,
  "yards": "Collections.emptyList()"
}
 

属性

名称类型必选约束中文名说明
tenantIdstringfalsenoneUnique tenant identifier
tenantNamestringfalsenoneHuman-readable tenant name for display
unisCompanybooleanfalsenoneWhether this tenant is a UniS company
yards[YardInfo]falsenoneList of yards associated with this tenant
Defaults to empty list to ensure safe iteration

MapUserProfileView

{
  "key": {
    "userId": "string",
    "userName": "string",
    "admin": true,
    "tenantId": "string",
    "yardList": [
      {
        "yardId": "string",
        "yardName": "string",
        "timezone": "string"
      }
    ],
    "yardIds": [
      "string"
    ],
    "defaultYardId": "string"
  }
}
 

属性

名称类型必选约束中文名说明
keykeyfalsenonenone