@@ -3,16 +3,18 @@ package main
3
3
import (
4
4
"context"
5
5
"fmt"
6
- fmt2 "github.com/ArtisanCloud/PowerLibs/v3/fmt"
7
6
"os"
8
7
"strconv"
9
8
9
+ fmt2 "github.com/ArtisanCloud/PowerLibs/v3/fmt"
10
+
10
11
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel"
11
12
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/power"
12
13
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram"
13
14
"github.com/ArtisanCloud/PowerWeChat/v3/src/officialAccount"
14
15
"github.com/ArtisanCloud/PowerWeChat/v3/src/officialAccount/templateMessage/request"
15
16
"github.com/ArtisanCloud/PowerWeChat/v3/src/openPlatform"
17
+ "github.com/ArtisanCloud/PowerWeChat/v3/src/openWork"
16
18
"github.com/ArtisanCloud/PowerWeChat/v3/src/payment"
17
19
"github.com/ArtisanCloud/PowerWeChat/v3/src/work"
18
20
"go.opentelemetry.io/otel"
@@ -189,6 +191,28 @@ func GetOpenPlatformConfig() *openPlatform.UserConfig {
189
191
}
190
192
}
191
193
194
+ func GetOpenWorkConfig () * openWork.UserConfig {
195
+ return & openWork.UserConfig {
196
+ AppID : "123" ,
197
+ Secret : "321" ,
198
+ AuthCode : "123" ,
199
+ AESKey : "321" ,
200
+ ResponseType : os .Getenv ("array" ),
201
+
202
+ Cache : kernel .NewRedisClient (& kernel.UniversalOptions {
203
+ Addrs : []string {"127.0.0.1:6379" },
204
+ Password : "" ,
205
+ DB : 1 ,
206
+ }),
207
+
208
+ // OAuth: "",
209
+ // HttpDebug: "",
210
+ // Debug: "",
211
+ // NotifyURL: "",
212
+ // Sandbox: "",
213
+ }
214
+ }
215
+
192
216
func initTracer () {
193
217
tp := trace .NewTracerProvider ()
194
218
// Set Global Tracer Provider
@@ -260,11 +284,20 @@ func main() {
260
284
}
261
285
fmt2 .Dump ("miniprogram config:" , miniProgramApp .GetConfig ().All ())
262
286
263
- // init miniProgram app
287
+ // init openplatform app
264
288
configOpenPlatform := GetOpenPlatformConfig ()
265
289
openPlatform , err := openPlatform .NewOpenPlatform (configOpenPlatform )
266
290
if err != nil {
267
291
fmt .Println (err .Error ())
268
292
}
269
293
fmt2 .Dump ("openPlatform config:" , openPlatform .GetConfig ().All ())
294
+
295
+ // init openwork app
296
+ configOpenWork := GetOpenWorkConfig ()
297
+ openWork , err := openWork .NewOpenWork (configOpenWork )
298
+ if err != nil {
299
+ fmt .Println (err .Error ())
300
+ }
301
+ fmt2 .Dump ("openPlatform config:" , openWork .GetConfig ().All ())
302
+
270
303
}
0 commit comments