File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed
examples/js/js-data_repository-03_container/src Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 1+ import { MySqlUserRepository } from "./MySqlUserRepository" ;
2+ import { UsersSearcher } from "./UsersSearcher" ;
3+
4+ export class Container {
5+ mysqlHost = "localhost" ;
6+ mysqlUser = "root" ;
7+ mysqlPassword = "" ;
8+ mysqlDatabase = "super_project" ;
9+ mysqlPort = 3306 ;
10+
11+ mysqlUserRepository = new MySqlUserRepository ( this ) ;
12+ usersSearcher = new UsersSearcher ( this . mysqlUserRepository ) ;
13+ }
Original file line number Diff line number Diff line change 11export class MySqlUserRepository {
2- mysqlHost = "localhost" ;
3- mysqlUser = "root" ;
4- mysqlPassword = "" ;
5- mysqlDatabase = "super_project" ;
6- mysqlPort = 3306 ;
7-
8- constructor ( ) {
2+ constructor ( container ) {
93 const Mysql = require ( 'sync-mysql' ) ;
104 this . connection = new Mysql ( {
11- host : this . mysqlHost ,
12- user : this . mysqlUser ,
13- password : this . mysqlPassword ,
14- database : this . mysqlDatabase ,
15- port : this . mysqlPort
5+ host : container . mysqlHost ,
6+ user : container . mysqlUser ,
7+ password : container . mysqlPassword ,
8+ database : container . mysqlDatabase ,
9+ port : container . mysqlPort
1610 } ) ;
1711 }
1812
You can’t perform that action at this time.
0 commit comments