@@ -28,7 +28,7 @@ class HomeController extends Controller {
console.log(msg);
// 插入待办事项到数据库中。
-
+ await this.service.message.create({producerid: '1', consumerid: '2',type: '1', content: '2222'});
});
ctx.body = "接收成功";
@@ -40,14 +40,25 @@ module.exports = appInfo => {
};
// mongoose config
+ // config.mongoose = {
+ // url: 'mongodb://127.0.0.1:27017/smart',
+ // options: {
+ // user: 'root',
+ // pass: 'Ziyouyanfa#@!',
+ // authSource: 'admin',
+ // useNewUrlParser: true,
+ // useCreateIndex: true,
+ // },
+ // };
config.mongoose = {
- url: 'mongodb://127.0.0.1:27017/smart',
+ url: 'mongodb://10.16.5.15:27017/smart',
options: {
- user: 'root',
- pass: 'Ziyouyanfa#@!',
- authSource: 'admin',
+ user: 'demo',
+ pass: 'demo2019',
+ authSource: 'demo',
useNewUrlParser: true,
useCreateIndex: true,
+ useUnifiedTopology: true,
},
@@ -9,9 +9,9 @@ module.exports = () => {
- config.mongoose = {
- url: 'mongodb://172.17.116.100:27017/smart',
- };
+ // url: 'mongodb://172.17.116.100:27017/smart',
return config;