OpenAPI Enterprise Edition
Login-Interface
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /user/login | POST | application/x-www-form-urlencoded |
| Parametername | Typ | Pflichtig | Beschreibung |
|---|
| username | string | ja | Benutzername |
| password | string | ja | Passwort |
- Durch den Aufruf des Login-Interfaces kann ein Token abgerufen werden.
- Der Zugriff auf alle OpenAPIs (mit Ausnahme des Login-Interfaces) erfordert eine Authentifizierung.
- Die Authentifizierung erfolgt über das Anfügen des Feldes
Authorization im Request-Header, dessen Wert das Token ist.
Datenquelle erstellen
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /datasource/add | POST | application/json |
- Beispiel für die Parameter:
json{
"note": "local",
"name": "local-mysql",
"detail": {
"type": "mysql",
"url": "jdbc:mysql://localhost:3306/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8",
"username": "root",
"password": "root",
"edit_password": true,
"driver": "com.mysql.cj.jdbc.Driver",
"druidProperties": "druid.testWhileIdle=true\ndruid.breakAfterAcquireFailure=true\ndruid.connectionErrorRetryAttempts=3",
"tableSql": "show tables"
},
"type": "jdbc"
}
Datenquelle löschen
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /datasource/delete/ | POST | application/x-www-form-urlencoded |
Gruppe erstellen
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /group/create | POST | application/x-www-form-urlencoded |
| Parametername | Typ | Pflichtig | Beschreibung |
|---|
| name | string | ja | Gruppenname |
Gruppe löschen
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /group/delete/ | POST | application/x-www-form-urlencoded |
API erstellen
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /apiConfig/add | POST | application/json |
- Beispiel für die Parameter:
json{
"note": "Abfrage von Studentendaten",
"cachePlugin": {
"pluginType": 1
},
"access": 1,
"paramsJson": [
{
"name": "id",
"type": "bigint",
"note": "Studenten-ID"
}
],
"taskJson": [
{
"taskType": 1,
"sqlList": [
{
"sqlText": "select * from student where id = #{id}"
}
],
"transaction": 0,
"datasourceId": "5iaIut1Z"
}
],
"paramRules": [
{
"apiId": "J3z0SP59",
"script": "id > 0",
"type": "JavaScript",
"message": "Die ID muss positiv sein"
}
],
"groupId": "leqbGt5S",
"globalTransformPlugin": {
"pluginType": 3
},
"path": "student/all",
"name": "Datenabfrage",
"alarmPlugins": [
{
"pluginType": 2
}
],
"transformScript": {
"type": "JavaScript"
},
"contentType": "application/x-www-form-urlencoded",
"jsonParam": "{}"
}
API ändern
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /apiConfig/update | POST | application/json |
- Beispiel für die Parameter:
json{
"note": "Abfrage von Studentendaten",
"cachePlugin": {
"pluginType": 1,
"apiId": "J3z0SP59"
},
"access": 1,
"paramsJson": [
{
"note": "Studenten-ID",
"name": "id",
"type": "bigint"
}
],
"taskJson": [
{
"taskType": 1,
"sqlList": [
{
"sqlText": "select * from student where id = #{id}"
}
],
"transaction": 0,
"datasourceId": "5iaIut1Z"
}
],
"paramRules": [
{
"id": 1,
"apiId": "J3z0SP59",
"script": "id > 0",
"type": "JavaScript",
"message": "Die ID muss positiv sein"
}
],
"groupId": "leqbGt5S",
"globalTransformPlugin": {
"pluginType": 3,
"apiId": "J3z0SP59"
},
"path": "student/all",
"name": "Datenabfrage",
"alarmPlugins": [
{
"pluginType": 2,
"apiId": "J3z0SP59"
}
],
"transformScript": {
"apiId": "J3z0SP59",
"type": "JavaScript"
},
"id": "J3z0SP59",
"contentType": "application/x-www-form-urlencoded"
}
API online stellen
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /apiConfig/online/ | POST | application/x-www-form-urlencoded |
API offline stellen
| API-Adresse | HTTP-Methode | Content-Type |
|---|
| /apiConfig/offline/ | POST | application/x-www-form-urlencoded |