lrf402788946 4 lat temu
rodzic
commit
6d94789867
3 zmienionych plików z 39 dodań i 34 usunięć
  1. 37 33
      app/controller/.user.js
  2. 1 1
      app/model/notice.js
  3. 1 0
      app/model/user.js

+ 37 - 33
app/controller/.user.js

@@ -1,54 +1,58 @@
 module.exports = {
   create: {
     requestBody: [
-      'name',
-      '!mobile',
-      '!passwd',
-      'openid',
-      'unionid',
-      'remark',
-      'type',
-      'uid'
-    ]
+      "name",
+      "!mobile",
+      "!passwd",
+      "openid",
+      "appopenid",
+      "unionid",
+      "remark",
+      "type",
+      "uid",
+    ],
   },
   destroy: {
-    params: ['!id'],
-    service: 'delete'
+    params: ["!id"],
+    service: "delete",
   },
   update: {
-    params: ['!id'],
+    params: ["!id"],
     requestBody: [
-      'name',
-      'mobile',
-      'passwd',
-      'openid',
-      'unionid',
-      'remark',
-      'type',
-      'uid'
-    ]
+      "name",
+      "mobile",
+      "passwd",
+      "openid",
+      "appopenid",
+      "unionid",
+      "remark",
+      "type",
+      "uid",
+    ],
   },
   show: {
     parameters: {
-      params: ['!id']
+      params: ["!id"],
     },
-    service: 'fetch'
+    service: "fetch",
   },
   index: {
     parameters: {
       query: {
-        name: 'name',
-        mobile: 'mobile',
-        type:"type",
-        openid: 'openid'
-      }
+        name: "name",
+        mobile: "mobile",
+        type: "type",
+        openid: "openid",
+        appopenid:"appopenid",
+
+      },
     },
-    service: 'query',
+    service: "query",
     options: {
-      query: ['skip', 'limit'],
-      sort: ['meta.createdAt'],
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
       desc: true,
-      count: true
-    }
+      count: true,
+    },
   },
 };

+ 1 - 1
app/model/notice.js

@@ -4,7 +4,7 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 
 // 被通知详情表
 const notifiedInfo = new Schema({
-  notifiedid: { type: String, required: false, maxLength: 200 }, // 被通知人id
+  notifiedid: { type: String, required: false, maxLength: 200 }, // 被通知人id,user表id
   username: { type: String, required: false, maxLength: 200 }, // 通知姓名
   status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态,0-未读,1-已读
   readtime: { type: String, required: false, maxLength: 200 }, // 读取时间

+ 1 - 0
app/model/user.js

@@ -9,6 +9,7 @@ const UserSchema = {
   mobile: { type: String, required: true, maxLength: 64 }, // 手机
   passwd: { type: Secret, select: false }, // 注册密码
   openid: { type: String, required: false }, // 微信openid
+  appopenid: { type: String, required: false }, // 微信小程序openid
   unionid: { type: String, required: false }, // 微信unionid
   remark: { type: String, required: false }, // 备注
   type: { type: String, required: false, maxLength: 200 }, // 身份,0、中心管理元1、班主任用户2、学校用户3、教师4、学生