增加postmanmodel 和 json文件

This commit is contained in:
xingzi 2019-11-29 13:47:08 +08:00
parent f2c46d526a
commit 48adc5a160
7 changed files with 365 additions and 0 deletions

View File

@ -0,0 +1,37 @@
package com.power.doc.model.postman;
import java.util.UUID;
/**
* @author xingzi
*/
public class InfoBean {
private final String _postman_id =UUID.randomUUID().toString();
private String name;
public InfoBean(String name) {
this.name = name;
}
public InfoBean() {
this.name = "smart-doc";
}
public String get_postman_id() {
return _postman_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSchema() {
String schema = "https://schema.getpostman.com/json/collection/v2.0.0/collection.json";
return schema;
}
}

View File

@ -0,0 +1,32 @@
package com.power.doc.model.postman;
import com.power.doc.model.postman.request.RequestBean;
import java.util.List;
/**
* @author xingzi
*/
public class ItemBean {
private String name;
private RequestBean request;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public RequestBean getRequest() {
return request;
}
public void setRequest(RequestBean request) {
this.request = request;
}
}

View File

@ -0,0 +1,28 @@
package com.power.doc.model.postman;
import java.util.List;
/**
* @author xingzi
*/
public class RequestItem {
private InfoBean info;
private List<ItemBean> item;
public InfoBean getInfo() {
return info;
}
public void setInfo(InfoBean info) {
this.info = info;
}
public List<ItemBean> getItem() {
return item;
}
public void setItem(List<ItemBean> item) {
this.item = item;
}
}

View File

@ -0,0 +1,57 @@
package com.power.doc.model.postman.request;
import com.power.doc.model.postman.request.body.BodyBean;
import com.power.doc.model.postman.request.header.HeaderBean;
import java.util.List;
/**
* @author xingzi
*/
public class RequestBean {
private String method;
private BodyBean body;
private String url;
private String description;
private List<HeaderBean> header;
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public BodyBean getBody() {
return body;
}
public void setBody(BodyBean body) {
this.body = body;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<HeaderBean> getHeader() {
return header;
}
public void setHeader(List<HeaderBean> header) {
this.header = header;
}
}

View File

@ -0,0 +1,27 @@
package com.power.doc.model.postman.request.body;
/**
* @author xingzi
*/
public class BodyBean {
private String mode;
private String raw;
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public String getRaw() {
return raw;
}
public void setRaw(String raw) {
this.raw = raw;
}
}

View File

@ -0,0 +1,53 @@
package com.power.doc.model.postman.request.header;
/**
* @author xingzi
*/
public class HeaderBean {
private String key;
private String value;
private String type;
private boolean disabled;
private String name;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public boolean isDisabled() {
return disabled;
}
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
}

View File

@ -0,0 +1,131 @@
{
"info": {
"_postman_id": "1ae3c2c6-450c-873c-84bae5a6ed8d",
"name": "test1",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "登录",
"request": {
"method": "POST",
"header": [
{
"key": "token",
"value": "0p7urnuy4jfx0pynb942kr16m",
"type": "text",
"disabled": true
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"userId\": \"admin\",\n \"userName\": \"admin\",\n \"password\": \"123456\",\n \"captcha\": \"derx\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "http://localhost:8080/program/user/login",
"description": "45634534"
}
},
{
"name": "get请求测试",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "token",
"value": "d833ajrzkr1grz6d5u6urzwlu",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"current\":2,\n\t\"\n}"
},
"url": "http://localhost:8080/program/statistics/getBurnDown?programId=2",
"description": "get描述"
}
},
{
"name": "post请求测试",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "token",
"value": "7bdn36y3797z8dk846uvusw1d",
"type": "text"
},
{
"key": "head2",
"value": "12312",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\"programId\":2}"
},
"url": "http://localhost:8080/program/statistics/getprogram",
"description": "post描述"
}
},
{
"name": "post文件上传测试",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
},
{
"key": "token",
"type": "text",
"value": "7bdn36y3797z8dk846uvusw1d"
},
{
"key": "head2",
"type": "text",
"value": "12312"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"type": "file",
"src": "/D:/wallhaven-dgk9qm.png"
}
]
},
"url": "http://localhost:8080/program/statistics/getprogram",
"description": "post文件上传测试"
}
}
]
}