@@ -91,6 +91,8 @@ public class LCApplication {
9191 /// Application Configuration.
9292 public struct Configuration {
9393
94+ public let customizedServers : [ ServerCustomizableModule ]
95+
9496 /// HTTP Request Timeout Interval, default is 60.0 second.
9597 public let HTTPRequestTimeoutInterval : TimeInterval
9698
@@ -106,17 +108,39 @@ public class LCApplication {
106108 public static let `default` = Configuration ( )
107109
108110 public init (
111+ customizedServers: [ ServerCustomizableModule ] = [ ] ,
109112 HTTPRequestTimeoutInterval: TimeInterval = 60.0 ,
110113 RTMConnectingTimeoutInterval: TimeInterval = 15.0 ,
111114 RTMCommandTimeoutInterval: TimeInterval = 30.0 ,
112115 RTMCustomServerURL: URL ? = nil )
113116 {
117+ self . customizedServers = customizedServers
114118 self . HTTPRequestTimeoutInterval = HTTPRequestTimeoutInterval
115119 self . RTMConnectingTimeoutInterval = RTMConnectingTimeoutInterval
116120 self . RTMCommandTimeoutInterval = RTMCommandTimeoutInterval
117121 self . RTMCustomServerURL = RTMCustomServerURL
118122 }
119123 }
124+
125+ public enum ServerCustomizableModule {
126+ case api( _ host: String )
127+ case push( _ host: String )
128+ case engine( _ host: String )
129+ case rtm( _ host: String )
130+
131+ var moduleKeyAndHost : ( key: String , host: String ) {
132+ switch self {
133+ case . api( let host) :
134+ return ( HTTPRouter . Module. api. key, host)
135+ case . engine( let host) :
136+ return ( HTTPRouter . Module. engine. key, host)
137+ case . push( let host) :
138+ return ( HTTPRouter . Module. push. key, host)
139+ case . rtm( let host) :
140+ return ( HTTPRouter . Module. rtm. key, host)
141+ }
142+ }
143+ }
120144
121145 /// Application ID.
122146 public private( set) var id : String !
@@ -245,6 +269,20 @@ public class LCApplication {
245269 application: self ,
246270 configuration: . default
247271 )
272+
273+ Logger . shared. debug (
274+ """
275+ \n
276+ ------ LCApplication Initializing Infomation
277+
278+ LCApplication with ID< \" \( self . id!) \" > did initialize success.
279+
280+ The Configuration of this Application is \( configuration) .
281+
282+ ------ END
283+
284+ """
285+ )
248286 }
249287
250288}
0 commit comments