From 930de958080d041d6996bb8c554ca869ce8a496f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Fri, 27 May 2022 01:01:41 +0800 Subject: [PATCH] - init --- .drone.yml | 17 ++ .gitignore | 10 + app.go | 98 +++++++ crypto.go | 15 ++ go.mod | 25 ++ go.sum | 239 ++++++++++++++++++ jd.union.open.activity.query.go | 75 ++++++ jd.union.open.category.goods.get.go | 52 ++++ jd.union.open.coupon.gift.get.go | 1 + jd.union.open.coupon.gift.stop.go | 1 + jd.union.open.goods.bigfield.query.go | 72 ++++++ jd.union.open.goods.jingfen.query.go | 136 ++++++++++ jd.union.open.goods.material.query.go | 133 ++++++++++ ...ion.open.goods.promotiongoodsinfo.query.go | 71 ++++++ jd.union.open.order.query.go | 96 +++++++ jd.union.open.order.row.query.go | 105 ++++++++ jd.union.open.promotion.bysubunionid.get.go | 50 ++++ jd.union.open.promotion.common.get.go | 50 ++++ jd.union.open.selling.goods.query.go | 1 + jd.union.open.selling.order.row.query.go | 1 + jd.union.open.selling.promotion.get.go | 1 + jd.union.open.statistics.giftcoupon.query.go | 1 + jd.union.open.statistics.redpacket.query.go | 1 + params.go | 97 +++++++ pgsql.go | 26 ++ version.go | 3 + 26 files changed, 1377 insertions(+) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 app.go create mode 100644 crypto.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 jd.union.open.activity.query.go create mode 100644 jd.union.open.category.goods.get.go create mode 100644 jd.union.open.coupon.gift.get.go create mode 100644 jd.union.open.coupon.gift.stop.go create mode 100644 jd.union.open.goods.bigfield.query.go create mode 100644 jd.union.open.goods.jingfen.query.go create mode 100644 jd.union.open.goods.material.query.go create mode 100644 jd.union.open.goods.promotiongoodsinfo.query.go create mode 100644 jd.union.open.order.query.go create mode 100644 jd.union.open.order.row.query.go create mode 100644 jd.union.open.promotion.bysubunionid.get.go create mode 100644 jd.union.open.promotion.common.get.go create mode 100644 jd.union.open.selling.goods.query.go create mode 100644 jd.union.open.selling.order.row.query.go create mode 100644 jd.union.open.selling.promotion.get.go create mode 100644 jd.union.open.statistics.giftcoupon.query.go create mode 100644 jd.union.open.statistics.redpacket.query.go create mode 100644 params.go create mode 100644 pgsql.go create mode 100644 version.go diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c56c479 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +kind: pipeline +type: docker +name: clone + +steps: + - name: Test + image: golang:1.18 + commands: + - go env -w GO111MODULE=on + - go env -w GOPROXY=https://goproxy.cn,direct + - go test -v ./... + - name: Benchmark + image: golang:1.18 + commands: + - go env -w GO111MODULE=on + - go env -w GOPROXY=https://goproxy.cn,direct + - go test -bench=. -benchmem \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..502d67a --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.env +.git +.svn +.idea +.vscode +*.log +goinit.sh +gomod.sh +/vendor/ +*_test.go \ No newline at end of file diff --git a/app.go b/app.go new file mode 100644 index 0000000..ecfc715 --- /dev/null +++ b/app.go @@ -0,0 +1,98 @@ +package jd + +import ( + "go.dtapp.net/golog" + "go.dtapp.net/gorequest" + "go.dtapp.net/gostring" + "gorm.io/gorm" +) + +type App struct { + appKey string // 应用Key + secretKey string // 密钥 + siteId string // 网站ID/APP ID + positionId string // 推广位id + pgsql *gorm.DB // pgsql数据库 + client *gorequest.App // 请求客户端 + log *golog.Api // 日志服务 + logTableName string // 日志表名 + logStatus bool // 日志状态 +} + +func NewApp(appKey string, secretKey string, siteId string, positionId string, pgsql *gorm.DB) *App { + app := &App{appKey: appKey, secretKey: secretKey, siteId: siteId, positionId: positionId} + app.client = gorequest.NewHttp() + app.client.Uri = "https://api.jd.com/routerjson" + if pgsql != nil { + app.pgsql = pgsql + app.logStatus = true + app.logTableName = "jd" + app.log = golog.NewApi(&golog.ApiConfig{ + Db: pgsql, + TableName: app.logTableName, + }) + } + return app +} + +// 请求接口 +func (app *App) request(params map[string]interface{}) (resp gorequest.Response, err error) { + + // 签名 + app.Sign(params) + + // 创建请求 + client := app.client + + // 设置格式 + client.SetContentTypeForm() + + // 设置参数 + client.SetParams(params) + + // 发起请求 + request, err := client.Post() + if err != nil { + return gorequest.Response{}, err + } + + // 日志 + if app.logStatus == true { + go app.postgresqlLog(gostring.ToString(params["method"]), request) + } + + return request, err +} + +// GoodsPriceToInt64 商品券后价 +func (app *App) GoodsPriceToInt64(LowestCouponPrice float64) int64 { + return int64(LowestCouponPrice * 100) +} + +// GoodsOriginalPriceToInt64 商品原价 +func (app *App) GoodsOriginalPriceToInt64(Price float64) int64 { + return int64(Price * 100) +} + +// CouponProportionToInt64 佣金比率 +func (app *App) CouponProportionToInt64(CommissionShare float64) int64 { + return int64(CommissionShare * 10) +} + +// CouponAmountToInt64 优惠券金额 +func (app *App) CouponAmountToInt64(Commission float64) int64 { + return int64(Commission * 100) +} + +// CommissionIntegralToInt64 佣金积分 +func (app *App) CommissionIntegralToInt64(GoodsPrice, CouponProportion int64) int64 { + return (GoodsPrice * CouponProportion) / 1000 +} + +func (app *App) GetSiteId() string { + return app.siteId +} + +func (app *App) GetPositionId() string { + return app.positionId +} diff --git a/crypto.go b/crypto.go new file mode 100644 index 0000000..0232bc4 --- /dev/null +++ b/crypto.go @@ -0,0 +1,15 @@ +package jd + +import ( + "crypto/md5" + "encoding/hex" + "strings" +) + +// 签名 +func createSign(signStr string) string { + h := md5.New() + h.Write([]byte(signStr)) + cipherStr := h.Sum(nil) + return strings.ToUpper(hex.EncodeToString(cipherStr)) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a665a5d --- /dev/null +++ b/go.mod @@ -0,0 +1,25 @@ +module go.dtapp.net/jd + +go 1.18 + +require ( + go.dtapp.net/gojson v1.0.0 + go.dtapp.net/golog v1.0.13 + go.dtapp.net/gorequest v1.0.19 + go.dtapp.net/gostring v1.0.3 + gorm.io/datatypes v1.0.6 + gorm.io/gorm v1.23.5 +) + +require ( + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/saracen/go7z v0.0.0-20191010121135-9c09b6bd7fda // indirect + github.com/saracen/solidblock v0.0.0-20190426153529-45df20abab6f // indirect + github.com/ulikunitz/xz v0.5.10 // indirect + go.dtapp.net/goip v1.0.16 // indirect + go.dtapp.net/gotime v1.0.2 // indirect + golang.org/x/text v0.3.7 // indirect + gorm.io/driver/mysql v1.3.3 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..7bb4234 --- /dev/null +++ b/go.sum @@ -0,0 +1,239 @@ +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= +github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.11.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.12.1 h1:rsDFzIpRk7xT4B8FufgpCCeyjdNpKyghZeSefViE5W8= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.0 h1:brH0pCGBDkBW07HWlN/oSBXrmo3WB0UvZd1pIuDcL8Y= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.9.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.10.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.11.0 h1:u4uiGPz/1hryuXzyaBhSk6dnIyyG2683olG2OV+UUgs= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.14.1/go.mod h1:RgDuE4Z34o7XE92RpLsvFiOEfrAUT0Xt2KxvX73W06M= +github.com/jackc/pgx/v4 v4.15.0/go.mod h1:D/zyOyXiaM1TmVWnOM18p0xdDtdakRBa0RsVGI3U3bw= +github.com/jackc/pgx/v4 v4.16.1 h1:JzTglcal01DrghUqt+PmzWsZx/Yh7SC/CTQmSBMTd0Y= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0= +github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/saracen/go7z v0.0.0-20191010121135-9c09b6bd7fda h1:h+YpzUB/bGVJcLqW+d5GghcCmE/A25KbzjXvWJQi/+o= +github.com/saracen/go7z v0.0.0-20191010121135-9c09b6bd7fda/go.mod h1:MSotTrCv1PwoR8QgU1JurEx+lNNbtr25I+m0zbLyAGw= +github.com/saracen/go7z-fixtures v0.0.0-20190623165746-aa6b8fba1d2f h1:PF9WV5j/x6MT+x/sauUHd4objCvJbZb0wdxZkHSdd5A= +github.com/saracen/solidblock v0.0.0-20190426153529-45df20abab6f h1:1cJITU3JUI8qNS5T0BlXwANsVdyoJQHQ4hvOxbunPCw= +github.com/saracen/solidblock v0.0.0-20190426153529-45df20abab6f/go.mod h1:LyBTue+RWeyIfN3ZJ4wVxvDuvlGJtDgCLgCb6HCPgps= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= +github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.dtapp.net/goip v1.0.16 h1:jJoXeLVc8BmlKEc+4T9mL2BFK63RJFd4B9xTMYhFRqg= +go.dtapp.net/goip v1.0.16/go.mod h1:BY2Xo5clizPZFQ8CYOlgg91fHMZR1Ll54f3P0sNHxbg= +go.dtapp.net/gojson v1.0.0 h1:jmRjeWChRyv2tKEByHvnW3kXh1jUcL8B7VurV0Zbygc= +go.dtapp.net/gojson v1.0.0/go.mod h1:TkkpTNxHBKxul0e7gC5MrL1K4ICFB9mQ7wHzjBah3/k= +go.dtapp.net/golog v1.0.13 h1:SnU6G4onDYZPOfZ9cgmj5rHdtGGOWP/Qee31aM49Wj0= +go.dtapp.net/golog v1.0.13/go.mod h1:6w5Lt1x6/yUN3iptAi59irm4kqDJHaolDsrZ9ApsZUQ= +go.dtapp.net/gorequest v1.0.19 h1:ZBkXb/oD59aChfzHfReK6M3M4eu3dwpaPTefe1c8P90= +go.dtapp.net/gorequest v1.0.19/go.mod h1:EwOfdfxsWPszOWrphCWHTN4DbYtU6fyQ/fuWQyQwSnk= +go.dtapp.net/gostring v1.0.3 h1:KSOq4D77/g5yZN/bqWfZ0kOOaPr/P1240vg03+XdENI= +go.dtapp.net/gostring v1.0.3/go.mod h1:+ggrOvgQDQturi1QGsXEpyRN/ZPoRDaqhMujIk5lrgQ= +go.dtapp.net/gotime v1.0.2 h1:CFIJHQXC/4t9bsJhk2cLhjHd6rpdPcJXr8BcHKHDuQo= +go.dtapp.net/gotime v1.0.2/go.mod h1:Gq7eNLr2iMLP18UNWONRq4V3Uhf/ADp4bIrS+Tc6ktY= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/datatypes v1.0.6 h1:3cqbakp1DIgC+P7wyODb5k+lSjW8g3mjkg/BIsmhjlE= +gorm.io/datatypes v1.0.6/go.mod h1:Gh/Xd/iUWWybMEk8CzYCK/swqlni2r+ROeM1HGIM0ck= +gorm.io/driver/mysql v1.3.2/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= +gorm.io/driver/mysql v1.3.3 h1:jXG9ANrwBc4+bMvBcSl8zCfPBaVoPyBEBshA8dA93X8= +gorm.io/driver/mysql v1.3.3/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= +gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= +gorm.io/driver/postgres v1.3.6 h1:Q0iLoYvWwsJVpYQrSrY5p5P4YzW7fJjFMBG2sa4Bz5U= +gorm.io/driver/sqlite v1.3.1 h1:bwfE+zTEWklBYoEodIOIBwuWHpnx52Z9zJFW5F33WLk= +gorm.io/driver/sqlite v1.3.1/go.mod h1:wJx0hJspfycZ6myN38x1O/AqLtNS6c5o9TndewFbELg= +gorm.io/driver/sqlserver v1.3.1 h1:F5t6ScMzOgy1zukRTIZgLZwKahgt3q1woAILVolKpOI= +gorm.io/driver/sqlserver v1.3.1/go.mod h1:w25Vrx2BG+CJNUu/xKbFhaKlGxT/nzRkhWCCoptX8tQ= +gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.2/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.5 h1:TnlF26wScKSvknUC/Rn8t0NLLM22fypYBlvj1+aH6dM= +gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/jd.union.open.activity.query.go b/jd.union.open.activity.query.go new file mode 100644 index 0000000..b2616ff --- /dev/null +++ b/jd.union.open.activity.query.go @@ -0,0 +1,75 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenActivityQueryResultResponse struct { + JdUnionOpenActivityQueryResponce struct { + Code string `json:"code"` + QueryResult string `json:"queryResult"` + } `json:"jd_union_open_activity_query_responce"` +} + +type UnionOpenActivityQueryQueryResult struct { + Code int `json:"code"` + Data []struct { + ActStatus int `json:"actStatus"` + Advantage string `json:"advantage"` + CategoryList []struct { + CategoryId int `json:"categoryId"` + Type int `json:"type"` + } `json:"categoryList,omitempty"` + Content string `json:"content"` + DownloadCode string `json:"downloadCode"` + DownloadUrl string `json:"downloadUrl"` + EndTime int64 `json:"endTime"` + Id int `json:"id"` + ImgList []struct { + ImgName string `json:"imgName"` + ImgUrl string `json:"imgUrl"` + WidthHeight string `json:"widthHeight"` + } `json:"imgList,omitempty"` + PlatformType int `json:"platformType"` + PromotionEndTime int64 `json:"promotionEndTime,omitempty"` + PromotionStartTime int64 `json:"promotionStartTime,omitempty"` + Recommend int `json:"recommend,omitempty"` + StartTime int64 `json:"startTime"` + Tag string `json:"tag"` + Title string `json:"title"` + UpdateTime int64 `json:"updateTime"` + UrlM string `json:"urlM"` + UrlPC string `json:"urlPC"` + } `json:"data"` + Message string `json:"message"` + RequestId string `json:"requestId"` + TotalCount int `json:"totalCount"` +} + +type UnionOpenActivityQueryResult struct { + Responce UnionOpenActivityQueryResultResponse // 结果 + Result UnionOpenActivityQueryQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenActivityQueryResult(responce UnionOpenActivityQueryResultResponse, result UnionOpenActivityQueryQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenActivityQueryResult { + return &UnionOpenActivityQueryResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenActivityQuery 活动查询接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.activity.query +func (app *App) UnionOpenActivityQuery(notMustParams ...Params) *UnionOpenActivityQueryResult { + // 参数 + params := NewParamsWithType("jd.union.open.activity.query", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenActivityQueryResultResponse + var result UnionOpenActivityQueryQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenActivityQueryResponce.QueryResult), &result) + return NewUnionOpenActivityQueryResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.category.goods.get.go b/jd.union.open.category.goods.get.go new file mode 100644 index 0000000..c3ca6a5 --- /dev/null +++ b/jd.union.open.category.goods.get.go @@ -0,0 +1,52 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenCategoryGoodsGetResultResponse struct { + JdUnionOpenCategoryGoodsGetResponce struct { + Code string `json:"code"` + GetResult string `json:"getResult"` + } `json:"jd_union_open_category_goods_get_responce"` +} + +type UnionOpenCategoryGoodsGetQueryResult struct { + Code int `json:"code"` + Data []struct { + Grade int `json:"grade"` // 类目级别(类目级别 0,1,2 代表一、二、三级类目) + Name string `json:"name"` // 类目名称 + Id int `json:"id"` // 类目Id + ParentId int `json:"parentId"` // 父类目Id + } `json:"data"` + Message string `json:"message"` + RequestId string `json:"requestId"` +} + +type UnionOpenCategoryGoodsGetResult struct { + Responce UnionOpenCategoryGoodsGetResultResponse // 结果 + Result UnionOpenCategoryGoodsGetQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenCategoryGoodsGetResult(responce UnionOpenCategoryGoodsGetResultResponse, result UnionOpenCategoryGoodsGetQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenCategoryGoodsGetResult { + return &UnionOpenCategoryGoodsGetResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenCategoryGoodsGet 商品类目查询接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.category.goods.get +func (app *App) UnionOpenCategoryGoodsGet(notMustParams ...Params) *UnionOpenCategoryGoodsGetResult { + // 参数 + params := NewParamsWithType("jd.union.open.category.goods.get", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenCategoryGoodsGetResultResponse + var result UnionOpenCategoryGoodsGetQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenCategoryGoodsGetResponce.GetResult), &result) + return NewUnionOpenCategoryGoodsGetResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.coupon.gift.get.go b/jd.union.open.coupon.gift.get.go new file mode 100644 index 0000000..fdd9350 --- /dev/null +++ b/jd.union.open.coupon.gift.get.go @@ -0,0 +1 @@ +package jd diff --git a/jd.union.open.coupon.gift.stop.go b/jd.union.open.coupon.gift.stop.go new file mode 100644 index 0000000..fdd9350 --- /dev/null +++ b/jd.union.open.coupon.gift.stop.go @@ -0,0 +1 @@ +package jd diff --git a/jd.union.open.goods.bigfield.query.go b/jd.union.open.goods.bigfield.query.go new file mode 100644 index 0000000..9d8444c --- /dev/null +++ b/jd.union.open.goods.bigfield.query.go @@ -0,0 +1,72 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenGoodsBigfieldQueryResultResponse struct { + JdUnionOpenGoodsBigfieldQueryResponce struct { + Code string `json:"code"` + QueryResult string `json:"queryResult"` + } `json:"jd_union_open_goods_bigfield_query_responce"` +} + +type UnionOpenGoodsBigfieldQueryQueryResult struct { + Code int `json:"code"` + Data []struct { + BaseBigFieldInfo struct { + WareQD string `json:"wareQD"` + Wdis string `json:"wdis"` + } `json:"baseBigFieldInfo"` + CategoryInfo struct { + Cid1 int `json:"cid1"` + Cid1Name string `json:"cid1Name"` + Cid2 int `json:"cid2"` + Cid2Name string `json:"cid2Name"` + Cid3 int `json:"cid3"` + Cid3Name string `json:"cid3Name"` + } `json:"categoryInfo"` + DetailImages string `json:"detailImages"` + ImageInfo struct { + ImageList []struct { + Url string `json:"url"` + } `json:"imageList"` + } `json:"imageInfo"` + MainSkuId int64 `json:"mainSkuId"` + Owner string `json:"owner"` + ProductId int64 `json:"productId"` + SkuId int64 `json:"skuId"` + SkuName string `json:"skuName"` + SkuStatus int `json:"skuStatus"` + } `json:"data"` + Message string `json:"message"` + RequestId string `json:"requestId"` +} + +type UnionOpenGoodsBigfieldQueryResult struct { + Responce UnionOpenGoodsBigfieldQueryResultResponse // 结果 + Result UnionOpenGoodsBigfieldQueryQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenGoodsBigfieldQueryResult(responce UnionOpenGoodsBigfieldQueryResultResponse, result UnionOpenGoodsBigfieldQueryQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenGoodsBigfieldQueryResult { + return &UnionOpenGoodsBigfieldQueryResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenGoodsBigfieldQuery 商品详情查询接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.goods.bigfield.query +func (app *App) UnionOpenGoodsBigfieldQuery(notMustParams ...Params) *UnionOpenGoodsBigfieldQueryResult { + // 参数 + params := NewParamsWithType("jd.union.open.goods.bigfield.query", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenGoodsBigfieldQueryResultResponse + var result UnionOpenGoodsBigfieldQueryQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsBigfieldQueryResponce.QueryResult), &result) + return NewUnionOpenGoodsBigfieldQueryResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.goods.jingfen.query.go b/jd.union.open.goods.jingfen.query.go new file mode 100644 index 0000000..e409c93 --- /dev/null +++ b/jd.union.open.goods.jingfen.query.go @@ -0,0 +1,136 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenGoodsJIngFenQueryResultResponse struct { + JdUnionOpenGoodsJingfenQueryResponce struct { + Code string `json:"code"` + QueryResult string `json:"queryResult"` + } `json:"jd_union_open_goods_jingfen_query_responce"` +} + +type UnionOpenGoodsJIngFenQueryQueryResult struct { + Code int `json:"code"` + Data []struct { + BrandCode string `json:"brandCode"` + BrandName string `json:"brandName"` + CategoryInfo struct { + Cid1 int64 `json:"cid1"` + Cid1Name string `json:"cid1Name"` + Cid2 int `json:"cid2"` + Cid2Name string `json:"cid2Name"` + Cid3 int `json:"cid3"` + Cid3Name string `json:"cid3Name"` + } `json:"categoryInfo"` + Comments int `json:"comments"` + CommissionInfo struct { + Commission float64 `json:"commission"` + CommissionShare float64 `json:"commissionShare"` + CouponCommission float64 `json:"couponCommission"` + EndTime int64 `json:"endTime"` + IsLock int `json:"isLock"` + PlusCommissionShare float64 `json:"plusCommissionShare"` + StartTime int64 `json:"startTime"` + } `json:"commissionInfo"` + CouponInfo struct { + CouponList []struct { + BindType int `json:"bindType"` + Discount float64 `json:"discount"` + GetEndTime int64 `json:"getEndTime"` + GetStartTime int64 `json:"getStartTime"` + HotValue int `json:"hotValue,omitempty"` + IsBest int `json:"isBest"` + Link string `json:"link"` + PlatformType int `json:"platformType"` + Quota float64 `json:"quota"` + UseEndTime int64 `json:"useEndTime"` + UseStartTime int64 `json:"useStartTime"` + } `json:"couponList"` + } `json:"couponInfo"` + DeliveryType int `json:"deliveryType"` + ForbidTypes []int `json:"forbidTypes"` + GoodCommentsShare float64 `json:"goodCommentsShare"` + ImageInfo struct { + ImageList []struct { + Url string `json:"url"` + } `json:"imageList"` + WhiteImage string `json:"whiteImage,omitempty"` + } `json:"imageInfo"` + InOrderCount30Days int64 `json:"inOrderCount30Days"` + InOrderCount30DaysSku int `json:"inOrderCount30DaysSku"` + IsHot int `json:"isHot"` + JxFlags []int `json:"jxFlags,omitempty"` + MaterialUrl string `json:"materialUrl"` + Owner string `json:"owner"` + PinGouInfo struct { + PingouEndTime int64 `json:"pingouEndTime,omitempty"` + PingouPrice float64 `json:"pingouPrice,omitempty"` + PingouStartTime int64 `json:"pingouStartTime,omitempty"` + PingouTmCount int `json:"pingouTmCount,omitempty"` + PingouUrl string `json:"pingouUrl,omitempty"` + } `json:"pinGouInfo"` + PriceInfo struct { + HistoryPriceDay int `json:"historyPriceDay"` + LowestCouponPrice float64 `json:"lowestCouponPrice"` + LowestPrice float64 `json:"lowestPrice"` + LowestPriceType int `json:"lowestPriceType"` + Price float64 `json:"price"` + } `json:"priceInfo"` + ResourceInfo struct { + EliteId int `json:"eliteId"` + EliteName string `json:"eliteName"` + } `json:"resourceInfo"` + ShopInfo struct { + ShopId int64 `json:"shopId"` + ShopLabel string `json:"shopLabel"` + ShopLevel float64 `json:"shopLevel"` + ShopName string `json:"shopName"` + AfsFactorScoreRankGrade string `json:"afsFactorScoreRankGrade,omitempty"` + AfterServiceScore string `json:"afterServiceScore,omitempty"` + CommentFactorScoreRankGrade string `json:"commentFactorScoreRankGrade,omitempty"` + LogisticsFactorScoreRankGrade string `json:"logisticsFactorScoreRankGrade,omitempty"` + LogisticsLvyueScore string `json:"logisticsLvyueScore,omitempty"` + ScoreRankRate string `json:"scoreRankRate,omitempty"` + UserEvaluateScore string `json:"userEvaluateScore,omitempty"` + } `json:"shopInfo"` + SkuId int64 `json:"skuId"` + SkuLabelInfo struct { + FxgServiceList []interface{} `json:"fxgServiceList"` + Is7ToReturn int `json:"is7ToReturn"` + } `json:"skuLabelInfo"` + SkuName string `json:"skuName"` + Spuid int64 `json:"spuid"` + } `json:"data"` + Message string `json:"message"` + TotalCount int64 `json:"totalCount"` +} + +type UnionOpenGoodsJIngFenQueryResult struct { + Responce UnionOpenGoodsJIngFenQueryResultResponse // 结果 + Result UnionOpenGoodsJIngFenQueryQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenGoodsJIngFenQueryResult(responce UnionOpenGoodsJIngFenQueryResultResponse, result UnionOpenGoodsJIngFenQueryQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenGoodsJIngFenQueryResult { + return &UnionOpenGoodsJIngFenQueryResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenGoodsJIngFenQuery 京粉精选商品查询接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.goods.jingfen.query +func (app *App) UnionOpenGoodsJIngFenQuery(notMustParams ...Params) *UnionOpenGoodsJIngFenQueryResult { + // 参数 + params := NewParamsWithType("jd.union.open.goods.jingfen.query", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenGoodsJIngFenQueryResultResponse + var result UnionOpenGoodsJIngFenQueryQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsJingfenQueryResponce.QueryResult), &result) + return NewUnionOpenGoodsJIngFenQueryResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.goods.material.query.go b/jd.union.open.goods.material.query.go new file mode 100644 index 0000000..56a48be --- /dev/null +++ b/jd.union.open.goods.material.query.go @@ -0,0 +1,133 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenGoodsMaterialQueryResultResponse struct { + JdUnionOpenGoodsMaterialQueryResponce struct { + Code string `json:"code"` + QueryResult string `json:"queryResult"` + } `json:"jd_union_open_goods_material_query_responce"` +} + +type UnionOpenGoodsMaterialQueryQueryResult struct { + Code int `json:"code"` + Data []struct { + BrandCode string `json:"brandCode"` + BrandName string `json:"brandName"` + CategoryInfo struct { + Cid1 int `json:"cid1"` + Cid1Name string `json:"cid1Name"` + Cid2 int `json:"cid2"` + Cid2Name string `json:"cid2Name"` + Cid3 int `json:"cid3"` + Cid3Name string `json:"cid3Name"` + } `json:"categoryInfo"` + Comments int `json:"comments"` + CommissionInfo struct { + Commission float64 `json:"commission"` + CommissionShare float64 `json:"commissionShare"` + CouponCommission float64 `json:"couponCommission"` + PlusCommissionShare float64 `json:"plusCommissionShare"` + } `json:"commissionInfo"` + CouponInfo struct { + CouponList []struct { + BindType int `json:"bindType"` + Discount float64 `json:"discount"` + GetEndTime int64 `json:"getEndTime"` + GetStartTime int64 `json:"getStartTime"` + IsBest int `json:"isBest"` + Link string `json:"link"` + PlatformType int `json:"platformType"` + Quota float64 `json:"quota"` + UseEndTime int64 `json:"useEndTime"` + UseStartTime int64 `json:"useStartTime"` + } `json:"couponList"` + } `json:"couponInfo"` + DeliveryType int `json:"deliveryType"` + ForbidTypes []int `json:"forbidTypes"` + GoodCommentsShare float64 `json:"goodCommentsShare"` + ImageInfo struct { + ImageList []struct { + Url string `json:"url"` + } `json:"imageList"` + WhiteImage string `json:"whiteImage,omitempty"` + } `json:"imageInfo"` + InOrderCount30Days int `json:"inOrderCount30Days"` + InOrderCount30DaysSku int `json:"inOrderCount30DaysSku"` + IsHot int `json:"isHot"` + JxFlags []int `json:"jxFlags,omitempty"` + MaterialUrl string `json:"materialUrl"` + Owner string `json:"owner"` + PinGouInfo struct { + PingouEndTime int64 `json:"pingouEndTime,omitempty"` + PingouPrice float64 `json:"pingouPrice,omitempty"` + PingouStartTime int64 `json:"pingouStartTime,omitempty"` + PingouTmCount int `json:"pingouTmCount,omitempty"` + PingouUrl string `json:"pingouUrl,omitempty"` + } `json:"pinGouInfo"` + PriceInfo struct { + LowestCouponPrice float64 `json:"lowestCouponPrice"` + LowestPrice float64 `json:"lowestPrice"` + LowestPriceType int `json:"lowestPriceType"` + Price float64 `json:"price"` + } `json:"priceInfo"` + PromotionInfo struct { + ClickURL string `json:"clickURL"` + } `json:"promotionInfo"` + ResourceInfo struct { + EliteId int `json:"eliteId"` + EliteName string `json:"eliteName"` + } `json:"resourceInfo"` + ShopInfo struct { + ShopId int `json:"shopId"` + ShopLabel string `json:"shopLabel"` + ShopLevel float64 `json:"shopLevel"` + ShopName string `json:"shopName"` + AfsFactorScoreRankGrade string `json:"afsFactorScoreRankGrade,omitempty"` + AfterServiceScore string `json:"afterServiceScore,omitempty"` + CommentFactorScoreRankGrade string `json:"commentFactorScoreRankGrade,omitempty"` + LogisticsFactorScoreRankGrade string `json:"logisticsFactorScoreRankGrade,omitempty"` + LogisticsLvyueScore string `json:"logisticsLvyueScore,omitempty"` + ScoreRankRate string `json:"scoreRankRate,omitempty"` + UserEvaluateScore string `json:"userEvaluateScore,omitempty"` + } `json:"shopInfo"` + SkuId int64 `json:"skuId"` + SkuName string `json:"skuName"` + Spuid int64 `json:"spuid"` + VideoInfo struct { + } `json:"videoInfo"` + } `json:"data"` + Message string `json:"message"` + RequestId string `json:"requestId"` + TotalCount int `json:"totalCount"` +} + +type UnionOpenGoodsMaterialQueryResult struct { + Responce UnionOpenGoodsMaterialQueryResultResponse // 结果 + Result UnionOpenGoodsMaterialQueryQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenGoodsMaterialQueryResult(responce UnionOpenGoodsMaterialQueryResultResponse, result UnionOpenGoodsMaterialQueryQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenGoodsMaterialQueryResult { + return &UnionOpenGoodsMaterialQueryResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenGoodsMaterialQuery 猜你喜欢商品推荐 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.goods.material.query +func (app *App) UnionOpenGoodsMaterialQuery(notMustParams ...Params) *UnionOpenGoodsMaterialQueryResult { + // 参数 + params := NewParamsWithType("jd.union.open.goods.material.query", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenGoodsMaterialQueryResultResponse + var result UnionOpenGoodsMaterialQueryQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsMaterialQueryResponce.QueryResult), &result) + return NewUnionOpenGoodsMaterialQueryResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.goods.promotiongoodsinfo.query.go b/jd.union.open.goods.promotiongoodsinfo.query.go new file mode 100644 index 0000000..5201e77 --- /dev/null +++ b/jd.union.open.goods.promotiongoodsinfo.query.go @@ -0,0 +1,71 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenGoodsPromotionGoodsInfoQueryResultResponse struct { + JdUnionOpenGoodsPromotiongoodsinfoQueryResponce struct { + Code string `json:"code"` + QueryResult string `json:"queryResult"` + } `json:"jd_union_open_goods_promotiongoodsinfo_query_responce"` +} + +type UnionOpenGoodsPromotionGoodsInfoQueryQueryResult struct { + Code int `json:"code"` + Data []struct { + UnitPrice float64 `json:"unitPrice"` + MaterialUrl string `json:"materialUrl"` + EndDate int64 `json:"endDate"` + IsFreeFreightRisk int `json:"isFreeFreightRisk"` + IsFreeShipping int `json:"isFreeShipping"` + CommisionRatioWl float64 `json:"commisionRatioWl"` + CommisionRatioPc float64 `json:"commisionRatioPc"` + ImgUrl string `json:"imgUrl"` + Vid int `json:"vid"` + CidName string `json:"cidName"` + WlUnitPrice float64 `json:"wlUnitPrice"` + Cid2Name string `json:"cid2Name"` + IsSeckill int `json:"isSeckill"` + Cid2 int `json:"cid2"` + Cid3Name string `json:"cid3Name"` + Unt int `json:"unt"` + Cid3 int `json:"cid3"` + ShopId int `json:"shopId"` + IsJdSale int `json:"isJdSale"` + GoodsName string `json:"goodsName"` + SkuId int64 `json:"skuId"` + StartDate int64 `json:"startDate"` + Cid int64 `json:"cid"` + } `json:"data"` + Message string `json:"message"` + RequestId string `json:"requestId"` +} + +type UnionOpenGoodsPromotionGoodsInfoQueryResult struct { + Responce UnionOpenGoodsPromotionGoodsInfoQueryResultResponse // 结果 + Result UnionOpenGoodsPromotionGoodsInfoQueryQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenGoodsPromotionGoodsInfoQueryResult(responce UnionOpenGoodsPromotionGoodsInfoQueryResultResponse, result UnionOpenGoodsPromotionGoodsInfoQueryQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenGoodsPromotionGoodsInfoQueryResult { + return &UnionOpenGoodsPromotionGoodsInfoQueryResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenGoodsPromotionGoodsInfoQuery 根据skuid查询商品信息接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.goods.promotiongoodsinfo.query +func (app *App) UnionOpenGoodsPromotionGoodsInfoQuery(notMustParams ...Params) *UnionOpenGoodsPromotionGoodsInfoQueryResult { + // 参数 + params := NewParamsWithType("jd.union.open.goods.promotiongoodsinfo.query", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenGoodsPromotionGoodsInfoQueryResultResponse + var result UnionOpenGoodsPromotionGoodsInfoQueryQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenGoodsPromotiongoodsinfoQueryResponce.QueryResult), &result) + return NewUnionOpenGoodsPromotionGoodsInfoQueryResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.order.query.go b/jd.union.open.order.query.go new file mode 100644 index 0000000..10e0550 --- /dev/null +++ b/jd.union.open.order.query.go @@ -0,0 +1,96 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenOrderQueryResultResponse struct { + JdUnionOpenOrderQueryResponce struct { + Code string `json:"code"` + QueryResult string `json:"queryResult"` + } `json:"jd_union_open_order_query_responce"` +} + +type UnionOpenOrderQueryQueryResult struct { + Code int `json:"code"` + Data []struct { + Ext1 string `json:"ext1"` + FinishTime int64 `json:"finishTime"` + OrderEmt int `json:"orderEmt"` + OrderId int64 `json:"orderId"` + OrderTime int64 `json:"orderTime"` + ParentId int `json:"parentId"` + PayMonth int `json:"payMonth"` + Plus int `json:"plus"` + PopId int `json:"popId"` + SkuList []struct { + ActualCosPrice float64 `json:"actualCosPrice"` + ActualFee float64 `json:"actualFee"` + Cid1 int `json:"cid1"` + Cid2 int `json:"cid2"` + Cid3 int `json:"cid3"` + CommissionRate float64 `json:"commissionRate"` + CpActId int `json:"cpActId"` + EstimateCosPrice float64 `json:"estimateCosPrice"` + EstimateFee float64 `json:"estimateFee"` + Ext1 string `json:"ext1"` + FinalRate float64 `json:"finalRate"` + FrozenSkuNum int `json:"frozenSkuNum"` + GiftCouponKey string `json:"giftCouponKey"` + GiftCouponOcsAmount float64 `json:"giftCouponOcsAmount"` + PayMonth int `json:"payMonth"` + Pid string `json:"pid"` + PopId int `json:"popId"` + PositionId int `json:"positionId"` + Price float64 `json:"price"` + ProPriceAmount float64 `json:"proPriceAmount"` + SiteId int `json:"siteId"` + SkuId int64 `json:"skuId"` + SkuName string `json:"skuName"` + SkuNum int `json:"skuNum"` + SkuReturnNum int `json:"skuReturnNum"` + SubSideRate float64 `json:"subSideRate"` + SubUnionId string `json:"subUnionId"` + SubsidyRate float64 `json:"subsidyRate"` + TraceType int `json:"traceType"` + UnionAlias string `json:"unionAlias"` + UnionRole int `json:"unionRole"` + UnionTag string `json:"unionTag"` + UnionTrafficGroup int `json:"unionTrafficGroup"` + ValidCode int `json:"validCode"` + } `json:"skuList"` + UnionId int `json:"unionId"` + ValidCode int `json:"validCode"` + } `json:"data"` + HasMore bool `json:"hasMore"` + Message string `json:"message"` + RequestId string `json:"requestId"` +} + +type UnionOpenOrderQueryResult struct { + Responce UnionOpenOrderQueryResultResponse // 结果 + Result UnionOpenOrderQueryQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenOrderQueryResult(responce UnionOpenOrderQueryResultResponse, result UnionOpenOrderQueryQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenOrderQueryResult { + return &UnionOpenOrderQueryResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenOrderQuery 订单查询接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.order.query +func (app *App) UnionOpenOrderQuery(notMustParams ...Params) *UnionOpenOrderQueryResult { + // 参数 + params := NewParamsWithType("jd.union.open.order.query", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenOrderQueryResultResponse + var result UnionOpenOrderQueryQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenOrderQueryResponce.QueryResult), &result) + return NewUnionOpenOrderQueryResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.order.row.query.go b/jd.union.open.order.row.query.go new file mode 100644 index 0000000..bdf9853 --- /dev/null +++ b/jd.union.open.order.row.query.go @@ -0,0 +1,105 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenOrderRowQueryResultResponse struct { + JdUnionOpenOrderRowQueryResponce struct { + Code string `json:"code"` + QueryResult string `json:"queryResult"` + } `json:"jd_union_open_order_row_query_responce"` +} + +type UnionOpenOrderRowQueryQueryResult struct { + Code int `json:"code"` + Data []struct { + ActualCosPrice float64 `json:"actualCosPrice"` + ActualFee float64 `json:"actualFee"` + BalanceExt string `json:"balanceExt"` + CategoryInfo struct { + Cid1 int `json:"cid1"` + Cid2 int `json:"cid2"` + Cid3 int `json:"cid3"` + } `json:"categoryInfo"` + ChannelId int `json:"channelId"` + Cid1 int `json:"cid1"` + Cid2 int `json:"cid2"` + Cid3 int `json:"cid3"` + CommissionRate float64 `json:"commissionRate"` + CpActId int `json:"cpActId"` + EstimateCosPrice float64 `json:"estimateCosPrice"` + EstimateFee float64 `json:"estimateFee"` + ExpressStatus int `json:"expressStatus"` + Ext1 string `json:"ext1"` + FinalRate float64 `json:"finalRate"` + FinishTime string `json:"finishTime"` + GiftCouponKey string `json:"giftCouponKey"` + GiftCouponOcsAmount float64 `json:"giftCouponOcsAmount"` + GoodsInfo struct { + MainSkuId int `json:"mainSkuId"` + ProductId int `json:"productId"` + ShopId int `json:"shopId"` + } `json:"goodsInfo"` + Id string `json:"id"` + ModifyTime string `json:"modifyTime"` + OrderEmt int `json:"orderEmt"` + OrderId int64 `json:"orderId"` + OrderTime string `json:"orderTime"` + ParentId int `json:"parentId"` + PayMonth int `json:"payMonth"` + Pid string `json:"pid"` + Plus int `json:"plus"` + PopId int `json:"popId"` + PositionId int `json:"positionId"` + Price float64 `json:"price"` + ProPriceAmount float64 `json:"proPriceAmount"` + Rid int `json:"rid"` + SiteId int `json:"siteId"` + SkuFrozenNum int `json:"skuFrozenNum"` + SkuId int64 `json:"skuId"` + SkuName string `json:"skuName"` + SkuNum int `json:"skuNum"` + SkuReturnNum int `json:"skuReturnNum"` + SubSideRate float64 `json:"subSideRate"` + SubUnionId string `json:"subUnionId"` + SubsidyRate float64 `json:"subsidyRate"` + TraceType int `json:"traceType"` + UnionAlias string `json:"unionAlias"` + UnionId int `json:"unionId"` + UnionRole int `json:"unionRole"` + UnionTag string `json:"unionTag"` + ValidCode int `json:"validCode"` + } `json:"data"` + HasMore bool `json:"hasMore"` + Message string `json:"message"` + RequestId string `json:"requestId"` +} + +type UnionOpenOrderRowQueryResult struct { + Responce UnionOpenOrderRowQueryResultResponse // 结果 + Result UnionOpenOrderRowQueryQueryResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenOrderRowQueryResult(responce UnionOpenOrderRowQueryResultResponse, result UnionOpenOrderRowQueryQueryResult, body []byte, http gorequest.Response, err error) *UnionOpenOrderRowQueryResult { + return &UnionOpenOrderRowQueryResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenOrderRowQuery 订单行查询接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.order.row.query +func (app *App) UnionOpenOrderRowQuery(notMustParams ...Params) *UnionOpenOrderRowQueryResult { + // 参数 + params := NewParamsWithType("jd.union.open.order.row.query", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenOrderRowQueryResultResponse + var result UnionOpenOrderRowQueryQueryResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenOrderRowQueryResponce.QueryResult), &result) + return NewUnionOpenOrderRowQueryResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.promotion.bysubunionid.get.go b/jd.union.open.promotion.bysubunionid.get.go new file mode 100644 index 0000000..4a09954 --- /dev/null +++ b/jd.union.open.promotion.bysubunionid.get.go @@ -0,0 +1,50 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenPromotionBySubUnionIdGetResultResponse struct { + JdUnionOpenPromotionBySubUnionIdGetResponce struct { + Code string `json:"code"` + GetResult string `json:"getResult"` + } `json:"jd_union_open_promotion_common_get_responce"` +} + +type UnionOpenPromotionBySubUnionIdGetGetResult struct { + Code int `json:"code"` + Data struct { + ClickURL string `json:"clickURL"` + JCommand string `json:"jCommand"` + } `json:"data"` + Message string `json:"message"` + RequestId string `json:"requestId"` +} + +type UnionOpenPromotionBySubUnionIdGetResult struct { + Responce UnionOpenPromotionBySubUnionIdGetResultResponse // 结果 + Result UnionOpenPromotionBySubUnionIdGetGetResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenPromotionBySubUnionIdGetResult(responce UnionOpenPromotionBySubUnionIdGetResultResponse, result UnionOpenPromotionBySubUnionIdGetGetResult, body []byte, http gorequest.Response, err error) *UnionOpenPromotionBySubUnionIdGetResult { + return &UnionOpenPromotionBySubUnionIdGetResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenPromotionBySubUnionIdGet 社交媒体获取推广链接接口【申请】 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.promotion.bysubunionid.get +func (app *App) UnionOpenPromotionBySubUnionIdGet(notMustParams ...Params) *UnionOpenPromotionBySubUnionIdGetResult { + // 参数 + params := NewParamsWithType("jd.union.open.promotion.bysubunionid.get", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenPromotionBySubUnionIdGetResultResponse + var result UnionOpenPromotionBySubUnionIdGetGetResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenPromotionBySubUnionIdGetResponce.GetResult), &result) + return NewUnionOpenPromotionBySubUnionIdGetResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.promotion.common.get.go b/jd.union.open.promotion.common.get.go new file mode 100644 index 0000000..5ff5429 --- /dev/null +++ b/jd.union.open.promotion.common.get.go @@ -0,0 +1,50 @@ +package jd + +import ( + "encoding/json" + "go.dtapp.net/gorequest" +) + +type UnionOpenPromotionCommonGetResultResponse struct { + JdUnionOpenPromotionCommonGetResponce struct { + Code string `json:"code"` + GetResult string `json:"getResult"` + } `json:"jd_union_open_promotion_common_get_responce"` +} + +type UnionOpenPromotionCommonGetGetResult struct { + Code int `json:"code"` + Data struct { + ClickURL string `json:"clickURL"` + JCommand string `json:"jCommand"` + } `json:"data"` + Message string `json:"message"` + RequestId string `json:"requestId"` +} + +type UnionOpenPromotionCommonGetResult struct { + Responce UnionOpenPromotionCommonGetResultResponse // 结果 + Result UnionOpenPromotionCommonGetGetResult // 结果 + Body []byte // 内容 + Http gorequest.Response // 请求 + Err error // 错误 +} + +func NewUnionOpenPromotionCommonGetResult(responce UnionOpenPromotionCommonGetResultResponse, result UnionOpenPromotionCommonGetGetResult, body []byte, http gorequest.Response, err error) *UnionOpenPromotionCommonGetResult { + return &UnionOpenPromotionCommonGetResult{Responce: responce, Result: result, Body: body, Http: http, Err: err} +} + +// UnionOpenPromotionCommonGet 网站/APP获取推广链接接口 +// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.promotion.common.get +func (app *App) UnionOpenPromotionCommonGet(notMustParams ...Params) *UnionOpenPromotionCommonGetResult { + // 参数 + params := NewParamsWithType("jd.union.open.promotion.common.get", notMustParams...) + // 请求 + request, err := app.request(params) + // 定义 + var responce UnionOpenPromotionCommonGetResultResponse + var result UnionOpenPromotionCommonGetGetResult + err = json.Unmarshal(request.ResponseBody, &responce) + err = json.Unmarshal([]byte(responce.JdUnionOpenPromotionCommonGetResponce.GetResult), &result) + return NewUnionOpenPromotionCommonGetResult(responce, result, request.ResponseBody, request, err) +} diff --git a/jd.union.open.selling.goods.query.go b/jd.union.open.selling.goods.query.go new file mode 100644 index 0000000..fdd9350 --- /dev/null +++ b/jd.union.open.selling.goods.query.go @@ -0,0 +1 @@ +package jd diff --git a/jd.union.open.selling.order.row.query.go b/jd.union.open.selling.order.row.query.go new file mode 100644 index 0000000..fdd9350 --- /dev/null +++ b/jd.union.open.selling.order.row.query.go @@ -0,0 +1 @@ +package jd diff --git a/jd.union.open.selling.promotion.get.go b/jd.union.open.selling.promotion.get.go new file mode 100644 index 0000000..fdd9350 --- /dev/null +++ b/jd.union.open.selling.promotion.get.go @@ -0,0 +1 @@ +package jd diff --git a/jd.union.open.statistics.giftcoupon.query.go b/jd.union.open.statistics.giftcoupon.query.go new file mode 100644 index 0000000..fdd9350 --- /dev/null +++ b/jd.union.open.statistics.giftcoupon.query.go @@ -0,0 +1 @@ +package jd diff --git a/jd.union.open.statistics.redpacket.query.go b/jd.union.open.statistics.redpacket.query.go new file mode 100644 index 0000000..fdd9350 --- /dev/null +++ b/jd.union.open.statistics.redpacket.query.go @@ -0,0 +1 @@ +package jd diff --git a/params.go b/params.go new file mode 100644 index 0000000..2b34b57 --- /dev/null +++ b/params.go @@ -0,0 +1,97 @@ +package jd + +import ( + "encoding/json" + "net/url" + "sort" + "strconv" + "time" +) + +// Params 请求参数 +type Params map[string]interface{} + +func NewParams() Params { + p := make(Params) + return p +} + +func NewParamsWith(params ...Params) Params { + p := make(Params) + for _, v := range params { + p.SetParams(v) + } + return p +} + +func NewParamsWithType(_method string, params ...Params) Params { + p := make(Params) + p["method"] = _method + hh, _ := time.ParseDuration("8h") + loc := time.Now().UTC().Add(hh) + p["timestamp"] = loc.Format("2006-01-02 15:04:05") + p["format"] = "json" + p["v"] = "1.0" + p["sign_method"] = "md5" + for _, v := range params { + p.SetParams(v) + } + return p +} + +func (app *App) Sign(p Params) { + p["app_key"] = app.appKey + // 排序所有的 key + var keys []string + for key := range p { + keys = append(keys, key) + } + sort.Strings(keys) + signStr := app.secretKey + for _, key := range keys { + signStr += key + getString(p[key]) + } + signStr += app.secretKey + p["sign"] = createSign(signStr) +} + +func (p Params) Set(key string, value interface{}) { + p[key] = value +} + +func (p Params) SetParams(params Params) { + for key, value := range params { + p[key] = value + } +} + +func (p Params) SetCustomParameters(uid string, sid string) { + p["custom_parameters"] = map[string]interface{}{ + "uid": uid, + "sid": sid, + } +} + +func (p Params) GetQuery() string { + u := url.Values{} + for k, v := range p { + u.Set(k, getString(v)) + } + return u.Encode() +} + +func getString(i interface{}) string { + switch v := i.(type) { + case string: + return v + case []byte: + return string(v) + case int: + return strconv.Itoa(v) + case bool: + return strconv.FormatBool(v) + default: + bytes, _ := json.Marshal(v) + return string(bytes) + } +} diff --git a/pgsql.go b/pgsql.go new file mode 100644 index 0000000..796868c --- /dev/null +++ b/pgsql.go @@ -0,0 +1,26 @@ +package jd + +import ( + "go.dtapp.net/gojson" + "go.dtapp.net/golog" + "go.dtapp.net/gorequest" + "gorm.io/datatypes" +) + +// 记录日志 +func (app *App) postgresqlLog(api string, request gorequest.Response) { + app.log.Record(golog.ApiPostgresqlLog{ + RequestTime: golog.TimeString{Time: request.RequestTime}, //【请求】时间 + RequestUri: request.RequestUri, //【请求】链接 + RequestUrl: gorequest.UriParse(request.RequestUri).Url, //【请求】链接 + RequestApi: api, //【请求】接口 + RequestMethod: request.RequestMethod, //【请求】方式 + RequestParams: datatypes.JSON(gojson.JsonEncodeNoError(request.RequestParams)), //【请求】参数 + RequestHeader: datatypes.JSON(gojson.JsonEncodeNoError(request.RequestHeader)), //【返回】头部 + ResponseHeader: datatypes.JSON(gojson.JsonEncodeNoError(request.ResponseHeader)), //【返回】头部 + ResponseStatusCode: request.ResponseStatusCode, //【返回】状态码 + ResponseBody: request.ResponseBody, //【返回】内容 + ResponseContentLength: request.ResponseContentLength, //【返回】大小 + ResponseTime: golog.TimeString{Time: request.ResponseTime}, //【返回】时间 + }) +} diff --git a/version.go b/version.go new file mode 100644 index 0000000..cd091e3 --- /dev/null +++ b/version.go @@ -0,0 +1,3 @@ +package jd + +const Version = "1.0.0"