File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -48,25 +48,25 @@ exports.oracle = {
48
48
``` js
49
49
// {app_root}/app/service/my_service.js
50
50
' use strict' ;
51
-
52
- module .exports = app => {
53
- class MyService extends app .Service {
54
- // example for getConnection
55
- async foo () {
56
- const connection = await app .oracle .getConnection ();
57
- const result = await connnection .execute (' SELECT sysdate AS "date" FROM dual' );
58
- connection .close ();
59
- console .log (result .rows [0 ].date );
60
- }
61
- // it work
62
- async foo2 () {
63
- const result = await app .oracle .execute (' SELECT sysdate AS "date" FROM dual' );
64
- connection .close ();
65
- console .log (result .rows [0 ].date );
66
- }
51
+ const Service = require (' egg' ).Service ;
52
+
53
+ class MyService extends Service {
54
+ // example for getConnection
55
+ async foo () {
56
+ const connection = await this .app .oracle .getConnection ();
57
+ const result = await connnection .execute (' SELECT sysdate AS "date" FROM dual' );
58
+ connection .close ();
59
+ console .log (result .rows [0 ].date );
60
+ }
61
+ // it work
62
+ async foo2 () {
63
+ const result = await this .app .oracle .execute (' SELECT sysdate AS "date" FROM dual' );
64
+ connection .close ();
65
+ console .log (result .rows [0 ].date );
67
66
}
68
- return MyService;
69
67
}
68
+ module .exports = MyService;
69
+
70
70
```
71
71
## Configuration
72
72
You can’t perform that action at this time.
0 commit comments