guhongwei 3 years ago
parent
commit
22f996e4d6

+ 19 - 2
app/controller/patent/.patentnotice.js

@@ -1,6 +1,14 @@
 module.exports = {
   create: {
-    requestBody: ["send_id", "send_name", "to_type", "to_id", "content"],
+    requestBody: [
+      "send_id",
+      "send_name",
+      "to_type",
+      "to_id",
+      "is_read",
+      "content",
+      "notice_file",
+    ],
   },
   destroy: {
     params: ["!id"],
@@ -8,7 +16,15 @@ module.exports = {
   },
   update: {
     params: ["!id"],
-    requestBody: ["send_id", "send_name", "to_type", "to_id", "content"],
+    requestBody: [
+      "send_id",
+      "send_name",
+      "to_type",
+      "to_id",
+      "is_read",
+      "content",
+      "notice_file",
+    ],
   },
   show: {
     parameters: {
@@ -23,6 +39,7 @@ module.exports = {
         send_name: "%send_name%",
         to_type: "to_type",
         to_id: "to_id",
+        is_read:"is_read"
       },
       // options: {
       //   "meta.state": 0 // 默认条件

+ 1 - 1
app/model/patent/answer_tea.js

@@ -4,7 +4,7 @@ const moment = require('moment');
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const { ObjectId } = require('mongoose').Types;
 const { Secret } = require('naf-framework-mongoose/lib/model/schema');
-// 答题师表
+// 咨询师表
 const answer_tea = {
   name: { type: String }, // 姓名
   phone: { type: String }, // 手机号

+ 3 - 1
app/model/patent/patentnotice.js

@@ -7,9 +7,11 @@ const { ObjectId } = require('mongoose').Types;
 const patentnotice = {
   send_id: { type: ObjectId }, // 发送人id
   send_name: { type: String }, // 发送人姓名
-  to_type: { type: String }, // 0-所有人;1-机构用户;2-平台用户;3机构发给自己用户
+  to_type: { type: String }, // 0-所有人;1-机构用户;2-平台用户;3机构发给自己用户,4:科企发给个人用户
   to_id: { type: [ ObjectId ] }, // 接收人id
+  is_read: { type: Boolean, default: false }, // 是否已读
   content: { type: String }, // 内容
+  notice_file: { type: Array }, // 通知文件
   remark: { type: String },
 };
 const schema = new Schema(patentnotice, { toJSON: { virtuals: true } });

+ 1 - 1
app/router.js

@@ -95,6 +95,6 @@ module.exports = (app) => {
   require('./router/patent/patentsafeg')(app); // 专利维权表
 
   require('./router/patent/agent_mech')(app); // 代理机构表
-  require('./router/patent/answer_tea')(app); // 答题师表
+  require('./router/patent/answer_tea')(app); // 咨询师表
   require('./router/patent/problem_service')(app); // 问题咨询表
 };;;

+ 1 - 1
app/service/patent/answer_tea.js

@@ -4,7 +4,7 @@ const { BusinessError, ErrorCode } = require('naf-core').Error;
 const _ = require('lodash');
 const assert = require('assert');
 
-// 答题
+// 咨询
 class Answer_teaService extends CrudService {
   constructor(ctx) {
     super(ctx, 'answer_tea');