lrf vor 2 Jahren
Ursprung
Commit
c3aa6e6b7c

+ 3 - 2
app/controller/user/config/.coach.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ['icon', 'name', 'card', 'age', 'phone', 'skill', 'user_id', 'gender'],
+    requestBody: ['name', 'icon', 'card', 'gender', 'age', 'phone', 'major', 'level', 'brief', 'honor', 'exp', 'user_id'],
   },
   destroy: {
     params: ['!id'],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ['!id'],
-    requestBody: ['icon', 'name', 'card', 'age', 'phone', 'skill', 'user_id', 'gender'],
+    requestBody: ['name', 'icon', 'card', 'gender', 'age', 'phone', 'major', 'level', 'brief', 'honor', 'exp', 'user_id'],
   },
   show: {
     parameters: {
@@ -23,6 +23,7 @@ module.exports = {
         'meta.createdAt@end': 'meta.createdAt@end',
         name: 'name',
         card: 'card',
+        level: 'level',
         user_id: 'user_id',
       },
       // options: {

+ 2 - 2
app/controller/user/config/.school.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ['name', 'brief', 'img_url', 'user_id'],
+    requestBody: ['yyzz', 'name', 'brief', 'img_url', 'address', 'phone', 'coach_num', 'student_num', 'past_student', 'honor', 'url', 'user_id'],
   },
   destroy: {
     params: ['!id'],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ['!id'],
-    requestBody: ['name', 'brief', 'img_url', 'user_id'],
+    requestBody: ['yyzz', 'name', 'brief', 'img_url', 'address', 'phone', 'coach_num', 'student_num', 'past_student', 'honor', 'url', 'user_id'],
   },
   show: {
     parameters: {

+ 2 - 3
app/controller/user/config/.student.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ['icon', 'name', 'card', 'gender', 'age', 'phone', 'user_id'],
+    requestBody: ['name', 'icon', 'gender', 'age', 'phone', 'level', 'brief', 'honer', 'exp', 'user_id'],
   },
   destroy: {
     params: ['!id'],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ['!id'],
-    requestBody: ['icon', 'name', 'card', 'gender', 'age', 'phone', 'user_id'],
+    requestBody: ['name', 'icon', 'gender', 'age', 'phone', 'level', 'brief', 'honer', 'exp', 'user_id'],
   },
   show: {
     parameters: {
@@ -22,7 +22,6 @@ module.exports = {
         'meta.createdAt@start': 'meta.createdAt@start',
         'meta.createdAt@end': 'meta.createdAt@end',
         name: 'name',
-        card: 'card',
         user_id: 'user_id',
       },
       // options: {

+ 9 - 3
app/model/user/coach.js

@@ -2,22 +2,28 @@
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
 
+
 // 教练
 const coach = {
-  icon: { type: Array, required: false, zh: '头像' }, //
   name: { type: String, required: false, zh: '姓名' }, //
+  icon: { type: Array, required: false, zh: '头像' }, //
   card: { type: String, required: false, zh: '身份证号' }, //
+  gender: { type: String, required: false, zh: '性别' }, //
   age: { type: Number, required: false, zh: '年龄' }, //
   phone: { type: String, required: false, zh: '联系电话' }, //
-  skill: { type: String, required: false, zh: '专业技能' }, //
+  major: { type: String, required: false, zh: '专业' }, //
+  level: { type: String, required: false, zh: '等级' }, //
+  brief: { type: String, required: false, zh: '简介' }, // 500字以内
+  honor: { type: String, required: false, zh: '荣誉' }, //
+  exp: { type: String, required: false, zh: '教学经历' }, //
   user_id: { type: String, required: false, zh: '用户id', ref: 'User', getProp: [ 'name' ] }, //
-  gender: { type: String, required: false, zh: '性别' }, //
 };
 const schema = new Schema(coach, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ name: 1 });
 schema.index({ card: 1 });
+schema.index({ level: 1 });
 schema.index({ user_id: 1 });
 
 schema.plugin(metaPlugin);

+ 9 - 0
app/model/user/school.js

@@ -2,11 +2,20 @@
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
 
+
 // 学校
 const school = {
+  yyzz: { type: Array, required: false, zh: '营业执照' }, //
   name: { type: String, required: false, zh: '名称' }, //
   brief: { type: String, required: false, zh: '简介' }, //
   img_url: { type: Array, required: false, zh: '图片' }, //
+  address: { type: String, required: false, zh: '训练地址' }, //
+  phone: { type: String, required: false, zh: '联系方式' }, //
+  coach_num: { type: Number, required: false, default: '0', zh: '教练人数' }, //
+  student_num: { type: Number, required: false, default: '0', zh: '学员人数' }, //
+  past_student: { type: String, required: false, zh: '历届学员' }, //
+  honor: { type: String, required: false, zh: '过往荣誉' }, //
+  url: { type: String, required: false, zh: '网址' }, //
   user_id: { type: String, required: false, zh: '用户表信息', ref: 'User', getProp: [ 'name' ] }, //
 };
 const schema = new Schema(school, { toJSON: { virtuals: true } });

+ 5 - 3
app/model/user/student.js

@@ -4,19 +4,21 @@ const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
 
 // 学员
 const student = {
-  icon: { type: Array, required: false, zh: '头像' }, //
   name: { type: String, required: false, zh: '姓名' }, //
-  card: { type: String, required: false, zh: '身份证号' }, //
+  icon: { type: Array, required: false, zh: '头像' }, //
   gender: { type: String, required: false, zh: '性别' }, //
   age: { type: Number, required: false, zh: '年龄' }, //
   phone: { type: String, required: false, zh: '联系电话' }, //
+  level: { type: String, required: false, zh: '等级' }, //
+  brief: { type: String, required: false, zh: '简介' }, //
+  honer: { type: String, required: false, zh: '荣誉' }, //
+  exp: { type: String, required: false, zh: '训练经历' }, //
   user_id: { type: String, required: false, zh: '用户id', ref: 'User' }, //
 };
 const schema = new Schema(student, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ name: 1 });
-schema.index({ card: 1 });
 schema.index({ user_id: 1 });
 
 schema.plugin(metaPlugin);

+ 1 - 0
app/service/user/student.js

@@ -10,6 +10,7 @@ class StudentService extends CrudService {
     super(ctx, 'student');
     this.model = this.ctx.model.User.Student;
   }
+
 }
 
 module.exports = StudentService;