Browse Source

添加字段

reloaded 5 years ago
parent
commit
b2213127b7

+ 6 - 3
app/controller/.column.js

@@ -1,7 +1,8 @@
 module.exports = {
   create: {
     requestBody: [
-      '!name'
+      '!name',
+      'site'
     ]
   },
   destroy: {
@@ -11,7 +12,8 @@ module.exports = {
   update: {
     params: ['!id'],
     requestBody: [
-      '!name'
+      '!name',
+      'site'
     ]
   },
   show: {
@@ -23,7 +25,8 @@ module.exports = {
   index: {
     parameters: {
       query: {
-        name: 'name'
+        name: 'name', 
+        site: 'site'
       }
     },
     service: 'query',

+ 3 - 0
app/controller/.information.js

@@ -6,6 +6,7 @@ module.exports = {
       'content',
       'user_id',
       'user_name',
+      'column_id',
       'state'
     ]
   },
@@ -21,6 +22,7 @@ module.exports = {
       'content',
       'user_id',
       'user_name',
+      'column_id',
       'state'
     ]
   },
@@ -38,6 +40,7 @@ module.exports = {
         content :'content',
         user_id :'user_id',
         user_name :'user_name',
+        column_id: 'column_id',
         state :'state'
       }
     },

+ 3 - 0
app/controller/.recruitment.js

@@ -3,6 +3,7 @@ module.exports = {
     requestBody: [
       '!license',
       '!name',
+      'column_id',
       'salary',
       'job_nature',
       'profession',
@@ -23,6 +24,7 @@ module.exports = {
     requestBody: [
       'license',
       'name',
+      'column_id',
       'salary',
       'job_nature',
       'profession',
@@ -45,6 +47,7 @@ module.exports = {
       query: {
         license :'license',
         name :'name',
+        column_id: 'column_id',
         salary :'salary',
         job_nature :'job_nature',
         profession :'profession',

+ 1 - 1
app/model/column.js

@@ -1,11 +1,11 @@
 'use strict';
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
-const { Secret } = require('naf-framework-mongoose/lib/model/schema');
 
 // 栏目表
 const ColumnSchema = {
   name: { type: String, required: true, maxLength: 500 }, // 栏目名称
+  site: { type: String, required: false, maxLength: 500 }, // 栏目位置
 };
 
 

+ 1 - 0
app/model/information.js

@@ -10,6 +10,7 @@ const InformationSchema = {
   content: { type: String, required: true }, // 正文
   user_id: { type: String, required: true, maxLength: 200 }, // 发布人id
   user_name: { type: String, required: true, maxLength: 200 }, // 发布人名称
+  column_id: { type: String, required: false, maxLength: 200 }, // 栏目id
   state: { type: String, required: false, maxLength: 200 }, // 状态,0-草稿,1-发布,2-删除
 };
 

+ 1 - 0
app/model/recruitment.js

@@ -7,6 +7,7 @@ const { Secret } = require('naf-framework-mongoose/lib/model/schema');
 const RecruitmentSchema = {
   license: { type: String, required: true, maxLength: 200 }, // 信用代码
   name: { type: String, required: true, maxLength: 500 }, // 招聘信息名称
+  column_id: { type: String, required: false, maxLength: 200 }, // 栏目id
   salary: { type: String, required: false, maxLength: 200 }, // 职位月薪
   job_nature: { type: String, required: false, maxLength: 200 }, // 工作性质,0-兼职,1-全职
   profession: { type: String, required: false, maxLength: 500 }, // 公司名称