服务端API
默认返回结构
名称 | 含义 | 类型 |
---|---|---|
code | 成功:200、失败:500、未登录:403 | Number |
data | 问卷列表数据 | Content |
msg | 错误提示信息 | String |
问卷状态
NEW = 'new', // 新建
EDITING = 'editing', // 编辑
PAUSING = 'pausing', // 暂停
PUBLISHED = 'published', // 发布
REMOVED = 'removed', // 删除
FORCE_REMOVED = 'forceRemoved', // 从回收站删除
问卷基础管理
创建问卷
用于创建问卷
POST /api/survey/createSurvey
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyType | 问卷类型 | String | Y | |
title | 问卷标题 | String | Y | |
remark | 问卷描述 | String | Y | |
createMethod | 创建方式 | String | Y | |
createFrom | 创建来源 | String | Y |
请求示例
{
"surveyType": "normal",
"title": "问卷",
"remark": "",
"loginLimitType": "unlimited",
"loginType": ""
}
返回示例
{
"success": true,
"data": {
"id": "64c8bde289e41908d8898d13"
}
}
获取问卷列表
获取问卷列表
GET /api/survey/getList
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
pageSize | 每次获取数据 | number | Y | |
curPage | 当前页码,从 1 开始 | number | Y | |
filter | 筛选条件 | FilterItem[] | N | |
order | 排序条件 | OrderItem[] | N | |
workspaceId | 新建的空间 id | string | Y |
FilterItem
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
comparator | 条件之间的关系,$or :或者,默认合并条件进行查询 | string | N | |
condition | 筛选条件 | FilterCondition | Y |
FilterCondition
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
field | 筛选字段,title :搜索问卷名、 curStatus.status :筛选问卷状态、surveyType :问卷类型 | string | Y | |
comparator | 比较符,$ne 、$regex :匹配问卷 title | string | N | |
value | 筛选/搜索条件 | string | Y |
OrderItem
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
field | 字段名 | string | Y | |
value | 升序降序, -1、1 | number | Y |
请求示例
{
"pageSize": 10,
"curPage": 1,
"filter": [
{
"comparator": "",
"condition": [
{
"field": "title",
"value": "问卷1",
"comparator": "$regex"
}
]
},
{
"comparator": "",
"condition": [
{
"field": "curStatus.status",
"value": "published"
}
]
},
{
"comparator": "",
"condition": [
{
"field": "surveyType",
"value": "normal"
}
]
}
],
"order": [
{
"field": "createDate",
"value": 1
}
],
"workspaceId": ""
}
返回示例
{
"success": true,
"data": {
"data": [
{
"_id": "64c8bde289e41908d8898d13",
"name": "测试名字",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690878454080
},
"createDate": 1690877410380,
"creator": "test",
"owner": "test"
},
{
"_id": "64c21f84c553d5f8ca9f364f",
"name": "",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690443652253
},
"createDate": 1690443652253,
"creator": "test",
"owner": "test"
}
],
"count": 2
}
}
修改问卷
用于修改问卷
POST /api/survey/updateMeta
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y | |
title | 问卷标题 | string | Y | |
remark | 问卷描述 | string | Y |
请求示例
{
"surveyId": "64c8bde289e41908d8898d13",
"title": "问卷标题",
"remark": "问卷描述"
}
删除问卷
用于删除问卷
POST /api/survey/deleteSurvey
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y |
请求示例
{
"surveyId": "64c8bde289e41908d8898d13"
}
返回示例
{
"success": true,
"data": {
"surveyMetaDeleteRes": {
"acknowledged": true,
"deletedCount": 0
}
}
}
问卷编辑管理
获取问卷配置
用于获取问卷配置
GET /api/survey/getSurvey
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y |
请求示例
/api/survey/getSurvey?surveyId=64c8bde289e41908d8898d13
返回示例
{
"success": true,
"data": {
"surveyMetaRes": {
"_id": "64c8bde289e41908d8898d13",
"name": "测试名字",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877410380
},
"createDate": 1690877410380
},
"surveyConfRes": {
"_id": "64c8bde289e41908d8898d14",
"pageId": "64c8bde289e41908d8898d13",
"pageType": "normal",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877410471
},
"code": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"passwordSwitch": true,
"password": "xxx",
"whitelistType": "CUSTOM",
"memberType": "MOBILE",
"whitelist": ["xxx"],
"whitelistTip": "xxx"
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
}
}
}
获取 Banner 配置
用于获取问卷配置
GET /api/survey/getBannerData
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
请求示例
GET /api/survey/getBannerData
返回示例
{
"code": 200,
"data": {
"temp": {
"key": "default",
"name": "默认分类",
"list": [
{
"src": "/imgs/skin/nUc1h8MM0y1582635399432.png",
"title": "1"
},
{
"src": "/imgs/skin/EqcneDJ8xI1582635403367.png",
"title": "2"
}
]
},
"activity": {
"key": "activity",
"name": "节日",
"list": [
{
"src": "/imgs/skin/Ixx8hqiwwk1660979120801.jpg",
"title": "1"
},
{
"src": "/imgs/skin/q2eDZjSLnB1660978085149.jpg",
"title": "2"
},
{
"src": "/imgs/skin/bTemK3oa0z1660978085209.jpg",
"title": "3"
},
{
"src": "/imgs/skin/ObQBPJqViY1660978085693.jpg",
"title": "4"
}
]
},
"creative": {
"key": "creative",
"name": "创意",
"list": [
{
"src": "/imgs/skin/PLwNH1rAie1558430219772.jpg",
"title": "1"
},
{
"src": "/imgs/skin/NnXsAOhBNm1558430219312.jpg",
"title": "2"
},
{
"src": "/imgs/skin/ujpUoWqhw31558430220124.jpg",
"title": "3"
},
{
"src": "/imgs/skin/5OCvbjqJQm1558430220362.jpg",
"title": "4"
},
{
"src": "/imgs/skin/0k7Jg7In8I1558430221154.jpg",
"title": "5"
},
{
"src": "/imgs/skin/UH0A8DbTai1558430221033.jpg",
"title": "6"
},
{
"src": "/imgs/skin/FRIzPC6ZtN1558430221344.jpg",
"title": "7"
}
]
},
"scenery": {
"key": "scenery",
"name": "风景",
"list": [
{
"src": "/imgs/skin/SyiLRcukyE1558430525760.jpg",
"title": "1"
},
{
"src": "/imgs/skin/sqYig4AcWr1558430525663.jpg",
"title": "2"
},
{
"src": "/imgs/skin/ElNeqJT2I21558430526165.jpg",
"title": "3"
},
{
"src": "/imgs/skin/CxQkSU6AY21558430526163.jpg",
"title": "4"
},
{
"src": "/imgs/skin/VTUwbp6vY61558430527320.jpg",
"title": "5"
},
{
"src": "/imgs/skin/SHs0K703Yn1558430527218.jpg",
"title": "6"
},
{
"src": "/imgs/skin/oVTedX9V4s1558430527671.jpg",
"title": "7"
}
]
},
"transportation": {
"key": "transportation",
"name": "交通",
"list": [
{
"src": "/imgs/skin/XYKqJZuMig1558430904735.jpg",
"title": "1"
},
{
"src": "/imgs/skin/GnPatsr48Z1558430904680.jpg",
"title": "2"
},
{
"src": "/imgs/skin/UqIvVvEXAK1558430905204.jpg",
"title": "3"
},
{
"src": "/imgs/skin/PUssufh5uI1558430905104.jpg",
"title": "4"
},
{
"src": "/imgs/skin/O409pRTDlW1558430905738.jpg",
"title": "5"
},
{
"src": "/imgs/skin/A9FzlbYXqI1558430905739.jpg",
"title": "6"
},
{
"src": "/imgs/skin/HN9YGctDeF1558430906686.jpg",
"title": "7"
}
]
},
"delicacy": {
"key": "delicacy",
"name": "美食",
"list": [
{
"src": "/imgs/skin/lE6PSclCcU1558434536703.jpg",
"title": "1"
},
{
"src": "/imgs/skin/OnSdbm7u6n1558434536641.jpg",
"title": "2"
},
{
"src": "/imgs/skin/N9Z2ZuyO731558434537314.jpg",
"title": "3"
},
{
"src": "/imgs/skin/YP9PoW8pX51558434537301.jpg",
"title": "4"
},
{
"src": "/imgs/skin/zUtDv378bg1558434538351.jpg",
"title": "5"
},
{
"src": "/imgs/skin/gY1JljCow21558434538303.jpg",
"title": "6"
},
{
"src": "/imgs/skin/oOjHPbABdd1558434538864.jpg",
"title": "7"
}
]
},
"business": {
"key": "business",
"name": "商务",
"list": [
{
"src": "/imgs/skin/3ABKqvDaVn1558514860472.jpg",
"title": "1"
},
{
"src": "/imgs/skin/OewuaQmWoq1558514860285.jpg",
"title": "2"
},
{
"src": "/imgs/skin/HuVqqtbFjs1558514860570.jpg",
"title": "3"
},
{
"src": "/imgs/skin/icSlqsr0uZ1558514860875.jpg",
"title": "4"
},
{
"src": "/imgs/skin/Qu9rg33wmq1558514861015.jpg",
"title": "5"
},
{
"src": "/imgs/skin/145gBCRtNP1558514861211.jpg",
"title": "6"
},
{
"src": "/imgs/skin/ykWLFV0QWj1558514861444.jpg",
"title": "7"
}
]
},
"campus": {
"key": "campus",
"name": "校园",
"list": [
{
"src": "/imgs/skin/4aWi5JxG471558514268698.jpg",
"title": "1"
},
{
"src": "/imgs/skin/j8C2OBP7WK1558514268563.jpg",
"title": "2"
},
{
"src": "/imgs/skin/q3uJoQhYsR1558514268877.jpg",
"title": "3"
},
{
"src": "/imgs/skin/W5PPlNsmsr1558514269088.jpg",
"title": "4"
},
{
"src": "/imgs/skin/6xQk1IAmKt1558514269874.jpg",
"title": "5"
},
{
"src": "/imgs/skin/XQE2iyF0rj1558514269935.jpg",
"title": "6"
},
{
"src": "/imgs/skin/POHlQiSwPR1558514270379.jpg",
"title": "7"
}
]
}
}
}
获取历史数据
用于获取问卷配置
GET /api/surveyHistory/getList
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y | |
historyType | 历史数据类别 | string | Y | dailyHis 日常保存历史; publishHis 发布历史 |
请求示例
/api/surveyHistory/getList?surveyId=64c8bde289e41908d8898d13&historyType=dailyHis
返回示例
{
"success": true,
"data": [
{
"_id": "64c8c001e593703b0f458074",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877953435
},
"pageId": "64c8bde289e41908d8898d13",
"type": "dailyHis",
"code": {
"data": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">2欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
},
"createDate": 1690877953435
},
{
"_id": "64c8bfeee593703b0f458073",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877934313
},
"pageId": "64c8bde289e41908d8898d13",
"type": "dailyHis",
"code": {
"data": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
},
"createDate": 1690877934313,
"operator": {
"_id": "64c8ccd1eb145f835dce08fa",
"username": "test"
}
}
]
}
记录编辑窗口
用于编辑冲突检测
POST /api/session/create
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | String | Y |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
sessionId | 问卷编辑窗口会话 id | number | Y |
获取问卷编辑权限
用于编辑冲突检测
POST /api/session/seize
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
sessionId | 问卷编辑窗口会话 id | number | Y |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
sessionId | 问卷编辑窗口会话 id | number | Y |
保存问卷
用于保存问卷
POST /api/surveyConf/updateConf
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | String | Y | |
sessionId | 问卷编辑会话 ID | Object | Y | |
configData | 问卷数据 | Object | Y |
请求示例
{
"surveyId": "64c8bde289e41908d8898d13",
"sessionId": "66f0e7ad90207bca808aa178",
"configData": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">2欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
}
返回示例
{
"success": true,
"msg": ""
}
发布问卷
用于发布问卷
POST /api/survey/publishSurvey
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y |
请求示例
{
"surveyId": "64c8bde289e41908d8898d13"
}
返回示例
{
"success": true,
"data": {
"updateMetaRes": {
"acknowledged": true,
"modifiedCount": 1,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
},
"insertPublishRes": {
"acknowledged": true,
"insertedId": {}
},
"historyRes": {
"acknowledged": true,
"insertedId": {}
}
}
}
C 端接口
获取已发布问卷 schema
获取发布后的问卷数据 schema
get /api/responseSchema/getSchema
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyPath | 问卷短 ID | String | Y |
请求示例
/api/responseSchema/getSchema?surveyPath=9VBpGNQi
返回示例
{
"success": true,
"data": {
"surveyMetaRes": {
"_id": "64c8bde289e41908d8898d13",
"name": "测试名字",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690878454080
},
"createDate": 1690877410380
},
"surveyPublishRes": {
"_id": "64c8bde289e41908d8898d14",
"pageId": "64c8bde289e41908d8898d13",
"pageType": "normal",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877410471
},
"code": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">2欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
}
}
}
获取选项已选信息
get /api/counter/queryOptionCountInfo
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyPath | 问卷短 ID | String | Y | |
fieldList | 题目 ID,逗号隔开 | String | Y |
请求示例
/api/counter/queryOptionCountInfo?fieldList=data458,data459&surveyPath=9VBpGNQi
返回示例
{
"code": 200,
"data": {
"data458": {
"9584": 2,
"9585": 1,
"total": 5
}
}
}
提交问卷
用于提交问卷
POST /api/surveyResponse/createResponse
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyPath | 问卷短 ID | String | Y | |
data | 活动数据,如果 encryptType 为 base64 则 data 数据 JSON 化后传 base64 字符串 | String | Y | |
encryptType | 加密方式 | String | N | |
sign | 签名 | String | Y | |
verifyId | 白名单 ID | String | N | |
whitelist | 用户输入的值(手机号/邮箱/用户名) | String | N | |
password | 密码 | String | N |
请求示例
{
"surveyId": "64c8bde289e41908d8898d13",
"data": {
"data458": "11111",
"data515": "E0GZGNDY",
"scores": {},
"optionsWithId": {
"data515": [
{
"id": "E0GZGNDY",
"value": "选项1"
}
]
},
"channel": "",
"p": "",
"diffTime": 14.138,
"secret": ""
},
"sign": "",
"backParams": {},
"cityId": "",
"cityName": "",
"omgh5fp": "a4edc724-b201-4e53-877b-d9b4f134909f",
"isForceSubmit": false,
"memberKey": "",
"businessParams": {},
"clientTime": 1690183745048,
"userInfo": {},
"appName": "Others"
}
返回示例
{
"code": 200,
"success": true
}
白名单验证
POST /api/responseSchema/:surveyPath/validate
Request
字段 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
whitelist | 用户输入的值(手机号/邮箱/用户名) | String | N | |
password | 密码 | String | N |
返回示例
{
"code": 200,
"data": {
"result": true,
"verifyId": "xxx"
}
}
数据分析
获取回收数据
获取回收数据
GET /api/survey/dataStatistic/dataTable
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y | |
page | 页码 | number | N | 1 |
isShowSecret | [是否展示脱敏的数据]{.mark} | boolean | N | false |
pageSize | 页面尺寸 | number | N | 10 |
请求示例
GET /api/survey/dataStatistic/dataTable
返回示例
{
"success": true,
"data": {
"total": 1,
"listHead": [
{
"field": "data458",
"title": "标题1",
"type": "text"
},
{
"field": "data515",
"title": "标题2",
"type": "radio-v"
}
],
"listBody": [
{
"_id": "64ca0a8ee71efa1ace9eb574",
"surveyId": "64c8bde289e41908d8898d13",
"data": {
"data458": "11111",
"data515": "E0GZGNDY",
"scores": {},
"optionsWithId": {
"data515": [
{
"id": "E0GZGNDY",
"value": "选项1"
}
]
},
"channel": "",
"p": "",
"diffTime": 14.138,
"secret": ""
},
"sign": "",
"backParams": {},
"cityId": "",
"cityName": "",
"omgh5fp": "a4edc724-b201-4e53-877b-d9b4f134909f",
"isForceSubmit": false,
"memberKey": "",
"businessParams": {},
"clientTime": 1690183745048,
"userInfo": {},
"appName": "Others",
"pageId": "64c8bde289e41908d8898d13",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690962574622
},
"createDate": 1690962574622
}
]
}
}
分题统计
分题统计
GET /api/survey/dataStatistic/aggregationStatis
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y |
请求示例
GET /api/survey/dataStatistic/aggregationStatis?surveyId=xxx
返回示例
{
"code": 200,
"data": [
{
"field": "data515",
"data": {
"aggregation": [
{
"id": "115019",
"text": "选项1",
"count": 3
},
{
"id": "115020",
"text": "选项2",
"count": 1
}
],
"submitionCount": 4
},
"title": "<p>单选</p>",
"type": "radio"
},
{
"field": "data389",
"data": {
"aggregation": [
{
"id": "140079",
"text": "选项1",
"count": 2
},
{
"id": "657361",
"text": "选项2",
"count": 4
},
{
"id": "029899",
"text": "选项",
"count": 1
}
],
"submitionCount": 4
},
"title": "<p>多选标题</p>",
"type": "checkbox"
},
{
"field": "data551",
"data": {
"aggregation": [
{
"id": "187688",
"text": "对",
"count": 1
},
{
"id": "264793",
"text": "错",
"count": 3
}
],
"submitionCount": 4
},
"title": "<p>判断题</p>",
"type": "binary-choice"
},
{
"field": "data731",
"data": {
"aggregation": [
{
"text": "1",
"id": "1",
"count": 0
},
{
"text": "2",
"id": "2",
"count": 0
},
{
"text": "3",
"id": "3",
"count": 0
},
{
"text": "4",
"id": "4",
"count": 1
},
{
"text": "5",
"id": "5",
"count": 3
}
],
"submitionCount": 4,
"summary": {
"average": "4.75",
"median": "5.00",
"variance": "0.21"
}
},
"title": "<p>评分题</p>",
"type": "radio-star"
},
{
"field": "data249",
"data": {
"aggregation": [
{
"text": "0",
"id": "0",
"count": 0
},
{
"text": "1",
"id": "1",
"count": 0
},
{
"text": "2",
"id": "2",
"count": 0
},
{
"text": "3",
"id": "3",
"count": 0
},
{
"text": "4",
"id": "4",
"count": 0
},
{
"text": "5",
"id": "5",
"count": 0
},
{
"text": "6",
"id": "6",
"count": 0
},
{
"text": "7",
"id": "7",
"count": 0
},
{
"text": "8",
"id": "8",
"count": 1
},
{
"text": "9",
"id": "9",
"count": 1
},
{
"text": "10",
"id": "10",
"count": 2
}
],
"submitionCount": 4,
"summary": {
"average": "9.25",
"median": "9.50",
"variance": "0.73",
"nps": "75.00%"
}
},
"title": "<p>NPS标题</p>",
"type": "radio-nps"
},
{
"field": "data234",
"data": {
"aggregation": [
{
"id": "597844",
"text": "选项1",
"count": 3
},
{
"id": "646556",
"text": "选项2",
"count": 1
}
],
"submitionCount": 4
},
"title": "标题8",
"type": "vote"
}
]
}
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
data | 协作人列表 | Array<QuestionItem> | Y |
QuestionItem
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
field | 题目 id | string | Y |
title | 题目标题 | string | Y |
type | 类型 | string | Y |
data | 分题数据 | Data | Y |
Data
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
submitionCount | 提交的用户数 | number | Y |
aggregation | 分题数据 | Array<Aggregation> | Y |
summary | 聚合数据 | Array<Aggregation> | Y |
Aggregation
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
id | 选项的 id 或者评分的分数 | string | Y |
text | 选项的文本或者评分的分数 | string | Y |
count | 选择当前选项的 | string | Y |
Summary
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
average | 平均分 | string | Y |
median | 中位数 | string | Y |
variance | 方差 | string | Y |
nps | 净推荐值,只有 nps 题才会返回 | string | N |
创建下载任务
创建下载任务
POST /api/downloadTask/createTask
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
surveyId | 问卷 ID | string | Y | |
isMasked | 是否脱敏 | boolean | N | false |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
taskId | 任务 id | string | Y |
获取下载任务列表
获取下载任务列表
GET /api/downloadTask/getDownloadTaskList
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
pageIndex | 页码 | number | N | 1 |
pageSize | 查询数量 | number | N | 20 |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
total | 任务总数 | number | Y |
list | 任务列表 | ListItem | Y |
ListItem
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
taskId | 任务 id | string | Y |
curStatus | 任务状态 | Y | |
filename | 文件名 | string | Y |
url | 文件链接 | string | Y |
fileSize | 文件大小 | string | Y |
createDate | 任务生成时间 | string | Y |
获取单个下载任务
获取单个下载任务
GET /api/downloadTask/getDownloadTask
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
taskId | 任务 id | string | Y |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
surveyId | 问卷 id | string | Y |
url | 文件链接 | string | Y |
filename | 文件名 | string | Y |
fileSize | 文件大小 | string | Y |
删除单个下载任务
删除单个下载任务
POST /api/downloadTask/deleteDownloadTask
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
taskId | 任务 id | string | Y |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
data | 是否删除成功,true 表示删除成功 | boolean | Y |
授权
注册
用于注册用户
POST /api/auth/register
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
username | 用户名 | String | Y | |
password | 密码 | String | Y | |
captchaId | 验证码 id | String | Y | |
captcha | 验证码文案 | String | Y |
请求示例
{
"username": "test",
"password": "123456",
"captcha": "xhfs",
"captchaId": "65b9e69de8df57de0ff04ced"
}
返回示例
{
"success": true,
"data": {
"username": "xxx",
"token": "xxx"
}
}
登录
登录
POST /api/auth/login
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
username | 用户名 | String | Y | |
password | 密码 | String | Y | |
captchaId | 验证码 id | String | Y | |
captcha | 验证码文案 | String | Y |
请求示例
{
"username": "test",
"password": "123456",
"captcha": "xhfs",
"captchaId": "65b9e69de8df57de0ff04ced"
}
返回示例
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGM4Y2NkMWViMTQ1ZjgzNWRjZTA4ZmEiLCJ1c2VybmFtZSI6InRlc3QiLCJpYXQiOjE2OTA4ODE1NzAsImV4cCI6MTY5MDkxMDM3MH0.wnJ_CGLKU5ljSUnocNwk4FkR6cS_5Pe_uMM2yeMYu9I"
}
}
默认 token 有效 8 小时,使用方式放到请求头的 headers 中的 Authorization,如:
Authorization:Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGM4Y2NkMWViMTQ1ZjgzNWRjZTA4ZmEiLCJ1c2VybmFtZSI6InRlc3QiLCJpYXQiOjE2OTA4ODE1NzAsImV4cCI6MTY5MDkxMDM3MH0.wnJ_CGLKU5ljSUnocNwk4FkR6cS_5Pe_uMM2yeMYu9I
密码强度检测
GET /api/password/strength'
Request
字段 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
password | 密码 | String | Y |
Response
字段 | 含义 | 类型 | 默认值 |
---|---|---|---|
data | 密码强度 | Strong orMedium orWeak | Weak |
获取用户列表
GET /api/user/getUserList?username=xxx
Request
字段 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
username | 查询的用户名 | string | Y | - |
pageIndex | 页码,默认 1 | number | N | 1 |
pageSize | 每页查询条数,默认 10 | number | N | 10 |
Response
字段 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
data | 用户列表 | Array<User> | Y | [] |
User
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
userId | 用户 id | string | Y |
username | 用户名 | string | Y |
获取用户信息
GET /api/user/getUserInfo
Request
名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
Response
字段 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
userId | 用户 id | string | Y | |
username | 用户名 | string | Y |
空间/协作权限
创建空间
POST /api/workspace
Request
字段 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
name | 空间名称 | string | Y | |
description | 空间描述 | string | N | |
members | 空间成员 | Array<Member> | N |
Member
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
userId | 用户 id | string | Y |
role | 用户角色枚举:admin、user | string | Y |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
workspaceId | 新建的空间 id | string | Y |
获取空间列表
获取我参与的空间列表
GET /api/workspace
Request
字段 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
pageSize | 每次获取数据 | number | Y | |
curPage | 当前页码,从 1 开始 | number | N | |
name | 空间名字 | string | N |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
list | 空间列表 | Array<Workspace> | Y |
Workspace
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
_id | 空间 id | string | Y |
ownerId | 所有者 id | string | Y |
owner | 所有者用户名 | string | Y |
name | 空间名称 | string | Y |
description | 空间描述 | string | Y |
currentUserId | 当前用户的 id | string | Y |
currentUserRole | 当前用户的角色,枚举:admin、user | string | Y |
surveyTotal | 包含的问卷总数 | number | Y |
memberTotal | 包含的成员总数 | number | Y |
获取空间成员列表
GET /api/workspace/member/list
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
members | 成员列表 | Array<Member> | Y |
Member
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
_id | 成员 id | string | Y |
userId | 用户 id | string | Y |
username | 用户名 | string | Y |
workspaceId | 空间 ID | string | Y |
获取空间详情
GET /api/workspace/{workspaceId}
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
_id | 空间 id | string | Y |
name | 空间名称 | string | Y |
description | 空间描述 | string | Y |
members | 空间成语啊 | Array<Member> | Y |
Member
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
_id | 成员 id | string | Y |
userId | 用户 id | string | Y |
username | 用户名 | string | Y |
role | 用户角色 | string | Y |
currentUserId | 当前用户的 id | string | Y |
currentUserRole | 当前用户的角色,枚举:admin、user | string | Y |
更新空间信息
POST /api/workspace/{workspaceId}
Request
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
name | 空间名称 | string | Y |
description | 空间描述 | string | N |
members | 空间成员 | Array<Member> | N |
Member
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
_id | 成员 id,新添加的不用传 | string | N |
userId | 用户 id | string | Y |
role | 用户角色 | string | Y |
body 示例
{
"name": "新的空间名称",
"description": "新的空间描述",
"members": [
{
userId: "xxx", "role": "user"
},
{
userId: "xxx", "role": "admin", _id: string
}
]
}
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
code | 状态码,200 表示正常 | number | Y |
删除空间
DELETE /api/workspace/{workspaceId}
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
code | 状态码,200 表示正常 | number | Y |
获取所有的协作权限列表
GET /api/collaborator/getPermissionList
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
data | 可选权限列表 | Array<Permission> | Y |
Permission
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
name | 权限说明 | string | Y |
value | 权限标识 | number | Y |
批量保存协作人(不区分新增还是更新)
POST /api/collaborator/batchSave
Request
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
surveyId | 问卷 id | string | Y |
collaborators | 协作人列表 | Array<Collaborator> | N |
Collaborator
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
_id | 成员 id,新添加的不用传 | string | N |
userId | 用户 id | string | Y |
permissions | 用户权限,1002,1002,1003 | Array<number> | Y |
body 示例
{
"surveyId": "xxx",
"collaborators": [
{
userId: "xxx", "permissions": [1001,1002]
},
{
userId: "xxx", "permissions": [1001,1002] _id: "xxx"
}
]
}
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
code | 状态码,200 表示正常 | number | Y |
获取问卷的协作人列表
GET /api/collaborator?surveyId=xxx
Query
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
surveyId | 问卷 id | string | Y |
Response
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
data | 协作人列表 | Array<Collaborator> | Y |
Collaborator
字段 | 含义 | 类型 | 必填 |
---|---|---|---|
_id | 协作 id | string | Y |
surveyId | 问卷 id | string | Y |
userId | 用户 id | string | Y |
username | 用户名 | string | Y |
permissions | 权限列表,枚举 1001、1002、1003 | Array<number> | Y |