- showapi.GetProductInfoByBarCode
This commit is contained in:
27
platformapi/showapi/showapi.go
Normal file
27
platformapi/showapi/showapi.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package showapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
)
|
||||
|
||||
type API struct {
|
||||
appID int
|
||||
appSecret string
|
||||
client *http.Client
|
||||
config *platformapi.APIConfig
|
||||
}
|
||||
|
||||
func New(appID int, appSecret string, config ...*platformapi.APIConfig) *API {
|
||||
curConfig := platformapi.DefAPIConfig
|
||||
if len(config) > 0 {
|
||||
curConfig = *config[0]
|
||||
}
|
||||
return &API{
|
||||
appID: appID,
|
||||
appSecret: appSecret,
|
||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||
config: &curConfig,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user