Skip to content

Commit

Permalink
init(miniprogram): create vod client in miniDrama
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix-X committed Jun 1, 2023
1 parent 469222b commit 751a032
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/miniProgram/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram/express"
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram/image"
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram/immediateDelivery"
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram/industry/miniDrama/vod"
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram/internet"
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram/liveBroadcast"
"github.com/ArtisanCloud/PowerWeChat/v3/src/miniProgram/nearbyPoi"
Expand Down Expand Up @@ -88,6 +89,8 @@ type MiniProgram struct {

RiskControl *riskControl.Client

MiniDramaVOD *vod.Client

Config *kernel.Config

Logger *logger.Logger
Expand Down Expand Up @@ -339,6 +342,12 @@ func NewMiniProgram(config *UserConfig, extraInfos ...*kernel.ExtraInfo) (*MiniP
return nil, err
}

//-------------- miniDrama Vod --------------
app.MiniDramaVOD, err = vod.RegisterProvider(app)
if err != nil {
return nil, err
}

return app, err
}

Expand Down Expand Up @@ -433,6 +442,9 @@ func (app *MiniProgram) GetComponent(name string) interface{} {
case "RiskControl":
return app.RiskControl

case "MiniDramaVDO":
return app.MiniDramaVOD

case "Logger":
return app.Logger

Expand Down
1 change: 1 addition & 0 deletions src/miniProgram/industry/miniDrama/request/request.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package request
1 change: 1 addition & 0 deletions src/miniProgram/industry/miniDrama/response/response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package response
7 changes: 7 additions & 0 deletions src/miniProgram/industry/miniDrama/vod/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package vod

import "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel"

type Client struct {
BaseClient *kernel.BaseClient
}
14 changes: 14 additions & 0 deletions src/miniProgram/industry/miniDrama/vod/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package vod

import "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel"

func RegisterProvider(app kernel.ApplicationInterface) (*Client, error) {
baseClient, err := kernel.NewBaseClient(&app, nil)
if err != nil {
return nil, err
}
return &Client{
baseClient,
}, nil

}
1 change: 1 addition & 0 deletions src/openWork/auth/accessToken.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/ArtisanCloud/PowerLibs/v3/object"
"github.com/ArtisanCloud/PowerLibs/v3/security"
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel"
"net/http"
)

type AccessToken struct {
Expand Down

0 comments on commit 751a032

Please sign in to comment.