Files
baseapi/platformapi/fnpsapi_v3/fnps_v3.go
2022-03-15 11:49:07 +08:00

64 lines
2.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package fnpsapi
import (
"git.rosy.net.cn/baseapi/platformapi"
"net/http"
"sync"
)
const (
sigKey = "signature"
TokenURL = "https://open-anubis.ele.me/anubis-webapi/openapi/token"
ApiURL = "https://open-anubis.ele.me/anubis-webapi/v3/invoke/"
RequestPost = "POST"
RequestGet = "GET"
)
//todo 返回参数没做玩
type TokenInfo struct {
AccessToken string `json:"access_token"`
AppID string `json:"app_id"`
ExpireTime int64 `json:"expire_time"`
}
// 注册请求api
type API struct {
grantType string `json:"grant_type"`
code string `json:"code"`
appID string `json:"app_id"`
merchantId string `json:"merchant_id"`
signature string `json:"signature"`
timestamp int64 `json:"timestamp"`
accessToken string `json:"access_token"`
appSecret string `json:"app_secret"`
locker sync.RWMutex
client *http.Client
config *platformapi.APIConfig
}
// CreateStoreParam 创建门店请求参数
type CreateStoreParam struct {
BranchShopName string `json:"branch_shop_name"` // 门店主店名 必填
ContactPhone string `json:"contact_phone"` // 门店联系方式
OwnerIDPicFrontHash string `json:"owner_id_pic_front_hash"` // 身份证正面
BusinessLicencePicHash string `json:"business_licence_pic_hash"` // 营业执照图片
Longitude float64 `json:"longitude"` // 门店经度(0-18)
Latitude float64 `json:"latitude"` // 门店纬度(0-90)
OutShopCode string `json:"out_shop_code"` // 外部门店编码
CategoryID string `json:"category_id"` // 门店类目
HandheldLicencePicHash string `json:"handheld_licence_pic_hash"` // 门店拥有人手持身份证、营业执照图片
CreditCode string `json:"credit_code"` // 统一社会信用代码
SettlementModel string `json:"settlement_model"` // 1实时结算 2账期结算默认为1若为账期结算需额外传入结算账号id
SettlementAccountID string `json:"settlement_account_id"` // 门店结算账号id
OwnerIDNum string `json:"owner_id_num"` // 门店拥有人身份证号
FoodLicensePicHash string `json:"food_license_pic_hash"` // 食品安全执照图片(食品经营必传)
HeadShopName string `json:"head_shop_name"` // 门店主店名
Address string `json:"address"` // 门店地址
OwnerName string `json:"owner_name"` // 门店拥有人姓名
ChainstoreType int `json:"chainstore_type"` // 门店类型 1正式门店2测试门店默认为1
OwnerIDPicBackHash string `json:"owner_id_pic_back_hash"` // 身份证反面
PositionSource int `json:"position_source"` // 经纬度来源只支持高德(默认值3)
}