daShangDao_kfzgw-info/md/kongfz.md
2025-12-22 19:09:56 +08:00

1598 lines
47 KiB
Markdown
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.

# kongfz.dll 使用教程
## 1.创建DLL工具实例
### 加载DLL文件
```gotemplate
// 加载DLL的函数
type kongfzDLL struct {
dll *syscall.DLL
outLogin *syscall.Proc // 孔网登录
outGetUserMsg *syscall.Proc // 获取孔网用户信息
outGetGoodsTplMsg *syscall.Proc // 获取商品模版-已登的店铺
outGetGoodsListMsgFromSelfShop *syscall.Proc // 获取商品列表-已登的店铺
outAddGoods *syscall.Proc // 新增商品-已登的店铺
outDelGoodsFromSelfShop *syscall.Proc // 删除商品-已登的店铺
outGetImageFilterShopId *syscall.Proc // 获取孔网商品图片(官图和拍图)-带有店铺过滤
outGetImageByIsbn *syscall.Proc // 获取孔网商品图片和信息(官图和拍图)
outGetGoodsListMsgByShopId *syscall.Proc // 获取商品列表通过店铺ID
outGetGoodsMsgByDetailUrl *syscall.Proc // 获取商品信息通过商品详情链接
outGetTopGoodsListMsg *syscall.Proc // 获取销量榜商品列表
freeCString *syscall.Proc // 释放C字符串内存
}
// 初始化kongfzDLL
func InitKongfzDLL() (*kongfzDLL, error) {
dllPath := filepath.Join("dll", "kongfz.dll")
if _, err := os.Stat(dllPath); os.IsNotExist(err) {
return nil, fmt.Errorf("kongfz DLL 不存在: %s", dllPath)
}
if dll, err := syscall.LoadDLL(dllPath); err != nil {
return nil, fmt.Errorf("加载 kongfz DLL 失败: %v", err)
} else {
return &kongfzDLL{
dll: dll,
outLogin: dll.MustFindProc("OutLogin"),
outGetUserMsg: dll.MustFindProc("OutGetUserMsg"),
outGetGoodsTplMsg: dll.MustFindProc("OutGetGoodsTplMsg"),
outGetGoodsListMsgFromSelfShop: dll.MustFindProc("OutGetGoodsListMsgFromSelfShop"),
outAddGoods: dll.MustFindProc("OutAddGoods"),
outDelGoodsFromSelfShop: dll.MustFindProc("OutDelGoodsFromSelfShop"),
outGetImageFilterShopId: dll.MustFindProc("OutGetImageFilterShopId"),
outGetImageByIsbn: dll.MustFindProc("OutGetImageByIsbn"),
outGetGoodsListMsgByShopId: dll.MustFindProc("OutGetGoodsListMsgByShopId"),
outGetGoodsMsgByDetailUrl: dll.MustFindProc("OutGetGoodsMsgByDetailUrl"),
outGetTopGoodsListMsg: dll.MustFindProc("OutGetTopGoodsListMsg"),
freeCString: dll.MustFindProc("FreeCString"),
}, nil
}
}
// main函数调用
dll, err := InitKongfzDLL()
if err != nil {
fmt.Println(err)
}
```
### 获取C字符串
```gotemplate
// cStr 获取C字符串
func (m *kongfzDLL) cStr(p uintptr) string {
if p == 0 {
return ""
}
b := []byte{}
for i := uintptr(0); ; i++ {
c := *(*byte)(unsafe.Pointer(p + i))
if c == 0 {
break
}
b = append(b, c)
}
s := string(b)
if m.freeCString != nil {
m.freeCString.Call(p)
}
return s
}
```
### 2.使用dll函数示例
```gotemplate
// 获取商品模版
func (m *kongfzDLL) OutGetGoodsTplMsg(token, itemId, proxy string) (string, error) {
proc, err := m.dll.FindProc("OutGetGoodsTplMsg")
if err != nil {
return "", fmt.Errorf("找不到函数 OutGetGoodsTplMsg 函数: %v", err)
}
tokenPtr, _ := syscall.BytePtrFromString(token)
itemIdPtr, _ := syscall.BytePtrFromString(itemId)
proxyPtr, _ := syscall.BytePtrFromString(proxy)
info, _, err := proc.Call(
uintptr(unsafe.Pointer(tokenPtr)),
uintptr(unsafe.Pointer(itemIdPtr)),
uintptr(unsafe.Pointer(proxyPtr)))
if err != nil && err.Error() != "The operation completed successfully." {
return "", fmt.Errorf("调用函数 OutGetGoodsTplMsg 失败: %v", err)
}
return m.cStr(info), nil
}
```
### 初始化配置信息(可以不调用)
```gotemplate
func main() {
// 使用默认配置初始化
config := createDefaultConfig()
configJSON, err := json.Marshal(config)
if err != nil {
log.Fatalf("序列化配置失败: %v", err)
}
result, err := manager.Initialize(string(configJSON))
if err != nil {
log.Fatalf("初始化失败: %v", err)
}
var initResp APIResponse
if err := json.Unmarshal([]byte(result), &initResp); err != nil {
log.Fatalf("解析初始化响应失败: %v", err)
}
if !initResp.Success {
log.Fatalf("初始化失败: %s", initResp.Message)
}
}
// 创建默认配置
func createDefaultConfig() Config {
var config Config
// App配置
config.App.MaxRetryTimes = 3
config.App.RateLimitDelay = 1000
config.App.Size = 10
config.App.DefaultUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
// API配置
config.API.LoginURL = "https://login.kongfz.com/Pc/Login/account"
config.API.BookSearchURL = "https://search.kongfz.com/pc-gw/search-web/client/pc/bookLib/keyword/list"
config.API.ProductSearchURL = "https://search.kongfz.com/pc-gw/search-web/client/pc/product/keyword/list"
// 代理配置(需要根据实际情况修改)
config.Proxy.Servers = "http-dynamic.xiaoxiangdaili.com,http-dynamic-S02.xiaoxiangdaili.com,http-dynamic-S03.xiaoxiangdaili.com,http-dynamic-S04.xiaoxiangdaili.com"
config.Proxy.Username = "1297757178467602432"
config.Proxy.Password = "QgQBvP7f"
config.Proxy.TailMachineCode = "b7bf22a237ec692f13fcc2c43ee63252"
config.Proxy.TailCardKey = "DL_20_YK_1920acb2129844c2aabade3896560a9b"
config.Proxy.ProxyFilePath = "dll/proxyConfig.dll"
config.Database.Username = "newAdmin"
config.Database.Password = "bYPp8SbBe5F7nz2i"
config.Database.Host = "146.56.227.42:3306"
config.Database.Name = "newadmin"
return config
}
```
## 2.配置结构体(可以不调用)
```gotemplate
type Config struct {
App struct {
MaxRetryTimes int `json:"max_retry_times"`
RateLimitDelay int `json:"rate_limit_delay"`
Size int `json:"size"`
DefaultUserAgent string `json:"default_user_agent"`
} `json:"app"`
API struct {
LoginURL string `json:"login_url"`
BookSearchURL string `json:"book_search_url"`
ProductSearchURL string `json:"product_search_url"`
} `json:"api"`
Proxy struct {
Servers string `json:"servers"`
Username string `json:"username"`
Password string `json:"password"`
TailMachineCode string `json:"tail_machine_code"`
TailCardKey string `json:"tail_card_key"`
ProxyFilePath string `json:"proxy_file_path"`
} `json:"proxy"`
}
```
# 接口详情
## 1.孔网登录--OutLogin
### 请求信息
```gotemplate
dll.OutLogin(username, password)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--|--|--|
| username | string | 是 | 登录用户名 |
| password | string | 是 | 登录密码 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"token": "abc123def456"
}
}
```
## 2.获取孔网用户信息--OutGetUserMsg
### 请求信息
```gotemplate
dll.OutGetUserMsg(token)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--|--|--|
| token | string | 是 | 登录凭证 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"userId": 123456,
"nickname": "用户昵称",
"mobile": "13800138000"
}
}
```
## 3.获取商品模版-已登的店铺--OutGetGoodsTplMsg
### 请求信息
```gotemplate
dll.OutGetGoodsTplMsg(token, proxy, itemId)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--|----|--|
| token | string | 是 | 登录凭证 |
| proxy | string | 否 | 代理地址 |
| itemId | string | 是 | 商品ID |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"status": 1,
"data": {
"categorySection": {
"key": "catId",
"name": "分类",
"value": "58012000000000000",
"catName": "收藏杂项 > 其他杂项",
"inputType": "other",
"title": "",
"tips": "",
"unit": "",
"check": {
"type": "categorySelect",
"status": 0,
"isRequired": 1
},
"isValid": true
},
"goodsSection": [
{
"key": "itemName",
"name": "商品名称",
"value": "鎏金降魔杵 全品",
"inputType": "textarea",
"title": "请填写商品名称",
"tips": "请填写商品名称",
"unit": "",
"explain": "",
"check": {
"type": "string",
"status": 0,
"isRequired": 1,
"maxLen": 200
}
},
{
"key": "author",
"name": "制作者",
"value": "未知",
"inputType": "text",
"title": "请填写制作者",
"tips": "请填写制作者",
"unit": "",
"explain": "",
"check": {
"type": "string",
"status": 0,
"isRequired": 0,
"maxLen": 120
}
},
{
"key": "yearsGroup",
"name": "年代",
"value": "2",
"inputType": "yearsGroup",
"title": "请填写时间或选择年代",
"tips": "",
"unit": "",
"check": {
"type": "radio",
"status": 0,
"isRequired": 0
},
"options": [
{
"name": "填写时间",
"value": "1",
"group": [
{
"key": "pubDate",
"name": "年代",
"value": "",
"inputType": "dateGroup",
"title": "请填写年代",
"tips": "请填写年代",
"unit": "",
"check": {
"type": "date",
"status": 0,
"isRequired": 0,
"enableUnknow": false,
"maxDate": "2026-12"
},
"group": [
{
"key": "pubDateYear",
"name": "年份",
"value": "",
"leftWords": "hidden",
"inputType": "int",
"title": "请填写年份",
"tips": "请填写年份",
"unit": "年",
"explain": "",
"check": {
"type": "int",
"status": 0,
"isRequired": 0,
"min": 0,
"max": 2026
}
},
{
"key": "pubDateMonth",
"name": "月份",
"value": "",
"leftWords": "hidden",
"inputType": "int",
"title": "请填写月份",
"tips": "请填写月份",
"unit": "月",
"explain": "",
"check": {
"type": "int",
"status": 0,
"isRequired": 0,
"min": 1,
"max": 12
}
}
]
}
]
},
{
"name": "选择年代",
"value": "2",
"group": [
{
"key": "years",
"name": "年代",
"value": 0,
"inputType": "yearsSelect",
"title": "请选择年代",
"tips": "",
"unit": "",
"check": {
"type": "yearsSelect",
"status": 0,
"isRequired": 0
}
}
]
}
]
},
{
"key": "material",
"name": "材质",
"value": "金属",
"inputType": "text",
"title": "请填写材质",
"tips": "请填写材质",
"unit": "",
"explain": "",
"check": {
"type": "string",
"status": 0,
"isRequired": 0,
"maxLen": 10
}
},
{
"key": "size",
"name": "尺寸",
"value": "",
"inputType": "row",
"isRequired": 0,
"title": "请填写尺寸",
"tips": "请填写尺寸",
"group": [
{
"key": "sizeLength",
"name": "长度",
"value": "6",
"leftWords": "长",
"inputType": "float",
"title": "请填写长度",
"tips": "请填写长度",
"unit": "cm",
"check": {
"type": "float",
"status": 0,
"isRequired": 1,
"min": 0.01,
"max": 99999.99,
"decimals": 2
}
},
{
"key": "sizeWidth",
"name": "宽度",
"value": "2",
"leftWords": "宽",
"inputType": "float",
"title": "请填写宽度",
"tips": "请填写宽度",
"unit": "cm",
"check": {
"type": "float",
"status": 0,
"isRequired": 1,
"min": 0.01,
"max": 99999.99,
"decimals": 2
}
},
{
"key": "sizeHeight",
"name": "高度",
"value": "3",
"leftWords": "高",
"inputType": "float",
"title": "请填写高度",
"tips": "请填写高度",
"unit": "cm",
"check": {
"type": "float",
"status": 0,
"isRequired": 0,
"min": 0.01,
"max": 99999.99,
"decimals": 2
}
}
]
},
{
"key": "quality",
"name": "品相",
"value": "95",
"inputType": "select",
"options": [
{
"name": "全新",
"value": 100
},
{
"name": "九五品",
"value": 95
},
{
"name": "九品",
"value": 90
},
{
"name": "八五品",
"value": 85
},
{
"name": "八品",
"value": 80
},
{
"name": "七五品",
"value": 75
},
{
"name": "七品",
"value": 70
},
{
"name": "六五品",
"value": 65
},
{
"name": "六品",
"value": 60
},
{
"name": "五品",
"value": 50
},
{
"name": "四品",
"value": 40
},
{
"name": "三品",
"value": 30
},
{
"name": "二品",
"value": 20
},
{
"name": "一品",
"value": 10
}
],
"title": "请选择品相",
"tips": "",
"unit": "",
"check": {
"type": "select",
"status": 0,
"isRequired": 1
}
},
{
"key": "qualityDesc",
"name": "品相描述",
"value": "老好了",
"inputType": "textarea",
"title": "请填写品相描述",
"tips": "请填写品相描述",
"unit": "",
"explain": "",
"check": {
"type": "string",
"status": 0,
"isRequired": 0,
"maxLen": 400
}
},
{
"key": "price",
"name": "售价",
"value": "1467.00",
"leftWords": "",
"inputType": "float",
"title": "请填写售价",
"tips": "请填写售价",
"unit": "元",
"check": {
"type": "float",
"status": 0,
"isRequired": 1,
"min": 0.01,
"max": 99999999.99,
"decimals": 2
}
},
{
"key": "number",
"name": "库存数量",
"value": "1",
"leftWords": "",
"inputType": "int",
"title": "请填写库存数量",
"tips": "请填写库存数量",
"unit": "件",
"explain": "",
"check": {
"type": "int",
"status": 0,
"isRequired": 0,
"min": 0,
"max": 9999
}
},
{
"key": "itemSn",
"name": "货号",
"value": "",
"inputType": "text",
"title": "请填写货号",
"tips": "请填写货号",
"unit": "",
"explain": "",
"check": {
"type": "string",
"status": 0,
"isRequired": 0,
"maxLen": 20
}
},
{
"key": "myCatId",
"name": "本店分类",
"value": "",
"inputType": "select",
"options": [],
"title": "请选择本店分类",
"tips": "",
"unit": "",
"check": {
"type": "select",
"status": 0,
"isRequired": 0
}
},
{
"key": "itemDesc",
"name": "详细描述",
"value": "",
"inputType": "textarea",
"title": "请填写详细描述",
"tips": "请填写详细描述",
"unit": "",
"explain": "",
"check": {
"type": "string",
"status": 0,
"isRequired": 0,
"maxLen": 10000
}
},
{
"key": "images",
"name": "图片",
"inputType": "images",
"title": "请填写图片",
"tips": "图片格式为jpg、png、gif、jpeg图片大小不能超过10M一次可以选择多张上传最多上传30张拖拽调整顺序。",
"unit": "",
"value": "",
"images": [
{
"imgId": 239722,
"imgType": 0,
"isMain": 1,
"imgUrl": "sw/kfz-cos/kfzimg/24175337/00fff0d9a9dbb89c_s.jpg",
"imgSrc": "https://www0.kfzimg.com/sw/kfz-cos/kfzimg/24175337/00fff0d9a9dbb89c_s.jpg",
"imgSrcMiddle": "https://www0.kfzimg.com/sw/kfz-cos/kfzimg/24175337/00fff0d9a9dbb89c_n.jpg",
"imgSrcBig": "https://www0.kfzimg.com/sw/kfz-cos/kfzimg/24175337/00fff0d9a9dbb89c_b.jpg",
"imgDesc": "",
"imgTag": []
}
],
"batchKey": "img",
"check": {
"type": "images",
"status": 0,
"isRequired": 1,
"descMaxLen": 300,
"minNum": 1,
"maxNum": 30,
"appMaxSize": "2MB",
"appMaxWidth": "1200",
"pcMaxSize": "10MB"
}
},
{
"key": "isOnSale",
"name": "货架状态",
"value": "1",
"inputType": "radio",
"title": "",
"tips": "",
"unit": "",
"check": {
"type": "radio",
"status": -1,
"isRequired": 1
},
"options": [
{
"name": "直接上架",
"value": "1"
},
{
"name": "暂时下架",
"value": "0"
}
]
},
{
"key": "itemId",
"name": "商品编号",
"value": 9250897118,
"inputType": "hidden",
"title": "",
"tips": "",
"unit": ""
},
{
"key": "oldCatId",
"name": "原商品分类",
"value": "58012000000000000",
"inputType": "hidden",
"title": "",
"tips": "",
"unit": ""
},
{
"key": "oldPrice",
"name": "原商品价格",
"value": "1467.00",
"inputType": "hidden",
"title": "",
"tips": "",
"unit": ""
},
{
"key": "tpl",
"name": "模板编号",
"value": 12,
"inputType": "hidden",
"title": "",
"tips": "",
"unit": ""
}
],
"deliverSection": [
{
"key": "deliverTimeGroup",
"name": "发货模式",
"value": "1",
"inputType": "ridio",
"title": "发货模式",
"tips": "",
"unit": "",
"check": {
"type": "radio",
"status": 0,
"isRequired": 1
},
"options": [
{
"name": "现货模式",
"value": "1",
"key": "deliverTypeInStock",
"group": [
{
"key": "deliverTime",
"name": "发货时间",
"value": "48h",
"inputType": "radio",
"title": "发货时间",
"tips": "",
"unit": "",
"check": {
"type": "radio",
"status": 0,
"isRequired": 1
},
"options": [
{
"name": "当日发",
"value": "today",
"tips": "买家在16点前付款当日24点前发货16点后付款次日24点前发货且在发货24小时内返回物流轨迹。"
},
{
"name": "24小时",
"value": "24h",
"tips": "买家付款后24小时内发货且在发货24小时内返回物流轨迹。"
},
{
"name": "48小时",
"value": "48h"
}
]
}
]
}
]
},
{
"key": "isDeliverTimeDefault",
"name": "设为默认发货时间",
"value": "48h",
"inputType": "hidden"
}
],
"shippingSection": [
{
"key": "bearShipping",
"name": "",
"value": "buyer",
"inputType": "radio",
"options": [
{
"name": "卖家承担运费",
"tips": "(必须支持快递)",
"value": "seller"
},
{
"name": "运费模板",
"value": "buyer"
}
],
"title": "请选择",
"tips": "",
"unit": "",
"check": {
"type": "radio",
"status": 0,
"isRequired": 1
}
},
{
"key": "isUseMould",
"name": "是否使用运费模板",
"value": "1",
"inputType": "hidden",
"title": "",
"tips": "",
"unit": ""
},
{
"key": "mouldId",
"name": "运费模板",
"value": 975623,
"inputType": "select",
"title": "请选择运费模板",
"tips": "为了提升消费者购物体验,方便您计算运费,买家承担运费的商品均需使用运费模板,如何使用模板,[url=]查看视频教程[/url]",
"unit": "",
"check": {
"type": "shippingMouldSelect",
"status": 0,
"isRequired": 1
},
"shipping": [],
"shopProductArea": 1001000000,
"mouldList": [
{
"mouldId": "975623",
"mouldName": "模板1",
"isTransfer": "0",
"isDefault": "0",
"isAppMould": "0",
"feeManner": "weight",
"productArea": "1001000000",
"mouldInfo": {
"mouldId": "975623",
"userId": "24175337",
"mouldName": "模板1",
"productArea": "1001000000",
"feeManner": "weight",
"sortOrder": [
"express"
],
"enableShipping": "express",
"dataMd5": "",
"isDefault": "0",
"isAppMould": "0",
"description": "",
"smartMouldId": "0",
"shipmentType": "0",
"provId": "1000000000",
"provName": "北京",
"cityId": "1001000000",
"cityName": "东城",
"feeList": {
"express": {
"enabled": true,
"name": "快递",
"special": [
{
"feeId": 8587228,
"area": [
{
"provId": "1000000000",
"provName": "北京",
"cities": []
}
],
"areaDivide": "china",
"initialNum": 1,
"addNum": 1,
"addFee": "5.00",
"initialFee": "5.00",
"registerFee": "0.00"
},
{
"feeId": 8587229,
"area": [
{
"provId": "3000000000",
"provName": "天津",
"cities": []
},
{
"provId": "12000000000",
"provName": "河北",
"cities": []
}
],
"areaDivide": "china",
"initialNum": 1,
"addNum": 1,
"addFee": "5.00",
"initialFee": "5.00",
"registerFee": "0.00"
},
{
"feeId": 8587230,
"area": [
{
"provId": "2000000000",
"provName": "上海",
"cities": []
},
{
"provId": "18000000000",
"provName": "江苏",
"cities": []
},
{
"provId": "31000000000",
"provName": "浙江",
"cities": []
},
{
"provId": "5000000000",
"provName": "安徽",
"cities": []
},
{
"provId": "19000000000",
"provName": "江西",
"cities": []
},
{
"provId": "25000000000",
"provName": "山西",
"cities": []
},
{
"provId": "24000000000",
"provName": "山东",
"cities": []
},
{
"provId": "21000000000",
"provName": "内蒙古",
"cities": []
},
{
"provId": "16000000000",
"provName": "湖南",
"cities": []
},
{
"provId": "15000000000",
"provName": "湖北",
"cities": []
},
{
"provId": "13000000000",
"provName": "河南",
"cities": []
},
{
"provId": "8000000000",
"provName": "广东",
"cities": []
},
{
"provId": "9000000000",
"provName": "广西",
"cities": []
},
{
"provId": "6000000000",
"provName": "福建",
"cities": []
},
{
"provId": "11000000000",
"provName": "海南",
"cities": []
},
{
"provId": "20000000000",
"provName": "辽宁",
"cities": []
},
{
"provId": "17000000000",
"provName": "吉林",
"cities": []
},
{
"provId": "14000000000",
"provName": "黑龙江",
"cities": []
},
{
"provId": "26000000000",
"provName": "陕西",
"cities": []
},
{
"provId": "7000000000",
"provName": "甘肃",
"cities": []
},
{
"provId": "22000000000",
"provName": "宁夏",
"cities": []
},
{
"provId": "23000000000",
"provName": "青海",
"cities": []
},
{
"provId": "4000000000",
"provName": "重庆",
"cities": []
},
{
"provId": "30000000000",
"provName": "云南",
"cities": []
},
{
"provId": "10000000000",
"provName": "贵州",
"cities": []
},
{
"provId": "27000000000",
"provName": "四川",
"cities": []
}
],
"areaDivide": "china",
"initialNum": 1,
"addNum": 1,
"addFee": "5.00",
"initialFee": "5.00",
"registerFee": "0.00"
},
{
"feeId": 8587231,
"area": [
{
"provId": "29000000000",
"provName": "新疆",
"cities": []
},
{
"provId": "28000000000",
"provName": "西藏",
"cities": []
}
],
"areaDivide": "china",
"initialNum": 1,
"addNum": 1,
"addFee": "30.00",
"initialFee": "30.00",
"registerFee": "0.00"
},
{
"feeId": 8587232,
"area": [
{
"provId": "34000000000",
"provName": "香港",
"cities": []
},
{
"provId": "32000000000",
"provName": "澳门",
"cities": []
},
{
"provId": "33000000000",
"provName": "台湾",
"cities": []
},
{
"provId": "40000000000",
"provName": "海外",
"cities": []
}
],
"areaDivide": "outChinaDefault",
"initialNum": 0,
"addNum": 0,
"addFee": "0.00",
"initialFee": "0.00",
"registerFee": 0
}
]
}
}
},
"shipmentType": "0"
}
]
},
{
"key": "weight",
"name": "物流重量",
"value": "0.5",
"leftWords": "",
"inputType": "float",
"title": "请填写物流重量",
"tips": "请填写物流重量",
"unit": "千克",
"check": {
"type": "float",
"status": 0,
"isRequired": 1,
"min": 0.01,
"max": 9999.99,
"decimals": 2
}
},
{
"key": "weightPiece",
"name": "物流标准本数",
"value": "1",
"leftWords": "",
"inputType": "float",
"title": "请填写物流标准本数",
"tips": "请填写物流标准本数",
"unit": "本",
"check": {
"type": "float",
"status": 0,
"isRequired": 1,
"min": 0.01,
"max": 9999.99,
"decimals": 2
}
}
],
"isDraft": 0
},
"message": "",
"errType": ""
}
}
```
## 4.获取商品列表-已登的店铺--OutGetGoodsListMsgFromSelfShop
### 请求信息
```gotemplate
dll.OutGetGoodsListMsgFromSelfShop(token, proxy, itemSn, priceMin, priceMax,
startCreateTime, endCreateTime, requestType,
isItemSnEqual, page, size)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--------|----|-----------------|
| token | string | 是 | 登录凭证 |
| proxy | string | 否 | 代理地址 |
| itemSn | string | 是 | 店铺货号 |
| priceMin | string | 否 | 最低价格 |
| priceMax | string | 否 | 最高价格 |
| startCreateTime | string | 否 | 上书开始时间 |
| endCreateTime | string | 否 | 上书结束时间 |
| requestType | string | 是 | 请求类型 onSale:出售中 |
| isItemSnEqual | int | 是 | 验证货号 填 0 就行 |
| page | int | 是 | 页码 |
| size | int | 是 | 每页数量 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"status": true,
"errCode": 0,
"errMessage": "",
"result": {
"productInfoPageResult": {
"list": [
{
"name": "鎏金降魔杵 全品",
"qualityName": "九五品",
"quality": 95,
"price": 1467.00,
"realPrice": 1467.00,
"number": 1,
"mouldName": "模板1",
"feeManner": "0.5千克",
"weight": 0.5,
"weightPiece": 0.0,
"mouldId": 975623,
"imageUrl": "https://www0.kfzimg.com/sw/kfz-cos/kfzimg/24175337/00fff0d9a9dbb89c_s.jpg",
"imageSrc": "https://www0.kfzimg.com/sw/kfz-cos/kfzimg/24175337/00fff0d9a9dbb89c_s.jpg",
"createTime": "2025-12-11 11:42",
"updateTime": "2025-12-11 11:43",
"itemId": 9250897118,
"catId": 58012000000000000,
"catName": "收藏杂项 > 其他杂项",
"tpl": 12,
"itemSn": "",
"discount": 100,
"certifyStatus": "certified",
"isOnSale": 1,
"certifyStatusName": "出售中",
"soldNumber": null,
"soldAmount": null,
"soldTime": null,
"operateList": null,
"shareInfo": null,
"isSyncISBN": 0,
"deliverType": 1,
"deliverTime": "48h",
"isDraft": 0
}
],
"pager": {
"page": 1,
"size": 100,
"total": 1,
"pages": 1
}
},
"productStatCount": {
"allUnSold": 3,
"onSale": 1,
"zeroStock": 0,
"offSale": 2,
"needApproved": 0,
"soldCount": null
},
"productListStat": {
"count": 1,
"itemNum": 1,
"amount": "1467.00"
}
}
}
}
```
## 5.新增商品-已登的店铺--OutAddGoods
### 请求信息
```gotemplate
dll.OutAddGoods(token, proxy, formData)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--------|----|----------------|
| token | string | 是 | 登录凭证 |
| proxy | string | 否 | 代理地址 |
| formData | string | 是 | 新增商品信息的json字符串 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"status":1,
"data":9279010923,
"message":"",
"errType":""
}
}
```
## 6.删除商品-已登的店铺--OutDelGoodsFromSelfShop
### 请求信息
```gotemplate
dll.OutDelGoodsFromSelfShop(token, proxy, itemId)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--------|----|------|
| token | string | 是 | 登录凭证 |
| proxy | string | 否 | 代理地址 |
| itemId | string | 是 | 店铺ID |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"status":true,
"errCode":0,
"errMessage":"",
"result":true
}
}
```
## 7.获取孔网商品图片(官图和拍图)-带有店铺过滤--OutGetImageFilterShopId
### 请求信息
```gotemplate
dll.OutGetImageFilterShopId(token, proxy, isbn, shopId, isLiveImage, isReturnMsg)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--------|----|----------------------|
| token | string | 是 | 登录凭证 |
| proxy | string | 否 | 代理地址 |
| isbn | string | 是 | ISBN |
| shopId | int | 是 | 店铺ID |
| isLiveImage | int | 是 | 需要官图还是实拍图 0:官图 1:实拍图 |
| isReturnMsg | int | 否 | 是否需要详细信息 0:是 1:否 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"book_name": "",
"book_pic": "",
"book_pic_s": "",
"isbn": ""
}
}
```
## 8.获取孔网商品图片和信息(官图和拍图)--OutGetImageByIsbn
### 请求信息
```gotemplate
dll.OutGetImageByIsbn(token, proxy,isbn, isLiveImage, isReturnMsg)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--------|----|----------------------|
| token | string | 是 | 登录凭证 |
| proxy | string | 否 | 代理地址 |
| isbn | string | 是 | ISBN |
| isLiveImage | int | 是 | 需要官图还是实拍图 0:官图 1:实拍图 |
| isReturnMsg | int | 是 | 是否需要详细信息 0:是 1:否 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"author": "",
"publisher": "",
"isbn": "",
"publication_time": 0,
"edition": "",
"print_time": "",
"fix_price": "",
"binding_layout": "",
"format": "",
"paper": "",
"pages": "",
"wordage": "",
"languages": "",
"era": "",
"engraving_method": "",
"dimensions": "",
"volume_number": "",
"book_pic": "",
"book_pic_s": "",
"selling_price": "",
"condition": "",
"express_delivery_fee": "",
"editor": "",
"category": "",
"buy_count": "",
"sell_count": "",
"content": "",
"mid": 0,
"item_id": 0,
"shop_id": 0,
"detail_url": ""
}
}
```
## 9.获取商品列表通过店铺ID--OutGetGoodsListMsgByShopId
### 请求信息
```gotemplate
dll.OutGetGoodsListMsgByShopId(
shopId, proxy, retPrice, isImage, sortType,
sort, priceMin, priceMax, pageNum, returnNum)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--|---|--|
| shopId | int | 是 | 店铺ID |
| proxy | string | 否 | 代理地址 |
| retPrice | int | 否 | 是否返回价格 |
| isImage | int | 否 | 是否有图片 |
| sortType | string | 否 | 排序类型 |
| sort | string | 否 | 排序方式 |
| priceMin | float | 否 | 最低价格 |
| priceMax | float | 否 | 最高价格 |
| pageNum | int | 否 | 页码 |
| returnNum | int | 否 | 每页数量 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"goods_num": "",
"pnum": "",
"book_info": [{
"author": "",
"publisher": "",
"isbn": "",
"publication_time": 0,
"edition": "",
"print_time": "",
"fix_price": "",
"binding_layout": "",
"format": "",
"paper": "",
"pages": "",
"wordage": "",
"languages": "",
"era": "",
"engraving_method": "",
"dimensions": "",
"volume_number": "",
"book_pic": "",
"book_pic_s": "",
"selling_price": "",
"condition": "",
"express_delivery_fee": "",
"editor": "",
"category": "",
"buy_count": "",
"sell_count": "",
"content": "",
"mid": 0,
"item_id": 0,
"shop_id": 0,
"detail_url": ""
}]
}
}
```
## 10.获取商品信息通过商品详情链接--OutGetGoodsMsgByDetailUrl
### 请求信息
```gotemplate
dll.OutGetGoodsMsgByDetailUrl(detailUrl,proxy)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--------|---|-----------|
| detailUrl | string | 是 | 请求详情页的url |
| proxy | string | 否 | 代理地址 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"author": "",
"publisher": "",
"isbn": "",
"publication_time": 0,
"edition": "",
"print_time": "",
"fix_price": "",
"binding_layout": "",
"format": "",
"paper": "",
"pages": "",
"wordage": "",
"languages": "",
"era": "",
"engraving_method": "",
"dimensions": "",
"volume_number": "",
"book_pic": "",
"book_pic_s": "",
"selling_price": "",
"condition": "",
"express_delivery_fee": "",
"editor": "",
"category": "",
"buy_count": "",
"sell_count": "",
"content": "",
"mid": 0,
"item_id": 0,
"shop_id": 0,
"detail_url": ""
}
}
```
## 11.获取销量榜商品列表--OutGetTopGoodsListMsg
### 请求信息
```gotemplate
dll.OutGetTopGoodsListMsg(catId,proxy)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--------|---|---------|
| catId | int | 是 | 销量榜类型ID |
| proxy | string | 否 | 代理地址 |
### 响应示例
```json
{
"success": true,
"message": "",
"data": {
"status": true,
"result": {
"current": 1,
"data": [
{
"author": "吴承恩 著",
"bookName": "西游记",
"contentIntroduction": "在中国古代小说中,《西游记(评注本)》是一部思想性和艺术性都臻于第一流的伟大作品。它也是明代长篇小说的重要流派之一神魔小说的代表作,是中国古代神魔小说的翘楚、浪漫文学的代表,作者以其丰富的艺术想象力建构了一个光怪陆离的神话世界,并塑造出以孙悟空、猪八戒为代表的一批性格鲜明、影响深远的文学形象,数百年来一直为人们所喜闻乐见。《西游记(评注本)》主要描写的是孙悟空保唐僧西天取经,历经九九八十一难的故事",
"imgUrl": "https://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/1/536c/536c60e36e75bf67f43d790901fc0fe2_0_1_300_300.jpg",
"isbn": "9787540310097",
"itemUrls": {
"appUrl": "kongfz://app.kongfz.com?page=isbnDetail&mid=52528207",
"mUrl": "https://m.kongfz.com/item/52528207/",
"miniUrl": "/pages/bookdetail/bookdetail?mid=52528207",
"pcUrl": "https://item.kongfz.com/book/52528207.html"
},
"mid": 52528207,
"newMinPrice": "3.45",
"oldMinPrice": "0.20",
"press": "崇文书局",
"price": "15.00",
"pubDate": "2006-05",
"riseTag": "",
"authorArr": [
{
"name": "吴承恩",
"oriName": "",
"nationality": "",
"role": "著",
"url": "https://search.kongfz.com/item_result/?status=0&select=2&author=hk5434k627fk6069"
}
],
"pressUrl": "https://search.kongfz.com/item_result/?status=0&press=hk5d07k6587k4e66k5c40"
}
],
"total": 100
},
"errMessage": "",
"errCode": 0
}
}
```
## 12.初始化--Initialize(可以不调用)
### 请求信息
```gotemplate
result, err := dll.Initialize(configJSON)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--|--|----------------|
| configJSON | string | 是 | 配置信息的 JSON 字符串 |
### 响应示例
```json
{
"success": true,
"message": "初始化成功"
}
```
## 12.释放C字符串内存--FreeCString
### 请求信息
```gotemplate
dll.FreeCString(str)
```
### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--|--|--|----------|
| str | string | 是 | 需要释放的字符串 |