<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 微信SDK # silenceper ## 配置參數 ```go package wx // 公眾號配置 const ( AppID = "wx7fa401xe810n1eb7" AppSecret = "35673237f5676a727b45b22f4ca8e34a" EncodingAESKey = "" ) // 微信支付配置 const ( MchID = "1602872469" // 商戶ID Key = "454dawdahhWWW441D8EXDle454741211" // 商戶Key NotifyURL = "http://www.test.com/v1/notify" // 通知回調鏈接 ) ``` ## 初始化 ```go package wx import ( "github.com/silenceper/wechat/v2" "github.com/silenceper/wechat/v2/cache" "github.com/silenceper/wechat/v2/miniprogram" miniConfig "github.com/silenceper/wechat/v2/miniprogram/config" "github.com/silenceper/wechat/v2/officialaccount" offConfig "github.com/silenceper/wechat/v2/officialaccount/config" "github.com/silenceper/wechat/v2/pay" payConfig "github.com/silenceper/wechat/v2/pay/config" ) var WC *wechat.Wechat // 微信 var Official *officialaccount.OfficialAccount // 微信公眾號 var MiniProgram *miniprogram.MiniProgram // 微信小程序 var Pay *pay.Pay // 微信支付 var memory *cache.Memory // 微信緩存 func init() { WC = wechat.NewWechat() memory = cache.NewMemory() InitOfficial() InitMiniProgram() InitPay() } func InitOfficial() { cfg1 := &offConfig.Config{ AppID: AppID, AppSecret: AppSecret, Cache: memory, } Official = WC.GetOfficialAccount(cfg1) } func InitMiniProgram() { cfg2 := &miniConfig.Config{ AppID: AppID, AppSecret: AppSecret, Cache: memory, } MiniProgram = WC.GetMiniProgram(cfg2) } func InitPay() { cfg3 := &payConfig.Config{ AppID: AppID, MchID: MchID, Key: Key, NotifyURL: NotifyURL, } Pay = WC.GetPay(cfg3) } ``` ## 使用 ```go package main import ( "fmt" "os" ) func main() { // 注:使用該工具無需關注AccessToken的獲取&失效問題 // 工具內部已經封裝對AccessToken的緩存與刷新邏輯 // 用戶只需關注實際需要調用的API即可 // 示例:獲取公眾號所有用戶openid ds, err := wx.Official.GetUser().ListAllUserOpenIDs() if err != nil { fmt.Println(err) } else { fmt.Println("count", len(ds)) for i, v := range ds { fmt.Println(i, v) } } } ``` 打印結果 ```bash count 59 0 otlUS1HpVEUEnE-64Q3EZDbxvV2g 1 otlUS1BxyVhVUD44QoJZ-mSokB_c 2 otlUS1O64PI6svk4tvGa6oU3rfSk 3 otlUS1DEse6XKfyJd2WyV5hliNCs ... 57 otlUS1DdGvBajcxni1szCyNeiYsk 58 otlUS1EH6jiBHlXzMLqBgFz2vvBs ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看