diff --git a/hinghwa-dict-backend/quiz/forms.py b/hinghwa-dict-backend/quiz/forms.py index 147dbf9d..35188379 100644 --- a/hinghwa-dict-backend/quiz/forms.py +++ b/hinghwa-dict-backend/quiz/forms.py @@ -1,8 +1,14 @@ from django import forms -from .models import Quiz +from .models import Quiz, QuizRecord class QuizForm(forms.ModelForm): class Meta: model = Quiz fields = ("question", "options", "answer", "explanation") + + +class QuizRecordForm(forms.ModelForm): + class Meta: + model = QuizRecord + fields = ("answer", "correctness", "contributor") diff --git a/hinghwa-dict-backend/quiz/migrations/0006_quiz_record.py b/hinghwa-dict-backend/quiz/migrations/0006_quiz_record.py new file mode 100644 index 00000000..4a650cb8 --- /dev/null +++ b/hinghwa-dict-backend/quiz/migrations/0006_quiz_record.py @@ -0,0 +1,58 @@ +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ("quiz", "0005_paper_record"), + ] + + operations = [ + migrations.CreateModel( + name="QuizRecord", + fields=[ + ("answer", models.CharField(max_length=1000, verbose_name="答案")), + ("correctness", models.BooleanField(verbose_name="是否正确")), + ("timestamp", models.DateTimeField(verbose_name="时间")), + ( + "id", + models.CharField( + max_length=20, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "contributor", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="QuizRecordUser", + to=settings.AUTH_USER_MODEL, + verbose_name="答题人", + ), + ), + ( + "paper", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="quiz_paper", + to="quiz.paperrecord", + verbose_name="所在试卷", + ), + ), + ( + "quiz", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="quiz", + to="quiz.quiz", + verbose_name="测试题", + ), + ), + ], + ), + ] diff --git a/hinghwa-dict-backend/quiz/models.py b/hinghwa-dict-backend/quiz/models.py index e4d3bd96..72fce44f 100644 --- a/hinghwa-dict-backend/quiz/models.py +++ b/hinghwa-dict-backend/quiz/models.py @@ -60,3 +60,26 @@ class PaperRecord(models.Model): verbose_name="试卷", ) id = models.CharField(max_length=20, verbose_name="ID", primary_key=True) + + +class QuizRecord(models.Model): + contributor = models.ForeignKey( + User, + on_delete=models.CASCADE, + related_name="QuizRecordUser", + verbose_name="答题人", + ) + quiz = models.ForeignKey( + Quiz, on_delete=models.CASCADE, related_name="quiz", verbose_name="测试题" + ) + paper = models.ForeignKey( + PaperRecord, + on_delete=models.CASCADE, + related_name="quiz_paper", + verbose_name="所在答卷记录", + null=True, + ) + answer = models.CharField(max_length=1000, verbose_name="答案") + correctness = models.BooleanField(verbose_name="是否正确") + timestamp = models.DateTimeField(verbose_name="时间") + id = models.CharField(max_length=20, verbose_name="ID", primary_key=True) diff --git a/hinghwa-dict-backend/quiz/paper/dto/paper_simple.py b/hinghwa-dict-backend/quiz/paper/dto/paper_simple.py new file mode 100644 index 00000000..de97e4d7 --- /dev/null +++ b/hinghwa-dict-backend/quiz/paper/dto/paper_simple.py @@ -0,0 +1,11 @@ +from ...models import Paper + + +# 返回问卷简单信息 +def paper_simple(paper: Paper): + response = { + "id": paper.id, + "title": paper.title, + } + + return response diff --git a/hinghwa-dict-backend/quiz/quiz_record/dto/quiz_record.py b/hinghwa-dict-backend/quiz/quiz_record/dto/quiz_record.py new file mode 100644 index 00000000..c4f3489b --- /dev/null +++ b/hinghwa-dict-backend/quiz/quiz_record/dto/quiz_record.py @@ -0,0 +1,18 @@ +from ...models import QuizRecord +from ...dto.quiz_all import quiz_all +from ...paper.dto.paper_record_dto import paper_record_all +from user.dto.user_simple import user_simple + + +def quiz_record(record: QuizRecord): + response = { + "id": record.id, + "contributor": user_simple(record.contributor), + "timestamp": record.timestamp, + "quiz": quiz_all(record.quiz), + "answer": record.answer, + "correctness": record.correctness, + "paper": None if record.paper is None else paper_record_all(record.paper), + } + + return response diff --git a/hinghwa-dict-backend/quiz/quiz_record/view/quiz_record_all.py b/hinghwa-dict-backend/quiz/quiz_record/view/quiz_record_all.py new file mode 100644 index 00000000..1bf01479 --- /dev/null +++ b/hinghwa-dict-backend/quiz/quiz_record/view/quiz_record_all.py @@ -0,0 +1,63 @@ +from django.http import JsonResponse +import demjson +from ..dto.quiz_record import quiz_record +from django.views import View +from ...models import Quiz, Paper, QuizRecord +from utils.token import token_pass, token_user +from utils.generate_id import generate_quiz_record_id +from ...forms import QuizRecordForm +from utils.exception.types.not_found import ( + PaperRecordNotFoundException, + QuizNotFoundException, + UserNotFoundException, +) +from utils.exception.types.bad_request import BadRequestException +from django.utils import timezone +from user.models import User +from ...models import PaperRecord + + +class QuizRecordAll(View): + # QZ0401创建答题记录 + def post(self, request): + token_pass(request.headers) + body = demjson.decode(request.body) + record_form = QuizRecordForm(body) + quiz_id = request.GET["quiz_id"] + quiz = Quiz.objects.filter(id=quiz_id) + if body["paper_record"] != "": + paper = PaperRecord.objects.filter(id=body["paper_record"]) + if not paper.exists(): + raise PaperRecordNotFoundException() + if not quiz.exists(): + raise QuizNotFoundException() + quiz = quiz[0] + contributor = User.objects.filter(id=body["contributor"]) + if not contributor.exists(): + raise UserNotFoundException() + contributor = contributor[0] + if not record_form.is_valid(): + raise BadRequestException() + record = record_form.save(commit=False) + record.id = generate_quiz_record_id() + if body["paper_record"] != "": + paper = PaperRecord.objects.filter(id=body["paper_record"]) + if not paper.exists(): + raise PaperRecordNotFoundException() + paper = paper[0] + record.paper = paper + record.quiz = quiz + record.contributor = contributor + record.timestamp = timezone.now() + print("test") + record.save() + return JsonResponse(quiz_record(record), status=200) + + # QZ0402查询所有答题记录 + def get(self, request): + token_pass(request.headers, -1) + records = QuizRecord.objects.all() + results = [] + for record in records: + results.append(quiz_record(record)) + return JsonResponse({"total": len(results), "records": results}, status=200) diff --git a/hinghwa-dict-backend/quiz/quiz_record/view/quiz_record_single.py b/hinghwa-dict-backend/quiz/quiz_record/view/quiz_record_single.py new file mode 100644 index 00000000..53fd2fb4 --- /dev/null +++ b/hinghwa-dict-backend/quiz/quiz_record/view/quiz_record_single.py @@ -0,0 +1,65 @@ +from django.http import JsonResponse +import demjson +from ..dto.quiz_record import quiz_record +from django.views import View +from ...models import Paper, QuizRecord, PaperRecord +from utils.token import token_pass +from ...forms import QuizRecordForm +from utils.exception.types.not_found import ( + UserNotFoundException, + PaperRecordNotFoundException, + QuizRecordNotFoundException, +) +from django.utils import timezone +from user.models import User + + +class QuizRecordSingle(View): + # QZ0403查询特定答题记录 + def get(self, request, record_id): + token_pass(request.headers, -1) + record = QuizRecord.objects.filter(id=record_id) + if not record.exists(): + raise QuizRecordNotFoundException + record = record[0] + return JsonResponse(quiz_record(record), status=200) + + # QZ0404更改特定答题记录 + def put(self, request, record_id): + token_pass(request.headers, -1) + body = demjson.decode(request.body) + if body["paper_record"] != "": + paper = PaperRecord.objects.filter(id=body["paper_record"]) + if not paper.exists(): + raise PaperRecordNotFoundException() + record = QuizRecord.objects.filter(id=record_id) + if not record.exists(): + raise QuizRecordNotFoundException + record = record[0] + record.answer = body["answer"] + record.correctness = body["correctness"] + contributor = User.objects.filter(id=body["contributor"]) + if not contributor.exists(): + raise UserNotFoundException() + contributor = contributor[0] + if body["paper_record"] != "": + paper = PaperRecord.objects.filter(id=body["paper_record"]) + if not paper.exists(): + raise PaperRecordNotFoundException() + paper = paper[0] + record.paper = paper + record.timestamp = timezone.now() + record.contributor = contributor + record.save() + return JsonResponse(quiz_record(record), status=200) + + # QZ0405删除特定答题记录 + def delete(self, request, record_id): + token_pass(request.headers, -1) + record = QuizRecord.objects.filter(id=record_id) + id = str(record_id) + if not record.exists(): + raise QuizRecordNotFoundException + record = record[0] + record.delete() + return JsonResponse({"msg": "答题记录{}删除成功".format(id)}, status=200) diff --git a/hinghwa-dict-backend/quiz/urls.py b/hinghwa-dict-backend/quiz/urls.py index 642640f6..69471e21 100644 --- a/hinghwa-dict-backend/quiz/urls.py +++ b/hinghwa-dict-backend/quiz/urls.py @@ -1,8 +1,8 @@ from django.urls import path -from .paper.view.manage_all import * -from .paper.view.manage_single import * from .views import * from .paper.view.paper_record_all import * +from .quiz_record.view.quiz_record_all import * +from .quiz_record.view.quiz_record_single import * from .paper.view.paper_record_single import * app_name = "users" @@ -12,4 +12,8 @@ path("/", csrf_exempt(SingleQuiz.as_view())), # QZ0101 QZ0103 QZ0104 path("//visibility", csrf_exempt(ManageVisibility.as_view())), # QZ0105 path("/random", csrf_exempt(RandomQuiz.as_view())), # QZ0202 + path("/records", csrf_exempt(QuizRecordAll.as_view())), # QZ0401 QZ0402 + path( + "/records/", csrf_exempt(QuizRecordSingle.as_view()) + ), # QZ0403 QZ0404 ] diff --git a/hinghwa-dict-backend/utils/exception/types/not_found.py b/hinghwa-dict-backend/utils/exception/types/not_found.py index 33e931d9..cfabea51 100644 --- a/hinghwa-dict-backend/utils/exception/types/not_found.py +++ b/hinghwa-dict-backend/utils/exception/types/not_found.py @@ -210,3 +210,15 @@ def __init__(self, id=""): super().__init__() self.status = 404 self.msg = "答卷记录{}不存在!".format(id) + + +class QuizRecordNotFoundException(NotFoundException): + """ + 答题记录不存在异常 + parma id:答题记录id + """ + + def __init__(self, id=""): + super().__init__() + self.status = 404 + self.msg = "答题记录{}不存在!".format(id) diff --git a/hinghwa-dict-backend/utils/generate_id.py b/hinghwa-dict-backend/utils/generate_id.py index aeecd201..8cc5a13b 100644 --- a/hinghwa-dict-backend/utils/generate_id.py +++ b/hinghwa-dict-backend/utils/generate_id.py @@ -3,6 +3,7 @@ from rewards.products.models.product import Product from rewards.orders.models.order import Order from word.models import List +from quiz.models import Paper, PaperRecord, QuizRecord from quiz.models import Paper, PaperRecord @@ -74,3 +75,13 @@ def generate_paper_record_id(): else: new_id = 1 return f"DJ{new_id:06d}" + + +def generate_quiz_record_id(): + last_quiz_record = QuizRecord.objects.order_by("-id").first() + if last_quiz_record: + last_id = int(last_quiz_record.id[2:]) + new_id = last_id + 1 + else: + new_id = 1 + return f"DT{new_id:06d}" diff --git a/hinghwa-dict-backend/word/lists/view/manage_all_list.py b/hinghwa-dict-backend/word/lists/view/manage_all_list.py index f5693352..b5626c89 100644 --- a/hinghwa-dict-backend/word/lists/view/manage_all_list.py +++ b/hinghwa-dict-backend/word/lists/view/manage_all_list.py @@ -41,4 +41,4 @@ def get(self, request): result = [] for list in total_list: result.append(list_all(list)) - return JsonResponse({"total": len(result), "lists": result}) + return JsonResponse({"total": len(result), "lists": result}, status=200) diff --git a/tests/quiz_record_200.json b/tests/quiz_record_200.json new file mode 100644 index 00000000..d6380775 --- /dev/null +++ b/tests/quiz_record_200.json @@ -0,0 +1,4604 @@ +{ + "apifoxCli": "1.1.0", + "item": [ + { + "item": [ + { + "id": "75068eac-175b-4056-9696-fdf4df2d8774", + "name": "LG0101 账号密码登录(登录用户admin)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "login" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"username\": \"admin\",\r\n \"password\": \"testtest123\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.token`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`token`, value);console.log('已设置环境变量【token】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【token】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + }, + { + "listen": "test", + "script": { + "id": "postProcessors.1.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.variables.set(`user_id`, value);console.log('已设置临时变量【user_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【user_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183271, + "apiDetailId": 5318056, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "token": { + "type": "string", + "mock": { + "mock": "@string" + }, + "title": "权" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "token", + "id" + ] + }, + "defaultEnable": true, + "projectId": 0, + "ordering": 1, + "unpackerId": "", + "unpackerSetting": "", + "createdAt": "2021-07-29T14:43:37.000Z", + "updatedAt": "2021-08-12T16:27:18.000Z", + "deletedAt": null, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "username": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "password": { + "type": "string", + "mock": { + "mock": "@string('lower', 1, 3)" + }, + "title": "密码" + } + }, + "required": [ + "username", + "password" + ] + } + }, + "metaInfo": { + "httpApiId": 5318056, + "httpApiCaseId": 126746850, + "httpApiName": "LG0101 账号密码登录", + "httpApiPath": "/login", + "httpApiMethod": "post", + "httpApiCaseName": "登录用户admin", + "id": "7d0c230d-5f99-4a80-ad07-c87223eb5140", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "13711933-91ee-45e1-986d-24841ba6e710", + "name": "QZ0102 增加单个测试(QZ0102 增加单个测试)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"记红国率由所历\",\r\n \"answer\": 88,\r\n \"options\": [\r\n \"容白界生存图六制则书验进米切写十流。\",\r\n \"务料后江命正见回建起很一选快子里。\",\r\n \"使管数是明观目土内回求清书。\",\r\n \"平非除听战革命为十传高团消花有数气光。\",\r\n \"压题光适五相思除极先术选复下。\"\r\n ],\r\n \"explanation\": \"国被提教干她话因平通才越但管于。器没身展政非更需而将人地生多经。商也处四建九往务集况素院学二队集。积那连局立状调和号认听化率。\",\r\n \"type\": \"1\",\r\n \"voice_source\": \"http://xpseiecged.gov/thinrxe\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.quiz.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`quiz_id`, value);console.log('已设置环境变量【quiz_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【quiz_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 70048663, + "apiDetailId": 29662986, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "x-apifox-overrides": {}, + "type": "object", + "x-apifox-refs": {}, + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "x-apifox-overrides": {} + } + }, + "required": [ + "quiz" + ], + "x-apifox-orders": [ + "quiz" + ] + }, + "defaultEnable": true, + "projectId": 0, + "ordering": 1, + "unpackerId": "", + "unpackerSetting": "", + "createdAt": "2022-07-15T11:22:03.000Z", + "updatedAt": "2022-07-23T08:30:31.000Z", + "deletedAt": null, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": { + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "$ref": "#/definitions/13080737", + "x-apifox-overrides": {} + } + }, + "metaInfo": { + "httpApiId": 29662986, + "httpApiCaseId": 126746849, + "httpApiName": "QZ0102 增加单个测试", + "httpApiPath": "/quizzes", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0102 增加单个测试", + "id": "c9d495c7-5a4f-49eb-b1ae-e8a1a1f6e48a", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "4f295f0f-1642-44c0-a1df-55b8ed46a552", + "name": "QZ0102 增加单个测试(QZ0102 增加单个测试)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"记红国率由所历\",\r\n \"answer\": 88,\r\n \"options\": [\r\n \"容白界生存图六制则书验进米切写十流。\",\r\n \"务料后江命正见回建起很一选快子里。\",\r\n \"使管数是明观目土内回求清书。\",\r\n \"平非除听战革命为十传高团消花有数气光。\",\r\n \"压题光适五相思除极先术选复下。\"\r\n ],\r\n \"explanation\": \"国被提教干她话因平通才越但管于。器没身展政非更需而将人地生多经。商也处四建九往务集况素院学二队集。积那连局立状调和号认听化率。\",\r\n \"type\": \"2\",\r\n \"voice_source\": \"http://xpseiecged.gov/thinrxe\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 70048663, + "apiDetailId": 29662986, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "x-apifox-overrides": {}, + "type": "object", + "x-apifox-refs": {}, + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "x-apifox-overrides": {} + } + }, + "required": [ + "quiz" + ], + "x-apifox-orders": [ + "quiz" + ] + }, + "defaultEnable": true, + "projectId": 0, + "ordering": 1, + "unpackerId": "", + "unpackerSetting": "", + "createdAt": "2022-07-15T11:22:03.000Z", + "updatedAt": "2022-07-23T08:30:31.000Z", + "deletedAt": null, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": { + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "$ref": "#/definitions/13080737", + "x-apifox-overrides": {} + } + }, + "metaInfo": { + "httpApiId": 29662986, + "httpApiCaseId": 126746848, + "httpApiName": "QZ0102 增加单个测试", + "httpApiPath": "/quizzes", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0102 增加单个测试", + "id": "13347a7e-d3b4-4522-8817-7c908a4eb818", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "2c7ab057-9d59-4ad0-acc4-8c4798fbb1e2", + "name": "QZ0203 测试题组卷(QZ0203 测试题组卷)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "papers" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "number", + "value": "2" + }, + { + "disabled": false, + "key": "type", + "value": "1,2" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"王时流安\"\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`paper_id`, value);console.log('已设置环境变量【paper_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【paper_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "createdAt": "2023-12-06T16:26:16.393Z", + "updatedAt": "2023-12-06T16:26:16.393Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "$ref": "#/definitions/65181535" + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 58017398, + "id": 147260241, + "responseExamples": [], + "schemaDefinitions": { + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "description": "试卷标题" + } + }, + "x-apifox-orders": [ + "title" + ], + "required": [ + "title" + ] + } + }, + "metaInfo": { + "httpApiId": 58017398, + "httpApiCaseId": 126746847, + "httpApiName": "QZ0203 测试题组卷", + "httpApiPath": "/papers", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0203 测试题组卷", + "id": "f07cd8d6-6e5e-4a3a-ac70-3220752a5642", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "2d5cff97-db4f-42cc-98a9-0a810edca88a", + "name": "QZ0401 创建答题记录(QZ0401 创建答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "quiz_id", + "value": "{{quiz_id}}" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"paper_record\": \"\",\r\n \"answer\": \"adipisicing ut ea\",\r\n \"correctness\": \"false\",\r\n \"contributor\": \"1\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`quiz_record_id`, value);console.log('已设置环境变量【quiz_record_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【quiz_record_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "createdAt": "2023-12-21T09:36:13.391Z", + "updatedAt": "2023-12-21T09:36:13.391Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HGG2YBQA0Y8GPE2F3TAV680T" + ], + "required": [], + "x-apifox-refs": { + "01HGG2YBQA0Y8GPE2F3TAV680T": { + "$ref": "#/definitions/71819921" + } + } + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 129579684, + "tempId": "1701346459608", + "id": 35697089, + "responseExamples": [], + "schemaDefinitions": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" + }, + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + }, + "71627581": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "ID" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + }, + "user": { + "$ref": "#/definitions/1077996" + }, + "paper": { + "title": "包含的测试题", + "$ref": "#/definitions/65181535" + } + }, + "x-apifox-orders": [ + "id", + "user", + "timestamp", + "paper" + ], + "required": [ + "id", + "timestamp", + "paper", + "user" + ], + "title": "paper_record_all", + "name": "paper_record_all" + }, + "71819921": { + "type": "object", + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "title": "对应测试题" + }, + "paper": { + "anyOf": [ + { + "$ref": "#/definitions/71627581" + }, + { + "type": "null" + } + ] + }, + "answer": { + "type": "string", + "title": "作答答案" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "@string" + } + }, + "correctness": { + "type": "boolean", + "mock": { + "mock": "@boolean" + }, + "title": "是否正确" + }, + "contributor": { + "title": "答题人", + "mock": { + "mock": "@name" + }, + "$ref": "#/definitions/1077996" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + } + }, + "x-apifox-orders": [ + "id", + "contributor", + "timestamp", + "quiz", + "correctness", + "answer", + "paper" + ], + "required": [ + "quiz", + "answer", + "paper", + "id", + "correctness", + "contributor", + "timestamp" + ], + "title": "quiz_record", + "name": "quiz_record" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "answer": { + "type": "string", + "title": "作答的答案" + }, + "correctness": { + "type": "string", + "title": "是否正确", + "mock": { + "mock": "@boolean" + } + }, + "contributor": { + "type": "string", + "title": "用户id", + "mock": { + "mock": "@string('number', 1, 3)" + } + }, + "paper_record": { + "type": "string", + "title": "所在试卷(可为空)", + "mock": { + "mock": "@string('number', 1, 3)" + } + } + }, + "x-apifox-orders": [ + "paper_record", + "contributor", + "answer", + "correctness" + ], + "required": [ + "paper_record", + "answer", + "correctness", + "contributor" + ] + } + }, + "metaInfo": { + "httpApiId": 129579684, + "httpApiCaseId": 126746951, + "httpApiName": "QZ0401 创建答题记录", + "httpApiPath": "/quizzes/records", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0401 创建答题记录", + "id": "4c9217d7-7e82-41d2-9144-3fccb9022ec5", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "2ba7a6c1-f5a7-463a-8dcc-6129906c29e3", + "name": "QZ0402 查询所有答题记录(QZ0402 查询所有答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "createdAt": "2023-12-21T09:58:50.043Z", + "updatedAt": "2023-12-21T09:58:50.043Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "mock": { + "mock": "@integer" + }, + "title": "总数量" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/definitions/71819921" + } + } + }, + "x-apifox-orders": [ + "total", + "records" + ], + "x-apifox-refs": {}, + "required": [ + "total", + "records" + ] + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 129582250, + "tempId": "1701347042844", + "id": 361865513, + "responseExamples": [], + "schemaDefinitions": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" + }, + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + }, + "71627581": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "ID" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + }, + "user": { + "$ref": "#/definitions/1077996" + }, + "paper": { + "title": "包含的测试题", + "$ref": "#/definitions/65181535" + } + }, + "x-apifox-orders": [ + "id", + "user", + "timestamp", + "paper" + ], + "required": [ + "id", + "timestamp", + "paper", + "user" + ], + "title": "paper_record_all", + "name": "paper_record_all" + }, + "71819921": { + "type": "object", + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "title": "对应测试题" + }, + "paper": { + "anyOf": [ + { + "$ref": "#/definitions/71627581" + }, + { + "type": "null" + } + ] + }, + "answer": { + "type": "string", + "title": "作答答案" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "@string" + } + }, + "correctness": { + "type": "boolean", + "mock": { + "mock": "@boolean" + }, + "title": "是否正确" + }, + "contributor": { + "title": "答题人", + "mock": { + "mock": "@name" + }, + "$ref": "#/definitions/1077996" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + } + }, + "x-apifox-orders": [ + "id", + "contributor", + "timestamp", + "quiz", + "correctness", + "answer", + "paper" + ], + "required": [ + "quiz", + "answer", + "paper", + "id", + "correctness", + "contributor", + "timestamp" + ], + "title": "quiz_record", + "name": "quiz_record" + } + } + }, + "requestDefinition": { + "jsonSchema": {} + }, + "metaInfo": { + "httpApiId": 129582250, + "httpApiCaseId": 126746950, + "httpApiName": "QZ0402 查询所有答题记录", + "httpApiPath": "/quizzes/records", + "httpApiMethod": "get", + "httpApiCaseName": "QZ0402 查询所有答题记录", + "id": "9fbb8f14-dcc3-4f24-bba5-d14cd037a2b8", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "114cf648-d7ec-4fb0-b199-9bedc2013e7e", + "name": "QZ0403 查询特定答题记录(QZ0403 查询特定答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records", + "{{quiz_record_id}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "createdAt": "2023-12-07T09:33:12.897Z", + "updatedAt": "2023-12-07T09:33:12.897Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HGG3CAPNVE0ECFY6BSGT3MGQ" + ], + "required": [], + "x-apifox-refs": { + "01HGG3CAPNVE0ECFY6BSGT3MGQ": { + "$ref": "#/definitions/71819921" + } + } + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 129582292, + "tempId": "1701347126480", + "id": 361863822, + "responseExamples": [], + "schemaDefinitions": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" + }, + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + }, + "71627581": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "ID" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + }, + "user": { + "$ref": "#/definitions/1077996" + }, + "paper": { + "title": "包含的测试题", + "$ref": "#/definitions/65181535" + } + }, + "x-apifox-orders": [ + "id", + "user", + "timestamp", + "paper" + ], + "required": [ + "id", + "timestamp", + "paper", + "user" + ], + "title": "paper_record_all", + "name": "paper_record_all" + }, + "71819921": { + "type": "object", + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "title": "对应测试题" + }, + "paper": { + "anyOf": [ + { + "$ref": "#/definitions/71627581" + }, + { + "type": "null" + } + ] + }, + "answer": { + "type": "string", + "title": "作答答案" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "@string" + } + }, + "correctness": { + "type": "boolean", + "mock": { + "mock": "@boolean" + }, + "title": "是否正确" + }, + "contributor": { + "title": "答题人", + "mock": { + "mock": "@name" + }, + "$ref": "#/definitions/1077996" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + } + }, + "x-apifox-orders": [ + "id", + "contributor", + "timestamp", + "quiz", + "correctness", + "answer", + "paper" + ], + "required": [ + "quiz", + "answer", + "paper", + "id", + "correctness", + "contributor", + "timestamp" + ], + "title": "quiz_record", + "name": "quiz_record" + } + } + }, + "requestDefinition": { + "jsonSchema": {} + }, + "metaInfo": { + "httpApiId": 129582292, + "httpApiCaseId": 126746949, + "httpApiName": "QZ0403 查询特定答题记录", + "httpApiPath": "/quizzes/records/{record_id}", + "httpApiMethod": "get", + "httpApiCaseName": "QZ0403 查询特定答题记录", + "id": "0971e940-230a-43cb-af71-ff064f0e94ce", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "5bdf0c5c-a0ca-4b26-8a82-d9cab1942846", + "name": "QZ0404 更新答题记录(QZ0404 更新答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records", + "{{quiz_record_id}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "PUT", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"paper_record\": \"\",\r\n \"answer\": \"in fugiat\",\r\n \"correctness\": true,\r\n \"contributor\": \"1\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "createdAt": "2023-12-21T10:01:14.599Z", + "updatedAt": "2023-12-21T10:01:14.599Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HGG36NHPXKXYG9XXPKA4WX7Y" + ], + "required": [], + "x-apifox-refs": { + "01HGG36NHPXKXYG9XXPKA4WX7Y": { + "$ref": "#/definitions/71819921" + } + } + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 129582449, + "tempId": "1701347227962", + "id": 361873202, + "responseExamples": [], + "schemaDefinitions": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" + }, + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + }, + "71627581": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "ID" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + }, + "user": { + "$ref": "#/definitions/1077996" + }, + "paper": { + "title": "包含的测试题", + "$ref": "#/definitions/65181535" + } + }, + "x-apifox-orders": [ + "id", + "user", + "timestamp", + "paper" + ], + "required": [ + "id", + "timestamp", + "paper", + "user" + ], + "title": "paper_record_all", + "name": "paper_record_all" + }, + "71819921": { + "type": "object", + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "title": "对应测试题" + }, + "paper": { + "anyOf": [ + { + "$ref": "#/definitions/71627581" + }, + { + "type": "null" + } + ] + }, + "answer": { + "type": "string", + "title": "作答答案" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "@string" + } + }, + "correctness": { + "type": "boolean", + "mock": { + "mock": "@boolean" + }, + "title": "是否正确" + }, + "contributor": { + "title": "答题人", + "mock": { + "mock": "@name" + }, + "$ref": "#/definitions/1077996" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + } + }, + "x-apifox-orders": [ + "id", + "contributor", + "timestamp", + "quiz", + "correctness", + "answer", + "paper" + ], + "required": [ + "quiz", + "answer", + "paper", + "id", + "correctness", + "contributor", + "timestamp" + ], + "title": "quiz_record", + "name": "quiz_record" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "answer": { + "type": "string", + "title": "作答答案" + }, + "correctness": { + "type": "boolean", + "title": "是否正确" + }, + "contributor": { + "type": "string", + "mock": { + "mock": "@string('number', 1, 3)" + }, + "title": "用户id" + }, + "paper_record": { + "type": "string", + "title": "所在试卷" + } + }, + "x-apifox-orders": [ + "paper_record", + "answer", + "correctness", + "contributor" + ], + "required": [ + "paper_record", + "answer", + "correctness", + "contributor" + ] + } + }, + "metaInfo": { + "httpApiId": 129582449, + "httpApiCaseId": 126746948, + "httpApiName": "QZ0404 更新答题记录", + "httpApiPath": "/quizzes/records/{record_id}", + "httpApiMethod": "put", + "httpApiCaseName": "QZ0404 更新答题记录", + "id": "41872fca-a2a2-4faa-b91a-ee02762ad194", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "2693d1f7-4569-475e-8291-37700682751a", + "name": "QZ0405 删除答题记录(QZ0405 删除答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records", + "{{quiz_record_id}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "DELETE", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "createdAt": "2023-12-07T12:08:25.011Z", + "updatedAt": "2023-12-07T12:08:25.011Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 131574153, + "tempId": "1701942356366", + "id": 36535032, + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "metaInfo": { + "httpApiId": 131574153, + "httpApiCaseId": 126746947, + "httpApiName": "QZ0405 删除答题记录", + "httpApiPath": "/quizzes/records/{record_id}", + "httpApiMethod": "delete", + "httpApiCaseName": "QZ0405 删除答题记录", + "id": "7bfa9304-90a3-4af0-8540-f67807ab7a43", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + } + ], + "name": "QZ模块答题记录 200" + } + ], + "info": { + "name": "QZ模块答题记录 200" + }, + "dataSchemas": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" + }, + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "13080737": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号" + }, + "voice_source": { + "type": "string", + "mock": { + "mock": "@url(\"http\")" + }, + "title": "播报语音链接" + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "type" + ], + "title": "[入] quiz_update", + "name": "[入] quiz_update" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + }, + "71627581": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "ID" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + }, + "user": { + "$ref": "#/definitions/1077996" + }, + "paper": { + "title": "包含的测试题", + "$ref": "#/definitions/65181535" + } + }, + "x-apifox-orders": [ + "id", + "user", + "timestamp", + "paper" + ], + "required": [ + "id", + "timestamp", + "paper", + "user" + ], + "title": "paper_record_all", + "name": "paper_record_all" + }, + "71819921": { + "type": "object", + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "title": "对应测试题" + }, + "paper": { + "anyOf": [ + { + "$ref": "#/definitions/71627581" + }, + { + "type": "null" + } + ] + }, + "answer": { + "type": "string", + "title": "作答答案" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "@string" + } + }, + "correctness": { + "type": "boolean", + "mock": { + "mock": "@boolean" + }, + "title": "是否正确" + }, + "contributor": { + "title": "答题人", + "mock": { + "mock": "@name" + }, + "$ref": "#/definitions/1077996" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + } + }, + "x-apifox-orders": [ + "id", + "contributor", + "timestamp", + "quiz", + "correctness", + "answer", + "paper" + ], + "required": [ + "quiz", + "answer", + "paper", + "id", + "correctness", + "contributor", + "timestamp" + ], + "title": "quiz_record", + "name": "quiz_record" + } + }, + "mockRules": { + "rules": [], + "enableSystemRule": true + }, + "environment": { + "id": 510825, + "name": "测试环境", + "baseUrl": "http://127.0.0.1:8000", + "baseUrls": { + "default": "http://127.0.0.1:8000" + }, + "variable": { + "id": "cdac320f-0036-48db-be3a-4cf19691553d", + "name": "测试环境", + "values": [ + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcwMzc1NTQxNy43NzIyMn0.qDtx_ydvnsTAwviajaKRdigEGoZYMkcZG0Xb7rFfe9U", + "key": "token", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "31", + "key": "quiz_id", + "initialValue": "" + }, + { + "type": "any", + "value": "16", + "key": "word_id_2", + "initialValue": "" + }, + { + "type": "any", + "value": "15", + "key": "word_id_1", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "token_2", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_3", + "initialValue": "" + }, + { + "type": "any", + "value": "2", + "key": "user_id", + "initialValue": "" + }, + { + "type": "any", + "value": "1", + "key": "article_id", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_1", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_2", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_2", + "initialValue": "" + }, + { + "type": "any", + "value": 6, + "key": "num_pre", + "initialValue": "" + }, + { + "type": "any", + "value": "7", + "key": "num_later", + "initialValue": "" + }, + { + "type": "any", + "value": "2", + "key": "id", + "initialValue": "2" + }, + { + "type": "any", + "value": "13", + "key": "music_id", + "initialValue": "13" + }, + { + "type": "any", + "value": "undefined", + "key": "rewards_id", + "initialValue": "undefined" + }, + { + "type": "any", + "value": "undefined", + "key": "title_id", + "initialValue": "undefined" + }, + { + "type": "any", + "value": "SP000011", + "key": "products_id", + "initialValue": "SP000011" + }, + { + "type": "any", + "value": "DD000004", + "key": "order_id", + "initialValue": "DD000004" + }, + { + "type": "any", + "value": "JL000039", + "key": "transaction_id", + "initialValue": "JL000039" + }, + { + "type": "any", + "value": "CD000015", + "key": "list_id", + "initialValue": "CD000015" + }, + { + "type": "any", + "value": "SJ000008", + "key": "paper_id", + "initialValue": "SJ000008" + }, + { + "type": "any", + "value": "undefined", + "key": "paper_count", + "initialValue": "undefined" + }, + { + "type": "any", + "value": "DJ000014", + "key": "paper_record_id", + "initialValue": "DJ000014" + }, + { + "type": "any", + "value": "DT000016", + "key": "quiz_record_id", + "initialValue": "DT000016" + } + ] + }, + "type": "normal", + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "globals": { + "baseUrl": "", + "baseUrls": {}, + "variable": { + "id": "81c3b978-80b6-4b97-8482-a69cc79d47af", + "values": [] + }, + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "isServerBuild": false, + "isTestFlowControl": false +} diff --git a/tests/quiz_record_404.json b/tests/quiz_record_404.json new file mode 100644 index 00000000..02e6469f --- /dev/null +++ b/tests/quiz_record_404.json @@ -0,0 +1,3228 @@ +{ + "apifoxCli": "1.1.0", + "item": [ + { + "item": [ + { + "id": "3c92ac93-eebf-4045-8bab-3e0e6fad4e14", + "name": "LG0101 账号密码登录(登录用户admin)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "login" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"username\": \"admin\",\r\n \"password\": \"testtest123\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.token`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`token`, value);console.log('已设置环境变量【token】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【token】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + }, + { + "listen": "test", + "script": { + "id": "postProcessors.1.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.variables.set(`user_id`, value);console.log('已设置临时变量【user_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【user_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183271, + "apiDetailId": 5318056, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "token": { + "type": "string", + "mock": { + "mock": "@string" + }, + "title": "权" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "token", + "id" + ] + }, + "defaultEnable": true, + "projectId": 0, + "ordering": 1, + "unpackerId": "", + "unpackerSetting": "", + "createdAt": "2021-07-29T14:43:37.000Z", + "updatedAt": "2021-08-12T16:27:18.000Z", + "deletedAt": null, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "username": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "password": { + "type": "string", + "mock": { + "mock": "@string('lower', 1, 3)" + }, + "title": "密码" + } + }, + "required": [ + "username", + "password" + ] + } + }, + "metaInfo": { + "httpApiId": 5318056, + "httpApiCaseId": 126748233, + "httpApiName": "LG0101 账号密码登录", + "httpApiPath": "/login", + "httpApiMethod": "post", + "httpApiCaseName": "登录用户admin", + "id": "ff45a8dd-f844-461d-aa2e-6b3c4fc35b94", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "9e717b5f-06ca-4b72-b67b-55cdcc3fd364", + "name": "QZ0102 增加单个测试(QZ0102 增加单个测试)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"记红国率由所历\",\r\n \"answer\": 88,\r\n \"options\": [\r\n \"容白界生存图六制则书验进米切写十流。\",\r\n \"务料后江命正见回建起很一选快子里。\",\r\n \"使管数是明观目土内回求清书。\",\r\n \"平非除听战革命为十传高团消花有数气光。\",\r\n \"压题光适五相思除极先术选复下。\"\r\n ],\r\n \"explanation\": \"国被提教干她话因平通才越但管于。器没身展政非更需而将人地生多经。商也处四建九往务集况素院学二队集。积那连局立状调和号认听化率。\",\r\n \"type\": \"1\",\r\n \"voice_source\": \"http://xpseiecged.gov/thinrxe\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.quiz.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`quiz_id`, value);console.log('已设置环境变量【quiz_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【quiz_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 70048663, + "apiDetailId": 29662986, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "x-apifox-overrides": {}, + "type": "object", + "x-apifox-refs": {}, + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "x-apifox-overrides": {} + } + }, + "required": [ + "quiz" + ], + "x-apifox-orders": [ + "quiz" + ] + }, + "defaultEnable": true, + "projectId": 0, + "ordering": 1, + "unpackerId": "", + "unpackerSetting": "", + "createdAt": "2022-07-15T11:22:03.000Z", + "updatedAt": "2022-07-23T08:30:31.000Z", + "deletedAt": null, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": { + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "$ref": "#/definitions/13080737", + "x-apifox-overrides": {} + } + }, + "metaInfo": { + "httpApiId": 29662986, + "httpApiCaseId": 126748232, + "httpApiName": "QZ0102 增加单个测试", + "httpApiPath": "/quizzes", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0102 增加单个测试", + "id": "37708fa0-cdd5-4ff8-b6d6-cddda21221ef", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "9a833b72-3746-48f9-81c7-f4458643d23d", + "name": "QZ0102 增加单个测试(QZ0102 增加单个测试)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"question\": \"记红国率由所历\",\r\n \"answer\": 88,\r\n \"options\": [\r\n \"容白界生存图六制则书验进米切写十流。\",\r\n \"务料后江命正见回建起很一选快子里。\",\r\n \"使管数是明观目土内回求清书。\",\r\n \"平非除听战革命为十传高团消花有数气光。\",\r\n \"压题光适五相思除极先术选复下。\"\r\n ],\r\n \"explanation\": \"国被提教干她话因平通才越但管于。器没身展政非更需而将人地生多经。商也处四建九往务集况素院学二队集。积那连局立状调和号认听化率。\",\r\n \"type\": \"2\",\r\n \"voice_source\": \"http://xpseiecged.gov/thinrxe\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 70048663, + "apiDetailId": 29662986, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "x-apifox-overrides": {}, + "type": "object", + "x-apifox-refs": {}, + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "x-apifox-overrides": {} + } + }, + "required": [ + "quiz" + ], + "x-apifox-orders": [ + "quiz" + ] + }, + "defaultEnable": true, + "projectId": 0, + "ordering": 1, + "unpackerId": "", + "unpackerSetting": "", + "createdAt": "2022-07-15T11:22:03.000Z", + "updatedAt": "2022-07-23T08:30:31.000Z", + "deletedAt": null, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": { + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "$ref": "#/definitions/13080737", + "x-apifox-overrides": {} + } + }, + "metaInfo": { + "httpApiId": 29662986, + "httpApiCaseId": 126748231, + "httpApiName": "QZ0102 增加单个测试", + "httpApiPath": "/quizzes", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0102 增加单个测试", + "id": "e5f80e45-ca27-4fc7-93c3-d0465bf60cda", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "da46514a-3517-4c09-b073-7cc5c09662ae", + "name": "QZ0203 测试题组卷(QZ0203 测试题组卷)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "papers" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "number", + "value": "2" + }, + { + "disabled": false, + "key": "type", + "value": "1,2" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"王时流安\"\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`paper_id`, value);console.log('已设置环境变量【paper_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【paper_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "createdAt": "2023-12-06T16:26:16.393Z", + "updatedAt": "2023-12-06T16:26:16.393Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "$ref": "#/definitions/65181535" + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 58017398, + "id": 147260241, + "responseExamples": [], + "schemaDefinitions": { + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "description": "试卷标题" + } + }, + "x-apifox-orders": [ + "title" + ], + "required": [ + "title" + ] + } + }, + "metaInfo": { + "httpApiId": 58017398, + "httpApiCaseId": 126748230, + "httpApiName": "QZ0203 测试题组卷", + "httpApiPath": "/papers", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0203 测试题组卷", + "id": "654be119-e793-4675-8a71-16124ae6d663", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "4d7dadc3-acd0-46bf-b811-e6944343647e", + "name": "QZ0401 创建答题记录(QZ0401 创建答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "quiz_id", + "value": "{{}}" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"paper\": \"\",\r\n \"answer\": \"cillum nisi\",\r\n \"correctness\": \"false\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "id": "postProcessors.0.extractor", + "type": "text/javascript", + "exec": [ + "", + " if (JSON.setEnableBigInt) {", + " JSON.setEnableBigInt(undefined);", + " }", + " ", + " try{", + " ", + " const expression = pm.variables.replaceIn(`$.id`);", + " const JSONPath = require('jsonpath-plus').JSONPath;", + " const jsonData = pm.response.json();", + " let value = JSONPath({", + " json: jsonData,", + " path: expression,", + " wrap: false", + " });", + "", + " ", + " if (false && undefined !== undefined) {", + " if (Array.isArray(value)) {", + " value = Number(undefined) >= 0 ? value[undefined] : value[value.length + Number(undefined)];", + " } else {", + " value = undefined;", + " }", + " }", + " ", + " ", + " switch (typeof value) {", + " case 'object':", + " value = JSON.stringify(value);", + " break;", + " default:", + " value = String(value);", + " break;", + " }", + " ", + " pm.environment.set(`quiz_record_id`, value);console.log('已设置环境变量【quiz_record_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【quiz_record_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 73275463, + "createdAt": "2022-07-24T10:43:07.000Z", + "updatedAt": "2022-07-24T10:43:07.000Z", + "deletedAt": null, + "name": "请求有误", + "apiDetailId": 0, + "projectId": 404238, + "code": 400, + "contentType": "json", + "ordering": 50, + "jsonSchema": { + "title": "", + "type": "object", + "properties": { + "msg": { + "type": "string" + } + }, + "x-apifox-orders": [ + "msg" + ], + "required": [ + "msg" + ] + }, + "defaultEnable": false, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "answer": { + "type": "string", + "title": "作答的答案" + }, + "correctness": { + "type": "string", + "title": "是否正确", + "mock": { + "mock": "@boolean" + } + }, + "contributor": { + "type": "string", + "title": "用户id", + "mock": { + "mock": "@string('number', 1, 3)" + } + }, + "paper_record": { + "type": "string", + "title": "所在试卷(可为空)", + "mock": { + "mock": "@string('number', 1, 3)" + } + } + }, + "x-apifox-orders": [ + "paper_record", + "contributor", + "answer", + "correctness" + ], + "required": [ + "paper_record", + "answer", + "correctness", + "contributor" + ] + } + }, + "metaInfo": { + "httpApiId": 129579684, + "httpApiCaseId": 126748229, + "httpApiName": "QZ0401 创建答题记录", + "httpApiPath": "/quizzes/records", + "httpApiMethod": "post", + "httpApiCaseName": "QZ0401 创建答题记录", + "id": "c2b39e5f-78e5-451d-8245-e4e12a6e79fe", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "c86c39b3-4315-4168-85b8-8a4e5d57c3fd", + "name": "QZ0402 查询所有答题记录(QZ0402 查询所有答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "createdAt": "2023-12-21T09:58:50.043Z", + "updatedAt": "2023-12-21T09:58:50.043Z", + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "mock": { + "mock": "@integer" + }, + "title": "总数量" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/definitions/71819921" + } + } + }, + "x-apifox-orders": [ + "total", + "records" + ], + "x-apifox-refs": {}, + "required": [ + "total", + "records" + ] + }, + "defaultEnable": true, + "projectId": 404238, + "ordering": 1, + "apiDetailId": 129582250, + "tempId": "1701347042844", + "id": 361865513, + "responseExamples": [], + "schemaDefinitions": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" + }, + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + }, + "71627581": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "ID" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + }, + "user": { + "$ref": "#/definitions/1077996" + }, + "paper": { + "title": "包含的测试题", + "$ref": "#/definitions/65181535" + } + }, + "x-apifox-orders": [ + "id", + "user", + "timestamp", + "paper" + ], + "required": [ + "id", + "timestamp", + "paper", + "user" + ], + "title": "paper_record_all", + "name": "paper_record_all" + }, + "71819921": { + "type": "object", + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "title": "对应测试题" + }, + "paper": { + "anyOf": [ + { + "$ref": "#/definitions/71627581" + }, + { + "type": "null" + } + ] + }, + "answer": { + "type": "string", + "title": "作答答案" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "@string" + } + }, + "correctness": { + "type": "boolean", + "mock": { + "mock": "@boolean" + }, + "title": "是否正确" + }, + "contributor": { + "title": "答题人", + "mock": { + "mock": "@name" + }, + "$ref": "#/definitions/1077996" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + } + }, + "x-apifox-orders": [ + "id", + "contributor", + "timestamp", + "quiz", + "correctness", + "answer", + "paper" + ], + "required": [ + "quiz", + "answer", + "paper", + "id", + "correctness", + "contributor", + "timestamp" + ], + "title": "quiz_record", + "name": "quiz_record" + } + } + }, + "requestDefinition": { + "jsonSchema": {} + }, + "metaInfo": { + "httpApiId": 129582250, + "httpApiCaseId": 126748228, + "httpApiName": "QZ0402 查询所有答题记录", + "httpApiPath": "/quizzes/records", + "httpApiMethod": "get", + "httpApiCaseName": "QZ0402 查询所有答题记录", + "id": "eb1f6c4b-f0d2-4a89-b0f7-31f5632e3dc3", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "01996320-04a8-4456-80cf-d65226d417c0", + "name": "QZ0403 查询特定答题记录(QZ0403 查询特定答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records", + "{{}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 69812670, + "createdAt": "2022-07-15T06:52:36.000Z", + "updatedAt": "2022-07-15T06:52:36.000Z", + "deletedAt": null, + "name": "不存在", + "apiDetailId": 0, + "projectId": 404238, + "code": 404, + "contentType": "json", + "ordering": 30, + "jsonSchema": {}, + "defaultEnable": false, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "metaInfo": { + "httpApiId": 129582292, + "httpApiCaseId": 126748227, + "httpApiName": "QZ0403 查询特定答题记录", + "httpApiPath": "/quizzes/records/{record_id}", + "httpApiMethod": "get", + "httpApiCaseName": "QZ0403 查询特定答题记录", + "id": "88f3a286-09fa-4874-9796-fdf8d7a92ecc", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "97354418-04a8-4d56-a1c4-e7d0d18efb6c", + "name": "QZ0404 更新答题记录(QZ0404 更新答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records", + "{{}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "PUT", + "baseUrl": "http://127.0.0.1:8000", + "body": { + "mode": "raw", + "raw": "{\r\n \"paper_record\": \"\",\r\n \"answer\": \"proident reprehenderit cillum\",\r\n \"correctness\": true,\r\n \"contributor\": \"1\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 69812670, + "createdAt": "2022-07-15T06:52:36.000Z", + "updatedAt": "2022-07-15T06:52:36.000Z", + "deletedAt": null, + "name": "不存在", + "apiDetailId": 0, + "projectId": 404238, + "code": 404, + "contentType": "json", + "ordering": 30, + "jsonSchema": {}, + "defaultEnable": false, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "answer": { + "type": "string", + "title": "作答答案" + }, + "correctness": { + "type": "boolean", + "title": "是否正确" + }, + "contributor": { + "type": "string", + "mock": { + "mock": "@string('number', 1, 3)" + }, + "title": "用户id" + }, + "paper_record": { + "type": "string", + "title": "所在试卷" + } + }, + "x-apifox-orders": [ + "paper_record", + "answer", + "correctness", + "contributor" + ], + "required": [ + "paper_record", + "answer", + "correctness", + "contributor" + ] + } + }, + "metaInfo": { + "httpApiId": 129582449, + "httpApiCaseId": 126748226, + "httpApiName": "QZ0404 更新答题记录", + "httpApiPath": "/quizzes/records/{record_id}", + "httpApiMethod": "put", + "httpApiCaseName": "QZ0404 更新答题记录", + "id": "59b253f3-1ba8-4d90-bbcc-3d90b4b5d0dc", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + }, + { + "id": "ba8daf83-5751-49a4-9aee-52ea08bd32df", + "name": "QZ0405 删除答题记录(QZ0405 删除答题记录)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "quizzes", + "records", + "{{}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "DELETE", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 69812670, + "createdAt": "2022-07-15T06:52:36.000Z", + "updatedAt": "2022-07-15T06:52:36.000Z", + "deletedAt": null, + "name": "不存在", + "apiDetailId": 0, + "projectId": 404238, + "code": 404, + "contentType": "json", + "ordering": 30, + "jsonSchema": {}, + "defaultEnable": false, + "folderId": 0, + "responseExamples": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "metaInfo": { + "httpApiId": 131574153, + "httpApiCaseId": 126748225, + "httpApiName": "QZ0405 删除答题记录", + "httpApiPath": "/quizzes/records/{record_id}", + "httpApiMethod": "delete", + "httpApiCaseName": "QZ0405 删除答题记录", + "id": "9fc5a4c6-8b89-411c-ab8c-3cdcc7d1b17d", + "type": "http" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false + } + } + ], + "name": "QZ模块答题记录 404" + } + ], + "info": { + "name": "QZ模块答题记录 404" + }, + "dataSchemas": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" + }, + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" + }, + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "1097305": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "user的id", + "mock": { + "mock": "@integer(10000)" + } + }, + "username": { + "type": "string", + "title": "用户名", + "mock": { + "mock": "@cname" + } + }, + "nickname": { + "type": "string", + "title": "昵称", + "mock": { + "mock": "@cname" + } + }, + "email": { + "type": "string", + "title": "邮箱", + "mock": { + "mock": "@email" + } + }, + "telephone": { + "type": "string", + "title": "电话" + }, + "birthday": { + "type": "string", + "title": "生日", + "mock": { + "mock": "@date('yyyy-MM-dd')" + } + }, + "avatar": { + "type": "string", + "title": "头像", + "description": "头像的url地址", + "mock": { + "mock": "@image" + } + }, + "is_admin": { + "type": "boolean", + "title": "是否管理员", + "mock": { + "mock": "@boolean" + } + }, + "county": { + "type": "string", + "title": "县区", + "description": "用户所在县区", + "mock": { + "mock": "@county" + } + }, + "town": { + "type": "string", + "title": "乡镇", + "description": "用户所在乡镇", + "mock": { + "mock": "@county" + } + }, + "registration_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" + }, + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" + }, + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } + }, + "title": "标题", + "mock": { + "mock": "@cname" + }, + "x-apifox-orders": [ + "title", + "color" + ], + "required": [ + "title", + "color" + ] + }, + "level": { + "type": "integer", + "title": "等级", + "mock": { + "mock": "@integer(1,6)" + } + } + }, + "required": [ + "id", + "email", + "username", + "is_admin", + "avatar", + "registration_time", + "login_time", + "nickname", + "telephone", + "birthday", + "county", + "town", + "wechat", + "points_sum", + "points_now", + "title", + "level" + ], + "x-apifox-orders": [ + "id", + "username", + "nickname", + "email", + "telephone", + "birthday", + "avatar", + "is_admin", + "county", + "town", + "points_sum", + "points_now", + "title", + "registration_time", + "login_time", + "wechat", + "level" + ], + "title": "user_all", + "name": "user_all" + }, + "13080595": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号", + "description": "options数组下标" + }, + "id": { + "type": "integer" + }, + "visibility": { + "type": "boolean", + "title": "" + }, + "author": { + "$ref": "#/definitions/1097305" + }, + "voice_source": { + "title": "播报语音链接", + "mock": { + "mock": "@url(\"http\")" + }, + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "id", + "author", + "visibility", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "id", + "visibility", + "author", + "voice_source", + "type" + ], + "title": "quiz_all", + "name": "quiz_all" + }, + "13080737": { + "type": "object", + "properties": { + "question": { + "type": "string", + "title": "问题", + "mock": { + "mock": "@ctitle" + } + }, + "options": { + "type": "array", + "items": { + "type": "string", + "mock": { + "mock": "@csentence" + } + }, + "title": "选项" + }, + "explanation": { + "type": "string", + "title": "答案解析", + "mock": { + "mock": "@cparagraph" + } + }, + "answer": { + "type": "integer", + "title": "答案序号" + }, + "voice_source": { + "type": "string", + "mock": { + "mock": "@url(\"http\")" + }, + "title": "播报语音链接" + }, + "type": { + "type": "string", + "title": "类型" + } + }, + "x-apifox-orders": [ + "question", + "options", + "answer", + "explanation", + "voice_source", + "type" + ], + "required": [ + "question", + "answer", + "options", + "explanation", + "type" + ], + "title": "[入] quiz_update", + "name": "[入] quiz_update" + }, + "65181535": { + "type": "object", + "properties": { + "id": { + "type": "string", + "mock": { + "mock": "@string" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + } + }, + "quizzes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01HD3987MFMNXZBC3WYH3E2Z14" + ], + "x-apifox-refs": { + "01HD3987MFMNXZBC3WYH3E2Z14": { + "$ref": "#/definitions/13080595" + } + } + } + } + }, + "x-apifox-orders": [ + "id", + "title", + "quizzes" + ], + "required": [ + "id", + "title", + "quizzes" + ], + "title": "paper_all", + "name": "paper_all" + }, + "71627581": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "ID" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + }, + "user": { + "$ref": "#/definitions/1077996" + }, + "paper": { + "title": "包含的测试题", + "$ref": "#/definitions/65181535" + } + }, + "x-apifox-orders": [ + "id", + "user", + "timestamp", + "paper" + ], + "required": [ + "id", + "timestamp", + "paper", + "user" + ], + "title": "paper_record_all", + "name": "paper_record_all" + }, + "71819921": { + "type": "object", + "properties": { + "quiz": { + "$ref": "#/definitions/13080595", + "title": "对应测试题" + }, + "paper": { + "anyOf": [ + { + "$ref": "#/definitions/71627581" + }, + { + "type": "null" + } + ] + }, + "answer": { + "type": "string", + "title": "作答答案" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "@string" + } + }, + "correctness": { + "type": "boolean", + "mock": { + "mock": "@boolean" + }, + "title": "是否正确" + }, + "contributor": { + "title": "答题人", + "mock": { + "mock": "@name" + }, + "$ref": "#/definitions/1077996" + }, + "timestamp": { + "type": "string", + "mock": { + "mock": "@timestamp" + }, + "title": "时间戳" + } + }, + "x-apifox-orders": [ + "id", + "contributor", + "timestamp", + "quiz", + "correctness", + "answer", + "paper" + ], + "required": [ + "quiz", + "answer", + "paper", + "id", + "correctness", + "contributor", + "timestamp" + ], + "title": "quiz_record", + "name": "quiz_record" + } + }, + "mockRules": { + "rules": [], + "enableSystemRule": true + }, + "environment": { + "id": 510825, + "name": "测试环境", + "baseUrl": "http://127.0.0.1:8000", + "baseUrls": { + "default": "http://127.0.0.1:8000" + }, + "variable": { + "id": "fe0d3498-4cf9-4814-aa1d-8f1d86bdd133", + "name": "测试环境", + "values": [ + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcwMzc1NTQxNy43NzIyMn0.qDtx_ydvnsTAwviajaKRdigEGoZYMkcZG0Xb7rFfe9U", + "key": "token", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "31", + "key": "quiz_id", + "initialValue": "" + }, + { + "type": "any", + "value": "16", + "key": "word_id_2", + "initialValue": "" + }, + { + "type": "any", + "value": "15", + "key": "word_id_1", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "token_2", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_3", + "initialValue": "" + }, + { + "type": "any", + "value": "2", + "key": "user_id", + "initialValue": "" + }, + { + "type": "any", + "value": "1", + "key": "article_id", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_1", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_2", + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_2", + "initialValue": "" + }, + { + "type": "any", + "value": 6, + "key": "num_pre", + "initialValue": "" + }, + { + "type": "any", + "value": "7", + "key": "num_later", + "initialValue": "" + }, + { + "type": "any", + "value": "2", + "key": "id", + "initialValue": "2" + }, + { + "type": "any", + "value": "13", + "key": "music_id", + "initialValue": "13" + }, + { + "type": "any", + "value": "undefined", + "key": "rewards_id", + "initialValue": "undefined" + }, + { + "type": "any", + "value": "undefined", + "key": "title_id", + "initialValue": "undefined" + }, + { + "type": "any", + "value": "SP000011", + "key": "products_id", + "initialValue": "SP000011" + }, + { + "type": "any", + "value": "DD000004", + "key": "order_id", + "initialValue": "DD000004" + }, + { + "type": "any", + "value": "JL000039", + "key": "transaction_id", + "initialValue": "JL000039" + }, + { + "type": "any", + "value": "CD000015", + "key": "list_id", + "initialValue": "CD000015" + }, + { + "type": "any", + "value": "SJ000008", + "key": "paper_id", + "initialValue": "SJ000008" + }, + { + "type": "any", + "value": "undefined", + "key": "paper_count", + "initialValue": "undefined" + }, + { + "type": "any", + "value": "DJ000014", + "key": "paper_record_id", + "initialValue": "DJ000014" + }, + { + "type": "any", + "value": "DT000016", + "key": "quiz_record_id", + "initialValue": "DT000016" + } + ] + }, + "type": "normal", + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "globals": { + "baseUrl": "", + "baseUrls": {}, + "variable": { + "id": "81c3b978-80b6-4b97-8482-a69cc79d47af", + "values": [] + }, + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "isServerBuild": false, + "isTestFlowControl": false +}