Ver Fonte

增加推荐api

XuShengTao há 6 anos atrás
pai
commit
33325c4f2f
2 ficheiros alterados com 67 adições e 92 exclusões
  1. 0 92
      api/Auth-权限.md
  2. 67 0
      api/REST-推荐.md

+ 0 - 92
api/Auth-权限.md

@@ -1,92 +0,0 @@
-# Auth - 权限
-
-> url 前缀:**auth**
->
-> 示例:**https://xxxxxxxxx/api/auth/xxxx**
-
-## 获得当前登录用户的信息
-
-```http
-get /current
-```
-
-### Response
-
-```ts
-interface UserData {
-  err: 0 | 401 /* 用户信息失效 */;
-  res: UserSerializer;
-}
-```
-
-see [UserSerializer](../serializer/UserSerializer.md)
-
-## 登录
-
-```http
-post /login
-```
-
-### Parameters
-
-```ts
-interface loginDTO {
-  username: string;
-  password: string;
-}
-```
-
-### Response
-
-```ts
-interface UserData {
-  err: 0 | 403 /* 用户名密码错 */;
-  res: UserSerializer;
-}
-```
-
-see [UserSerializer](../serializer/UserSerializer.md)
-
-## 手机验证码
-
-```http
-post /verification
-```
-
-### Parameters
-
-```ts
-interface VerificationDTO {
-  phoneNumber: string;
-  token: string;
-}
-```
-
-## 注册
-
-```http
-post /register
-```
-
-### Parameters
-
-```ts
-interface RegisterDTO {
-  username: string;
-  password: string;
-  phoneNumber: string;
-  token: string;
-  email: string;
-}
-```
-
-### Response
-
-```ts
-interface UserData {
-  err: 0 | 400;
-  res: UserSerializer;
-}
-```
-
-see [UserSerializer](../serializer/UserSerializer.md)

+ 67 - 0
api/REST-推荐.md

@@ -0,0 +1,67 @@
+# rest - 推荐
+
+> url 前缀:**rest/tq**
+>
+> 示例:**https://xxxxxxxxx/rest/tq/recommend**
+
+##  推荐
+
+```http
+post /rest/tq/recommend
+```
+
+### Parameters
+
+```ts
+interface recommendDTO {
+  courseId: number;
+  userId: number;
+  knowledgeId: Array<string>;
+  questionsNum: number;
+}
+```
+
+### Response
+
+`````ts
+interface ResponseData{
+  res:[{
+    id:           number;
+    type:         string;
+    stem:         string;
+    options:    {
+       [key: string]: string;
+    };
+    tags:         string[];
+    knowledgeId:  string[];
+    lastModified: Date;
+  }]
+}
+```
+
+### Example Response
+
+````json
+{
+"res":{
+"id": 11,
+"type": "choice",
+"stem": "这是一次测试",
+"options":{
+"A": "2k-l > n + k",
+"B": "2n-l <= n + k",
+"C": "n = k",
+"D": "n-l <= k"
+},
+"tags":[
+"test",
+"ok"
+],"knowledgeId":[
+"A.B",
+"C.D"
+],
+"lastModified": "2019-12-30 18:12:13",
+"tq_id": 11
+}
+}
+`````