红小豆数字   ->   API

添加表单数据【saveData】


通过这个API,用户可以插入表单数据。

名称: {{baseuri}}/formData/saveData

参数:

http方法: POST

步骤


下面是使用步骤

@baseuri = http://localhost:8080/cubedrive-webapp
@username= admin
@password= abcabc
@xAuthToken=bbb6c793-832c-4733-9601-a023366d918f

###
GET {{baseuri}}/getLogin?j_username={{username}}&j_password={{password}}

###
POST {{baseuri}}/formData/saveData?formId=6671575366949146624
X-Auth-Token: {{xAuthToken}}
Content-Type: application/json

{
  formId: "6671575366949146624"
  data: 
	u295: null
	u524: "小公募"
	u811: "2020-06-13T04:00:00.000Z"
	u1040: "刚拿到材料,请大家开始推介。"
	u2490: "上海2组"
	u2942: "2020-05-31T04:00:00.000Z"
	u7184: "吴筱菊"
	u8882: "20浦房集住房租赁专项公司债二期"
	_u2942: "6月上旬"
	_weight_u2942: 99999999
}
    

组成data数据格式


用户需要以一定的方式组成表单的数据。在【获取表单结构】, 用户可以看到如下数据结构。每个field都有一个【uid】, 用户必须用这个uid对应的值组成上面的数据结构。

{
  "success": true,
  "form": {
    "id": "6671575366949146624",
    "fields": [
      {
        "id": "5411",
        "title": "发行时间",
        "col": 8,
        "uid": "u2942",
        "hidden": false,
        "settings": {
          "dt": 2,
          "showRequired": false,
          "disabled": true,
          "hint": "",
          "title": "发行时间",
          "initialVal": "",
          "changeAllow": false,
          "description": "",
          "hidden": false,
          "openTplType": "default",
          "dfm": "M月d日(l)",
          "hasMetaData": true,
          "list": [],
          "listCss": [],
          "addSortWeight": true,
          "nullValNotInSort": true
        },
        "permission": null
      },
      {
        "id": "5412",
        "title": "债券类型",
        "col": 7,
        "uid": "u524",
        "hidden": false,
        "settings": {
          "dt": 1,
          "showRequired": false,
          "disabled": false,
          "hint": "",
          "title": "债券类型",
          "initialVal": "",
          "changeAllow": false,
          "description": "",
          "hidden": false,
          "openTplType": "default",
          "dv": ""
        },
        "permission": null
      },
      ...   
    ],
    "author": false
  }
}
    
注意: 每个field都有一个数据类型,请确认数据的格式是对的。例如: 日期格式是 "2020-05-31"

表单字段数据格式


查询结果


{
	dataId: "6678019837546991616"
	obj: {id: "6678019837546991616",…}
	success: true
	updateAt: 1592164040774
}