You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
983 B
38 lines
983 B
package code
|
|
|
|
import (
|
|
"gitea.codecodify.com/golang/tool/third/tencent/miniapp"
|
|
"github.com/ArtisanCloud/PowerWeChat/v2/src/kernel/power"
|
|
"io/ioutil"
|
|
"net/http"
|
|
)
|
|
|
|
// Unlimited 临时二维码
|
|
type Unlimited struct {
|
|
Scene string `json:"scene"`
|
|
Page string `json:"page"`
|
|
CheckPath bool `json:"check_path"`
|
|
EnvVersion string `json:"env_version"`
|
|
Width int64 `json:"width"`
|
|
AutoColor bool `json:"auto_color"`
|
|
LineColor *power.HashMap `json:"line_color"`
|
|
IsHyaLine bool `json:"is_hyaline"`
|
|
}
|
|
|
|
func (u *Unlimited) Get() ([]byte, error) {
|
|
miniProgram, err := miniapp.MiniProgramAppByEnv()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var resp *http.Response
|
|
resp, err = miniProgram.WXACode.GetUnlimited(u.Scene, u.Page, u.CheckPath, u.EnvVersion, u.Width, u.AutoColor, u.LineColor, u.IsHyaLine)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
defer resp.Body.Close()
|
|
|
|
return ioutil.ReadAll(resp.Body)
|
|
}
|