chengjie 6 kuukautta sitten
vanhempi
commit
708279b18b
4 muutettua tiedostoa jossa 6890 lisäystä ja 2 poistoa
  1. 1173 0
      src/api/hanzi/hanziController.js
  2. 35 0
      src/api/hanzi/routes.js
  3. 3 2
      src/app.js
  4. 5679 0
      src/util/constant/index.js

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1173 - 0
src/api/hanzi/hanziController.js


+ 35 - 0
src/api/hanzi/routes.js

@@ -0,0 +1,35 @@
1
+import Router from 'koa-router';
2
+import * as hanzi from './hanziController.js';
3
+
4
+
5
+const router = new Router();
6
+ //识字
7
+router.post('/api/HanziLogin',hanzi.HanziLogin);
8
+
9
+router.get('/api/GetHanziAll3',hanzi.GetHanziAll3);
10
+//router.get('/api/GetEnglishAll3',hanzi.GetEnglishAll3);
11
+router.get('/api/GetSoundErrorArr',hanzi.GetSoundErrorArr);
12
+
13
+router.get('/api/GetHanziDetail',hanzi.GetHanziDetail);
14
+router.post('/api/AddHanziRecord',hanzi.AddHanziRecord);
15
+router.post('/api/UpdateHanziRecord',hanzi.UpdateHanziRecord);
16
+router.get('/api/GetHanziRecordData',hanzi.GetHanziRecordData);
17
+router.post('/api/UpdateHanziFinished',hanzi.UpdateHanziFinished);
18
+router.get('/api/GetHanziFinishedData',hanzi.GetHanziFinishedData);
19
+router.post('/api/UpdateHanziReview',hanzi.UpdateHanziReview);
20
+router.get('/api/GetHanziReviewList',hanzi.GetHanziReviewList);
21
+router.get('/api/SearchHanzi',hanzi.SearchHanzi);
22
+router.get('/api/GetHanziUserListByIntroducer',hanzi.GetHanziUserListByIntroducer);
23
+
24
+router.get('/api/GetHanziWordListByUnitID',hanzi.GetHanziWordListByUnitID);
25
+router.post('/api/AddHanziCustom',hanzi.AddHanziCustom);
26
+router.get('/api/GetHanziCustomList',hanzi.GetHanziCustomList);
27
+
28
+router.get('/api/GetHanziTestList',hanzi.GetHanziTestList);
29
+router.get('/api/GetHanziUnitWords',hanzi.GetHanziUnitWords);
30
+router.get('/api/GetHanziAll0124',hanzi.GetHanziAll0124);
31
+
32
+router.post('/api/GetHanziByBookID',hanzi.GetHanziByBookID);
33
+
34
+
35
+export default router;

+ 3 - 2
src/app.js

@@ -7,11 +7,11 @@ import config from './config/index.js';
7 7
 import { decryptUrlMiddle } from './util/crypto/index.js';
8 8
 import { stringUtils } from './util/stringClass.js';
9 9
 
10
-
11 10
 import commonRouter from './api/common/routes.js';
12 11
 import mpsRouter from './api/mps/routes.js';
13 12
 import phonicsRouter from './api/phonics/routes.js';
14 13
 import pinyinRouter from './api/pinyin/routes.js';
14
+import hanziRouter from './api/hanzi/routes.js';
15 15
 
16 16
 const __dirname = path.dirname(fileURLToPath(import.meta.url));
17 17
 
@@ -42,7 +42,6 @@ app.use(async (ctx, next) => {
42 42
 app.use(decryptUrlMiddle());
43 43
 
44 44
 // 注册路由
45
-
46 45
 app.use(commonRouter.routes());
47 46
 app.use(commonRouter.allowedMethods());
48 47
 app.use(mpsRouter.routes());
@@ -51,6 +50,8 @@ app.use(phonicsRouter.routes());
51 50
 app.use(phonicsRouter.allowedMethods());
52 51
 app.use(pinyinRouter.routes());
53 52
 app.use(pinyinRouter.allowedMethods());
53
+app.use(hanziRouter.routes());
54
+app.use(hanziRouter.allowedMethods());
54 55
 
55 56
 // 启动服务器
56 57
 app.listen(config.port, () => {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 5679 - 0
src/util/constant/index.js