guhongwei 4 سال پیش
والد
کامیت
625a9436bd
2فایلهای تغییر یافته به همراه1 افزوده شده و 11 حذف شده
  1. 1 2
      app/controller/.company.js
  2. 0 9
      app/model/company.js

+ 1 - 2
app/controller/.company.js

@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ["!id"],
-    requestBody: ["!company", "mobile", "type", "file", "video", "image"],
+    requestBody: ["!company", "mobile"],
   },
   show: {
     parameters: {
@@ -21,7 +21,6 @@ module.exports = {
       query: {
         company: "company",
         mobile: "mobile",
-        type: "type",
       },
     },
     service: "query",

+ 0 - 9
app/model/company.js

@@ -1,19 +1,10 @@
 'use strict';
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
-// 图片路径
-const images = new Schema({
-  url: { type: String, required: true, maxLength: 500 }, // 图片路径
-  name: { type: String, required: true, maxLength: 500 }, // 图片名称
-});
 // 企业信息
 const CompanySchema = {
   company: { type: String, required: true, maxLength: 200 }, // 名称
   mobile: { type: String, required: false, maxLength: 500 }, // 电话
-  type: { type: String, required: false, maxLength: 500, default: 0 }, // 视频
-  file: { type: String, required: false, maxLength: 500 }, // 单张图片
-  video: { type: String, required: false, maxLength: 500 }, // 视频
-  image: { type: [ images ], select: true }, // 图片
 };
 
 const schema = new Schema(CompanySchema, { toJSON: { virtuals: true } });