mm_os 1.4.9 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -508,8 +508,8 @@ Drive.prototype.del_main = async function(db, query) {
508
508
  * @param {Object} body 修改项
509
509
  * @return {Object} 返回删除结果
510
510
  */
511
- Drive.prototype.del = async function(db, query, body) {
512
- return await this.del_main(db, query);
511
+ Drive.prototype.del = async function(db, query, body = {}) {
512
+ return await this.del_main(db, Object.assign({}, query, body));
513
513
  };
514
514
 
515
515
  /**
package/index.js CHANGED
@@ -235,7 +235,7 @@ Soa.prototype.before = async function(state) {
235
235
  * @param {String} state 状态
236
236
  */
237
237
  Soa.prototype.after = async function(state) {
238
-
238
+ this.app.run();
239
239
  };
240
240
 
241
241
  /**
package/lib/app.js CHANGED
@@ -63,6 +63,36 @@ App.prototype.initApp = async function() {
63
63
  }
64
64
  }
65
65
 
66
+ /**
67
+ * 启动应用
68
+ */
69
+ App.prototype.startApp = async function() {
70
+ for (var k in this.dict) {
71
+ var o = this.dict[k];
72
+ try {
73
+ o.state = 1;
74
+ await o.run('start');
75
+ } catch (e) {
76
+ $.log.error("启动应用错误", e);
77
+ }
78
+ }
79
+ }
80
+
81
+ /**
82
+ * 停止应用
83
+ */
84
+ App.prototype.stopApp = async function() {
85
+ for (var k in this.dict) {
86
+ var o = this.dict[k];
87
+ try {
88
+ o.state = 0;
89
+ await o.run('stop');
90
+ } catch (e) {
91
+ $.log.error("停止应用错误", e);
92
+ }
93
+ }
94
+ }
95
+
66
96
  /**
67
97
  * 安装应用
68
98
  */
@@ -70,4 +100,24 @@ App.prototype.install = async function(name, ...args) {
70
100
  return await this.exec(name, 'install', ...args);
71
101
  }
72
102
 
103
+ /**
104
+ * 卸载
105
+ */
106
+ App.prototype.uninstall = async function(name, ...args) {
107
+ return await this.exec(name, 'uninstall', ...args);
108
+ }
109
+
110
+ /**
111
+ * 启动
112
+ */
113
+ App.prototype.start = async function(name, ...args) {
114
+ return await this.exec(name, 'start', ...args);
115
+ }
116
+
117
+ /**
118
+ * 停止
119
+ */
120
+ App.prototype.stop = async function(name, ...args) {
121
+ return await this.exec(name, 'stop', ...args);
122
+ }
73
123
  module.exports = App;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_os",
3
- "version": "1.4.9",
3
+ "version": "1.5.1",
4
4
  "description": "这是超级美眉服务端框架,用于快速构建应用程序。",
5
5
  "main": "index.js",
6
6
  "scripts": {