repositorypackage
0.0.0-20220428025155-c098480852ce
Repository: https://github.com/easynet-cn/go-meituan.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
go-meituan
美团闪购开放平台-医疗健康 glang sdk
- [act] 活动类接口 接口文档地址
- [app] APP方接口 订单推送接口文档地址 取消订单推送接口文档地址 退款信息推送接口文档地址
- [comment] 评论评价接口 接口文档地址
- [image] 图片接口 接口文档地址
- [isv] 服务商接口 接口文档地址
- [medicine] 药品接口 接口文档地址
- [order] 订单接口 接口文档地址
- [poi] 门店接口 接口文档地址
- [shippping] 配送范围接口 接口文档地址
例子
package shangou
import (
"fmt"
"net/http"
"testing"
"github.com/easynet-cn/go-meituan/isv"
"github.com/easynet-cn/go-meituan/medicine"
)
const (
AppId = ""
AppSecret = ""
AppPoiCode = ""
AccessToken = ""
RefreshToken = ""
)
func Test_GetAccessToken(t *testing.T) {
shanGouClient := getClient()
bytes, err := shanGouClient.DoRequest("https://waimaiopen.meituan.com/api/v1/oauth/authorize", "GET", "", &isv.GetAccessTokenRequest{AppPoiCode: AppPoiCode, ResponseType: "token"})
fmt.Println(string(bytes), err)
}
func Test_RefreshAccessToken(t *testing.T) {
shanGouClient := getClient()
bytes, err := shanGouClient.DoRequest("https://waimaiopen.meituan.com/api/v1/oauth/token", "POST", "", &isv.RefreshAccessTokenRequest{GrantType: "refresh_token", RefreshToken: RefreshToken})
fmt.Println(string(bytes), err)
}
func Test_GetStoreCategories(t *testing.T) {
shanGouClient := getClient()
bytes, err := shanGouClient.DoRequest("https://waimaiopen.meituan.com/api/v1/medicineCat/list", "GET", "", &medicine.MedicineCatListRequest{AppPoiCode: AppPoiCode})
fmt.Println(string(bytes), err)
}
func Test_GetStoreCategoriesByMapParam(t *testing.T) {
shanGouClient := getClient()
bytes, err := shanGouClient.DoRequest("https://waimaiopen.meituan.com/api/v1/medicineCat/list", "GET", "", map[string]interface{}{"app_poi_code": AppPoiCode})
fmt.Println(string(bytes), err)
}
func Test_GetMedicineList(t *testing.T) {
shanGouClient := getClient()
bytes, err := shanGouClient.DoRequest("https://waimaiopen.meituan.com/api/v1/medicine/list", "GET", AccessToken, &medicine.MedicineListRequest{AppPoiCode: AppPoiCode, Offset: 0, Limit: 200})
fmt.Println(string(bytes), err)
}
func Test_CateMedicineCategory(t *testing.T) {
shanGouClient := getClient()
request := &medicine.MedicineCatRequest{
AppPoiCode: AppPoiCode,
CategoryCode: "092400",
CategoryName: "其他",
Sequence: 24,
}
bytes, err := shanGouClient.DoRequest("https://waimaiopen.meituan.com/api/v1/medicineCat/save", "POST", AccessToken, request)
fmt.Println(string(bytes), err)
}
func getClient() *ShanGouClient {
return &ShanGouClient{
HttpClient: &http.Client{},
AppId: AppId,
AppSecret: AppSecret,
}
}
type GetOrderDaySeqRequest struct {
AppPoiCode string `url:"app_poi_code"`
}