liuyu %!s(int64=4) %!d(string=hai) anos
pai
achega
1b2abaec63
Modificáronse 3 ficheiros con 11 adicións e 0 borrados
  1. 5 0
      app/controller/dock.js
  2. 1 0
      app/router.js
  3. 5 0
      app/service/dock.js

+ 5 - 0
app/controller/dock.js

@@ -37,6 +37,11 @@ class DockController extends Controller {
     const res = await this.service.getdock(this.ctx.params);
     this.ctx.ok({ res });
   }
+
+  async getdockByopenid(){
+    const res = await this.service.getdockByopenid(this.ctx.query);
+    this.ctx.ok({ res });
+  }
 }
 
 module.exports = CrudController(DockController, meta);

+ 1 - 0
app/router.js

@@ -36,6 +36,7 @@ module.exports = app => {
   router.post('chat', '/api/live/chat/:id', controller.chat.update);
 
   // 对接会表设置路由
+  router.get('/api/live/dock/dockopenid', controller.dock.getdockByopenid); // 查询申请的对接列表
   router.get('/api/live/dock/dockfetch/:id', controller.dock.dockfetch); // 查询申请的对接列表
   router.get('/api/live/dock/myapply', controller.dock.myapply); // 查询申请的对接列表
   router.resources('dock', '/api/live/dock', controller.dock); // index、create、show、destroy

+ 5 - 0
app/service/dock.js

@@ -203,6 +203,11 @@ class ChatService extends CrudService {
     const res = await this.model.find({ vipuser: { $elemMatch: { uid: id } } });
     return res;
   }
+
+  async getdockByopenid({ openid }){
+    const res = await this.model.findOne({ openid });
+    return res;
+  }
 }
 
 module.exports = ChatService;