Skip to content

Latest commit

 

History

History
206 lines (154 loc) · 3.09 KB

test-spring-api.rest

File metadata and controls

206 lines (154 loc) · 3.09 KB

@devhost=http://localhost:5000 @cookie=auth_name=SuperTestUser;auth_token=123456

## About user

### POST {{devhost}}/api/login Content-Type: application/json Cookie: {{cookie}}

{
"name": "Spring", "password": "123456"

}

### POST {{devhost}}/api/logout Cookie: {{cookie}}

### GET {{devhost}}/api/user/info Cookie: {{cookie}}

# About Group ### GET {{devhost}}/api/group Cookie: {{cookie}}

### POST {{devhost}}/api/group Cookie: {{cookie}} Content-Type: application/json

{
"name": "Group-Z", "intro": "intro"

}

### GET {{devhost}}/api/group/name Cookie: {{cookie}}

# About Application ### GET {{devhost}}/api/application Cookie: {{cookie}}

### GET {{devhost}}/api/application/name?groupId=1 Cookie: {{cookie}}

### POST {{devhost}}/api/application Content-Type: application/json Cookie: {{cookie}}

{
"name": "producer-server", "intro": "商家服务, 提供商家相关接口", "groupId": 4

}

### DELETE {{devhost}}/api/application/8 Cookie: {{cookie}}

### About protobuf GET {{devhost}}/api/protobuf?search=order-server Cookie: {{cookie}}

### GET {{devhost}}/api/protobuf Cookie: {{cookie}}

### GET {{devhost}}/api/protobuf/1 Cookie: {{cookie}}

### POST {{devhost}}/api/protobuf Content-Type: application/json Cookie: {{cookie}}

{
"name": "producer_service", "intro": "商家服务rpc接口", "groupName": "Group-A", "applicationName": "Application-1", "protocol": "grpc"

}

### PUT {{devhost}}/api/protobuf/1/intro Content-Type: application/json Cookie: {{cookie}}

{
"intro": "订单服务rpc接口的描述"

}

### PUT {{devhost}}/api/protobuf/3/current-version Content-Type: application/json Cookie: {{cookie}}

{
"version": 102

}

### DELETE {{devhost}}/api/protobuf/3 Cookie: {{cookie}}

### GET {{devhost}}/api/protobuf/1/current-code Cookie: {{cookie}}

### POST {{devhost}}/api/protobuf/code Content-Type: application/json Cookie: {{cookie}}

{
"protobufId": 1, "code": "syntax = "proto3";

package tutorial;

option java_multiple_files = true; option java_package = "com.example.tutorial.protos";

message Person {
string name = 1;
int32 id = 2; string email = 3;
enum PhoneType {
PHONE_TYPE_UNSPECIFIED = 0; PHONE_TYPE_MOBILE = 2; PHONE_TYPE_HOME = 2; PHONE_TYPE_WORK = 3;

}

message PhoneNumber {
string number = 1; PhoneType type = 2;

}

repeated PhoneNumber phones = 4;

}

message AddressBook {
repeated Person people = 1;

}

message FindPersonRequest {
int32 id = 1;

}

service PersonService {

rpc FindPerson (FindPersonRequest) returns (Person) {};
}",
"creator": "onemsg"

}

### GET {{devhost}}/api/protobuf/code/2 Cookie: {{cookie}}

### GET {{devhost}}/api/protobuf/1/code-version Cookie: {{cookie}}

### 生成客户端代码 GET {{devhost}}/api/protobuf/tools/generate-client-jar?protobufId=1 Cookie: {{cookie}}

### GET {{devhost}}/sleep?time=1000 Cookie: {{cookie}}

### GET {{devhost}}/test-null

### GET {{devhost}}/test-null-html # Accept: text/html

### GET {{devhost}}/error

### GET {{devhost}}/test-exception

### GET {{devhost}}/test-exception Accept: text/html

### GET {{devhost}}/404