189 lines
6.9 KiB
Go
189 lines
6.9 KiB
Go
package main
|
||
|
||
//func main() {
|
||
// //upload, err := kongfzImageUpload(576, "256e10220c5b307f5172b1a49c11467a6cfa8038bbe2a7feccc42231852324f8",
|
||
// // "306849d7541661989453102bc0e1a4f000c4469ab084beddc7b10a90ca55f6bb",
|
||
// // "D:/work/image/9787511220660.jpg",
|
||
// // "D:\\work\\project\\kfzgw-info\\kongfz")
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //fmt.Println(upload)
|
||
//
|
||
// //var q OrderQueryParams
|
||
// //q.UserType = "buyer"
|
||
// //marshal, err := json.Marshal(q)
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //fmt.Println(string(marshal))
|
||
// //
|
||
// //list, err := kongfzOrderList(576, "256e10220c5b307f5172b1a49c11467a6cfa8038bbe2a7feccc42231852324f8",
|
||
// // "306849d7541661989453102bc0e1a4f000c4469ab084beddc7b10a90ca55f6bb", string(marshal))
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //fmt.Println(list)
|
||
// //
|
||
// //key, err := outKfzimgKey("de810e9e702de07c50601ef27bb51c93878c920a", "")
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //fmt.Println(key)
|
||
// //
|
||
// //upload, err := outKfzimgUpload("8b7f613a6f9de5dbaff8f6c419e1c1de8495a993", "",
|
||
// // "D:/work/image/9787115460622.jpg")
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //fmt.Println(upload)
|
||
//
|
||
// //uploadd, err := outKfzimgUploadd("de810e9e702de07c50601ef27bb51c93878c920a", "",
|
||
// // "D:/work/image/9787511220660.jpg")
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //fmt.Println(uploadd)
|
||
//
|
||
// appId := 576
|
||
// appSecret := "256e10220c5b307f5172b1a49c11467a6cfa8038bbe2a7feccc42231852324f8"
|
||
// accessToken := "7c5ef2e492f82457898dd9a1bc2eb725df3a67b282721c9c52bfa24e460c4d92"
|
||
// shippingComName := "韵达快递"
|
||
// orderId := 275723461
|
||
// shippingId := ""
|
||
// shippingCom := ""
|
||
// shipmentNum := "312944151258647"
|
||
// userDefined := ""
|
||
// moreShipmentNum := ""
|
||
//
|
||
// synchronization, err := kongfzOrderSynchronization(appId, appSecret, accessToken, shippingComName, orderId, shippingId, shippingCom, shipmentNum, userDefined, moreShipmentNum)
|
||
// if err != nil {
|
||
// fmt.Println(err)
|
||
// }
|
||
// fmt.Println(synchronization)
|
||
//
|
||
// //data := ItemInfo{
|
||
// // ItemName: "至关重要的关系",
|
||
// // ISBN: "9787550213869",
|
||
// // Author: "[美]里德·霍夫曼、本·卡斯诺瓦 著;钱峰 译",
|
||
// // Press: "北京联合出版公司",
|
||
// // YearsGroup: "1",
|
||
// // PubDate: "2013-04",
|
||
// // PubDateYear: "2013",
|
||
// // PubDateMonth: "4",
|
||
// // Edition: "1",
|
||
// // Binding: "2", // 2可能表示平装
|
||
// // Quality: "95",
|
||
// // Price: "1500",
|
||
// // Number: "2",
|
||
// // ItemSn: "a1",
|
||
// // MouldId: "909963",
|
||
// // DeliverTime: "48h",
|
||
// // IsDeliverTimeDefault: "48h",
|
||
// // CatId: "43000000000000000",
|
||
// // PageType: "add",
|
||
// // OldCatId: "0000000000000000000",
|
||
// // Tpl: "13",
|
||
// // BearShipping: "buyer",
|
||
// // WeightPiece: "1",
|
||
// // IsOnSale: "1",
|
||
// // Weight: "0.5",
|
||
// // IsUseMould: "1",
|
||
// // DeliverTimeGroup: "1",
|
||
// //}
|
||
// //marshal, err := json.Marshal(data)
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //
|
||
// //file, err := outAddGoodsAndFile("7feb7d192911b5440a4c83d81decd568e3cb4833", "", "D:/work/image/9787115460622.jpg", string(marshal))
|
||
// //if err != nil {
|
||
// // fmt.Println(err)
|
||
// //}
|
||
// //fmt.Println(string(file))
|
||
//}
|
||
|
||
type ItemInfo struct {
|
||
ItemName string `json:"itemName"`
|
||
ISBN string `json:"isbn"`
|
||
Author string `json:"author"`
|
||
Press string `json:"press"`
|
||
YearsGroup string `json:"yearsGroup"`
|
||
PubDate string `json:"pubDate"`
|
||
PubDateYear string `json:"pubDateYear"`
|
||
PubDateMonth string `json:"pubDateMonth"`
|
||
Edition string `json:"edition"`
|
||
Binding string `json:"binding"`
|
||
Quality string `json:"quality"`
|
||
Price string `json:"price"`
|
||
Number string `json:"number"`
|
||
ItemSn string `json:"itemSn"`
|
||
Images []ImageInfo `json:"images"`
|
||
MouldId string `json:"mouldId"`
|
||
DeliverTime string `json:"deliverTime"`
|
||
IsDeliverTimeDefault string `json:"isDeliverTimeDefault"`
|
||
CatId string `json:"catId"`
|
||
PageType string `json:"pageType"`
|
||
OldCatId string `json:"oldCatId"`
|
||
Tpl string `json:"tpl"`
|
||
BearShipping string `json:"bearShipping"`
|
||
WeightPiece string `json:"weightPiece"`
|
||
IsOnSale string `json:"isOnSale"`
|
||
Weight string `json:"weight"`
|
||
IsUseMould string `json:"isUseMould"`
|
||
DeliverTimeGroup string `json:"deliverTimeGroup"`
|
||
}
|
||
|
||
type ImageInfo struct {
|
||
ImgUrl string `json:"imgUrl"`
|
||
IsMain int `json:"isMain"`
|
||
}
|
||
|
||
// OrderQueryParams 订单查询参数结构体
|
||
type OrderQueryParams struct {
|
||
// UserType 用户类型。取值 seller: 卖家;buyer: 买家。
|
||
UserType string `json:"userType" binding:"required"`
|
||
|
||
// OrderStatus 订单状态。默认为全部订单。
|
||
// Trading:交易中;
|
||
// Pending:待确认;
|
||
// ConfirmedToPay:待付款;
|
||
// PaidToShip:待发货;
|
||
// ShippedToReceipt:待确认收货;
|
||
// Refund:退货退款中;
|
||
// sellerReviewed:待评价;
|
||
// Successful:成功完成;
|
||
// RefundDeald:已退货退款;
|
||
// BuyerCancelled:买家取消;
|
||
// SellerCancelledBeforeConfirm:卖家取消;
|
||
// AdminClosedBeforeConfirm:管理员关闭。
|
||
OrderStatus string `json:"orderStatus,omitempty"`
|
||
|
||
// PageNum 页码。默认为:1
|
||
PageNum int `json:"pageNum,omitempty"`
|
||
|
||
// PageSize 每页最大条数。默认为:20,最大值为:100
|
||
PageSize int `json:"pageSize,omitempty"`
|
||
|
||
// IsDelete 是否已删除。默认查询未删除的
|
||
IsDelete int `json:"isDelete,omitempty"`
|
||
|
||
// StartDate 根据订单生成时间查询的起始日期,格式为yyyy-mm-dd,时区为GMT+8
|
||
StartDate string `json:"startDate,omitempty"`
|
||
|
||
// EndDate 根据订单生成时间查询的截止日期,格式为yyyy-mm-dd,时区为GMT+8
|
||
EndDate string `json:"endDate,omitempty"`
|
||
|
||
// StartTime 根据订单生成时间查询的起始时间,格式为yyyy-mm-dd hh:mm:ss,时区为GMT+8
|
||
StartTime string `json:"startTime,omitempty"`
|
||
|
||
// EndTime 根据订单生成时间查询的截止时间,格式为yyyy-mm-dd hh:mm:ss,时区为GMT+8
|
||
EndTime string `json:"endTime,omitempty"`
|
||
|
||
// StartUpdateTime 根据订单更新时间查询的起始时间,格式为yyyy-mm-dd hh:mm:ss,时区为GMT+8
|
||
StartUpdateTime string `json:"startUpdateTime,omitempty"`
|
||
|
||
// EndUpdateTime 根据订单更新时间查询的截止时间,格式为yyyy-mm-dd hh:mm:ss,时区为GMT+8
|
||
EndUpdateTime string `json:"endUpdateTime,omitempty"`
|
||
}
|