数据结构

 let User = {
   // '_id':'x',//String database main key
    'wechatopenid':'x'//
    'nickName':'x', // String every User need has unique nickName wechat name
    'avatarUrl':'x',
    'name':'X',//String real name
    'studentId':'',//String studient id
    'gender':'male|famale|*',//String
    'tasks':{ //Object the tasks which containd the user
      'joining':[task._id]//Strng Array the tasl._id that the user is joining the task and task has not verifed
      'doing':[task._id],//String Array the task._id that the user is doing right now
      'finished':[task._id],//String Array the task._id that the user finished

      'publishing':[task._id],// String Array the tasks._id that the publihser published
      'verifyed':[task._id]//Strng Array the tasl._id that the publish task has  verifed not end
      'ended':[task._id]//Strng Array the tasl._id that the publish task has  verifed and end
    },
    'balance':21,//Number free money coin
    'credit':100,//诚信度
    'isVerified': true,
    'personalStatement':'Hello World',
  }

 
 let task = {
    'title':'x', // String every task need a name Title
    'avatarId':'',//upload the avatar to server and get an id from the callback
    'type':'学习|生活|娱乐|',//String task type
    'description':'XXX',//String task detail description
    'state':'publishing|verifying|doing|finished',//String task state 任务发布中,任务确认中,任务执行中,任务完成
    'maxJoiner':1,//Number Max Nubmer of joiners
    'joiners':['x'],//String Array the joiners _id array
    'location':'x'
    'publish':{
      'publisher':'X',//String user._id
      'beginTime':Date,
      'endTime':Date,
    }
    'payment':200,
    'work':{
       'beginTime':Date,
       'endTime':Date,
    },
    'isQuestionnaire':true,
    'questionnaireId':X,
  }

  let questionnaire ={
    //'_id'
    'title':xx,
    'description':xx,
    'maxCount':50,
    'template':[
      {
        'type':Input,
        'description':'你的学号',
        'content':'',
      },
      {'type':SingleSelect,
      'description':'是否喜欢xx',
      'content':{
        '是':false,
        '否':false,
      }
      },
      {
        'type':MultiSelect,
        'description':'以下哪一个代表你现在的心情',
        'content':{
          '开心':false,
          '沮丧':false,
          '感激':false
        }
      }
    ],
    'results':[
      [
         {
        'type':Input,
        'description':'你的学号',
        'content':'16666',
      },
      {'type':SingleSelect,
      'description':'是否喜欢xx',
      'content':{
        '是':true,
        '否':false,
      }
      },
      {
        'type':MultiSelect,
        'description':'以下哪一个代表你现在的心情',
        'content':{
          '开心':true,
          '沮丧':false,
          '感激':true
        }
      }
      ],[
         {
        'type':Input,
        'description':'你的学号',
        'content':'12333',
      },
      {'type':SingleSelect,
      'description':'是否喜欢xx',
      'content':{
        '是':false,
        '否':true,
      }
      },
      {
        'type':MultiSelect,
        'description':'以下哪一个代表你现在的心情',
        'content':{
          '开心':false,
          '沮丧':true,
          '感激':false
        }
      }
      ]
    ]
  }