From 2d24dde0b07b3fbd147766903a7bb716b5b2b7a5 Mon Sep 17 00:00:00 2001 From: "13313720778@163.com" <13313720778@163.com> Date: Tue, 1 Oct 2024 20:22:03 +0800 Subject: [PATCH 1/7] Rename PronunciationRankWithoutDays to RankWithoutDays --- hinghwa-dict-backend/article/models.py | 5 ++++- .../utils/exception/types/bad_request.py | 4 ++-- hinghwa-dict-backend/word/pronunciation/views.py | 10 +++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/hinghwa-dict-backend/article/models.py b/hinghwa-dict-backend/article/models.py index 33f44e9e..90ffe720 100644 --- a/hinghwa-dict-backend/article/models.py +++ b/hinghwa-dict-backend/article/models.py @@ -4,7 +4,10 @@ class Article(models.Model): author = models.ForeignKey( - User, on_delete=models.CASCADE, related_name="articles", verbose_name="作者" + User, + on_delete=models.CASCADE, + related_name="articles", + verbose_name="作者" ) views = models.IntegerField(default=0, verbose_name="阅读量", editable=False) like_users = models.ManyToManyField( diff --git a/hinghwa-dict-backend/utils/exception/types/bad_request.py b/hinghwa-dict-backend/utils/exception/types/bad_request.py index bd23aa9f..60d82fd1 100644 --- a/hinghwa-dict-backend/utils/exception/types/bad_request.py +++ b/hinghwa-dict-backend/utils/exception/types/bad_request.py @@ -30,12 +30,12 @@ def __init__(self, msg="可用测试题不足"): super().__init__(msg) -class PronunciationRankWithoutDays(BadRequestException): +class RankWithoutDays(BadRequestException): """ 发音排名请求没有发送天数异常 """ - def __init__(self, msg="发音排名请求没有发送天数"): + def __init__(self, msg="排名请求没有发送天数"): super().__init__(msg) diff --git a/hinghwa-dict-backend/word/pronunciation/views.py b/hinghwa-dict-backend/word/pronunciation/views.py index b63c049b..0ce873f2 100644 --- a/hinghwa-dict-backend/word/pronunciation/views.py +++ b/hinghwa-dict-backend/word/pronunciation/views.py @@ -19,7 +19,7 @@ from user.dto.user_simple import user_simple from utils.exception.types.bad_request import ( BadRequestException, - PronunciationRankWithoutDays, + RankWithoutDays, InvalidPronunciation, ) from utils.exception.types.not_found import ( @@ -55,7 +55,7 @@ class SearchPronunciations(View): # PN0201 发音的批量获取 def get(self, request) -> JsonResponse: if ("token" in request.headers) and token_check( - request.headers["token"], settings.JWT_KEY, -1 + request.headers["token"], settings.JWT_KEY, -1 ): pronunciations = Pronunciation.objects.all() else: @@ -155,7 +155,7 @@ def combinePronunciation(request, ipa): os.makedirs(dir) time = timezone.now().__format__("%Y_%m_%d") filename = ( - time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" + time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" ) path = os.path.join(dir, filename) result = MergeAudio(results, path) @@ -277,7 +277,7 @@ def combinePronunciationV2(request): os.makedirs(dir) time = timezone.now().__format__("%Y_%m_%d") filename = ( - time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" + time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" ) path = os.path.join(dir, filename) result = MergeAudio(results, path) @@ -498,7 +498,7 @@ def get(self, request) -> JsonResponse: page = request.GET.get("page", 1) # 获取页面数,默认为第1页 pagesize = request.GET.get("pageSize", 10) # 获取每页显示数量,默认为10条 if not days: - raise PronunciationRankWithoutDays() + raise RankWithoutDays() days = int(days) try: token = token_pass(request.headers) From 90b95331eaf26e72dd4b395e458a21adb101b58e Mon Sep 17 00:00:00 2001 From: "13313720778@163.com" <13313720778@163.com> Date: Tue, 1 Oct 2024 23:06:24 +0800 Subject: [PATCH 2/7] (AT0203) Add Article Ranking Function --- hinghwa-dict-backend/HinghwaDict/settings.py | 5 + hinghwa-dict-backend/article/urls.py | 1 + hinghwa-dict-backend/article/views.py | 112 ++++++++++++++++++- 3 files changed, 117 insertions(+), 1 deletion(-) diff --git a/hinghwa-dict-backend/HinghwaDict/settings.py b/hinghwa-dict-backend/HinghwaDict/settings.py index d6e4a955..329ee23f 100644 --- a/hinghwa-dict-backend/HinghwaDict/settings.py +++ b/hinghwa-dict-backend/HinghwaDict/settings.py @@ -318,6 +318,11 @@ "BACKEND": "django.core.cache.backends.locmem.LocMemCache", "LOCATION": "pronunciation_ranking_cache_table", }, + "article_ranking": { + "TIMEOUT": 900, + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + "LOCATION": "article_ranking_cache_table", + }, } SIMPLEUI_LOGO = "https://hinghwa.cn/img/blue.7169aa26.svg" SIMPLEUI_HOME_INFO = False diff --git a/hinghwa-dict-backend/article/urls.py b/hinghwa-dict-backend/article/urls.py index 66664a95..5173dee5 100644 --- a/hinghwa-dict-backend/article/urls.py +++ b/hinghwa-dict-backend/article/urls.py @@ -13,4 +13,5 @@ path("/comments//like", csrf_exempt(LikeComment.as_view())), path("/comments/", csrf_exempt(CommentDetail.as_view())), path("/comments", csrf_exempt(SearchComment.as_view())), + path("/ranking", csrf_exempt(ArticleRanking.as_view())), # AT0203文章榜单 ] diff --git a/hinghwa-dict-backend/article/views.py b/hinghwa-dict-backend/article/views.py index 1dc72b9c..9be0e7e6 100644 --- a/hinghwa-dict-backend/article/views.py +++ b/hinghwa-dict-backend/article/views.py @@ -1,4 +1,5 @@ import demjson3 +import datetime from django.http import JsonResponse from django.utils import timezone from django.views.decorators.csrf import csrf_exempt @@ -11,9 +12,12 @@ sendNotification, ) from .forms import ArticleForm, CommentForm +from django.db.models import Q, Count, Max +from user.dto.user_simple import user_simple from .models import Article, Comment from django.conf import settings from .dto.article_all import article_all +from django.core.cache import caches from .dto.article_normal import article_normal from .dto.comment_normal import comment_normal from .dto.comment_likes import comment_likes @@ -22,7 +26,9 @@ from utils.exception.types.bad_request import ( BadRequestException, ReturnUsersNumException, + RankWithoutDays, ) +from django.core.paginator import Paginator from utils.exception.types.not_found import ( ArticleNotFoundException, CommentNotFoundException, @@ -78,7 +84,7 @@ def post(self, request) -> JsonResponse: article.update_time = timezone.now() article.author = user article.save() - content = f"我创建了文章(id={article.id}),请及时去审核" + content = f"我创建了文章(id={article.id}),请及时审核" sendNotification( article.author, None, @@ -372,3 +378,107 @@ def return_users_num_pass(self, request): raise ReturnUsersNumException() return int(request.GET["return_users_num"]) return None + + +class ArticleRanking(View): + # AT0203 文章上传榜单 + def get(self, request) -> JsonResponse: + days = request.GET["days"] # 要多少天的榜单 + page = request.GET.get("page", 1) # 获取页面数,默认为第1页 + pagesize = request.GET.get("pageSize", 10) # 获取每页显示数量,默认为10条 + if not days: + raise RankWithoutDays() + days = int(days) + try: + token = token_pass(request.headers) + user: User = token_user(token) + my_id = user.id + except: + my_id = 0 + my_amount = 0 + my_rank = 0 + rank_count = 0 + result_json_list = [] + paginator = Pages(self.get_rank_queries(days), pagesize) + current_page = paginator.get_page(page) + adjacent_pages = list( + paginator.get_adjacent_pages(current_page, adjancent_pages=3) + ) + + for rank_q in self.get_rank_queries(days): + con_id = rank_q["author_id"] + amount = rank_q["article_count"] + rank_count = rank_count + 1 + if con_id == my_id: + my_amount = amount + my_rank = rank_count + result_json_list.append( + { + "author": user_simple(User.objects.filter(id=con_id)[0]), + "amount": amount, + } + ) + # 发送给前端 + return JsonResponse( + { + "ranking": result_json_list, + "me": {"amount": my_amount, "rank": my_rank}, + "pagination": { + "total_pages": paginator.num_pages, + "current_page": current_page.number, + "page_size": pagesize, + "previous_page": current_page.has_previous(), + "next_page": current_page.has_next(), + "adjacent_pages": adjacent_pages, + }, + }, + status=200, + ) + + @classmethod + def get_rank_queries(cls, days): + rank_cache = caches["article_ranking"] + rank_queries = rank_cache.get(str(days)) + if rank_queries is None: + # 发现缓存中没有要查询的天数的榜单,更新榜单,并把更新的表格录入到数据库缓存中article_ranking表的对应位置 + rank_queries = cls.update_rank(days) + rank_cache.set(str(days), rank_queries) + return rank_queries + + @classmethod + def update_rank(cls, search_days): # 不包括存储在数据库中 + if search_days != 0: + start_date = timezone.now() - datetime.timedelta(days=search_days) + # 查询发布时间在规定开始时间之后的 + result = ( + Article.objects.filter( + Q(publish_time__gt=start_date) + & Q(visibility=True) + ) + .values("author_id") + .annotate( + article_count=Count("author_id"), + last_date=Max("publish_time"), + ) + .order_by("-article_count", "-last_date") + ) + else: + result = ( + Article.objects.filter(visibility=True) + .values("author_id") + .annotate( + article_count=Count("author_id"), + last_date=Max("publish_time"), + ) + .order_by("-article_count", "-last_date") + ) + return result # 返回的是Queries + + +class Pages(Paginator): + # 对原有的Paginator类进行扩展,获取当前页的相邻页面 + def get_adjacent_pages(self, current_page, adjancent_pages=3): + current_page = current_page.number + start_page = max(current_page - adjancent_pages, 1) # 前面的页码数 + end_page = min(current_page + adjancent_pages, self.num_pages) # 后面的页码数 + return range(start_page, end_page + 1) From 30e67f06a899081e5a1a455421840143cd403790 Mon Sep 17 00:00:00 2001 From: "13313720778@163.com" <13313720778@163.com> Date: Tue, 1 Oct 2024 23:18:56 +0800 Subject: [PATCH 3/7] (AT0203) Add Article Ranking cli json --- tests/article_AT0203_200.apifox-cli.json | 1 + tests/article_AT0203_400.apifox-cli.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/article_AT0203_200.apifox-cli.json create mode 100644 tests/article_AT0203_400.apifox-cli.json diff --git a/tests/article_AT0203_200.apifox-cli.json b/tests/article_AT0203_200.apifox-cli.json new file mode 100644 index 00000000..c428465a --- /dev/null +++ b/tests/article_AT0203_200.apifox-cli.json @@ -0,0 +1 @@ +{"apifoxCli":"1.1.0","item":[{"item":[{"id":"dff3d035-5244-4b24-b0bd-fed55aba1110","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":"{\n \"username\": \"admin\",\n \"password\": \"testtest123\"\n}","generateMode":"normal","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"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('___label_placeholder__processor___', '已设置环境变量【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('___label_placeholder__processor___', '已设置临时变量【user_id】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【user_id】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183271,"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,"ordering":1,"description":"","mediaType":"","headers":[],"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"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318056,"httpApiCaseId":200385981,"httpApiName":"LG0101 账号密码登录","httpApiPath":"/login","httpApiMethod":"post","httpApiCaseName":"LG0101 账号密码登录","id":"dff3d035-5244-4b24-b0bd-fed55aba1110","type":"http","name":"LG0101 账号密码登录(登录用户admin)","relatedId":5179477,"blockId":"dff3d035-5244-4b24-b0bd-fed55aba1110"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"9125ee79-9f55-47f8-aa7f-96aad2a52c82","name":"AT0101 创建文章(创建文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles"],"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":"{\n \"title\": \"能花情\",\n \"description\": \"划存容再者开速件世处果机导近。\",\n \"content\": \"实看确拉书育越热积利住查民共力者料连。办门快图大史下近证百影派至清运须商。三列断可成性深整改力马县无。任元日收解前林提提党选际步。\",\n \"cover\": \"http://dummyimage.com/250x250\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[{"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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【article_id】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183335,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id","description":"注:初始化publish_time,update_time"}},"required":["id"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","mock":{"mock":"@csentence"},"title":"文章简介"},"content":{"type":"string","mock":{"mock":"@cparagraph"},"title":"文章内容","description":"markdown"},"cover":{"type":"string","mock":{"mock":"@image"},"title":"文章封面","description":"url"}},"required":["title","description","content","cover"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318101,"httpApiCaseId":200385995,"httpApiName":"AT0101 创建文章","httpApiPath":"/articles","httpApiMethod":"post","httpApiCaseName":"AT0101 创建文章","id":"9125ee79-9f55-47f8-aa7f-96aad2a52c82","type":"http","name":"AT0101 创建文章(创建文章)","relatedId":5179477,"blockId":"9125ee79-9f55-47f8-aa7f-96aad2a52c82"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"1646828c-64f8-41a2-81b6-d2618e5615a0","name":"AT0105 审核文章(AT0105 审核文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}","visibility"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"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":"{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":27919786,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{},"x-apifox-orders":["01H6X55E47JH482NARACB4TV1K"],"required":[],"x-apifox-refs":{"01H6X55E47JH482NARACB4TV1K":{"$ref":"#/definitions/53485892"}}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"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"},"53485892":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","title":"时间","mock":{"mock":"@datetime"}},"action":{"type":"string","enum":["earn","redeem","other"],"x-apifox":{"enumDescriptions":{"earn":"增加","redeem":"兑换","other":"其他"}},"title":"类型","mock":{"mock":"@string"},"description":"add或reedm"},"points":{"type":"integer","title":"积分数","mock":{"mock":"@integer(0)"}},"user":{"title":"用户","$ref":"#/definitions/1077996"},"id":{"type":"string","title":"ID","mock":{"mock":"JL@integer"}},"reason":{"type":"string","title":"原因","mock":{"mock":"@cparagraph"}}},"x-apifox-orders":["user","timestamp","action","points","id","reason"],"required":["user","timestamp","action","points","id","reason"],"title":"transaction","name":"transaction"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"result":{"type":"boolean","title":"审核结果"},"reason":{"type":"string","title":"理由"}},"required":["result","reason"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":14440370,"httpApiCaseId":200386092,"httpApiName":"AT0105 审核文章","httpApiPath":"/articles/{id}/visibility","httpApiMethod":"put","httpApiCaseName":"AT0105 审核文章","id":"1646828c-64f8-41a2-81b6-d2618e5615a0","type":"http","name":"AT0105 审核文章(AT0105 审核文章)","relatedId":5179477,"blockId":"1646828c-64f8-41a2-81b6-d2618e5615a0"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"fd2c02b6-6725-4d57-8847-420fa8ddc2e1","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"header":[{"disabled":false,"key":"token","value":""},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":4233285,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"article":{"title":"文章字典","description":"含article表的所有字段","$ref":"#/definitions/1077703","x-apifox-overrides":{}},"me":{"type":"object","properties":{"liked":{"type":"boolean","title":"是否点赞"},"is_author":{"type":"boolean","title":"是否文章作者"}},"description":"检测查询用户与该文章的关联","required":["liked","is_author"],"x-apifox-orders":["liked","is_author"]}},"required":["article","me"],"x-apifox-orders":["article","me"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{"1077703":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id"},"author":{"title":"作者","description":"用户id","$ref":"#/definitions/1097305","x-apifox-overrides":{}},"likes":{"type":"integer","title":"点赞数"},"views":{"type":"integer","title":"访问量"},"like_users":{"type":"array","items":{"type":"integer","description":"用户id"},"title":"点赞用户列表"},"publish_time":{"type":"string","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"},"title":"发表时间"},"update_time":{"type":"string","title":"更新时间","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"}},"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","title":"文章简介","mock":{"mock":"@csentence"}},"content":{"type":"string","title":"文章内容","description":"markdown","mock":{"mock":"@cparagraph"}},"cover":{"type":"string","title":"文章封面","description":"url","mock":{"mock":"@image"}},"visibility":{"type":"boolean"}},"required":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"x-apifox-orders":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"title":"article_all","name":"article_all"},"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"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{}}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5333397,"httpApiCaseId":200386239,"httpApiName":"AT0104 获取文章内容","httpApiPath":"/articles/{id}","httpApiMethod":"get","httpApiCaseName":"AT0104 获取文章内容","id":"fd2c02b6-6725-4d57-8847-420fa8ddc2e1","type":"http","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","relatedId":5179477,"blockId":"fd2c02b6-6725-4d57-8847-420fa8ddc2e1"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"70e76a33-ed84-49f6-9724-162086d8e4cd","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"7"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"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":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386289,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"70e76a33-ed84-49f6-9724-162086d8e4cd","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"70e76a33-ed84-49f6-9724-162086d8e4cd"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"ae45b2ce-257f-4e33-9a5f-eff17036c78b","name":"LG0101 账号密码登录 (登录用户user_test)","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\": \"user_test\",\r\n \"password\": \"123456\"\r\n}","generateMode":"normal","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"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_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【token_2】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【token_2】出错: ' + 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.environment.set(`user_id_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【user_id_2】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【user_id_2】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183271,"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,"ordering":1,"description":"","mediaType":"","headers":[],"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"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318056,"httpApiCaseId":200386296,"httpApiName":"LG0101 账号密码登录","httpApiPath":"/login","httpApiMethod":"post","httpApiCaseName":"登录用户user_test","id":"ae45b2ce-257f-4e33-9a5f-eff17036c78b","type":"http","name":"LG0101 账号密码登录 (登录用户user_test)","relatedId":5179477,"blockId":"ae45b2ce-257f-4e33-9a5f-eff17036c78b"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"1e1b4c05-ac96-451d-809e-9b5f662d4fc6","name":"AT0101 创建文章(创建文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles"],"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":"{\n \"title\": \"日样色\",\n \"description\": \"位团听大做标质其地候传意指区铁上。\",\n \"content\": \"级每压目县干全方没识重以方还难名厂。周教场对油派厂织太展或值到。华立代红上示素名育满感名次。制流之意争就图得标者队及道无非部历例。争声分导么被真自级心造或经本类决后。\",\n \"cover\": \"http://dummyimage.com/468x60\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[{"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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【article_id】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183335,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id","description":"注:初始化publish_time,update_time"}},"required":["id"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","mock":{"mock":"@csentence"},"title":"文章简介"},"content":{"type":"string","mock":{"mock":"@cparagraph"},"title":"文章内容","description":"markdown"},"cover":{"type":"string","mock":{"mock":"@image"},"title":"文章封面","description":"url"}},"required":["title","description","content","cover"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318101,"httpApiCaseId":200386316,"httpApiName":"AT0101 创建文章","httpApiPath":"/articles","httpApiMethod":"post","httpApiCaseName":"AT0101 创建文章","id":"1e1b4c05-ac96-451d-809e-9b5f662d4fc6","type":"http","name":"AT0101 创建文章(创建文章)","relatedId":5179477,"blockId":"1e1b4c05-ac96-451d-809e-9b5f662d4fc6"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"48eb929d-2ff6-4865-99c2-c074ae0270eb","name":"AT0105 审核文章(AT0105 审核文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}","visibility"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"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":"{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":27919786,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{},"x-apifox-orders":["01H6X55E47JH482NARACB4TV1K"],"required":[],"x-apifox-refs":{"01H6X55E47JH482NARACB4TV1K":{"$ref":"#/definitions/53485892"}}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"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"},"53485892":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","title":"时间","mock":{"mock":"@datetime"}},"action":{"type":"string","enum":["earn","redeem","other"],"x-apifox":{"enumDescriptions":{"earn":"增加","redeem":"兑换","other":"其他"}},"title":"类型","mock":{"mock":"@string"},"description":"add或reedm"},"points":{"type":"integer","title":"积分数","mock":{"mock":"@integer(0)"}},"user":{"title":"用户","$ref":"#/definitions/1077996"},"id":{"type":"string","title":"ID","mock":{"mock":"JL@integer"}},"reason":{"type":"string","title":"原因","mock":{"mock":"@cparagraph"}}},"x-apifox-orders":["user","timestamp","action","points","id","reason"],"required":["user","timestamp","action","points","id","reason"],"title":"transaction","name":"transaction"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"result":{"type":"boolean","title":"审核结果"},"reason":{"type":"string","title":"理由"}},"required":["result","reason"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":14440370,"httpApiCaseId":200386326,"httpApiName":"AT0105 审核文章","httpApiPath":"/articles/{id}/visibility","httpApiMethod":"put","httpApiCaseName":"AT0105 审核文章","id":"48eb929d-2ff6-4865-99c2-c074ae0270eb","type":"http","name":"AT0105 审核文章(AT0105 审核文章)","relatedId":5179477,"blockId":"48eb929d-2ff6-4865-99c2-c074ae0270eb"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"54387fc9-dd07-435c-a33c-601ba45f3a4e","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"header":[{"disabled":false,"key":"token","value":""},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":4233285,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"article":{"title":"文章字典","description":"含article表的所有字段","$ref":"#/definitions/1077703","x-apifox-overrides":{}},"me":{"type":"object","properties":{"liked":{"type":"boolean","title":"是否点赞"},"is_author":{"type":"boolean","title":"是否文章作者"}},"description":"检测查询用户与该文章的关联","required":["liked","is_author"],"x-apifox-orders":["liked","is_author"]}},"required":["article","me"],"x-apifox-orders":["article","me"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{"1077703":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id"},"author":{"title":"作者","description":"用户id","$ref":"#/definitions/1097305","x-apifox-overrides":{}},"likes":{"type":"integer","title":"点赞数"},"views":{"type":"integer","title":"访问量"},"like_users":{"type":"array","items":{"type":"integer","description":"用户id"},"title":"点赞用户列表"},"publish_time":{"type":"string","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"},"title":"发表时间"},"update_time":{"type":"string","title":"更新时间","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"}},"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","title":"文章简介","mock":{"mock":"@csentence"}},"content":{"type":"string","title":"文章内容","description":"markdown","mock":{"mock":"@cparagraph"}},"cover":{"type":"string","title":"文章封面","description":"url","mock":{"mock":"@image"}},"visibility":{"type":"boolean"}},"required":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"x-apifox-orders":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"title":"article_all","name":"article_all"},"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"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{}}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5333397,"httpApiCaseId":200386328,"httpApiName":"AT0104 获取文章内容","httpApiPath":"/articles/{id}","httpApiMethod":"get","httpApiCaseName":"AT0104 获取文章内容","id":"54387fc9-dd07-435c-a33c-601ba45f3a4e","type":"http","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","relatedId":5179477,"blockId":"54387fc9-dd07-435c-a33c-601ba45f3a4e"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"f98a1d53-5c2d-4c94-a696-525a7c90c09b","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"0"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"variable":[]},"header":[{"key":"token","value":"{{token_2}}"},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386329,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"f98a1d53-5c2d-4c94-a696-525a7c90c09b","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"f98a1d53-5c2d-4c94-a696-525a7c90c09b"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"0df4ed39-af95-4889-bd66-a6f525f768e9","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"7"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"variable":[]},"header":[{"key":"token","value":"{{token_2}}"},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386349,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"0df4ed39-af95-4889-bd66-a6f525f768e9","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"0df4ed39-af95-4889-bd66-a6f525f768e9"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"fc0a94f2-5119-40e9-b9eb-70f44e34b015","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"30"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"variable":[]},"header":[{"key":"token","value":"{{token_2}}"},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386352,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"fc0a94f2-5119-40e9-b9eb-70f44e34b015","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"fc0a94f2-5119-40e9-b9eb-70f44e34b015"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}}],"name":"文章上传榜单 AT0203-200"}],"info":{"name":"文章上传榜单 AT0203-200"},"dataSchemas":{"1077703":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id"},"author":{"title":"作者","description":"用户id","$ref":"#/definitions/1097305","x-apifox-overrides":{}},"likes":{"type":"integer","title":"点赞数"},"views":{"type":"integer","title":"访问量"},"like_users":{"type":"array","items":{"type":"integer","description":"用户id"},"title":"点赞用户列表"},"publish_time":{"type":"string","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"},"title":"发表时间"},"update_time":{"type":"string","title":"更新时间","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"}},"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","title":"文章简介","mock":{"mock":"@csentence"}},"content":{"type":"string","title":"文章内容","description":"markdown","mock":{"mock":"@cparagraph"}},"cover":{"type":"string","title":"文章封面","description":"url","mock":{"mock":"@image"}},"visibility":{"type":"boolean"}},"required":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"x-apifox-orders":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"title":"article_all","name":"article_all"},"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"},"53485892":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","title":"时间","mock":{"mock":"@datetime"}},"action":{"type":"string","enum":["earn","redeem","other"],"x-apifox":{"enumDescriptions":{"earn":"增加","redeem":"兑换","other":"其他"}},"title":"类型","mock":{"mock":"@string"},"description":"add或reedm"},"points":{"type":"integer","title":"积分数","mock":{"mock":"@integer(0)"}},"user":{"title":"用户","$ref":"#/definitions/1077996"},"id":{"type":"string","title":"ID","mock":{"mock":"JL@integer"}},"reason":{"type":"string","title":"原因","mock":{"mock":"@cparagraph"}}},"x-apifox-orders":["user","timestamp","action","points","id","reason"],"required":["user","timestamp","action","points","id","reason"],"title":"transaction","name":"transaction"}},"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":"82cf7fe3-7e13-4765-b695-284853fcee8e","name":"测试环境","values":[{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8","key":"token","isBindInitial":false,"initialValue":""},{"type":"any","value":"16","key":"quiz_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"word_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM","key":"token_2","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_3","isBindInitial":true,"initialValue":""},{"type":"any","value":"3","key":"user_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"10","key":"article_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"comment_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"comment_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_pre","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_later","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"SJ000006","key":"paper_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"DJ000002","key":"paper_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"undefined","key":"quiz_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"3","key":"word_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"2","key":"user_id_2","isBindInitial":false,"initialValue":""}]},"type":"normal","parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"globals":{"baseUrl":"","baseUrls":{},"variable":{"id":"e941a7f7-b2f4-44ff-9c68-33172417a3c0","values":[]},"parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"isServerBuild":false,"isTestFlowControl":false,"projectOptions":{"enableJsonc":false,"enableBigint":false,"responseValidate":true,"isDefaultUrlEncoding":2,"enableTestScenarioSetting":false,"enableYAPICompatScript":false}} \ No newline at end of file diff --git a/tests/article_AT0203_400.apifox-cli.json b/tests/article_AT0203_400.apifox-cli.json new file mode 100644 index 00000000..a1cc3084 --- /dev/null +++ b/tests/article_AT0203_400.apifox-cli.json @@ -0,0 +1 @@ +{"apifoxCli":"1.1.0","item":[{"item":[{"id":"e9dbe642-1c2b-4d55-be47-8da1086b9cf4","name":"AT0203 文章上传榜单","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":""},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"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":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539399074,"name":"没有发送天数","code":400,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":2,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386435,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"e9dbe642-1c2b-4d55-be47-8da1086b9cf4","type":"http","name":"AT0203 文章上传榜单","relatedId":5179481,"blockId":"e9dbe642-1c2b-4d55-be47-8da1086b9cf4"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}}],"name":"文章上传榜单 AT0203-400 未传天数"}],"info":{"name":"文章上传榜单 AT0203-400 未传天数"},"dataSchemas":{},"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":"572b4526-4bab-463a-aeb2-7ae9103d6963","name":"测试环境","values":[{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8","key":"token","isBindInitial":false,"initialValue":""},{"type":"any","value":"16","key":"quiz_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"word_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM","key":"token_2","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_3","isBindInitial":true,"initialValue":""},{"type":"any","value":"3","key":"user_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"10","key":"article_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"comment_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"comment_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_pre","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_later","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"SJ000006","key":"paper_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"DJ000002","key":"paper_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"undefined","key":"quiz_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"3","key":"word_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"2","key":"user_id_2","isBindInitial":false,"initialValue":""}]},"type":"normal","parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"globals":{"baseUrl":"","baseUrls":{},"variable":{"id":"e941a7f7-b2f4-44ff-9c68-33172417a3c0","values":[]},"parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"isServerBuild":false,"isTestFlowControl":false,"projectOptions":{"enableJsonc":false,"enableBigint":false,"responseValidate":true,"isDefaultUrlEncoding":2,"enableTestScenarioSetting":false,"enableYAPICompatScript":false}} \ No newline at end of file From 2b86fd017ae6145bc48cdb899b745c8114495e74 Mon Sep 17 00:00:00 2001 From: "13313720778@163.com" <13313720778@163.com> Date: Wed, 2 Oct 2024 00:45:50 +0800 Subject: [PATCH 4/7] (AT0203) Change Article Ranking cli json --- tests/article_AT0203_200.apifox-cli.json | 3181 +++++++++++++++++++++- tests/article_AT0203_400.apifox-cli.json | 298 +- 2 files changed, 3477 insertions(+), 2 deletions(-) diff --git a/tests/article_AT0203_200.apifox-cli.json b/tests/article_AT0203_200.apifox-cli.json index c428465a..1ca8dd7a 100644 --- a/tests/article_AT0203_200.apifox-cli.json +++ b/tests/article_AT0203_200.apifox-cli.json @@ -1 +1,3180 @@ -{"apifoxCli":"1.1.0","item":[{"item":[{"id":"dff3d035-5244-4b24-b0bd-fed55aba1110","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":"{\n \"username\": \"admin\",\n \"password\": \"testtest123\"\n}","generateMode":"normal","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"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('___label_placeholder__processor___', '已设置环境变量【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('___label_placeholder__processor___', '已设置临时变量【user_id】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【user_id】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183271,"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,"ordering":1,"description":"","mediaType":"","headers":[],"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"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318056,"httpApiCaseId":200385981,"httpApiName":"LG0101 账号密码登录","httpApiPath":"/login","httpApiMethod":"post","httpApiCaseName":"LG0101 账号密码登录","id":"dff3d035-5244-4b24-b0bd-fed55aba1110","type":"http","name":"LG0101 账号密码登录(登录用户admin)","relatedId":5179477,"blockId":"dff3d035-5244-4b24-b0bd-fed55aba1110"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"9125ee79-9f55-47f8-aa7f-96aad2a52c82","name":"AT0101 创建文章(创建文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles"],"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":"{\n \"title\": \"能花情\",\n \"description\": \"划存容再者开速件世处果机导近。\",\n \"content\": \"实看确拉书育越热积利住查民共力者料连。办门快图大史下近证百影派至清运须商。三列断可成性深整改力马县无。任元日收解前林提提党选际步。\",\n \"cover\": \"http://dummyimage.com/250x250\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[{"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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【article_id】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183335,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id","description":"注:初始化publish_time,update_time"}},"required":["id"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","mock":{"mock":"@csentence"},"title":"文章简介"},"content":{"type":"string","mock":{"mock":"@cparagraph"},"title":"文章内容","description":"markdown"},"cover":{"type":"string","mock":{"mock":"@image"},"title":"文章封面","description":"url"}},"required":["title","description","content","cover"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318101,"httpApiCaseId":200385995,"httpApiName":"AT0101 创建文章","httpApiPath":"/articles","httpApiMethod":"post","httpApiCaseName":"AT0101 创建文章","id":"9125ee79-9f55-47f8-aa7f-96aad2a52c82","type":"http","name":"AT0101 创建文章(创建文章)","relatedId":5179477,"blockId":"9125ee79-9f55-47f8-aa7f-96aad2a52c82"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"1646828c-64f8-41a2-81b6-d2618e5615a0","name":"AT0105 审核文章(AT0105 审核文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}","visibility"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"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":"{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":27919786,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{},"x-apifox-orders":["01H6X55E47JH482NARACB4TV1K"],"required":[],"x-apifox-refs":{"01H6X55E47JH482NARACB4TV1K":{"$ref":"#/definitions/53485892"}}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"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"},"53485892":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","title":"时间","mock":{"mock":"@datetime"}},"action":{"type":"string","enum":["earn","redeem","other"],"x-apifox":{"enumDescriptions":{"earn":"增加","redeem":"兑换","other":"其他"}},"title":"类型","mock":{"mock":"@string"},"description":"add或reedm"},"points":{"type":"integer","title":"积分数","mock":{"mock":"@integer(0)"}},"user":{"title":"用户","$ref":"#/definitions/1077996"},"id":{"type":"string","title":"ID","mock":{"mock":"JL@integer"}},"reason":{"type":"string","title":"原因","mock":{"mock":"@cparagraph"}}},"x-apifox-orders":["user","timestamp","action","points","id","reason"],"required":["user","timestamp","action","points","id","reason"],"title":"transaction","name":"transaction"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"result":{"type":"boolean","title":"审核结果"},"reason":{"type":"string","title":"理由"}},"required":["result","reason"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":14440370,"httpApiCaseId":200386092,"httpApiName":"AT0105 审核文章","httpApiPath":"/articles/{id}/visibility","httpApiMethod":"put","httpApiCaseName":"AT0105 审核文章","id":"1646828c-64f8-41a2-81b6-d2618e5615a0","type":"http","name":"AT0105 审核文章(AT0105 审核文章)","relatedId":5179477,"blockId":"1646828c-64f8-41a2-81b6-d2618e5615a0"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"fd2c02b6-6725-4d57-8847-420fa8ddc2e1","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"header":[{"disabled":false,"key":"token","value":""},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":4233285,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"article":{"title":"文章字典","description":"含article表的所有字段","$ref":"#/definitions/1077703","x-apifox-overrides":{}},"me":{"type":"object","properties":{"liked":{"type":"boolean","title":"是否点赞"},"is_author":{"type":"boolean","title":"是否文章作者"}},"description":"检测查询用户与该文章的关联","required":["liked","is_author"],"x-apifox-orders":["liked","is_author"]}},"required":["article","me"],"x-apifox-orders":["article","me"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{"1077703":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id"},"author":{"title":"作者","description":"用户id","$ref":"#/definitions/1097305","x-apifox-overrides":{}},"likes":{"type":"integer","title":"点赞数"},"views":{"type":"integer","title":"访问量"},"like_users":{"type":"array","items":{"type":"integer","description":"用户id"},"title":"点赞用户列表"},"publish_time":{"type":"string","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"},"title":"发表时间"},"update_time":{"type":"string","title":"更新时间","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"}},"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","title":"文章简介","mock":{"mock":"@csentence"}},"content":{"type":"string","title":"文章内容","description":"markdown","mock":{"mock":"@cparagraph"}},"cover":{"type":"string","title":"文章封面","description":"url","mock":{"mock":"@image"}},"visibility":{"type":"boolean"}},"required":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"x-apifox-orders":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"title":"article_all","name":"article_all"},"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"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{}}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5333397,"httpApiCaseId":200386239,"httpApiName":"AT0104 获取文章内容","httpApiPath":"/articles/{id}","httpApiMethod":"get","httpApiCaseName":"AT0104 获取文章内容","id":"fd2c02b6-6725-4d57-8847-420fa8ddc2e1","type":"http","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","relatedId":5179477,"blockId":"fd2c02b6-6725-4d57-8847-420fa8ddc2e1"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"70e76a33-ed84-49f6-9724-162086d8e4cd","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"7"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"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":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386289,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"70e76a33-ed84-49f6-9724-162086d8e4cd","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"70e76a33-ed84-49f6-9724-162086d8e4cd"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"ae45b2ce-257f-4e33-9a5f-eff17036c78b","name":"LG0101 账号密码登录 (登录用户user_test)","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\": \"user_test\",\r\n \"password\": \"123456\"\r\n}","generateMode":"normal","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"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_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【token_2】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【token_2】出错: ' + 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.environment.set(`user_id_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【user_id_2】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【user_id_2】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183271,"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,"ordering":1,"description":"","mediaType":"","headers":[],"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"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318056,"httpApiCaseId":200386296,"httpApiName":"LG0101 账号密码登录","httpApiPath":"/login","httpApiMethod":"post","httpApiCaseName":"登录用户user_test","id":"ae45b2ce-257f-4e33-9a5f-eff17036c78b","type":"http","name":"LG0101 账号密码登录 (登录用户user_test)","relatedId":5179477,"blockId":"ae45b2ce-257f-4e33-9a5f-eff17036c78b"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"1e1b4c05-ac96-451d-809e-9b5f662d4fc6","name":"AT0101 创建文章(创建文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles"],"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":"{\n \"title\": \"日样色\",\n \"description\": \"位团听大做标质其地候传意指区铁上。\",\n \"content\": \"级每压目县干全方没识重以方还难名厂。周教场对油派厂织太展或值到。华立代红上示素名育满感名次。制流之意争就图得标者队及道无非部历例。争声分导么被真自级心造或经本类决后。\",\n \"cover\": \"http://dummyimage.com/468x60\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[{"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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')"," } catch(e) {"," e.message = '提取变量【article_id】出错: ' + e.message;"," throw e;"," }"," "," "]}}],"responseDefinition":{"id":4183335,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id","description":"注:初始化publish_time,update_time"}},"required":["id"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","mock":{"mock":"@csentence"},"title":"文章简介"},"content":{"type":"string","mock":{"mock":"@cparagraph"},"title":"文章内容","description":"markdown"},"cover":{"type":"string","mock":{"mock":"@image"},"title":"文章封面","description":"url"}},"required":["title","description","content","cover"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5318101,"httpApiCaseId":200386316,"httpApiName":"AT0101 创建文章","httpApiPath":"/articles","httpApiMethod":"post","httpApiCaseName":"AT0101 创建文章","id":"1e1b4c05-ac96-451d-809e-9b5f662d4fc6","type":"http","name":"AT0101 创建文章(创建文章)","relatedId":5179477,"blockId":"1e1b4c05-ac96-451d-809e-9b5f662d4fc6"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"48eb929d-2ff6-4865-99c2-c074ae0270eb","name":"AT0105 审核文章(AT0105 审核文章)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}","visibility"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"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":"{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}","generateMode":"example","type":"application/json"},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":27919786,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{},"x-apifox-orders":["01H6X55E47JH482NARACB4TV1K"],"required":[],"x-apifox-refs":{"01H6X55E47JH482NARACB4TV1K":{"$ref":"#/definitions/53485892"}}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"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"},"53485892":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","title":"时间","mock":{"mock":"@datetime"}},"action":{"type":"string","enum":["earn","redeem","other"],"x-apifox":{"enumDescriptions":{"earn":"增加","redeem":"兑换","other":"其他"}},"title":"类型","mock":{"mock":"@string"},"description":"add或reedm"},"points":{"type":"integer","title":"积分数","mock":{"mock":"@integer(0)"}},"user":{"title":"用户","$ref":"#/definitions/1077996"},"id":{"type":"string","title":"ID","mock":{"mock":"JL@integer"}},"reason":{"type":"string","title":"原因","mock":{"mock":"@cparagraph"}}},"x-apifox-orders":["user","timestamp","action","points","id","reason"],"required":["user","timestamp","action","points","id","reason"],"title":"transaction","name":"transaction"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{"result":{"type":"boolean","title":"审核结果"},"reason":{"type":"string","title":"理由"}},"required":["result","reason"]}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":14440370,"httpApiCaseId":200386326,"httpApiName":"AT0105 审核文章","httpApiPath":"/articles/{id}/visibility","httpApiMethod":"put","httpApiCaseName":"AT0105 审核文章","id":"48eb929d-2ff6-4865-99c2-c074ae0270eb","type":"http","name":"AT0105 审核文章(AT0105 审核文章)","relatedId":5179477,"blockId":"48eb929d-2ff6-4865-99c2-c074ae0270eb"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"54387fc9-dd07-435c-a33c-601ba45f3a4e","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","request":{"url":{"protocol":"http","port":"8000","path":["articles","{{article_id}}"],"host":["127","0","0","1"],"query":[],"variable":[{"disabled":false,"type":"string","value":"{{article_id}}","key":"id"}]},"header":[{"disabled":false,"key":"token","value":""},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":4233285,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{"article":{"title":"文章字典","description":"含article表的所有字段","$ref":"#/definitions/1077703","x-apifox-overrides":{}},"me":{"type":"object","properties":{"liked":{"type":"boolean","title":"是否点赞"},"is_author":{"type":"boolean","title":"是否文章作者"}},"description":"检测查询用户与该文章的关联","required":["liked","is_author"],"x-apifox-orders":["liked","is_author"]}},"required":["article","me"],"x-apifox-orders":["article","me"]},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{"1077703":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id"},"author":{"title":"作者","description":"用户id","$ref":"#/definitions/1097305","x-apifox-overrides":{}},"likes":{"type":"integer","title":"点赞数"},"views":{"type":"integer","title":"访问量"},"like_users":{"type":"array","items":{"type":"integer","description":"用户id"},"title":"点赞用户列表"},"publish_time":{"type":"string","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"},"title":"发表时间"},"update_time":{"type":"string","title":"更新时间","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"}},"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","title":"文章简介","mock":{"mock":"@csentence"}},"content":{"type":"string","title":"文章内容","description":"markdown","mock":{"mock":"@cparagraph"}},"cover":{"type":"string","title":"文章封面","description":"url","mock":{"mock":"@image"}},"visibility":{"type":"boolean"}},"required":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"x-apifox-orders":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"title":"article_all","name":"article_all"},"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"}}},"requestDefinition":{"jsonSchema":{"type":"object","properties":{}}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":5333397,"httpApiCaseId":200386328,"httpApiName":"AT0104 获取文章内容","httpApiPath":"/articles/{id}","httpApiMethod":"get","httpApiCaseName":"AT0104 获取文章内容","id":"54387fc9-dd07-435c-a33c-601ba45f3a4e","type":"http","name":"AT0104 获取文章内容 (AT0104 获取文章内容)","relatedId":5179477,"blockId":"54387fc9-dd07-435c-a33c-601ba45f3a4e"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"f98a1d53-5c2d-4c94-a696-525a7c90c09b","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"0"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"variable":[]},"header":[{"key":"token","value":"{{token_2}}"},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386329,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"f98a1d53-5c2d-4c94-a696-525a7c90c09b","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"f98a1d53-5c2d-4c94-a696-525a7c90c09b"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"0df4ed39-af95-4889-bd66-a6f525f768e9","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"7"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"variable":[]},"header":[{"key":"token","value":"{{token_2}}"},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386349,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"0df4ed39-af95-4889-bd66-a6f525f768e9","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"0df4ed39-af95-4889-bd66-a6f525f768e9"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}},{"id":"fc0a94f2-5119-40e9-b9eb-70f44e34b015","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":"30"},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"variable":[]},"header":[{"key":"token","value":"{{token_2}}"},{"key":"User-Agent","value":"Apifox/1.0.0 (https://apifox.com)"}],"method":"GET","baseUrl":"http://127.0.0.1:8000","body":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539428440,"name":"成功","code":200,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":1,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386352,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"fc0a94f2-5119-40e9-b9eb-70f44e34b015","type":"http","name":"AT0203 文章上传榜单 (AT0203 文章上传榜单)","relatedId":5179477,"blockId":"fc0a94f2-5119-40e9-b9eb-70f44e34b015"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}}],"name":"文章上传榜单 AT0203-200"}],"info":{"name":"文章上传榜单 AT0203-200"},"dataSchemas":{"1077703":{"type":"object","properties":{"id":{"type":"integer","title":"文章的id"},"author":{"title":"作者","description":"用户id","$ref":"#/definitions/1097305","x-apifox-overrides":{}},"likes":{"type":"integer","title":"点赞数"},"views":{"type":"integer","title":"访问量"},"like_users":{"type":"array","items":{"type":"integer","description":"用户id"},"title":"点赞用户列表"},"publish_time":{"type":"string","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"},"title":"发表时间"},"update_time":{"type":"string","title":"更新时间","mock":{"mock":"@datetime('yyyy-MM-dd HH:mm:ss')"}},"title":{"type":"string","mock":{"mock":"@ctitle"},"title":"文章标题"},"description":{"type":"string","title":"文章简介","mock":{"mock":"@csentence"}},"content":{"type":"string","title":"文章内容","description":"markdown","mock":{"mock":"@cparagraph"}},"cover":{"type":"string","title":"文章封面","description":"url","mock":{"mock":"@image"}},"visibility":{"type":"boolean"}},"required":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"x-apifox-orders":["id","author","likes","views","like_users","publish_time","update_time","title","description","content","cover","visibility"],"title":"article_all","name":"article_all"},"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"},"53485892":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","title":"时间","mock":{"mock":"@datetime"}},"action":{"type":"string","enum":["earn","redeem","other"],"x-apifox":{"enumDescriptions":{"earn":"增加","redeem":"兑换","other":"其他"}},"title":"类型","mock":{"mock":"@string"},"description":"add或reedm"},"points":{"type":"integer","title":"积分数","mock":{"mock":"@integer(0)"}},"user":{"title":"用户","$ref":"#/definitions/1077996"},"id":{"type":"string","title":"ID","mock":{"mock":"JL@integer"}},"reason":{"type":"string","title":"原因","mock":{"mock":"@cparagraph"}}},"x-apifox-orders":["user","timestamp","action","points","id","reason"],"required":["user","timestamp","action","points","id","reason"],"title":"transaction","name":"transaction"}},"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":"82cf7fe3-7e13-4765-b695-284853fcee8e","name":"测试环境","values":[{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8","key":"token","isBindInitial":false,"initialValue":""},{"type":"any","value":"16","key":"quiz_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"word_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM","key":"token_2","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_3","isBindInitial":true,"initialValue":""},{"type":"any","value":"3","key":"user_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"10","key":"article_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"comment_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"comment_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_pre","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_later","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"SJ000006","key":"paper_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"DJ000002","key":"paper_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"undefined","key":"quiz_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"3","key":"word_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"2","key":"user_id_2","isBindInitial":false,"initialValue":""}]},"type":"normal","parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"globals":{"baseUrl":"","baseUrls":{},"variable":{"id":"e941a7f7-b2f4-44ff-9c68-33172417a3c0","values":[]},"parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"isServerBuild":false,"isTestFlowControl":false,"projectOptions":{"enableJsonc":false,"enableBigint":false,"responseValidate":true,"isDefaultUrlEncoding":2,"enableTestScenarioSetting":false,"enableYAPICompatScript":false}} \ No newline at end of file +{ + "apifoxCli": "1.1.0", + "item": [ + { + "item": [ + { + "id": "dff3d035-5244-4b24-b0bd-fed55aba1110", + "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": "{\n \"username\": \"admin\",\n \"password\": \"testtest123\"\n}", + "generateMode": "normal", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "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('___label_placeholder__processor___', '已设置环境变量【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('___label_placeholder__processor___', '已设置临时变量【user_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【user_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183271, + "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, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "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" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318056, + "httpApiCaseId": 200385981, + "httpApiName": "LG0101 账号密码登录", + "httpApiPath": "/login", + "httpApiMethod": "post", + "httpApiCaseName": "LG0101 账号密码登录", + "id": "dff3d035-5244-4b24-b0bd-fed55aba1110", + "type": "http", + "name": "LG0101 账号密码登录(登录用户admin)", + "relatedId": 5179477, + "blockId": "dff3d035-5244-4b24-b0bd-fed55aba1110" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "9125ee79-9f55-47f8-aa7f-96aad2a52c82", + "name": "AT0101 创建文章(创建文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles" + ], + "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": "{\n \"title\": \"能花情\",\n \"description\": \"划存容再者开速件世处果机导近。\",\n \"content\": \"实看确拉书育越热积利住查民共力者料连。办门快图大史下近证百影派至清运须商。三列断可成性深整改力马县无。任元日收解前林提提党选际步。\",\n \"cover\": \"http://dummyimage.com/250x250\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [ + { + "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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【article_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183335, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id", + "description": "注:初始化publish_time,update_time" + } + }, + "required": [ + "id" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "mock": { + "mock": "@csentence" + }, + "title": "文章简介" + }, + "content": { + "type": "string", + "mock": { + "mock": "@cparagraph" + }, + "title": "文章内容", + "description": "markdown" + }, + "cover": { + "type": "string", + "mock": { + "mock": "@image" + }, + "title": "文章封面", + "description": "url" + } + }, + "required": [ + "title", + "description", + "content", + "cover" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318101, + "httpApiCaseId": 200385995, + "httpApiName": "AT0101 创建文章", + "httpApiPath": "/articles", + "httpApiMethod": "post", + "httpApiCaseName": "AT0101 创建文章", + "id": "9125ee79-9f55-47f8-aa7f-96aad2a52c82", + "type": "http", + "name": "AT0101 创建文章(创建文章)", + "relatedId": 5179477, + "blockId": "9125ee79-9f55-47f8-aa7f-96aad2a52c82" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "1646828c-64f8-41a2-81b6-d2618e5615a0", + "name": "AT0105 审核文章(AT0105 审核文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}", + "visibility" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ + { + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" + } + ] + }, + "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": "{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 27919786, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01H6X55E47JH482NARACB4TV1K" + ], + "required": [], + "x-apifox-refs": { + "01H6X55E47JH482NARACB4TV1K": { + "$ref": "#/definitions/53485892" + } + } + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "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" + }, + "53485892": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "title": "时间", + "mock": { + "mock": "@datetime" + } + }, + "action": { + "type": "string", + "enum": [ + "earn", + "redeem", + "other" + ], + "x-apifox": { + "enumDescriptions": { + "earn": "增加", + "redeem": "兑换", + "other": "其他" + } + }, + "title": "类型", + "mock": { + "mock": "@string" + }, + "description": "add或reedm" + }, + "points": { + "type": "integer", + "title": "积分数", + "mock": { + "mock": "@integer(0)" + } + }, + "user": { + "title": "用户", + "$ref": "#/definitions/1077996" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "JL@integer" + } + }, + "reason": { + "type": "string", + "title": "原因", + "mock": { + "mock": "@cparagraph" + } + } + }, + "x-apifox-orders": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "required": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "title": "transaction", + "name": "transaction" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "result": { + "type": "boolean", + "title": "审核结果" + }, + "reason": { + "type": "string", + "title": "理由" + } + }, + "required": [ + "result", + "reason" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 14440370, + "httpApiCaseId": 200386092, + "httpApiName": "AT0105 审核文章", + "httpApiPath": "/articles/{id}/visibility", + "httpApiMethod": "put", + "httpApiCaseName": "AT0105 审核文章", + "id": "1646828c-64f8-41a2-81b6-d2618e5615a0", + "type": "http", + "name": "AT0105 审核文章(AT0105 审核文章)", + "relatedId": 5179477, + "blockId": "1646828c-64f8-41a2-81b6-d2618e5615a0" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ + { + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" + } + ] + }, + "header": [ + { + "disabled": false, + "key": "token", + "value": "" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 4233285, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "article": { + "title": "文章字典", + "description": "含article表的所有字段", + "$ref": "#/definitions/1077703", + "x-apifox-overrides": {} + }, + "me": { + "type": "object", + "properties": { + "liked": { + "type": "boolean", + "title": "是否点赞" + }, + "is_author": { + "type": "boolean", + "title": "是否文章作者" + } + }, + "description": "检测查询用户与该文章的关联", + "required": [ + "liked", + "is_author" + ], + "x-apifox-orders": [ + "liked", + "is_author" + ] + } + }, + "required": [ + "article", + "me" + ], + "x-apifox-orders": [ + "article", + "me" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": { + "1077703": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id" + }, + "author": { + "title": "作者", + "description": "用户id", + "$ref": "#/definitions/1097305", + "x-apifox-overrides": {} + }, + "likes": { + "type": "integer", + "title": "点赞数" + }, + "views": { + "type": "integer", + "title": "访问量" + }, + "like_users": { + "type": "array", + "items": { + "type": "integer", + "description": "用户id" + }, + "title": "点赞用户列表" + }, + "publish_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "发表时间" + }, + "update_time": { + "type": "string", + "title": "更新时间", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "title": "文章简介", + "mock": { + "mock": "@csentence" + } + }, + "content": { + "type": "string", + "title": "文章内容", + "description": "markdown", + "mock": { + "mock": "@cparagraph" + } + }, + "cover": { + "type": "string", + "title": "文章封面", + "description": "url", + "mock": { + "mock": "@image" + } + }, + "visibility": { + "type": "boolean" + } + }, + "required": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "x-apifox-orders": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "title": "article_all", + "name": "article_all" + }, + "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" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": {} + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5333397, + "httpApiCaseId": 200386239, + "httpApiName": "AT0104 获取文章内容", + "httpApiPath": "/articles/{id}", + "httpApiMethod": "get", + "httpApiCaseName": "AT0104 获取文章内容", + "id": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1", + "type": "http", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "relatedId": 5179477, + "blockId": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "70e76a33-ed84-49f6-9724-162086d8e4cd", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "days", + "value": "7" + }, + { + "disabled": false, + "key": "page", + "value": "1" + }, + { + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "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": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386289, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "70e76a33-ed84-49f6-9724-162086d8e4cd", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "70e76a33-ed84-49f6-9724-162086d8e4cd" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "ae45b2ce-257f-4e33-9a5f-eff17036c78b", + "name": "LG0101 账号密码登录 (登录用户user_test)", + "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\": \"user_test\",\r\n \"password\": \"123456\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "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_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【token_2】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【token_2】出错: ' + 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.environment.set(`user_id_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【user_id_2】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【user_id_2】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183271, + "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, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "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" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318056, + "httpApiCaseId": 200386296, + "httpApiName": "LG0101 账号密码登录", + "httpApiPath": "/login", + "httpApiMethod": "post", + "httpApiCaseName": "登录用户user_test", + "id": "ae45b2ce-257f-4e33-9a5f-eff17036c78b", + "type": "http", + "name": "LG0101 账号密码登录 (登录用户user_test)", + "relatedId": 5179477, + "blockId": "ae45b2ce-257f-4e33-9a5f-eff17036c78b" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6", + "name": "AT0101 创建文章(创建文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles" + ], + "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": "{\n \"title\": \"日样色\",\n \"description\": \"位团听大做标质其地候传意指区铁上。\",\n \"content\": \"级每压目县干全方没识重以方还难名厂。周教场对油派厂织太展或值到。华立代红上示素名育满感名次。制流之意争就图得标者队及道无非部历例。争声分导么被真自级心造或经本类决后。\",\n \"cover\": \"http://dummyimage.com/468x60\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [ + { + "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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【article_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183335, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id", + "description": "注:初始化publish_time,update_time" + } + }, + "required": [ + "id" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "mock": { + "mock": "@csentence" + }, + "title": "文章简介" + }, + "content": { + "type": "string", + "mock": { + "mock": "@cparagraph" + }, + "title": "文章内容", + "description": "markdown" + }, + "cover": { + "type": "string", + "mock": { + "mock": "@image" + }, + "title": "文章封面", + "description": "url" + } + }, + "required": [ + "title", + "description", + "content", + "cover" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318101, + "httpApiCaseId": 200386316, + "httpApiName": "AT0101 创建文章", + "httpApiPath": "/articles", + "httpApiMethod": "post", + "httpApiCaseName": "AT0101 创建文章", + "id": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6", + "type": "http", + "name": "AT0101 创建文章(创建文章)", + "relatedId": 5179477, + "blockId": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "48eb929d-2ff6-4865-99c2-c074ae0270eb", + "name": "AT0105 审核文章(AT0105 审核文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}", + "visibility" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ + { + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" + } + ] + }, + "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": "{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 27919786, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01H6X55E47JH482NARACB4TV1K" + ], + "required": [], + "x-apifox-refs": { + "01H6X55E47JH482NARACB4TV1K": { + "$ref": "#/definitions/53485892" + } + } + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "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" + }, + "53485892": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "title": "时间", + "mock": { + "mock": "@datetime" + } + }, + "action": { + "type": "string", + "enum": [ + "earn", + "redeem", + "other" + ], + "x-apifox": { + "enumDescriptions": { + "earn": "增加", + "redeem": "兑换", + "other": "其他" + } + }, + "title": "类型", + "mock": { + "mock": "@string" + }, + "description": "add或reedm" + }, + "points": { + "type": "integer", + "title": "积分数", + "mock": { + "mock": "@integer(0)" + } + }, + "user": { + "title": "用户", + "$ref": "#/definitions/1077996" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "JL@integer" + } + }, + "reason": { + "type": "string", + "title": "原因", + "mock": { + "mock": "@cparagraph" + } + } + }, + "x-apifox-orders": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "required": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "title": "transaction", + "name": "transaction" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "result": { + "type": "boolean", + "title": "审核结果" + }, + "reason": { + "type": "string", + "title": "理由" + } + }, + "required": [ + "result", + "reason" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 14440370, + "httpApiCaseId": 200386326, + "httpApiName": "AT0105 审核文章", + "httpApiPath": "/articles/{id}/visibility", + "httpApiMethod": "put", + "httpApiCaseName": "AT0105 审核文章", + "id": "48eb929d-2ff6-4865-99c2-c074ae0270eb", + "type": "http", + "name": "AT0105 审核文章(AT0105 审核文章)", + "relatedId": 5179477, + "blockId": "48eb929d-2ff6-4865-99c2-c074ae0270eb" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "54387fc9-dd07-435c-a33c-601ba45f3a4e", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ + { + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" + } + ] + }, + "header": [ + { + "disabled": false, + "key": "token", + "value": "" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 4233285, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "article": { + "title": "文章字典", + "description": "含article表的所有字段", + "$ref": "#/definitions/1077703", + "x-apifox-overrides": {} + }, + "me": { + "type": "object", + "properties": { + "liked": { + "type": "boolean", + "title": "是否点赞" + }, + "is_author": { + "type": "boolean", + "title": "是否文章作者" + } + }, + "description": "检测查询用户与该文章的关联", + "required": [ + "liked", + "is_author" + ], + "x-apifox-orders": [ + "liked", + "is_author" + ] + } + }, + "required": [ + "article", + "me" + ], + "x-apifox-orders": [ + "article", + "me" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": { + "1077703": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id" + }, + "author": { + "title": "作者", + "description": "用户id", + "$ref": "#/definitions/1097305", + "x-apifox-overrides": {} + }, + "likes": { + "type": "integer", + "title": "点赞数" + }, + "views": { + "type": "integer", + "title": "访问量" + }, + "like_users": { + "type": "array", + "items": { + "type": "integer", + "description": "用户id" + }, + "title": "点赞用户列表" + }, + "publish_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "发表时间" + }, + "update_time": { + "type": "string", + "title": "更新时间", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "title": "文章简介", + "mock": { + "mock": "@csentence" + } + }, + "content": { + "type": "string", + "title": "文章内容", + "description": "markdown", + "mock": { + "mock": "@cparagraph" + } + }, + "cover": { + "type": "string", + "title": "文章封面", + "description": "url", + "mock": { + "mock": "@image" + } + }, + "visibility": { + "type": "boolean" + } + }, + "required": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "x-apifox-orders": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "title": "article_all", + "name": "article_all" + }, + "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" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": {} + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5333397, + "httpApiCaseId": 200386328, + "httpApiName": "AT0104 获取文章内容", + "httpApiPath": "/articles/{id}", + "httpApiMethod": "get", + "httpApiCaseName": "AT0104 获取文章内容", + "id": "54387fc9-dd07-435c-a33c-601ba45f3a4e", + "type": "http", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "relatedId": 5179477, + "blockId": "54387fc9-dd07-435c-a33c-601ba45f3a4e" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "f98a1d53-5c2d-4c94-a696-525a7c90c09b", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "days", + "value": "0" + }, + { + "disabled": false, + "key": "page", + "value": "1" + }, + { + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token_2}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386329, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "f98a1d53-5c2d-4c94-a696-525a7c90c09b", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "f98a1d53-5c2d-4c94-a696-525a7c90c09b" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "0df4ed39-af95-4889-bd66-a6f525f768e9", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "days", + "value": "7" + }, + { + "disabled": false, + "key": "page", + "value": "1" + }, + { + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token_2}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386349, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "0df4ed39-af95-4889-bd66-a6f525f768e9", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "0df4ed39-af95-4889-bd66-a6f525f768e9" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "fc0a94f2-5119-40e9-b9eb-70f44e34b015", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "days", + "value": "30" + }, + { + "disabled": false, + "key": "page", + "value": "1" + }, + { + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token_2}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386352, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "fc0a94f2-5119-40e9-b9eb-70f44e34b015", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "fc0a94f2-5119-40e9-b9eb-70f44e34b015" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + } + ], + "name": "文章上传榜单 AT0203-200" + } + ], + "info": { + "name": "文章上传榜单 AT0203-200" + }, + "dataSchemas": { + "1077703": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id" + }, + "author": { + "title": "作者", + "description": "用户id", + "$ref": "#/definitions/1097305", + "x-apifox-overrides": {} + }, + "likes": { + "type": "integer", + "title": "点赞数" + }, + "views": { + "type": "integer", + "title": "访问量" + }, + "like_users": { + "type": "array", + "items": { + "type": "integer", + "description": "用户id" + }, + "title": "点赞用户列表" + }, + "publish_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "发表时间" + }, + "update_time": { + "type": "string", + "title": "更新时间", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "title": "文章简介", + "mock": { + "mock": "@csentence" + } + }, + "content": { + "type": "string", + "title": "文章内容", + "description": "markdown", + "mock": { + "mock": "@cparagraph" + } + }, + "cover": { + "type": "string", + "title": "文章封面", + "description": "url", + "mock": { + "mock": "@image" + } + }, + "visibility": { + "type": "boolean" + } + }, + "required": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "x-apifox-orders": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "title": "article_all", + "name": "article_all" + }, + "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" + }, + "53485892": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "title": "时间", + "mock": { + "mock": "@datetime" + } + }, + "action": { + "type": "string", + "enum": [ + "earn", + "redeem", + "other" + ], + "x-apifox": { + "enumDescriptions": { + "earn": "增加", + "redeem": "兑换", + "other": "其他" + } + }, + "title": "类型", + "mock": { + "mock": "@string" + }, + "description": "add或reedm" + }, + "points": { + "type": "integer", + "title": "积分数", + "mock": { + "mock": "@integer(0)" + } + }, + "user": { + "title": "用户", + "$ref": "#/definitions/1077996" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "JL@integer" + } + }, + "reason": { + "type": "string", + "title": "原因", + "mock": { + "mock": "@cparagraph" + } + } + }, + "x-apifox-orders": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "required": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "title": "transaction", + "name": "transaction" + } + }, + "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": "82cf7fe3-7e13-4765-b695-284853fcee8e", + "name": "测试环境", + "values": [ + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8", + "key": "token", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "16", + "key": "quiz_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM", + "key": "token_2", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_3", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "3", + "key": "user_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "10", + "key": "article_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_pre", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_later", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "SJ000006", + "key": "paper_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "DJ000002", + "key": "paper_record_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "undefined", + "key": "quiz_record_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "3", + "key": "word_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "2", + "key": "user_id_2", + "isBindInitial": false, + "initialValue": "" + } + ] + }, + "type": "normal", + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "globals": { + "baseUrl": "", + "baseUrls": {}, + "variable": { + "id": "e941a7f7-b2f4-44ff-9c68-33172417a3c0", + "values": [] + }, + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "isServerBuild": false, + "isTestFlowControl": false, + "projectOptions": { + "enableJsonc": false, + "enableBigint": false, + "responseValidate": true, + "isDefaultUrlEncoding": 2, + "enableTestScenarioSetting": false, + "enableYAPICompatScript": false + } +} \ No newline at end of file diff --git a/tests/article_AT0203_400.apifox-cli.json b/tests/article_AT0203_400.apifox-cli.json index a1cc3084..8cff6a08 100644 --- a/tests/article_AT0203_400.apifox-cli.json +++ b/tests/article_AT0203_400.apifox-cli.json @@ -1 +1,297 @@ -{"apifoxCli":"1.1.0","item":[{"item":[{"id":"e9dbe642-1c2b-4d55-be47-8da1086b9cf4","name":"AT0203 文章上传榜单","request":{"url":{"protocol":"http","port":"8000","path":["articles","ranking"],"host":["127","0","0","1"],"query":[{"disabled":false,"key":"days","value":""},{"disabled":false,"key":"page","value":"1"},{"disabled":false,"key":"pagesize","value":"10"}],"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":{},"auth":{"type":"noauth","noauth":[]},"type":"http"},"response":[],"event":[],"responseDefinition":{"id":539399074,"name":"没有发送天数","code":400,"contentType":"json","jsonSchema":{"type":"object","properties":{}},"defaultEnable":true,"ordering":2,"description":"","mediaType":"","headers":[],"schemaDefinitions":{}},"requestDefinition":{"jsonSchema":{}},"overrideRequesterOptions":{"strictSSL":false,"followRedirects":false},"metaInfo":{"httpApiId":220125505,"httpApiCaseId":200386435,"httpApiName":"AT0203 文章上传榜单","httpApiPath":"/articles/ranking","httpApiMethod":"get","httpApiCaseName":"AT0203 文章上传榜单","id":"e9dbe642-1c2b-4d55-be47-8da1086b9cf4","type":"http","name":"AT0203 文章上传榜单","relatedId":5179481,"blockId":"e9dbe642-1c2b-4d55-be47-8da1086b9cf4"},"type":"http","protocolProfileBehavior":{"useWhatWGUrlParser":false,"disableUrlEncoding":false,"disabledSystemHeaders":{},"disableCookies":false}}],"name":"文章上传榜单 AT0203-400 未传天数"}],"info":{"name":"文章上传榜单 AT0203-400 未传天数"},"dataSchemas":{},"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":"572b4526-4bab-463a-aeb2-7ae9103d6963","name":"测试环境","values":[{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8","key":"token","isBindInitial":false,"initialValue":""},{"type":"any","value":"16","key":"quiz_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"word_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM","key":"token_2","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"word_id_3","isBindInitial":true,"initialValue":""},{"type":"any","value":"3","key":"user_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"10","key":"article_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"","key":"comment_id_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"comment_id_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_2","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_pre","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"num_later","isBindInitial":true,"initialValue":""},{"type":"any","value":"","key":"like_num_1","isBindInitial":true,"initialValue":""},{"type":"any","value":"SJ000006","key":"paper_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"DJ000002","key":"paper_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"undefined","key":"quiz_record_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"3","key":"word_id","isBindInitial":false,"initialValue":""},{"type":"any","value":"2","key":"user_id_2","isBindInitial":false,"initialValue":""}]},"type":"normal","parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"globals":{"baseUrl":"","baseUrls":{},"variable":{"id":"e941a7f7-b2f4-44ff-9c68-33172417a3c0","values":[]},"parameter":{"header":[],"query":[],"body":[],"cookie":[]}},"isServerBuild":false,"isTestFlowControl":false,"projectOptions":{"enableJsonc":false,"enableBigint":false,"responseValidate":true,"isDefaultUrlEncoding":2,"enableTestScenarioSetting":false,"enableYAPICompatScript":false}} \ No newline at end of file +{ + "apifoxCli": "1.1.0", + "item": [ + { + "item": [ + { + "id": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4", + "name": "AT0203 文章上传榜单", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ + { + "disabled": false, + "key": "days", + "value": "" + }, + { + "disabled": false, + "key": "page", + "value": "1" + }, + { + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "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": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539399074, + "name": "没有发送天数", + "code": 400, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 2, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386435, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4", + "type": "http", + "name": "AT0203 文章上传榜单", + "relatedId": 5179481, + "blockId": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + } + ], + "name": "文章上传榜单 AT0203-400 未传天数" + } + ], + "info": { + "name": "文章上传榜单 AT0203-400 未传天数" + }, + "dataSchemas": {}, + "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": "572b4526-4bab-463a-aeb2-7ae9103d6963", + "name": "测试环境", + "values": [ + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8", + "key": "token", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "16", + "key": "quiz_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM", + "key": "token_2", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_3", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "3", + "key": "user_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "10", + "key": "article_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_pre", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_later", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "SJ000006", + "key": "paper_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "DJ000002", + "key": "paper_record_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "undefined", + "key": "quiz_record_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "3", + "key": "word_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "2", + "key": "user_id_2", + "isBindInitial": false, + "initialValue": "" + } + ] + }, + "type": "normal", + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "globals": { + "baseUrl": "", + "baseUrls": {}, + "variable": { + "id": "e941a7f7-b2f4-44ff-9c68-33172417a3c0", + "values": [] + }, + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "isServerBuild": false, + "isTestFlowControl": false, + "projectOptions": { + "enableJsonc": false, + "enableBigint": false, + "responseValidate": true, + "isDefaultUrlEncoding": 2, + "enableTestScenarioSetting": false, + "enableYAPICompatScript": false + } +} \ No newline at end of file From 96be63f8376fc0819a0a8141e99dd2040e9aba07 Mon Sep 17 00:00:00 2001 From: "13313720778@163.com" <13313720778@163.com> Date: Thu, 3 Oct 2024 14:43:17 +0800 Subject: [PATCH 5/7] (AT0203) Format JSON content and beautify Python code --- hinghwa-dict-backend/article/models.py | 5 +- hinghwa-dict-backend/article/views.py | 3 +- .../word/pronunciation/views.py | 6 +- tests/article_AT0203_200.apifox-cli.json | 5984 ++++++++--------- tests/article_AT0203_400.apifox-cli.json | 564 +- 5 files changed, 3279 insertions(+), 3283 deletions(-) diff --git a/hinghwa-dict-backend/article/models.py b/hinghwa-dict-backend/article/models.py index 90ffe720..33f44e9e 100644 --- a/hinghwa-dict-backend/article/models.py +++ b/hinghwa-dict-backend/article/models.py @@ -4,10 +4,7 @@ class Article(models.Model): author = models.ForeignKey( - User, - on_delete=models.CASCADE, - related_name="articles", - verbose_name="作者" + User, on_delete=models.CASCADE, related_name="articles", verbose_name="作者" ) views = models.IntegerField(default=0, verbose_name="阅读量", editable=False) like_users = models.ManyToManyField( diff --git a/hinghwa-dict-backend/article/views.py b/hinghwa-dict-backend/article/views.py index 9be0e7e6..15be2e90 100644 --- a/hinghwa-dict-backend/article/views.py +++ b/hinghwa-dict-backend/article/views.py @@ -452,8 +452,7 @@ def update_rank(cls, search_days): # 不包括存储在数据库中 # 查询发布时间在规定开始时间之后的 result = ( Article.objects.filter( - Q(publish_time__gt=start_date) - & Q(visibility=True) + Q(publish_time__gt=start_date) & Q(visibility=True) ) .values("author_id") .annotate( diff --git a/hinghwa-dict-backend/word/pronunciation/views.py b/hinghwa-dict-backend/word/pronunciation/views.py index 0ce873f2..d8a1a418 100644 --- a/hinghwa-dict-backend/word/pronunciation/views.py +++ b/hinghwa-dict-backend/word/pronunciation/views.py @@ -55,7 +55,7 @@ class SearchPronunciations(View): # PN0201 发音的批量获取 def get(self, request) -> JsonResponse: if ("token" in request.headers) and token_check( - request.headers["token"], settings.JWT_KEY, -1 + request.headers["token"], settings.JWT_KEY, -1 ): pronunciations = Pronunciation.objects.all() else: @@ -155,7 +155,7 @@ def combinePronunciation(request, ipa): os.makedirs(dir) time = timezone.now().__format__("%Y_%m_%d") filename = ( - time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" + time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" ) path = os.path.join(dir, filename) result = MergeAudio(results, path) @@ -277,7 +277,7 @@ def combinePronunciationV2(request): os.makedirs(dir) time = timezone.now().__format__("%Y_%m_%d") filename = ( - time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" + time + "_" + ("".join([item["pinyin"] for item in results])) + ".mp3" ) path = os.path.join(dir, filename) result = MergeAudio(results, path) diff --git a/tests/article_AT0203_200.apifox-cli.json b/tests/article_AT0203_200.apifox-cli.json index 1ca8dd7a..7745900e 100644 --- a/tests/article_AT0203_200.apifox-cli.json +++ b/tests/article_AT0203_200.apifox-cli.json @@ -1,3180 +1,3180 @@ { - "apifoxCli": "1.1.0", - "item": [ + "apifoxCli": "1.1.0", + "item": [ + { + "item": [ { - "item": [ + "id": "dff3d035-5244-4b24-b0bd-fed55aba1110", + "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": "{\n \"username\": \"admin\",\n \"password\": \"testtest123\"\n}", + "generateMode": "normal", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "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('___label_placeholder__processor___', '已设置环境变量【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('___label_placeholder__processor___', '已设置临时变量【user_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【user_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183271, + "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, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "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" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318056, + "httpApiCaseId": 200385981, + "httpApiName": "LG0101 账号密码登录", + "httpApiPath": "/login", + "httpApiMethod": "post", + "httpApiCaseName": "LG0101 账号密码登录", + "id": "dff3d035-5244-4b24-b0bd-fed55aba1110", + "type": "http", + "name": "LG0101 账号密码登录(登录用户admin)", + "relatedId": 5179477, + "blockId": "dff3d035-5244-4b24-b0bd-fed55aba1110" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "9125ee79-9f55-47f8-aa7f-96aad2a52c82", + "name": "AT0101 创建文章(创建文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles" + ], + "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": "{\n \"title\": \"能花情\",\n \"description\": \"划存容再者开速件世处果机导近。\",\n \"content\": \"实看确拉书育越热积利住查民共力者料连。办门快图大史下近证百影派至清运须商。三列断可成性深整改力马县无。任元日收解前林提提党选际步。\",\n \"cover\": \"http://dummyimage.com/250x250\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [ + { + "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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【article_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183335, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id", + "description": "注:初始化publish_time,update_time" + } + }, + "required": [ + "id" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "mock": { + "mock": "@csentence" + }, + "title": "文章简介" + }, + "content": { + "type": "string", + "mock": { + "mock": "@cparagraph" + }, + "title": "文章内容", + "description": "markdown" + }, + "cover": { + "type": "string", + "mock": { + "mock": "@image" + }, + "title": "文章封面", + "description": "url" + } + }, + "required": [ + "title", + "description", + "content", + "cover" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318101, + "httpApiCaseId": 200385995, + "httpApiName": "AT0101 创建文章", + "httpApiPath": "/articles", + "httpApiMethod": "post", + "httpApiCaseName": "AT0101 创建文章", + "id": "9125ee79-9f55-47f8-aa7f-96aad2a52c82", + "type": "http", + "name": "AT0101 创建文章(创建文章)", + "relatedId": 5179477, + "blockId": "9125ee79-9f55-47f8-aa7f-96aad2a52c82" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "1646828c-64f8-41a2-81b6-d2618e5615a0", + "name": "AT0105 审核文章(AT0105 审核文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}", + "visibility" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ { - "id": "dff3d035-5244-4b24-b0bd-fed55aba1110", - "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": "{\n \"username\": \"admin\",\n \"password\": \"testtest123\"\n}", - "generateMode": "normal", - "type": "application/json" - }, - "auth": { - "type": "noauth", - "noauth": [] - }, - "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('___label_placeholder__processor___', '已设置环境变量【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('___label_placeholder__processor___', '已设置临时变量【user_id】,值为 【' + value + '】')", - " } catch(e) {", - " e.message = '提取变量【user_id】出错: ' + e.message;", - " throw e;", - " }", - " ", - " " - ] - } - } - ], - "responseDefinition": { - "id": 4183271, - "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, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "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" - ] - } - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" + } + ] + }, + "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": "{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 27919786, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01H6X55E47JH482NARACB4TV1K" + ], + "required": [], + "x-apifox-refs": { + "01H6X55E47JH482NARACB4TV1K": { + "$ref": "#/definitions/53485892" + } + } + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" }, - "metaInfo": { - "httpApiId": 5318056, - "httpApiCaseId": 200385981, - "httpApiName": "LG0101 账号密码登录", - "httpApiPath": "/login", - "httpApiMethod": "post", - "httpApiCaseName": "LG0101 账号密码登录", - "id": "dff3d035-5244-4b24-b0bd-fed55aba1110", - "type": "http", - "name": "LG0101 账号密码登录(登录用户admin)", - "relatedId": 5179477, - "blockId": "dff3d035-5244-4b24-b0bd-fed55aba1110" + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false - } + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } }, - { - "id": "9125ee79-9f55-47f8-aa7f-96aad2a52c82", - "name": "AT0101 创建文章(创建文章)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles" - ], - "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": "{\n \"title\": \"能花情\",\n \"description\": \"划存容再者开速件世处果机导近。\",\n \"content\": \"实看确拉书育越热积利住查民共力者料连。办门快图大史下近证百影派至清运须商。三列断可成性深整改力马县无。任元日收解前林提提党选际步。\",\n \"cover\": \"http://dummyimage.com/250x250\"\n}", - "generateMode": "example", - "type": "application/json" - }, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [ - { - "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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')", - " } catch(e) {", - " e.message = '提取变量【article_id】出错: ' + e.message;", - " throw e;", - " }", - " ", - " " - ] - } - } + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "53485892": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "title": "时间", + "mock": { + "mock": "@datetime" + } + }, + "action": { + "type": "string", + "enum": [ + "earn", + "redeem", + "other" ], - "responseDefinition": { - "id": 4183335, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "title": "文章的id", - "description": "注:初始化publish_time,update_time" - } - }, - "required": [ - "id" - ] - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": {} - }, - "requestDefinition": { - "jsonSchema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "mock": { - "mock": "@ctitle" - }, - "title": "文章标题" - }, - "description": { - "type": "string", - "mock": { - "mock": "@csentence" - }, - "title": "文章简介" - }, - "content": { - "type": "string", - "mock": { - "mock": "@cparagraph" - }, - "title": "文章内容", - "description": "markdown" - }, - "cover": { - "type": "string", - "mock": { - "mock": "@image" - }, - "title": "文章封面", - "description": "url" - } - }, - "required": [ - "title", - "description", - "content", - "cover" - ] - } - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false + "x-apifox": { + "enumDescriptions": { + "earn": "增加", + "redeem": "兑换", + "other": "其他" + } }, - "metaInfo": { - "httpApiId": 5318101, - "httpApiCaseId": 200385995, - "httpApiName": "AT0101 创建文章", - "httpApiPath": "/articles", - "httpApiMethod": "post", - "httpApiCaseName": "AT0101 创建文章", - "id": "9125ee79-9f55-47f8-aa7f-96aad2a52c82", - "type": "http", - "name": "AT0101 创建文章(创建文章)", - "relatedId": 5179477, - "blockId": "9125ee79-9f55-47f8-aa7f-96aad2a52c82" + "title": "类型", + "mock": { + "mock": "@string" }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false + "description": "add或reedm" + }, + "points": { + "type": "integer", + "title": "积分数", + "mock": { + "mock": "@integer(0)" } - }, - { - "id": "1646828c-64f8-41a2-81b6-d2618e5615a0", - "name": "AT0105 审核文章(AT0105 审核文章)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "{{article_id}}", - "visibility" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [], - "variable": [ - { - "disabled": false, - "type": "string", - "value": "{{article_id}}", - "key": "id" - } - ] - }, - "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": "{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}", - "generateMode": "example", - "type": "application/json" - }, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 27919786, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": {}, - "x-apifox-orders": [ - "01H6X55E47JH482NARACB4TV1K" - ], - "required": [], - "x-apifox-refs": { - "01H6X55E47JH482NARACB4TV1K": { - "$ref": "#/definitions/53485892" - } - } - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "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" - }, - "53485892": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "date-time", - "title": "时间", - "mock": { - "mock": "@datetime" - } - }, - "action": { - "type": "string", - "enum": [ - "earn", - "redeem", - "other" - ], - "x-apifox": { - "enumDescriptions": { - "earn": "增加", - "redeem": "兑换", - "other": "其他" - } - }, - "title": "类型", - "mock": { - "mock": "@string" - }, - "description": "add或reedm" - }, - "points": { - "type": "integer", - "title": "积分数", - "mock": { - "mock": "@integer(0)" - } - }, - "user": { - "title": "用户", - "$ref": "#/definitions/1077996" - }, - "id": { - "type": "string", - "title": "ID", - "mock": { - "mock": "JL@integer" - } - }, - "reason": { - "type": "string", - "title": "原因", - "mock": { - "mock": "@cparagraph" - } - } - }, - "x-apifox-orders": [ - "user", - "timestamp", - "action", - "points", - "id", - "reason" - ], - "required": [ - "user", - "timestamp", - "action", - "points", - "id", - "reason" - ], - "title": "transaction", - "name": "transaction" - } - } - }, - "requestDefinition": { - "jsonSchema": { - "type": "object", - "properties": { - "result": { - "type": "boolean", - "title": "审核结果" - }, - "reason": { - "type": "string", - "title": "理由" - } - }, - "required": [ - "result", - "reason" - ] - } - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 14440370, - "httpApiCaseId": 200386092, - "httpApiName": "AT0105 审核文章", - "httpApiPath": "/articles/{id}/visibility", - "httpApiMethod": "put", - "httpApiCaseName": "AT0105 审核文章", - "id": "1646828c-64f8-41a2-81b6-d2618e5615a0", - "type": "http", - "name": "AT0105 审核文章(AT0105 审核文章)", - "relatedId": 5179477, - "blockId": "1646828c-64f8-41a2-81b6-d2618e5615a0" - }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false + }, + "user": { + "title": "用户", + "$ref": "#/definitions/1077996" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "JL@integer" } - }, - { - "id": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1", - "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "{{article_id}}" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [], - "variable": [ - { - "disabled": false, - "type": "string", - "value": "{{article_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "disabled": false, - "key": "token", - "value": "" - }, - { - "key": "User-Agent", - "value": "Apifox/1.0.0 (https://apifox.com)" - } - ], - "method": "GET", - "baseUrl": "http://127.0.0.1:8000", - "body": {}, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 4233285, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": { - "article": { - "title": "文章字典", - "description": "含article表的所有字段", - "$ref": "#/definitions/1077703", - "x-apifox-overrides": {} - }, - "me": { - "type": "object", - "properties": { - "liked": { - "type": "boolean", - "title": "是否点赞" - }, - "is_author": { - "type": "boolean", - "title": "是否文章作者" - } - }, - "description": "检测查询用户与该文章的关联", - "required": [ - "liked", - "is_author" - ], - "x-apifox-orders": [ - "liked", - "is_author" - ] - } - }, - "required": [ - "article", - "me" - ], - "x-apifox-orders": [ - "article", - "me" - ] - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": { - "1077703": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "title": "文章的id" - }, - "author": { - "title": "作者", - "description": "用户id", - "$ref": "#/definitions/1097305", - "x-apifox-overrides": {} - }, - "likes": { - "type": "integer", - "title": "点赞数" - }, - "views": { - "type": "integer", - "title": "访问量" - }, - "like_users": { - "type": "array", - "items": { - "type": "integer", - "description": "用户id" - }, - "title": "点赞用户列表" - }, - "publish_time": { - "type": "string", - "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" - }, - "title": "发表时间" - }, - "update_time": { - "type": "string", - "title": "更新时间", - "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" - } - }, - "title": { - "type": "string", - "mock": { - "mock": "@ctitle" - }, - "title": "文章标题" - }, - "description": { - "type": "string", - "title": "文章简介", - "mock": { - "mock": "@csentence" - } - }, - "content": { - "type": "string", - "title": "文章内容", - "description": "markdown", - "mock": { - "mock": "@cparagraph" - } - }, - "cover": { - "type": "string", - "title": "文章封面", - "description": "url", - "mock": { - "mock": "@image" - } - }, - "visibility": { - "type": "boolean" - } - }, - "required": [ - "id", - "author", - "likes", - "views", - "like_users", - "publish_time", - "update_time", - "title", - "description", - "content", - "cover", - "visibility" - ], - "x-apifox-orders": [ - "id", - "author", - "likes", - "views", - "like_users", - "publish_time", - "update_time", - "title", - "description", - "content", - "cover", - "visibility" - ], - "title": "article_all", - "name": "article_all" - }, - "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" - } - } - }, - "requestDefinition": { - "jsonSchema": { - "type": "object", - "properties": {} - } - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 5333397, - "httpApiCaseId": 200386239, - "httpApiName": "AT0104 获取文章内容", - "httpApiPath": "/articles/{id}", - "httpApiMethod": "get", - "httpApiCaseName": "AT0104 获取文章内容", - "id": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1", - "type": "http", - "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", - "relatedId": 5179477, - "blockId": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1" - }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false + }, + "reason": { + "type": "string", + "title": "原因", + "mock": { + "mock": "@cparagraph" } + } }, - { - "id": "70e76a33-ed84-49f6-9724-162086d8e4cd", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "ranking" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [ - { - "disabled": false, - "key": "days", - "value": "7" - }, - { - "disabled": false, - "key": "page", - "value": "1" - }, - { - "disabled": false, - "key": "pagesize", - "value": "10" - } - ], - "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": 539428440, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": {} - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": {} - }, - "requestDefinition": { - "jsonSchema": {} - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 220125505, - "httpApiCaseId": 200386289, - "httpApiName": "AT0203 文章上传榜单", - "httpApiPath": "/articles/ranking", - "httpApiMethod": "get", - "httpApiCaseName": "AT0203 文章上传榜单", - "id": "70e76a33-ed84-49f6-9724-162086d8e4cd", - "type": "http", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "relatedId": 5179477, - "blockId": "70e76a33-ed84-49f6-9724-162086d8e4cd" - }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false - } + "x-apifox-orders": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "required": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "title": "transaction", + "name": "transaction" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "result": { + "type": "boolean", + "title": "审核结果" }, + "reason": { + "type": "string", + "title": "理由" + } + }, + "required": [ + "result", + "reason" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 14440370, + "httpApiCaseId": 200386092, + "httpApiName": "AT0105 审核文章", + "httpApiPath": "/articles/{id}/visibility", + "httpApiMethod": "put", + "httpApiCaseName": "AT0105 审核文章", + "id": "1646828c-64f8-41a2-81b6-d2618e5615a0", + "type": "http", + "name": "AT0105 审核文章(AT0105 审核文章)", + "relatedId": 5179477, + "blockId": "1646828c-64f8-41a2-81b6-d2618e5615a0" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ { - "id": "ae45b2ce-257f-4e33-9a5f-eff17036c78b", - "name": "LG0101 账号密码登录 (登录用户user_test)", - "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\": \"user_test\",\r\n \"password\": \"123456\"\r\n}", - "generateMode": "normal", - "type": "application/json" - }, - "auth": { - "type": "noauth", - "noauth": [] - }, - "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_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【token_2】,值为 【' + value + '】')", - " } catch(e) {", - " e.message = '提取变量【token_2】出错: ' + 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.environment.set(`user_id_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【user_id_2】,值为 【' + value + '】')", - " } catch(e) {", - " e.message = '提取变量【user_id_2】出错: ' + e.message;", - " throw e;", - " }", - " ", - " " - ] - } - } - ], - "responseDefinition": { - "id": 4183271, - "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, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "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" - ] - } + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" + } + ] + }, + "header": [ + { + "disabled": false, + "key": "token", + "value": "" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 4233285, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "article": { + "title": "文章字典", + "description": "含article表的所有字段", + "$ref": "#/definitions/1077703", + "x-apifox-overrides": {} + }, + "me": { + "type": "object", + "properties": { + "liked": { + "type": "boolean", + "title": "是否点赞" + }, + "is_author": { + "type": "boolean", + "title": "是否文章作者" + } + }, + "description": "检测查询用户与该文章的关联", + "required": [ + "liked", + "is_author" + ], + "x-apifox-orders": [ + "liked", + "is_author" + ] + } + }, + "required": [ + "article", + "me" + ], + "x-apifox-orders": [ + "article", + "me" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": { + "1077703": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id" + }, + "author": { + "title": "作者", + "description": "用户id", + "$ref": "#/definitions/1097305", + "x-apifox-overrides": {} + }, + "likes": { + "type": "integer", + "title": "点赞数" + }, + "views": { + "type": "integer", + "title": "访问量" + }, + "like_users": { + "type": "array", + "items": { + "type": "integer", + "description": "用户id" }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false + "title": "点赞用户列表" + }, + "publish_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" }, - "metaInfo": { - "httpApiId": 5318056, - "httpApiCaseId": 200386296, - "httpApiName": "LG0101 账号密码登录", - "httpApiPath": "/login", - "httpApiMethod": "post", - "httpApiCaseName": "登录用户user_test", - "id": "ae45b2ce-257f-4e33-9a5f-eff17036c78b", - "type": "http", - "name": "LG0101 账号密码登录 (登录用户user_test)", - "relatedId": 5179477, - "blockId": "ae45b2ce-257f-4e33-9a5f-eff17036c78b" + "title": "发表时间" + }, + "update_time": { + "type": "string", + "title": "更新时间", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false + "title": "文章标题" + }, + "description": { + "type": "string", + "title": "文章简介", + "mock": { + "mock": "@csentence" + } + }, + "content": { + "type": "string", + "title": "文章内容", + "description": "markdown", + "mock": { + "mock": "@cparagraph" + } + }, + "cover": { + "type": "string", + "title": "文章封面", + "description": "url", + "mock": { + "mock": "@image" } + }, + "visibility": { + "type": "boolean" + } }, - { - "id": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6", - "name": "AT0101 创建文章(创建文章)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles" - ], - "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": "{\n \"title\": \"日样色\",\n \"description\": \"位团听大做标质其地候传意指区铁上。\",\n \"content\": \"级每压目县干全方没识重以方还难名厂。周教场对油派厂织太展或值到。华立代红上示素名育满感名次。制流之意争就图得标者队及道无非部历例。争声分导么被真自级心造或经本类决后。\",\n \"cover\": \"http://dummyimage.com/468x60\"\n}", - "generateMode": "example", - "type": "application/json" - }, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [ - { - "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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')", - " } catch(e) {", - " e.message = '提取变量【article_id】出错: ' + e.message;", - " throw e;", - " }", - " ", - " " - ] - } - } - ], - "responseDefinition": { - "id": 4183335, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "title": "文章的id", - "description": "注:初始化publish_time,update_time" - } - }, - "required": [ - "id" - ] - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": {} + "required": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "x-apifox-orders": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "title": "article_all", + "name": "article_all" + }, + "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')" }, - "requestDefinition": { - "jsonSchema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "mock": { - "mock": "@ctitle" - }, - "title": "文章标题" - }, - "description": { - "type": "string", - "mock": { - "mock": "@csentence" - }, - "title": "文章简介" - }, - "content": { - "type": "string", - "mock": { - "mock": "@cparagraph" - }, - "title": "文章内容", - "description": "markdown" - }, - "cover": { - "type": "string", - "mock": { - "mock": "@image" - }, - "title": "文章封面", - "description": "url" - } - }, - "required": [ - "title", - "description", - "content", - "cover" - ] - } + "title": "注册时间" + }, + "login_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false + "title": "登录时间" + }, + "wechat": { + "type": "boolean", + "title": "绑定微信" + }, + "points_sum": { + "type": "integer", + "title": "总分数", + "mock": { + "mock": "@integer(0)" }, - "metaInfo": { - "httpApiId": 5318101, - "httpApiCaseId": 200386316, - "httpApiName": "AT0101 创建文章", - "httpApiPath": "/articles", - "httpApiMethod": "post", - "httpApiCaseName": "AT0101 创建文章", - "id": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6", - "type": "http", - "name": "AT0101 创建文章(创建文章)", - "relatedId": 5179477, - "blockId": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6" + "minimum": 0 + }, + "points_now": { + "type": "integer", + "title": "现有分数", + "mock": { + "mock": "@integer(0)" }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false - } - }, - { - "id": "48eb929d-2ff6-4865-99c2-c074ae0270eb", - "name": "AT0105 审核文章(AT0105 审核文章)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "{{article_id}}", - "visibility" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [], - "variable": [ - { - "disabled": false, - "type": "string", - "value": "{{article_id}}", - "key": "id" - } - ] - }, - "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": "{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}", - "generateMode": "example", - "type": "application/json" - }, - "auth": { - "type": "noauth", - "noauth": [] + "minimum": 0 + }, + "title": { + "type": "object", + "properties": { + "color": { + "type": "string", + "mock": { + "mock": "@color" }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 27919786, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": {}, - "x-apifox-orders": [ - "01H6X55E47JH482NARACB4TV1K" - ], - "required": [], - "x-apifox-refs": { - "01H6X55E47JH482NARACB4TV1K": { - "$ref": "#/definitions/53485892" - } - } + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "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" - }, - "53485892": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "date-time", - "title": "时间", - "mock": { - "mock": "@datetime" - } - }, - "action": { - "type": "string", - "enum": [ - "earn", - "redeem", - "other" - ], - "x-apifox": { - "enumDescriptions": { - "earn": "增加", - "redeem": "兑换", - "other": "其他" - } - }, - "title": "类型", - "mock": { - "mock": "@string" - }, - "description": "add或reedm" - }, - "points": { - "type": "integer", - "title": "积分数", - "mock": { - "mock": "@integer(0)" - } - }, - "user": { - "title": "用户", - "$ref": "#/definitions/1077996" - }, - "id": { - "type": "string", - "title": "ID", - "mock": { - "mock": "JL@integer" - } - }, - "reason": { - "type": "string", - "title": "原因", - "mock": { - "mock": "@cparagraph" - } - } - }, - "x-apifox-orders": [ - "user", - "timestamp", - "action", - "points", - "id", - "reason" - ], - "required": [ - "user", - "timestamp", - "action", - "points", - "id", - "reason" - ], - "title": "transaction", - "name": "transaction" - } - } - }, - "requestDefinition": { - "jsonSchema": { - "type": "object", - "properties": { - "result": { - "type": "boolean", - "title": "审核结果" - }, - "reason": { - "type": "string", - "title": "理由" - } - }, - "required": [ - "result", - "reason" - ] - } + "title": "称号" + } }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 14440370, - "httpApiCaseId": 200386326, - "httpApiName": "AT0105 审核文章", - "httpApiPath": "/articles/{id}/visibility", - "httpApiMethod": "put", - "httpApiCaseName": "AT0105 审核文章", - "id": "48eb929d-2ff6-4865-99c2-c074ae0270eb", - "type": "http", - "name": "AT0105 审核文章(AT0105 审核文章)", - "relatedId": 5179477, - "blockId": "48eb929d-2ff6-4865-99c2-c074ae0270eb" + "title": "标题", + "mock": { + "mock": "@cname" }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false + "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" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": {} + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5333397, + "httpApiCaseId": 200386239, + "httpApiName": "AT0104 获取文章内容", + "httpApiPath": "/articles/{id}", + "httpApiMethod": "get", + "httpApiCaseName": "AT0104 获取文章内容", + "id": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1", + "type": "http", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "relatedId": 5179477, + "blockId": "fd2c02b6-6725-4d57-8847-420fa8ddc2e1" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "70e76a33-ed84-49f6-9724-162086d8e4cd", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ { - "id": "54387fc9-dd07-435c-a33c-601ba45f3a4e", - "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "{{article_id}}" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [], - "variable": [ - { - "disabled": false, - "type": "string", - "value": "{{article_id}}", - "key": "id" - } - ] - }, - "header": [ - { - "disabled": false, - "key": "token", - "value": "" - }, - { - "key": "User-Agent", - "value": "Apifox/1.0.0 (https://apifox.com)" - } - ], - "method": "GET", - "baseUrl": "http://127.0.0.1:8000", - "body": {}, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 4233285, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": { - "article": { - "title": "文章字典", - "description": "含article表的所有字段", - "$ref": "#/definitions/1077703", - "x-apifox-overrides": {} - }, - "me": { - "type": "object", - "properties": { - "liked": { - "type": "boolean", - "title": "是否点赞" - }, - "is_author": { - "type": "boolean", - "title": "是否文章作者" - } - }, - "description": "检测查询用户与该文章的关联", - "required": [ - "liked", - "is_author" - ], - "x-apifox-orders": [ - "liked", - "is_author" - ] - } - }, - "required": [ - "article", - "me" - ], - "x-apifox-orders": [ - "article", - "me" - ] - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": { - "1077703": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "title": "文章的id" - }, - "author": { - "title": "作者", - "description": "用户id", - "$ref": "#/definitions/1097305", - "x-apifox-overrides": {} - }, - "likes": { - "type": "integer", - "title": "点赞数" - }, - "views": { - "type": "integer", - "title": "访问量" - }, - "like_users": { - "type": "array", - "items": { - "type": "integer", - "description": "用户id" - }, - "title": "点赞用户列表" - }, - "publish_time": { - "type": "string", - "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" - }, - "title": "发表时间" - }, - "update_time": { - "type": "string", - "title": "更新时间", - "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" - } - }, - "title": { - "type": "string", - "mock": { - "mock": "@ctitle" - }, - "title": "文章标题" - }, - "description": { - "type": "string", - "title": "文章简介", - "mock": { - "mock": "@csentence" - } - }, - "content": { - "type": "string", - "title": "文章内容", - "description": "markdown", - "mock": { - "mock": "@cparagraph" - } - }, - "cover": { - "type": "string", - "title": "文章封面", - "description": "url", - "mock": { - "mock": "@image" - } - }, - "visibility": { - "type": "boolean" - } - }, - "required": [ - "id", - "author", - "likes", - "views", - "like_users", - "publish_time", - "update_time", - "title", - "description", - "content", - "cover", - "visibility" - ], - "x-apifox-orders": [ - "id", - "author", - "likes", - "views", - "like_users", - "publish_time", - "update_time", - "title", - "description", - "content", - "cover", - "visibility" - ], - "title": "article_all", - "name": "article_all" - }, - "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" - } - } - }, - "requestDefinition": { - "jsonSchema": { - "type": "object", - "properties": {} - } - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 5333397, - "httpApiCaseId": 200386328, - "httpApiName": "AT0104 获取文章内容", - "httpApiPath": "/articles/{id}", - "httpApiMethod": "get", - "httpApiCaseName": "AT0104 获取文章内容", - "id": "54387fc9-dd07-435c-a33c-601ba45f3a4e", - "type": "http", - "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", - "relatedId": 5179477, - "blockId": "54387fc9-dd07-435c-a33c-601ba45f3a4e" - }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false - } + "disabled": false, + "key": "days", + "value": "7" }, { - "id": "f98a1d53-5c2d-4c94-a696-525a7c90c09b", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "ranking" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [ - { - "disabled": false, - "key": "days", - "value": "0" - }, - { - "disabled": false, - "key": "page", - "value": "1" - }, - { - "disabled": false, - "key": "pagesize", - "value": "10" - } - ], - "variable": [] - }, - "header": [ - { - "key": "token", - "value": "{{token_2}}" - }, - { - "key": "User-Agent", - "value": "Apifox/1.0.0 (https://apifox.com)" - } - ], - "method": "GET", - "baseUrl": "http://127.0.0.1:8000", - "body": {}, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 539428440, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": {} - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": {} - }, - "requestDefinition": { - "jsonSchema": {} - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 220125505, - "httpApiCaseId": 200386329, - "httpApiName": "AT0203 文章上传榜单", - "httpApiPath": "/articles/ranking", - "httpApiMethod": "get", - "httpApiCaseName": "AT0203 文章上传榜单", - "id": "f98a1d53-5c2d-4c94-a696-525a7c90c09b", - "type": "http", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "relatedId": 5179477, - "blockId": "f98a1d53-5c2d-4c94-a696-525a7c90c09b" - }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false - } + "disabled": false, + "key": "page", + "value": "1" }, { - "id": "0df4ed39-af95-4889-bd66-a6f525f768e9", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "ranking" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [ - { - "disabled": false, - "key": "days", - "value": "7" - }, - { - "disabled": false, - "key": "page", - "value": "1" - }, - { - "disabled": false, - "key": "pagesize", - "value": "10" - } - ], - "variable": [] - }, - "header": [ - { - "key": "token", - "value": "{{token_2}}" - }, - { - "key": "User-Agent", - "value": "Apifox/1.0.0 (https://apifox.com)" - } - ], - "method": "GET", - "baseUrl": "http://127.0.0.1:8000", - "body": {}, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 539428440, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": {} - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": {} - }, - "requestDefinition": { - "jsonSchema": {} - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 220125505, - "httpApiCaseId": 200386349, - "httpApiName": "AT0203 文章上传榜单", - "httpApiPath": "/articles/ranking", - "httpApiMethod": "get", - "httpApiCaseName": "AT0203 文章上传榜单", - "id": "0df4ed39-af95-4889-bd66-a6f525f768e9", - "type": "http", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "relatedId": 5179477, - "blockId": "0df4ed39-af95-4889-bd66-a6f525f768e9" - }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false - } + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "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": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386289, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "70e76a33-ed84-49f6-9724-162086d8e4cd", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "70e76a33-ed84-49f6-9724-162086d8e4cd" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "ae45b2ce-257f-4e33-9a5f-eff17036c78b", + "name": "LG0101 账号密码登录 (登录用户user_test)", + "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\": \"user_test\",\r\n \"password\": \"123456\"\r\n}", + "generateMode": "normal", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "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_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【token_2】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【token_2】出错: ' + 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.environment.set(`user_id_2`, value);console.log('___label_placeholder__processor___', '已设置环境变量【user_id_2】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【user_id_2】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183271, + "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, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "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" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318056, + "httpApiCaseId": 200386296, + "httpApiName": "LG0101 账号密码登录", + "httpApiPath": "/login", + "httpApiMethod": "post", + "httpApiCaseName": "登录用户user_test", + "id": "ae45b2ce-257f-4e33-9a5f-eff17036c78b", + "type": "http", + "name": "LG0101 账号密码登录 (登录用户user_test)", + "relatedId": 5179477, + "blockId": "ae45b2ce-257f-4e33-9a5f-eff17036c78b" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6", + "name": "AT0101 创建文章(创建文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles" + ], + "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": "{\n \"title\": \"日样色\",\n \"description\": \"位团听大做标质其地候传意指区铁上。\",\n \"content\": \"级每压目县干全方没识重以方还难名厂。周教场对油派厂织太展或值到。华立代红上示素名育满感名次。制流之意争就图得标者队及道无非部历例。争声分导么被真自级心造或经本类决后。\",\n \"cover\": \"http://dummyimage.com/468x60\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [ + { + "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.environment.set(`article_id`, value);console.log('___label_placeholder__processor___', '已设置环境变量【article_id】,值为 【' + value + '】')", + " } catch(e) {", + " e.message = '提取变量【article_id】出错: ' + e.message;", + " throw e;", + " }", + " ", + " " + ] + } + } + ], + "responseDefinition": { + "id": 4183335, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id", + "description": "注:初始化publish_time,update_time" + } + }, + "required": [ + "id" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "mock": { + "mock": "@csentence" + }, + "title": "文章简介" + }, + "content": { + "type": "string", + "mock": { + "mock": "@cparagraph" + }, + "title": "文章内容", + "description": "markdown" + }, + "cover": { + "type": "string", + "mock": { + "mock": "@image" + }, + "title": "文章封面", + "description": "url" + } + }, + "required": [ + "title", + "description", + "content", + "cover" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5318101, + "httpApiCaseId": 200386316, + "httpApiName": "AT0101 创建文章", + "httpApiPath": "/articles", + "httpApiMethod": "post", + "httpApiCaseName": "AT0101 创建文章", + "id": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6", + "type": "http", + "name": "AT0101 创建文章(创建文章)", + "relatedId": 5179477, + "blockId": "1e1b4c05-ac96-451d-809e-9b5f662d4fc6" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "48eb929d-2ff6-4865-99c2-c074ae0270eb", + "name": "AT0105 审核文章(AT0105 审核文章)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}", + "visibility" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ { - "id": "fc0a94f2-5119-40e9-b9eb-70f44e34b015", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "ranking" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [ - { - "disabled": false, - "key": "days", - "value": "30" - }, - { - "disabled": false, - "key": "page", - "value": "1" - }, - { - "disabled": false, - "key": "pagesize", - "value": "10" - } - ], - "variable": [] - }, - "header": [ - { - "key": "token", - "value": "{{token_2}}" - }, - { - "key": "User-Agent", - "value": "Apifox/1.0.0 (https://apifox.com)" - } - ], - "method": "GET", - "baseUrl": "http://127.0.0.1:8000", - "body": {}, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 539428440, - "name": "成功", - "code": 200, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": {} - }, - "defaultEnable": true, - "ordering": 1, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": {} + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" + } + ] + }, + "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": "{\n \"result\": true,\n \"reason\": \"Excepteur anim irure\"\n}", + "generateMode": "example", + "type": "application/json" + }, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 27919786, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {}, + "x-apifox-orders": [ + "01H6X55E47JH482NARACB4TV1K" + ], + "required": [], + "x-apifox-refs": { + "01H6X55E47JH482NARACB4TV1K": { + "$ref": "#/definitions/53485892" + } + } + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": { + "1077996": { + "type": "object", + "properties": { + "nickname": { + "type": "string", + "mock": { + "mock": "@cname" }, - "requestDefinition": { - "jsonSchema": {} + "title": "用户名" + }, + "avatar": { + "type": "string", + "mock": { + "mock": "@image('100x100')" }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false + "title": "头像" + }, + "id": { + "type": "integer", + "title": "用户id" + } + }, + "required": [ + "nickname", + "avatar", + "id" + ], + "title": "user_simple", + "name": "user_simple" + }, + "53485892": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "title": "时间", + "mock": { + "mock": "@datetime" + } + }, + "action": { + "type": "string", + "enum": [ + "earn", + "redeem", + "other" + ], + "x-apifox": { + "enumDescriptions": { + "earn": "增加", + "redeem": "兑换", + "other": "其他" + } }, - "metaInfo": { - "httpApiId": 220125505, - "httpApiCaseId": 200386352, - "httpApiName": "AT0203 文章上传榜单", - "httpApiPath": "/articles/ranking", - "httpApiMethod": "get", - "httpApiCaseName": "AT0203 文章上传榜单", - "id": "fc0a94f2-5119-40e9-b9eb-70f44e34b015", - "type": "http", - "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", - "relatedId": 5179477, - "blockId": "fc0a94f2-5119-40e9-b9eb-70f44e34b015" + "title": "类型", + "mock": { + "mock": "@string" }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false + "description": "add或reedm" + }, + "points": { + "type": "integer", + "title": "积分数", + "mock": { + "mock": "@integer(0)" + } + }, + "user": { + "title": "用户", + "$ref": "#/definitions/1077996" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "JL@integer" + } + }, + "reason": { + "type": "string", + "title": "原因", + "mock": { + "mock": "@cparagraph" } + } + }, + "x-apifox-orders": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "required": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "title": "transaction", + "name": "transaction" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": { + "result": { + "type": "boolean", + "title": "审核结果" + }, + "reason": { + "type": "string", + "title": "理由" + } + }, + "required": [ + "result", + "reason" + ] + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 14440370, + "httpApiCaseId": 200386326, + "httpApiName": "AT0105 审核文章", + "httpApiPath": "/articles/{id}/visibility", + "httpApiMethod": "put", + "httpApiCaseName": "AT0105 审核文章", + "id": "48eb929d-2ff6-4865-99c2-c074ae0270eb", + "type": "http", + "name": "AT0105 审核文章(AT0105 审核文章)", + "relatedId": 5179477, + "blockId": "48eb929d-2ff6-4865-99c2-c074ae0270eb" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "54387fc9-dd07-435c-a33c-601ba45f3a4e", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "{{article_id}}" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [], + "variable": [ + { + "disabled": false, + "type": "string", + "value": "{{article_id}}", + "key": "id" } + ] + }, + "header": [ + { + "disabled": false, + "key": "token", + "value": "" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } ], - "name": "文章上传榜单 AT0203-200" - } - ], - "info": { - "name": "文章上传榜单 AT0203-200" - }, - "dataSchemas": { - "1077703": { - "type": "object", - "properties": { - "id": { + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 4233285, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": { + "article": { + "title": "文章字典", + "description": "含article表的所有字段", + "$ref": "#/definitions/1077703", + "x-apifox-overrides": {} + }, + "me": { + "type": "object", + "properties": { + "liked": { + "type": "boolean", + "title": "是否点赞" + }, + "is_author": { + "type": "boolean", + "title": "是否文章作者" + } + }, + "description": "检测查询用户与该文章的关联", + "required": [ + "liked", + "is_author" + ], + "x-apifox-orders": [ + "liked", + "is_author" + ] + } + }, + "required": [ + "article", + "me" + ], + "x-apifox-orders": [ + "article", + "me" + ] + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": { + "1077703": { + "type": "object", + "properties": { + "id": { "type": "integer", "title": "文章的id" - }, - "author": { + }, + "author": { "title": "作者", "description": "用户id", "$ref": "#/definitions/1097305", "x-apifox-overrides": {} - }, - "likes": { + }, + "likes": { "type": "integer", "title": "点赞数" - }, - "views": { + }, + "views": { "type": "integer", "title": "访问量" - }, - "like_users": { + }, + "like_users": { "type": "array", "items": { - "type": "integer", - "description": "用户id" + "type": "integer", + "description": "用户id" }, "title": "点赞用户列表" - }, - "publish_time": { + }, + "publish_time": { "type": "string", "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" }, "title": "发表时间" - }, - "update_time": { + }, + "update_time": { "type": "string", "title": "更新时间", "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" } - }, - "title": { + }, + "title": { "type": "string", "mock": { - "mock": "@ctitle" + "mock": "@ctitle" }, "title": "文章标题" - }, - "description": { + }, + "description": { "type": "string", "title": "文章简介", "mock": { - "mock": "@csentence" + "mock": "@csentence" } - }, - "content": { + }, + "content": { "type": "string", "title": "文章内容", "description": "markdown", "mock": { - "mock": "@cparagraph" + "mock": "@cparagraph" } - }, - "cover": { + }, + "cover": { "type": "string", "title": "文章封面", "description": "url", "mock": { - "mock": "@image" + "mock": "@image" } - }, - "visibility": { + }, + "visibility": { "type": "boolean" - } - }, - "required": [ - "id", - "author", - "likes", - "views", - "like_users", - "publish_time", - "update_time", - "title", - "description", - "content", - "cover", - "visibility" - ], - "x-apifox-orders": [ - "id", - "author", - "likes", - "views", - "like_users", - "publish_time", - "update_time", - "title", - "description", - "content", - "cover", - "visibility" - ], - "title": "article_all", - "name": "article_all" - }, - "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": { + "required": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "x-apifox-orders": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "title": "article_all", + "name": "article_all" + }, + "1097305": { + "type": "object", + "properties": { + "id": { "type": "integer", "title": "user的id", "mock": { - "mock": "@integer(10000)" + "mock": "@integer(10000)" } - }, - "username": { + }, + "username": { "type": "string", "title": "用户名", "mock": { - "mock": "@cname" + "mock": "@cname" } - }, - "nickname": { + }, + "nickname": { "type": "string", "title": "昵称", "mock": { - "mock": "@cname" + "mock": "@cname" } - }, - "email": { + }, + "email": { "type": "string", "title": "邮箱", "mock": { - "mock": "@email" + "mock": "@email" } - }, - "telephone": { + }, + "telephone": { "type": "string", "title": "电话" - }, - "birthday": { + }, + "birthday": { "type": "string", "title": "生日", "mock": { - "mock": "@date('yyyy-MM-dd')" + "mock": "@date('yyyy-MM-dd')" } - }, - "avatar": { + }, + "avatar": { "type": "string", "title": "头像", "description": "头像的url地址", "mock": { - "mock": "@image" + "mock": "@image" } - }, - "is_admin": { + }, + "is_admin": { "type": "boolean", "title": "是否管理员", "mock": { - "mock": "@boolean" + "mock": "@boolean" } - }, - "county": { + }, + "county": { "type": "string", "title": "县区", "description": "用户所在县区", "mock": { - "mock": "@county" + "mock": "@county" } - }, - "town": { + }, + "town": { "type": "string", "title": "乡镇", "description": "用户所在乡镇", "mock": { - "mock": "@county" + "mock": "@county" } - }, - "registration_time": { + }, + "registration_time": { "type": "string", "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" }, "title": "注册时间" - }, - "login_time": { + }, + "login_time": { "type": "string", "mock": { - "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" }, "title": "登录时间" - }, - "wechat": { + }, + "wechat": { "type": "boolean", "title": "绑定微信" - }, - "points_sum": { + }, + "points_sum": { "type": "integer", "title": "总分数", "mock": { - "mock": "@integer(0)" + "mock": "@integer(0)" }, "minimum": 0 - }, - "points_now": { + }, + "points_now": { "type": "integer", "title": "现有分数", "mock": { - "mock": "@integer(0)" + "mock": "@integer(0)" }, "minimum": 0 - }, - "title": { + }, + "title": { "type": "object", "properties": { - "color": { - "type": "string", - "mock": { - "mock": "@color" - }, - "title": "颜色" + "color": { + "type": "string", + "mock": { + "mock": "@color" }, - "title": { - "type": "string", - "mock": { - "mock": "@cword" - }, - "title": "称号" - } + "title": "颜色" + }, + "title": { + "type": "string", + "mock": { + "mock": "@cword" + }, + "title": "称号" + } }, "title": "标题", "mock": { - "mock": "@cname" + "mock": "@cname" }, "x-apifox-orders": [ - "title", - "color" + "title", + "color" ], "required": [ - "title", - "color" + "title", + "color" ] - }, - "level": { + }, + "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" - }, - "53485892": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "date-time", - "title": "时间", - "mock": { - "mock": "@datetime" + "mock": "@integer(1,6)" } + } }, - "action": { - "type": "string", - "enum": [ - "earn", - "redeem", - "other" - ], - "x-apifox": { - "enumDescriptions": { - "earn": "增加", - "redeem": "兑换", - "other": "其他" - } - }, - "title": "类型", - "mock": { - "mock": "@string" - }, - "description": "add或reedm" - }, - "points": { - "type": "integer", - "title": "积分数", - "mock": { - "mock": "@integer(0)" - } - }, - "user": { - "title": "用户", - "$ref": "#/definitions/1077996" - }, - "id": { - "type": "string", - "title": "ID", - "mock": { - "mock": "JL@integer" - } - }, - "reason": { - "type": "string", - "title": "原因", - "mock": { - "mock": "@cparagraph" - } - } - }, - "x-apifox-orders": [ - "user", - "timestamp", - "action", - "points", - "id", - "reason" - ], - "required": [ - "user", - "timestamp", - "action", - "points", - "id", - "reason" - ], - "title": "transaction", - "name": "transaction" - } - }, - "mockRules": { - "rules": [], - "enableSystemRule": true - }, - "environment": { - "id": 510825, - "name": "测试环境", - "baseUrl": "http://127.0.0.1:8000", - "baseUrls": { - "default": "http://127.0.0.1:8000" + "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" + } + } + }, + "requestDefinition": { + "jsonSchema": { + "type": "object", + "properties": {} + } + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 5333397, + "httpApiCaseId": 200386328, + "httpApiName": "AT0104 获取文章内容", + "httpApiPath": "/articles/{id}", + "httpApiMethod": "get", + "httpApiCaseName": "AT0104 获取文章内容", + "id": "54387fc9-dd07-435c-a33c-601ba45f3a4e", + "type": "http", + "name": "AT0104 获取文章内容 (AT0104 获取文章内容)", + "relatedId": 5179477, + "blockId": "54387fc9-dd07-435c-a33c-601ba45f3a4e" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } }, - "variable": { - "id": "82cf7fe3-7e13-4765-b695-284853fcee8e", - "name": "测试环境", - "values": [ - { - "type": "any", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8", - "key": "token", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "16", - "key": "quiz_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "word_id_2", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "word_id_1", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM", - "key": "token_2", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "word_id_3", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "3", - "key": "user_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "10", - "key": "article_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "comment_id_1", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "comment_id_2", - "isBindInitial": true, - "initialValue": "" - }, + { + "id": "f98a1d53-5c2d-4c94-a696-525a7c90c09b", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ { - "type": "any", - "value": "", - "key": "like_num_2", - "isBindInitial": true, - "initialValue": "" + "disabled": false, + "key": "days", + "value": "0" }, { - "type": "any", - "value": "", - "key": "num_pre", - "isBindInitial": true, - "initialValue": "" + "disabled": false, + "key": "page", + "value": "1" }, { - "type": "any", - "value": "", - "key": "num_later", - "isBindInitial": true, - "initialValue": "" - }, + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token_2}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386329, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "f98a1d53-5c2d-4c94-a696-525a7c90c09b", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "f98a1d53-5c2d-4c94-a696-525a7c90c09b" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "0df4ed39-af95-4889-bd66-a6f525f768e9", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ { - "type": "any", - "value": "", - "key": "like_num_1", - "isBindInitial": true, - "initialValue": "" + "disabled": false, + "key": "days", + "value": "7" }, { - "type": "any", - "value": "SJ000006", - "key": "paper_id", - "isBindInitial": false, - "initialValue": "" + "disabled": false, + "key": "page", + "value": "1" }, { - "type": "any", - "value": "DJ000002", - "key": "paper_record_id", - "isBindInitial": false, - "initialValue": "" - }, + "disabled": false, + "key": "pagesize", + "value": "10" + } + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token_2}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386349, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "0df4ed39-af95-4889-bd66-a6f525f768e9", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "0df4ed39-af95-4889-bd66-a6f525f768e9" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + }, + { + "id": "fc0a94f2-5119-40e9-b9eb-70f44e34b015", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ { - "type": "any", - "value": "undefined", - "key": "quiz_record_id", - "isBindInitial": false, - "initialValue": "" + "disabled": false, + "key": "days", + "value": "30" }, { - "type": "any", - "value": "3", - "key": "word_id", - "isBindInitial": false, - "initialValue": "" + "disabled": false, + "key": "page", + "value": "1" }, { - "type": "any", - "value": "2", - "key": "user_id_2", - "isBindInitial": false, - "initialValue": "" + "disabled": false, + "key": "pagesize", + "value": "10" } - ] + ], + "variable": [] + }, + "header": [ + { + "key": "token", + "value": "{{token_2}}" + }, + { + "key": "User-Agent", + "value": "Apifox/1.0.0 (https://apifox.com)" + } + ], + "method": "GET", + "baseUrl": "http://127.0.0.1:8000", + "body": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539428440, + "name": "成功", + "code": 200, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 1, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386352, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "fc0a94f2-5119-40e9-b9eb-70f44e34b015", + "type": "http", + "name": "AT0203 文章上传榜单 (AT0203 文章上传榜单)", + "relatedId": 5179477, + "blockId": "fc0a94f2-5119-40e9-b9eb-70f44e34b015" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } + } + ], + "name": "文章上传榜单 AT0203-200" + } + ], + "info": { + "name": "文章上传榜单 AT0203-200" + }, + "dataSchemas": { + "1077703": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "title": "文章的id" + }, + "author": { + "title": "作者", + "description": "用户id", + "$ref": "#/definitions/1097305", + "x-apifox-overrides": {} + }, + "likes": { + "type": "integer", + "title": "点赞数" + }, + "views": { + "type": "integer", + "title": "访问量" + }, + "like_users": { + "type": "array", + "items": { + "type": "integer", + "description": "用户id" + }, + "title": "点赞用户列表" + }, + "publish_time": { + "type": "string", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + }, + "title": "发表时间" + }, + "update_time": { + "type": "string", + "title": "更新时间", + "mock": { + "mock": "@datetime('yyyy-MM-dd HH:mm:ss')" + } + }, + "title": { + "type": "string", + "mock": { + "mock": "@ctitle" + }, + "title": "文章标题" + }, + "description": { + "type": "string", + "title": "文章简介", + "mock": { + "mock": "@csentence" + } + }, + "content": { + "type": "string", + "title": "文章内容", + "description": "markdown", + "mock": { + "mock": "@cparagraph" + } + }, + "cover": { + "type": "string", + "title": "文章封面", + "description": "url", + "mock": { + "mock": "@image" + } + }, + "visibility": { + "type": "boolean" + } + }, + "required": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "x-apifox-orders": [ + "id", + "author", + "likes", + "views", + "like_users", + "publish_time", + "update_time", + "title", + "description", + "content", + "cover", + "visibility" + ], + "title": "article_all", + "name": "article_all" + }, + "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 }, - "type": "normal", - "parameter": { - "header": [], - "query": [], - "body": [], - "cookie": [] + "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" + }, + "53485892": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "title": "时间", + "mock": { + "mock": "@datetime" + } + }, + "action": { + "type": "string", + "enum": [ + "earn", + "redeem", + "other" + ], + "x-apifox": { + "enumDescriptions": { + "earn": "增加", + "redeem": "兑换", + "other": "其他" + } + }, + "title": "类型", + "mock": { + "mock": "@string" + }, + "description": "add或reedm" + }, + "points": { + "type": "integer", + "title": "积分数", + "mock": { + "mock": "@integer(0)" + } + }, + "user": { + "title": "用户", + "$ref": "#/definitions/1077996" + }, + "id": { + "type": "string", + "title": "ID", + "mock": { + "mock": "JL@integer" + } + }, + "reason": { + "type": "string", + "title": "原因", + "mock": { + "mock": "@cparagraph" + } } + }, + "x-apifox-orders": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "required": [ + "user", + "timestamp", + "action", + "points", + "id", + "reason" + ], + "title": "transaction", + "name": "transaction" + } + }, + "mockRules": { + "rules": [], + "enableSystemRule": true + }, + "environment": { + "id": 510825, + "name": "测试环境", + "baseUrl": "http://127.0.0.1:8000", + "baseUrls": { + "default": "http://127.0.0.1:8000" }, - "globals": { - "baseUrl": "", - "baseUrls": {}, - "variable": { - "id": "e941a7f7-b2f4-44ff-9c68-33172417a3c0", - "values": [] + "variable": { + "id": "82cf7fe3-7e13-4765-b695-284853fcee8e", + "name": "测试环境", + "values": [ + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8", + "key": "token", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "16", + "key": "quiz_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM", + "key": "token_2", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_3", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "3", + "key": "user_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "10", + "key": "article_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_pre", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_later", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "SJ000006", + "key": "paper_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "DJ000002", + "key": "paper_record_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "undefined", + "key": "quiz_record_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "3", + "key": "word_id", + "isBindInitial": false, + "initialValue": "" }, - "parameter": { - "header": [], - "query": [], - "body": [], - "cookie": [] + { + "type": "any", + "value": "2", + "key": "user_id_2", + "isBindInitial": false, + "initialValue": "" } + ] + }, + "type": "normal", + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "globals": { + "baseUrl": "", + "baseUrls": {}, + "variable": { + "id": "e941a7f7-b2f4-44ff-9c68-33172417a3c0", + "values": [] }, - "isServerBuild": false, - "isTestFlowControl": false, - "projectOptions": { - "enableJsonc": false, - "enableBigint": false, - "responseValidate": true, - "isDefaultUrlEncoding": 2, - "enableTestScenarioSetting": false, - "enableYAPICompatScript": false + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] } + }, + "isServerBuild": false, + "isTestFlowControl": false, + "projectOptions": { + "enableJsonc": false, + "enableBigint": false, + "responseValidate": true, + "isDefaultUrlEncoding": 2, + "enableTestScenarioSetting": false, + "enableYAPICompatScript": false + } } \ No newline at end of file diff --git a/tests/article_AT0203_400.apifox-cli.json b/tests/article_AT0203_400.apifox-cli.json index 8cff6a08..04d553c4 100644 --- a/tests/article_AT0203_400.apifox-cli.json +++ b/tests/article_AT0203_400.apifox-cli.json @@ -1,297 +1,297 @@ { - "apifoxCli": "1.1.0", - "item": [ + "apifoxCli": "1.1.0", + "item": [ + { + "item": [ { - "item": [ + "id": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4", + "name": "AT0203 文章上传榜单", + "request": { + "url": { + "protocol": "http", + "port": "8000", + "path": [ + "articles", + "ranking" + ], + "host": [ + "127", + "0", + "0", + "1" + ], + "query": [ { - "id": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4", - "name": "AT0203 文章上传榜单", - "request": { - "url": { - "protocol": "http", - "port": "8000", - "path": [ - "articles", - "ranking" - ], - "host": [ - "127", - "0", - "0", - "1" - ], - "query": [ - { - "disabled": false, - "key": "days", - "value": "" - }, - { - "disabled": false, - "key": "page", - "value": "1" - }, - { - "disabled": false, - "key": "pagesize", - "value": "10" - } - ], - "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": {}, - "auth": { - "type": "noauth", - "noauth": [] - }, - "type": "http" - }, - "response": [], - "event": [], - "responseDefinition": { - "id": 539399074, - "name": "没有发送天数", - "code": 400, - "contentType": "json", - "jsonSchema": { - "type": "object", - "properties": {} - }, - "defaultEnable": true, - "ordering": 2, - "description": "", - "mediaType": "", - "headers": [], - "schemaDefinitions": {} - }, - "requestDefinition": { - "jsonSchema": {} - }, - "overrideRequesterOptions": { - "strictSSL": false, - "followRedirects": false - }, - "metaInfo": { - "httpApiId": 220125505, - "httpApiCaseId": 200386435, - "httpApiName": "AT0203 文章上传榜单", - "httpApiPath": "/articles/ranking", - "httpApiMethod": "get", - "httpApiCaseName": "AT0203 文章上传榜单", - "id": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4", - "type": "http", - "name": "AT0203 文章上传榜单", - "relatedId": 5179481, - "blockId": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4" - }, - "type": "http", - "protocolProfileBehavior": { - "useWhatWGUrlParser": false, - "disableUrlEncoding": false, - "disabledSystemHeaders": {}, - "disableCookies": false - } - } - ], - "name": "文章上传榜单 AT0203-400 未传天数" - } - ], - "info": { - "name": "文章上传榜单 AT0203-400 未传天数" - }, - "dataSchemas": {}, - "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": "572b4526-4bab-463a-aeb2-7ae9103d6963", - "name": "测试环境", - "values": [ - { - "type": "any", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8", - "key": "token", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "16", - "key": "quiz_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "word_id_2", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "word_id_1", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM", - "key": "token_2", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "word_id_3", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "3", - "key": "user_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "10", - "key": "article_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "comment_id_1", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "comment_id_2", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "like_num_2", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "num_pre", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "num_later", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "", - "key": "like_num_1", - "isBindInitial": true, - "initialValue": "" - }, - { - "type": "any", - "value": "SJ000006", - "key": "paper_id", - "isBindInitial": false, - "initialValue": "" + "disabled": false, + "key": "days", + "value": "" }, { - "type": "any", - "value": "DJ000002", - "key": "paper_record_id", - "isBindInitial": false, - "initialValue": "" + "disabled": false, + "key": "page", + "value": "1" }, { - "type": "any", - "value": "undefined", - "key": "quiz_record_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "3", - "key": "word_id", - "isBindInitial": false, - "initialValue": "" - }, - { - "type": "any", - "value": "2", - "key": "user_id_2", - "isBindInitial": false, - "initialValue": "" + "disabled": false, + "key": "pagesize", + "value": "10" } - ] - }, - "type": "normal", - "parameter": { - "header": [], - "query": [], - "body": [], - "cookie": [] + ], + "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": {}, + "auth": { + "type": "noauth", + "noauth": [] + }, + "type": "http" + }, + "response": [], + "event": [], + "responseDefinition": { + "id": 539399074, + "name": "没有发送天数", + "code": 400, + "contentType": "json", + "jsonSchema": { + "type": "object", + "properties": {} + }, + "defaultEnable": true, + "ordering": 2, + "description": "", + "mediaType": "", + "headers": [], + "schemaDefinitions": {} + }, + "requestDefinition": { + "jsonSchema": {} + }, + "overrideRequesterOptions": { + "strictSSL": false, + "followRedirects": false + }, + "metaInfo": { + "httpApiId": 220125505, + "httpApiCaseId": 200386435, + "httpApiName": "AT0203 文章上传榜单", + "httpApiPath": "/articles/ranking", + "httpApiMethod": "get", + "httpApiCaseName": "AT0203 文章上传榜单", + "id": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4", + "type": "http", + "name": "AT0203 文章上传榜单", + "relatedId": 5179481, + "blockId": "e9dbe642-1c2b-4d55-be47-8da1086b9cf4" + }, + "type": "http", + "protocolProfileBehavior": { + "useWhatWGUrlParser": false, + "disableUrlEncoding": false, + "disabledSystemHeaders": {}, + "disableCookies": false + } } + ], + "name": "文章上传榜单 AT0203-400 未传天数" + } + ], + "info": { + "name": "文章上传榜单 AT0203-400 未传天数" + }, + "dataSchemas": {}, + "mockRules": { + "rules": [], + "enableSystemRule": true + }, + "environment": { + "id": 510825, + "name": "测试环境", + "baseUrl": "http://127.0.0.1:8000", + "baseUrls": { + "default": "http://127.0.0.1:8000" }, - "globals": { - "baseUrl": "", - "baseUrls": {}, - "variable": { - "id": "e941a7f7-b2f4-44ff-9c68-33172417a3c0", - "values": [] + "variable": { + "id": "572b4526-4bab-463a-aeb2-7ae9103d6963", + "name": "测试环境", + "values": [ + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWQiOjEsImV4cCI6MTcyODM5ODk0Ny40MTU2NjV9.4c5CVN-LWxpREsVtGTqvwdt4gbFyITZDPfDPt4sE8O8", + "key": "token", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "16", + "key": "quiz_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXJfdGVzdCIsImlkIjoyLCJleHAiOjE3MjgzOTg5NDguMTc2MTQ3fQ.ecCkA9W42cgfh7D1fGi4wU9ys8cGXO6UNf_SZ5nkgNM", + "key": "token_2", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "word_id_3", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "3", + "key": "user_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "10", + "key": "article_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "comment_id_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_2", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_pre", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "num_later", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "", + "key": "like_num_1", + "isBindInitial": true, + "initialValue": "" + }, + { + "type": "any", + "value": "SJ000006", + "key": "paper_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "DJ000002", + "key": "paper_record_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "undefined", + "key": "quiz_record_id", + "isBindInitial": false, + "initialValue": "" }, - "parameter": { - "header": [], - "query": [], - "body": [], - "cookie": [] + { + "type": "any", + "value": "3", + "key": "word_id", + "isBindInitial": false, + "initialValue": "" + }, + { + "type": "any", + "value": "2", + "key": "user_id_2", + "isBindInitial": false, + "initialValue": "" } + ] + }, + "type": "normal", + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] + } + }, + "globals": { + "baseUrl": "", + "baseUrls": {}, + "variable": { + "id": "e941a7f7-b2f4-44ff-9c68-33172417a3c0", + "values": [] }, - "isServerBuild": false, - "isTestFlowControl": false, - "projectOptions": { - "enableJsonc": false, - "enableBigint": false, - "responseValidate": true, - "isDefaultUrlEncoding": 2, - "enableTestScenarioSetting": false, - "enableYAPICompatScript": false + "parameter": { + "header": [], + "query": [], + "body": [], + "cookie": [] } + }, + "isServerBuild": false, + "isTestFlowControl": false, + "projectOptions": { + "enableJsonc": false, + "enableBigint": false, + "responseValidate": true, + "isDefaultUrlEncoding": 2, + "enableTestScenarioSetting": false, + "enableYAPICompatScript": false + } } \ No newline at end of file From 2e7335706e2385156b664925fa20556227f29e69 Mon Sep 17 00:00:00 2001 From: "13313720778@163.com" <13313720778@163.com> Date: Thu, 3 Oct 2024 15:00:20 +0800 Subject: [PATCH 6/7] add newline at end of file --- tests/article_AT0203_200.apifox-cli.json | 2 +- tests/article_AT0203_400.apifox-cli.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/article_AT0203_200.apifox-cli.json b/tests/article_AT0203_200.apifox-cli.json index 7745900e..e24c5fa4 100644 --- a/tests/article_AT0203_200.apifox-cli.json +++ b/tests/article_AT0203_200.apifox-cli.json @@ -3177,4 +3177,4 @@ "enableTestScenarioSetting": false, "enableYAPICompatScript": false } -} \ No newline at end of file +} diff --git a/tests/article_AT0203_400.apifox-cli.json b/tests/article_AT0203_400.apifox-cli.json index 04d553c4..3d4beb4d 100644 --- a/tests/article_AT0203_400.apifox-cli.json +++ b/tests/article_AT0203_400.apifox-cli.json @@ -294,4 +294,4 @@ "enableTestScenarioSetting": false, "enableYAPICompatScript": false } -} \ No newline at end of file +} From c1d57893ac0f2c4e04c6c2564243259721411e08 Mon Sep 17 00:00:00 2001 From: "13313720778@163.com" <13313720778@163.com> Date: Wed, 9 Oct 2024 16:56:53 +0800 Subject: [PATCH 7/7] (AT0203) Rename Article Ranking cli json --- ...article_AT0203_200.apifox-cli.json => article_AT0203_200.json} | 0 ...article_AT0203_400.apifox-cli.json => article_AT0203_400.json} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/{article_AT0203_200.apifox-cli.json => article_AT0203_200.json} (100%) rename tests/{article_AT0203_400.apifox-cli.json => article_AT0203_400.json} (100%) diff --git a/tests/article_AT0203_200.apifox-cli.json b/tests/article_AT0203_200.json similarity index 100% rename from tests/article_AT0203_200.apifox-cli.json rename to tests/article_AT0203_200.json diff --git a/tests/article_AT0203_400.apifox-cli.json b/tests/article_AT0203_400.json similarity index 100% rename from tests/article_AT0203_400.apifox-cli.json rename to tests/article_AT0203_400.json