123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- /**
- * 议题模型。
- */
- "use strict";
- let RedisClient = require('../../repository/redis/redis.client.js');
- let redisClient = RedisClient.redisClient();
- let RedisModel = require('./../redis.model.js');
- let modelUtil = require('../../util/modelUtil');
- let Participants = require("./participants");
- let Sessions = require("./sessions");
- const RedisKey = require('../../include/commons').RedisKey;
- class Topics extends RedisModel {
- constructor() {
- super();
- }
- /**
- * 根据topicId获取对应的Topics
- * @param topicId
- */
- getTopicsById(topicId){
-
- }
- /**
- * 根据用户ID获取用户的Topics列表
- * @param UserId
- */
- getUserTopics(UserId){
- }
- /**
- * 根据topicId获取对应的消息
- * @param topicId
- */
- getTopicMessages(topicId){
- }
- /**
- *
- * @param topicName 发起议题的名称
- * @param patient 发起议题的患者
- * @param doctor 参与的医生
- * @param messages 发送的消息对象{quesion:"",img:""}图片多个用逗号隔开
- */
- createTopics(topicName,patient,healthDoctor,doctor,messages){
- let self = this;
- let participants = new Participants();
- let sessions = new Sessions();
- //从数据库中获取sessionId
- participants.getSessionIdByParticipants(patient,healthDoctor,function(err,res){
- if (err) {
- modelUtil.emitDbError(self.eventEmitter, "Get group member's avatar list failed", err);
- return;
- }
- //如果存在的情况直接返回
- if(res){
- return res;
- }else{
- //不存在则去创建一个session
- }
- })
- }
- }
- // Expose class
- module.exports = Topics;
|