|
@@ -12,6 +12,21 @@ class PatentchatService extends CrudService {
|
|
|
super(ctx, 'patentchat');
|
|
|
this.model = this.ctx.model.Patent.Patentchat;
|
|
|
}
|
|
|
+
|
|
|
+ async query({ id }) {
|
|
|
+ assert(id, '缺少用户信息');
|
|
|
+ const data = await this.model.find({ $or: [{ sender_id: id }, { receiver_id: id }] });
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ async count({ id }) {
|
|
|
+ assert(id, '缺少用户信息');
|
|
|
+ const data = await this.model.count({ $or: [{ sender_id: id }, { receiver_id: id }] });
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ async getChatList({ id }) {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
module.exports = PatentchatService;
|