From 55e5ff47599b0f3f0a34901e7e83f0c1ff793ad8 Mon Sep 17 00:00:00 2001 From: duancheng Date: Wed, 6 Nov 2024 15:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/common.go | 3 + config.yaml | 2 +- log/2024-11-05.log | 12 ---- log/2024-11-06.log | 41 +++++++++++++ log/sqlLog/2024-11-04.log | 31 ---------- log/sqlLog/2024-11-05.log | 7 --- log/sqlLog/2024-11-06.log | 122 ++++++++++++++++++++++++++++++++++++++ main.go | 3 +- repo/pay_order.go | 4 +- service/mqtt.go | 80 ++++++++++++------------- service/pay.go | 16 ++--- service/po/dict.go | 23 +++++++ service/po/district.go | 22 +++++++ service/po/pay_order.go | 23 ++++--- service/vo/mqtt.go | 5 +- service/ysepay.go | 45 +++++++++++--- 16 files changed, 311 insertions(+), 128 deletions(-) create mode 100644 common/common.go delete mode 100644 log/2024-11-05.log create mode 100644 log/2024-11-06.log delete mode 100644 log/sqlLog/2024-11-04.log delete mode 100644 log/sqlLog/2024-11-05.log create mode 100644 log/sqlLog/2024-11-06.log create mode 100644 service/po/dict.go create mode 100644 service/po/district.go diff --git a/common/common.go b/common/common.go new file mode 100644 index 0000000..ad7b334 --- /dev/null +++ b/common/common.go @@ -0,0 +1,3 @@ +package common + +var Layout = "2006-01-02 15:04:05" diff --git a/config.yaml b/config.yaml index 176bbf8..580459f 100644 --- a/config.yaml +++ b/config.yaml @@ -23,7 +23,7 @@ ysepay: CERTID: "826452972730006" MQTT: topic: "pay" - ip: "101.200.88.58" + ip: "101.200.127.15" #测试环境IP port: 1883 user: "yuledui" passwd: "yuledui" \ No newline at end of file diff --git a/log/2024-11-05.log b/log/2024-11-05.log deleted file mode 100644 index 031e36d..0000000 --- a/log/2024-11-05.log +++ /dev/null @@ -1,12 +0,0 @@ -2024-11-05 08:48:34.467 {4cf78ff910ec0418c94d0c59368b82be} main.go:31: 初始化成功 -2024-11-05 08:52:00.651 {d8d007fb40ec04185998a93c02952ba0} main.go:31: 初始化成功 -2024-11-05 08:52:29.385 main.go:18: 初始化成功 -2024-11-05 09:42:18.488 main.go:18: 初始化成功 -2024-11-05 15:21:03.977 main.go:18: 初始化成功 -2024-11-05 16:09:55.574 main.go:18: 初始化成功 -2024-11-05 16:55:56.689 main.go:20: 初始化成功 -2024-11-05 17:01:39.141 main.go:20: 初始化成功 -2024-11-05 17:26:42.774 mqtt.go:49: no servers defined to connect to -2024-11-05 17:26:42.774 main.go:26: 初始化成功 -2024-11-05 17:34:28.482 mqtt.go:49: no servers defined to connect to -2024-11-05 17:34:28.482 main.go:26: 初始化成功 diff --git a/log/2024-11-06.log b/log/2024-11-06.log new file mode 100644 index 0000000..42c972f --- /dev/null +++ b/log/2024-11-06.log @@ -0,0 +1,41 @@ +2024-11-06 10:49:02.779 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 10:49:02.812 main.go:25: 初始化成功 +2024-11-06 10:49:19.872 pay.go:31: {POST /wxApi/payQrCode HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[172] Content-Type:[application/json] Postman-Token:[3afbb558-9808-41f2-b06d-c3a07b0c8323] User-Agent:[PostmanRuntime/7.42.0]] 0xc0001da180 172 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:53564 /wxApi/payQrCode 0xc0005b8780 [] map[]} +2024-11-06 10:49:19.873 pay.go:38: {ShopId:ccccwsdfwefwefwef Price:65.3 Amount:65.2 Bean:0.1 OpenId:aaaaaaaaaaaaaaaaabbbbbbbb Mobile:15963264270} +2024-11-06 10:49:20.014 200 /wxApi/payQrCode sql: no rows in result set +2024-11-06 11:19:09.423 pay.go:31: {POST /wxApi/payQrCode HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[165] Content-Type:[application/json] Postman-Token:[f96dc232-7ca4-442f-a6b9-3ecafa3961e5] User-Agent:[PostmanRuntime/7.42.0]] 0xc0001da140 165 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:53942 /wxApi/payQrCode 0xc0002ac300 [] map[]} +2024-11-06 11:19:09.423 pay.go:38: {ShopId:aaaaaaaaaa Price:65.3 Amount:65.2 Bean:0.1 OpenId:aaaaaaaaaaaaaaaaabbbbbbbb Mobile:15963264270} +2024-11-06 11:19:09.565 200 /wxApi/payQrCode INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0f6k0d5ers1qw07vg200sxh8e7',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','aaaaaaaaaa','2024-11-06 11:19:09','2024-11-06 11:19:09') RETURNING "orderId": pq: null value in column "ysePayStatus" of relation "pay_order" violates not-null constraint +2024-11-06 11:19:59.111 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 11:19:59.139 main.go:25: 初始化成功 +2024-11-06 11:20:04.080 pay.go:31: {POST /wxApi/payQrCode HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[165] Content-Type:[application/json] Postman-Token:[c7ccfd37-7354-4590-bcb7-a8ac2b31f1a7] User-Agent:[PostmanRuntime/7.42.0]] 0xc000105100 165 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:53965 /wxApi/payQrCode 0xc000264630 [] map[]} +2024-11-06 11:20:07.651 pay.go:38: {ShopId:aaaaaaaaaa Price:65.3 Amount:65.2 Bean:0.1 OpenId:aaaaaaaaaaaaaaaaabbbbbbbb Mobile:15963264270} +2024-11-06 11:24:43.455 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 11:24:43.488 main.go:25: 初始化成功 +2024-11-06 11:24:59.094 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 11:24:59.129 main.go:25: 初始化成功 +2024-11-06 11:25:01.860 pay.go:31: {POST /wxApi/payQrCode HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[165] Content-Type:[application/json] Postman-Token:[7e79b932-e1cb-400e-8f83-9864b4f5aeac] User-Agent:[PostmanRuntime/7.42.0]] 0xc0001d2280 165 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:54024 /wxApi/payQrCode 0xc0001cf050 [] map[]} +2024-11-06 11:25:03.841 pay.go:38: {ShopId:aaaaaaaaaa Price:65.3 Amount:65.2 Bean:0.1 OpenId:aaaaaaaaaaaaaaaaabbbbbbbb Mobile:15963264270} +2024-11-06 11:25:28.724 200 /wxApi/payQrCode unexpected end of JSON input +2024-11-06 11:26:22.403 ysepay.go:22: {POST /ysePay/notifyWxPay HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[211] Content-Type:[application/json] Postman-Token:[898c5cac-78ed-482c-9bb9-e446fe9f3543] User-Agent:[PostmanRuntime/7.42.0]] 0xc00007d2c0 211 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:54040 /ysePay/notifyWxPay 0xc0001cfb90 [] map[]} +2024-11-06 11:32:22.797 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 11:32:22.828 main.go:25: 初始化成功 +2024-11-06 11:32:44.567 ysepay.go:22: {POST /ysePay/notifyWxPay HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[211] Content-Type:[application/json] Postman-Token:[2500771c-f91a-4184-8f0b-3ab008c54eed] User-Agent:[PostmanRuntime/7.42.0]] 0xc0001da5c0 211 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:54118 /ysePay/notifyWxPay 0xc000030690 [] map[]} +2024-11-06 11:32:44.693 200 /ysePay/notifyWxPay SELECT "order_id","price","amount","bean","open_id","mobile","shop_id","created","updated","ysepay_status" FROM "pay_order" WHERE orderId = 'pyacyq08u00d5erwl40rvgk200i0fyaq' LIMIT 1: pq: column "orderid" does not exist +2024-11-06 11:33:07.822 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 11:33:07.855 main.go:25: 初始化成功 +2024-11-06 11:33:14.488 ysepay.go:22: {POST /ysePay/notifyWxPay HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[211] Content-Type:[application/json] Postman-Token:[700622f3-b3c9-462b-a0b8-3622cd196fff] User-Agent:[PostmanRuntime/7.42.0]] 0xc00007d100 211 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:54134 /ysePay/notifyWxPay 0xc000111ce0 [] map[]} +2024-11-06 11:34:27.699 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 11:34:27.737 main.go:25: 初始化成功 +2024-11-06 11:34:32.619 ysepay.go:22: {POST /ysePay/notifyWxPay HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[211] Content-Type:[application/json] Postman-Token:[a0399e86-c7cd-4aaf-844e-dcba9d00c0a1] User-Agent:[PostmanRuntime/7.42.0]] 0xc00009a5c0 211 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:54149 /ysePay/notifyWxPay 0xc000258b70 [] map[]} +2024-11-06 11:35:02.646 200 /ysePay/notifyWxPay parsing time "2024-04-5 15:32:39" as "2006-01-02 15:04:05": cannot parse "5 15:32:39" as "02" +2024-11-06 11:35:06.831 ysepay.go:22: {POST /ysePay/notifyWxPay HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[212] Content-Type:[application/json] Postman-Token:[fddf4aed-ed24-4509-bdf7-50f3a436ef22] User-Agent:[PostmanRuntime/7.42.0]] 0xc0001d25c0 212 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:54149 /ysePay/notifyWxPay 0xc000258c90 [] map[]} +2024-11-06 11:35:55.810 200 /ysePay/notifyWxPay +2024-11-06 11:37:08.778 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 11:37:08.818 main.go:25: 初始化成功 +2024-11-06 11:37:18.545 ysepay.go:22: {POST /ysePay/notifyWxPay HTTP/1.1 1 1 map[Accept:[*/*] Accept-Encoding:[gzip, deflate, br] Connection:[keep-alive] Content-Length:[212] Content-Type:[application/json] Postman-Token:[6bfe39fd-34bb-45bf-9c62-8339f8b38de3] User-Agent:[PostmanRuntime/7.42.0]] 0xc0001d22c0 212 [] false 127.0.0.1:8080 map[] map[] map[] 127.0.0.1:54181 /ysePay/notifyWxPay 0xc0000a5470 [] map[]} +2024-11-06 11:37:36.129 200 /ysePay/notifyWxPay +2024-11-06 15:15:21.888 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 15:15:21.923 main.go:25: 初始化成功 +2024-11-06 15:15:28.377 mqtt.go:31: MQTT连接地址: mqtt://101.200.127.15:1883 +2024-11-06 15:15:28.410 main.go:25: 初始化成功 diff --git a/log/sqlLog/2024-11-04.log b/log/sqlLog/2024-11-04.log deleted file mode 100644 index c6e8486..0000000 --- a/log/sqlLog/2024-11-04.log +++ /dev/null @@ -1,31 +0,0 @@ -2024-11-04 16:05:15.154 [DEBU] {64b7c1b450b5041821e3ff1223397e38} [103 ms] [default] [test] [rows:0 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:05:15.173 [ERRO] {988cfdba50b5041822e3ff126c4a2ee6} [ 17 ms] [default] [test] [rows:0 ] SELECT * FROM "pay_order" WHERE orderid = 2 -Error: pq: relation "pay_order" does not exist -Stack: -1. yuleduiPay/service.(*Pay).PayQrCode - C:/Users/Administrator/Desktop/Code/yuleduiPay/service/pay.go:51 -2. yuleduiPay/middle.MiddlewareCORS - C:/Users/Administrator/Desktop/Code/yuleduiPay/middle/middle.go:7 - -2024-11-04 16:05:44.141 [DEBU] {048d897557b5041818db8b7667b34ea7} [ 87 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:05:44.156 [ERRO] {b809ae7a57b5041819db8b76ec30a2be} [ 14 ms] [default] [yuledui] [rows:0 ] SELECT * FROM "pay_order" WHERE orderid = 2 -Error: pq: column "orderid" does not exist -Stack: -1. yuleduiPay/service.(*Pay).PayQrCode - C:/Users/Administrator/Desktop/Code/yuleduiPay/service/pay.go:51 -2. yuleduiPay/middle.MiddlewareCORS - C:/Users/Administrator/Desktop/Code/yuleduiPay/middle/middle.go:7 - -2024-11-04 16:12:03.361 [DEBU] {7c63e7c0afb5041867655f5b4aea7818} [ 84 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:12:03.391 [DEBU] {a493fdc5afb5041868655f5b11dd1295} [ 29 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0hrw0d5d8r7ssp2ao10069gcnf',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','ccccwsdfwefwefwef','2024-11-04 16:12:03','2024-11-04 16:12:03') RETURNING "orderId" -2024-11-04 16:29:09.295 [DEBU] {74d94b9f9eb6041893c9603f4874f219} [ 85 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:29:09.327 [DEBU] {88da9aa49eb6041894c9603ff239cd00} [ 28 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0akg0d5d947s5kla0100d16lio',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','ccccwsdfwefwefwef','2024-11-04 16:29:01','2024-11-04 16:29:01') RETURNING "orderId" -2024-11-04 16:29:52.957 [DEBU] {bce0bdc9a8b6041896c9603ffb731790} [ 85 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0akg0d5d94tuhxjx0200lurlnt',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','ccccwsdfwefwefwef','2024-11-04 16:29:50','2024-11-04 16:29:50') RETURNING "orderId" -2024-11-04 16:30:54.940 [DEBU] {d07fd937b7b604181d9e4d653a5797dd} [ 91 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:30:54.972 [DEBU] {b8d6583db7b604181e9e4d656f104bed} [ 31 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0cfw0d5d95m4jwqac1000wq5ea',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','ccccwsdfwefwefwef','2024-11-04 16:30:51','2024-11-04 16:30:51') RETURNING "orderId" -2024-11-04 16:35:49.311 [DEBU] {a02c15c2fbb60418d3785163710dec0f} [ 85 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:35:49.334 [DEBU] {d4422fc7fbb60418d4785163f713427d} [ 23 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0i2c0d5d99dp6usko100d2t9us',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','ccccwsdfwefwefwef','2024-11-04 16:35:46','2024-11-04 16:35:46') RETURNING "orderId" -2024-11-04 16:56:37.136 [DEBU] {24f94b491eb80418c0a3bf749f672c2b} [101 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:56:37.173 [DEBU] {88e6584f1eb80418c1a3bf74ba11171e} [ 37 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0x400d5d9pc3v1wco1000o37tg',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','ccccwsdfwefwefwef','2024-11-04 16:56:37','2024-11-04 16:56:37') RETURNING "orderId" -2024-11-04 16:57:54.227 [DEBU] {0c4a213d30b8041830267b7d0c54718b} [ 87 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-04 16:57:54.256 [DEBU] {94a7634230b8041831267b7d9a93dcb4} [ 28 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0d3g0d5d9qbj1y4uk1001qdhxs',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','ccccwsdfwefwefwef','2024-11-04 16:57:54','2024-11-04 16:57:54') RETURNING "orderId" diff --git a/log/sqlLog/2024-11-05.log b/log/sqlLog/2024-11-05.log deleted file mode 100644 index b1997a3..0000000 --- a/log/sqlLog/2024-11-05.log +++ /dev/null @@ -1,7 +0,0 @@ -2024-11-05 09:30:49.100 [DEBU] {78fdd4185fee04183edff833322ba4a3} [ 77 ms] [default] [yuledui] [rows:1 ] SELECT version(); -2024-11-05 09:30:49.115 [DEBU] {28b57c1d5fee04183fdff8338ad848b0} [ 14 ms] [default] [yuledui] [rows:5 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname -2024-11-05 09:30:49.142 [DEBU] {64cfe5175fee04183ddff833cddfc354} [ 26 ms] [default] [yuledui] [rows:30 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'account' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-05 09:30:49.182 [DEBU] {64cfe5175fee04183ddff833cddfc354} [ 21 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-05 09:30:49.221 [DEBU] {64cfe5175fee04183ddff833cddfc354} [ 19 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'promoter' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-05 09:30:49.259 [DEBU] {64cfe5175fee04183ddff833cddfc354} [ 20 ms] [default] [yuledui] [rows:18 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum -2024-11-05 09:30:49.299 [DEBU] {64cfe5175fee04183ddff833cddfc354} [ 19 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop_admin' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum diff --git a/log/sqlLog/2024-11-06.log b/log/sqlLog/2024-11-06.log new file mode 100644 index 0000000..6cafb0f --- /dev/null +++ b/log/sqlLog/2024-11-06.log @@ -0,0 +1,122 @@ +2024-11-06 10:49:19.944 [DEBU] {6866d17e3c41051841328f3831a21cdc} [ 69 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 10:49:19.959 [DEBU] {903102833c41051842328f387c8f2407} [ 14 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 10:49:19.986 [DEBU] {54b4ec833c41051843328f388155e10c} [ 26 ms] [default] [yuledui] [rows:18 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 10:49:20.014 [DEBU] {ec3482853c41051844328f38368be513} [ 27 ms] [default] [yuledui] [rows:0 ] SELECT "shop_id","promoter_id","account_number","child_account_number","contact_name","tel","shop_name","address","door_photo","interior_photo","industry","equipment_no","extend","join_date","state","delete_flag","create_time","update_time" FROM "shop" WHERE shop_id = 'ccccwsdfwefwefwef' LIMIT 1 +2024-11-06 11:19:09.509 [DEBU] {24303c28dd42051846328f388d580e16} [ 85 ms] [default] [yuledui] [rows:1 ] SELECT "shop_id","promoter_id","account_number","child_account_number","contact_name","tel","shop_name","address","door_photo","interior_photo","industry","equipment_no","extend","join_date","state","delete_flag","create_time","update_time" FROM "shop" WHERE shop_id = 'aaaaaaaaaa' LIMIT 1 +2024-11-06 11:19:09.535 [DEBU] {dcff592ddd42051847328f382099c3db} [ 26 ms] [default] [yuledui] [rows:11 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:19:09.564 [ERRO] {dc15f72edd42051848328f38ebe267b6} [ 28 ms] [default] [yuledui] [rows:0 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq0f6k0d5ers1qw07vg200sxh8e7',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','aaaaaaaaaa','2024-11-06 11:19:09','2024-11-06 11:19:09') RETURNING "orderId" +Error: pq: null value in column "ysePayStatus" of relation "pay_order" violates not-null constraint +Stack: +1. yuleduiPay/repo.(*PayOrder).CreatePayOrder + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/repo/pay_order.go:13 +2. yuleduiPay/service.(*Pay).PayQrCode + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/service/pay.go:69 +3. yuleduiPay/middle.MiddlewareHandlerResponse + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:26 +4. yuleduiPay/middle.MiddlewareCORS + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:15 + +2024-11-06 11:20:08.799 [DEBU] {d05b97f6ea42051864e20a07b30416a0} [ 79 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:20:08.815 [DEBU] {403f58fbea42051865e20a07e2869f28} [ 15 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:20:08.842 [DEBU] {e83842fcea42051866e20a07b33d81be} [ 27 ms] [default] [yuledui] [rows:18 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:20:08.872 [DEBU] {9c14e8fdea42051867e20a0724bd0d0c} [ 29 ms] [default] [yuledui] [rows:1 ] SELECT "shop_id","promoter_id","account_number","child_account_number","contact_name","tel","shop_name","address","door_photo","interior_photo","industry","equipment_no","extend","join_date","state","delete_flag","create_time","update_time" FROM "shop" WHERE shop_id = 'aaaaaaaaaa' LIMIT 1 +2024-11-06 11:20:25.360 [DEBU] {cc1f04d5ee42051868e20a07eb77aa77} [ 23 ms] [default] [yuledui] [rows:11 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:20:25.388 [ERRO] {08fe65d6ee42051869e20a07ea4ac1ce} [ 28 ms] [default] [yuledui] [rows:0 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated") VALUES('pyacyq078s0d5ersunjnh7o200nle3xa',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','aaaaaaaaaa','2024-11-06 11:20:24','2024-11-06 11:20:24') RETURNING "orderId" +Error: pq: null value in column "ysePayStatus" of relation "pay_order" violates not-null constraint +Stack: +1. yuleduiPay/repo.(*PayOrder).CreatePayOrder + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/repo/pay_order.go:13 +2. yuleduiPay/service.(*Pay).PayQrCode + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/service/pay.go:69 +3. yuleduiPay/middle.MiddlewareHandlerResponse + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:26 +4. yuleduiPay/middle.MiddlewareCORS + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:15 + +2024-11-06 11:21:10.048 [DEBU] {30de1d39f9420518c8062f59ea0b213c} [ 82 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:21:10.065 [DEBU] {001c103ef9420518c9062f595a2f4418} [ 16 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:21:10.094 [DEBU] {bc734338f9420518c7062f59c792ad43} [ 29 ms] [default] [yuledui] [rows:30 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'account' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:21:10.140 [DEBU] {bc734338f9420518c7062f59c792ad43} [ 23 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'dict' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:21:10.181 [DEBU] {bc734338f9420518c7062f59c792ad43} [ 21 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'district' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:21:10.220 [DEBU] {bc734338f9420518c7062f59c792ad43} [ 21 ms] [default] [yuledui] [rows:11 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:21:10.259 [DEBU] {bc734338f9420518c7062f59c792ad43} [ 21 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'promoter' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:21:10.300 [DEBU] {bc734338f9420518c7062f59c792ad43} [ 22 ms] [default] [yuledui] [rows:18 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:21:10.341 [DEBU] {bc734338f9420518c7062f59c792ad43} [ 22 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop_admin' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:24:29.613 [DEBU] {a48958b0274305184bd3b75b2b76e9fd} [ 78 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:24:29.630 [DEBU] {903c14b5274305184cd3b75b531dc027} [ 16 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:24:29.660 [DEBU] {9ccc73af274305184ad3b75b8eeb9f61} [ 29 ms] [default] [yuledui] [rows:30 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'account' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:24:29.705 [DEBU] {9ccc73af274305184ad3b75b8eeb9f61} [ 22 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'dict' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:24:29.746 [DEBU] {9ccc73af274305184ad3b75b8eeb9f61} [ 21 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'district' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:24:29.790 [DEBU] {9ccc73af274305184ad3b75b8eeb9f61} [ 21 ms] [default] [yuledui] [rows:11 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:24:29.829 [DEBU] {9ccc73af274305184ad3b75b8eeb9f61} [ 20 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'promoter' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:24:29.869 [DEBU] {9ccc73af274305184ad3b75b8eeb9f61} [ 21 ms] [default] [yuledui] [rows:18 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:24:29.910 [DEBU] {9ccc73af274305184ad3b75b8eeb9f61} [ 21 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop_admin' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:25:04.118 [DEBU] {90b887b82f4305187b9fc95db7523785} [ 86 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:25:04.135 [DEBU] {847aaebd2f4305187c9fc95d479707a8} [ 17 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:25:04.166 [DEBU] {70ddb8be2f4305187d9fc95d5f39bb16} [ 30 ms] [default] [yuledui] [rows:18 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:25:04.198 [DEBU] {d47b82c02f4305187e9fc95d803acfe3} [ 32 ms] [default] [yuledui] [rows:1 ] SELECT "shop_id","promoter_id","account_number","child_account_number","contact_name","tel","shop_name","address","door_photo","interior_photo","industry","equipment_no","extend","join_date","state","delete_flag","create_time","update_time" FROM "shop" WHERE shop_id = 'aaaaaaaaaa' LIMIT 1 +2024-11-06 11:25:09.322 [DEBU] {443544f2304305187f9fc95d2d81b2d5} [ 27 ms] [default] [yuledui] [rows:11 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:25:09.355 [DEBU] {087adff330430518809fc95d239662c3} [ 33 ms] [default] [yuledui] [rows:1 ] INSERT INTO "pay_order"("orderId","price","amount","bean","openId","mobile","shopId","created","updated","payStatus","ysePayStatus") VALUES('pyacyq08u00d5erwl40rvgk200i0fyaq',65.3,65.2,0.1,'aaaaaaaaaaaaaaaaabbbbbbbb','15963264270','aaaaaaaaaa','2024-11-06 11:25:08','2024-11-06 11:25:08',0,'') RETURNING "orderId" +2024-11-06 11:26:26.462 [ERRO] {b82841e542430518829fc95def92af16} [ 75 ms] [default] [yuledui] [rows:0 ] SELECT "orderId","price","amount","bean","openId","mobile","shopId","created","updated","payStatus","ysePayStatus" FROM "pay_order" WHERE orderId = 'pyacyq08u00d5erwl40rvgk200i0fyaq' LIMIT 1 +Error: pq: column "orderid" does not exist +Stack: +1. yuleduiPay/repo.(*PayOrder).GetPayOrderByOrderId + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/repo/pay_order.go:23 +2. yuleduiPay/service.(*YsePay).NotifyWxPay + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/service/ysepay.go:30 +3. yuleduiPay/middle.MiddlewareHandlerResponse + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:26 +4. yuleduiPay/middle.MiddlewareCORS + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:15 + +2024-11-06 11:30:38.849 [DEBU] {98c45da87d430518235ffa7cfb773752} [ 81 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:30:38.867 [DEBU] {7c4e40ad7d430518245ffa7cd678625e} [ 17 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:30:38.899 [DEBU] {e07277a77d430518225ffa7cb5df3b17} [ 29 ms] [default] [yuledui] [rows:30 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'account' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:30:38.938 [DEBU] {e07277a77d430518225ffa7cb5df3b17} [ 23 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'dict' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:30:38.966 [DEBU] {e07277a77d430518225ffa7cb5df3b17} [ 22 ms] [default] [yuledui] [rows:9 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'district' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:30:39.006 [DEBU] {e07277a77d430518225ffa7cb5df3b17} [ 21 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:30:39.049 [DEBU] {e07277a77d430518225ffa7cb5df3b17} [ 22 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'promoter' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:30:39.092 [DEBU] {e07277a77d430518225ffa7cb5df3b17} [ 23 ms] [default] [yuledui] [rows:18 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:30:39.126 [DEBU] {e07277a77d430518225ffa7cb5df3b17} [ 22 ms] [default] [yuledui] [rows:12 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'shop_admin' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:32:44.637 [DEBU] {74e0a8f29a430518bf386b74835536fe} [ 68 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:32:44.651 [DEBU] {884ac7f69a430518c0386b74c624e913} [ 13 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:32:44.678 [DEBU] {ecdaa9f79a430518c1386b748dec2a06} [ 26 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:32:44.692 [ERRO] {94c538f99a430518c2386b7413a3ece7} [ 13 ms] [default] [yuledui] [rows:0 ] SELECT "order_id","price","amount","bean","open_id","mobile","shop_id","created","updated","ysepay_status" FROM "pay_order" WHERE orderId = 'pyacyq08u00d5erwl40rvgk200i0fyaq' LIMIT 1 +Error: pq: column "orderid" does not exist +Stack: +1. yuleduiPay/repo.(*PayOrder).GetPayOrderByOrderId + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/repo/pay_order.go:23 +2. yuleduiPay/service.(*YsePay).NotifyWxPay + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/service/ysepay.go:30 +3. yuleduiPay/middle.MiddlewareHandlerResponse + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:26 +4. yuleduiPay/middle.MiddlewareCORS + C:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:15 + +2024-11-06 11:33:15.952 [DEBU] {2cc98a3ba2430518a47d5548b3cff090} [ 96 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:33:15.971 [DEBU] {585f4a41a2430518a57d5548b08583e4} [ 19 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:33:16.001 [DEBU] {68ee6d42a2430518a67d5548c086e993} [ 29 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:33:16.020 [ERRO] {3cd94344a2430518a77d5548773a1aeb} [ 18 ms] [default] [yuledui] [rows:0 ] SELECT "order_id","price","amount","bean","open_id","mobile","shop_id","created","updated","ysepay_status" FROM "pay_order" WHERE orderId = 'pyacyq08u00d5erwl40rvgk200i0fyaq' LIMIT 1 +Error: pq: column "orderid" does not exist +Stack: +1. yuleduiPay/repo.(*PayOrder).GetPayOrderByOrderId + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/repo/pay_order.go:23 +2. yuleduiPay/service.(*YsePay).NotifyWxPay + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/service/ysepay.go:30 +3. yuleduiPay/middle.MiddlewareHandlerResponse + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:26 +4. yuleduiPay/middle.MiddlewareCORS + c:/Users/Administrator/Desktop/yuleduiPay/yuleduiPay/middle/middle.go:15 + +2024-11-06 11:34:34.144 [DEBU] {c0740871b44305187da42110f01305e4} [ 81 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:34:34.160 [DEBU] {e484de75b44305187ea4211095eb527e} [ 16 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:34:34.188 [DEBU] {0028dd76b44305187fa4211083c6536f} [ 27 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:34:34.227 [DEBU] {c05b8d78b443051880a4211026d1f285} [ 38 ms] [default] [yuledui] [rows:1 ] SELECT "order_id","price","amount","bean","open_id","mobile","shop_id","created","updated","ysepay_status" FROM "pay_order" WHERE order_id = 'pyacyq08u00d5erwl40rvgk200i0fyaq' LIMIT 1 +2024-11-06 11:34:40.117 [DEBU] {409c25d8b543051881a42110a2822f5c} [ 29 ms] [default] [yuledui] [rows:1 ] UPDATE "pay_order" SET "updated"='2024-11-06 11:34:39',"ysepay_status"='TRADE_SUCCESS' WHERE order_id = 'pyacyq08u00d5erwl40rvgk200i0fyaq' +2024-11-06 11:35:07.681 [DEBU] {f0cef33ebc43051883a42110903bfd19} [ 99 ms] [default] [yuledui] [rows:1 ] SELECT "order_id","price","amount","bean","open_id","mobile","shop_id","created","updated","ysepay_status" FROM "pay_order" WHERE order_id = 'pyacyq08u00d5erwl40rvgk200i0fyaq' LIMIT 1 +2024-11-06 11:35:08.961 [DEBU] {b8e6188fbc43051884a4211036508299} [ 34 ms] [default] [yuledui] [rows:1 ] UPDATE "pay_order" SET "updated"='2024-11-06 11:35:08',"ysepay_status"='TRADE_SUCCESS' WHERE order_id = 'pyacyq08u00d5erwl40rvgk200i0fyaq' +2024-11-06 11:37:19.522 [DEBU] {0074d5f2da43051834c1e4064766300a} [ 73 ms] [default] [yuledui] [rows:1 ] SELECT version(); +2024-11-06 11:37:19.539 [DEBU] {3cde48f7da43051835c1e406b592f297} [ 15 ms] [default] [yuledui] [rows:7 ] SELECT c.relname FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = 'public' AND c.relkind IN ('r', 'p') AND c.relpartbound IS NULL ORDER BY c.relname +2024-11-06 11:37:19.566 [DEBU] {14ab34f8da43051836c1e4060b51aa6a} [ 27 ms] [default] [yuledui] [rows:10 ] SELECT a.attname AS field, t.typname AS type,a.attnotnull as null, (case when d.contype = 'p' then 'pri' when d.contype = 'u' then 'uni' else '' end) as key ,ic.column_default as default_value,b.description as comment ,coalesce(character_maximum_length, numeric_precision, -1) as length ,numeric_scale as scale FROM pg_attribute a left join pg_class c on a.attrelid = c.oid left join pg_constraint d on d.conrelid = c.oid and a.attnum = d.conkey[1] left join pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid left join pg_type t ON a.atttypid = t.oid left join information_schema.columns ic on ic.column_name = a.attname and ic.table_name = c.relname WHERE c.relname = 'pay_order' and a.attisdropped is false and a.attnum > 0 ORDER BY a.attnum +2024-11-06 11:37:19.595 [DEBU] {4c06d7f9da43051837c1e406aa643129} [ 28 ms] [default] [yuledui] [rows:1 ] SELECT "order_id","price","amount","bean","open_id","mobile","shop_id","created","updated","ysepay_status" FROM "pay_order" WHERE order_id = 'pyacyq08u00d5erwl40rvgk200i0fyaq' LIMIT 1 +2024-11-06 11:37:20.939 [DEBU] {bc24ee49db43051838c1e406b5e88f7b} [ 28 ms] [default] [yuledui] [rows:1 ] UPDATE "pay_order" SET "updated"='2024-11-06 11:37:20',"ysepay_status"='TRADE_SUCCESS' WHERE order_id = 'pyacyq08u00d5erwl40rvgk200i0fyaq' diff --git a/main.go b/main.go index 8d867a5..6a30e40 100644 --- a/main.go +++ b/main.go @@ -18,8 +18,7 @@ func main() { s.Group("/wxApi", payRouter.RouterGroup) yesPayRouter := controller.YsePay{} s.Group("/ysePay", yesPayRouter.RouterGroup) - mqtt := service.MQTT{} - err := mqtt.InitMQTT() + err := service.MQTTService.InitMQTT() if err != nil { return } diff --git a/repo/pay_order.go b/repo/pay_order.go index 8a386f2..8bdb261 100644 --- a/repo/pay_order.go +++ b/repo/pay_order.go @@ -15,11 +15,11 @@ func (t *PayOrder) CreatePayOrder(payOrder *po.PayOrder) error { } func (t *PayOrder) UpdatePayOrderByOrderId(updateMap g.Map, orderId string) error { - _, err := g.Model("pay_order").Data(updateMap).Where("orderId = ?", orderId).Update() + _, err := g.Model("pay_order").Data(updateMap).Where("order_id = ?", orderId).Update() return err } func (t *PayOrder) GetPayOrderByOrderId(orderId string) (*po.PayOrder, error) { payOrder := &po.PayOrder{} - err := g.Model("pay_order").Where("orderId = ?", orderId).Scan(payOrder) + err := g.Model("pay_order").Where("order_id = ?", orderId).Scan(payOrder) return payOrder, err } diff --git a/service/mqtt.go b/service/mqtt.go index 80f95a9..176f85e 100644 --- a/service/mqtt.go +++ b/service/mqtt.go @@ -1,8 +1,11 @@ package service import ( + "encoding/json" + "errors" "fmt" "time" + "yuleduiPay/service/vo" mqtt "github.com/eclipse/paho.mqtt.golang" "github.com/gogf/gf/v2/frame/g" @@ -10,68 +13,59 @@ import ( ) type MQTT struct { - mc mqtt.Client + client mqtt.Client } +var MQTTService MQTT + func (t *MQTT) InitMQTT() error { - ip, err := g.Cfg().Get(nil, "MQTT.ip") - if err != nil { - g.Log().Line().Print(nil, err) - return err - } - port, err := g.Cfg().Get(nil, "MQTT.port") - if err != nil { - g.Log().Line().Print(nil, err) - return err - } - user, err := g.Cfg().Get(nil, "MQTT.user") - if err != nil { - g.Log().Line().Print(nil, err) - return err - } - passwd, err := g.Cfg().Get(nil, "MQTT.passwd") - if err != nil { - g.Log().Line().Print(nil, err) - return err - } + ip := g.Cfg().MustGet(nil, "MQTT.ip") + port := g.Cfg().MustGet(nil, "MQTT.port") + + /* + user := g.Cfg().MustGet(nil, "MQTT.user") + passwd := g.Cfg().MustGet(nil, "MQTT.passwd") + */ opts := mqtt.NewClientOptions() - opts.AddBroker(fmt.Sprintf("mqtt://%s:%d", ip, port)) + mqttAddress := fmt.Sprintf("mqtt://%s:%d", ip.String(), port.Int()) + g.Log().Line().Print(nil, "MQTT连接地址:", mqttAddress) + opts.AddBroker(mqttAddress) opts.SetKeepAlive(time.Hour * 24) opts.SetPingTimeout(time.Second * 30) opts.SetClientID(guid.S()) - opts.SetUsername(user.String()) - opts.SetPassword(passwd.String()) + //opts.SetUsername(user.String()) //使用用户名和密码 + //opts.SetPassword(passwd.String()) //opts.SetDefaultPublishHandler(messagePubHandler) //opts.OnConnect = connectHandler opts.OnConnectionLost = t.connectLostHandler - t.mc = mqtt.NewClient(opts) - if token := t.mc.Connect(); token.Wait() && token.Error() != nil { - g.Log().Line().Print(nil, token.Error()) + t.client = mqtt.NewClient(opts) + token := t.client.Connect() + if token.Wait() && token.Error() != nil { + err := errors.New("MQTT初始化失败:" + token.Error().Error()) + g.Log().Line().Error(nil, err) return err } return nil } // MQTT 推送订单结果消息 -//func (t *MQTT) Publish(client mqtt.Client,msg *vo.MQTTOrder) string { - -// 返回支付结果消息 -/* -func publishResult(client mqtt.Client, msg *vo.MQTTOrder) string { - //command.Msg_Id = guid.S() - command.SendTime = time.Now() - j, err := json.Marshal(msg) - if err == nil { - token := client.Publish(command.Topic, 0, false, string(j)) - token.Wait() - return "" - } else { - return err.Error() +func (t *MQTT) Publish(msg *vo.MQTTOrder) error { + msg.MsgId = guid.S() + msg.SendTime = time.Now().Unix() + jsonbytes, err := json.Marshal(msg) + if err != nil { + return err } + token := t.client.Publish(msg.Topic, 2, false, string(jsonbytes)) + tokenOk := token.Wait() + if !tokenOk { //失败,获取错误原因 + return token.Error() + } + return nil } -*/ + func (t *MQTT) connectLostHandler(client mqtt.Client, err error) { - token := t.mc.Connect() + token := t.client.Connect() g.Log().Line().Print(nil, "MQTT 重新连接成功") token.Wait() } diff --git a/service/pay.go b/service/pay.go index a7d4bc4..5ae30f5 100644 --- a/service/pay.go +++ b/service/pay.go @@ -127,19 +127,14 @@ func (t *Pay) ysePayRequestJson(shop *po.Shop, payOrder *po.PayOrder) ([]byte, e jsonMap := g.Map{} //公共请求参数 jsonMap["method"] = "ysepay.online.weixin.pay" //接口名称,固定值 - certId, err := g.Cfg().Get(nil, "ysepay.CERTID") - if err != nil { - return nil, err - } + certId := g.Cfg().MustGet(nil, "ysepay.CERTID") + jsonMap["partner_id"] = certId //在银盛支付开设的服务商商户号 jsonMap["timestamp"] = time.Now().Format("2006-01-02 15:04:05") //发送请求的时间 jsonMap["charset"] = "UTF-8" //商户网站使用的编码格式 jsonMap["sign_type"] = "SM" //报文签名算法 //sign 需要java项目处理 todo - notifyUrl, err := g.Cfg().Get(nil, "ysepay.notifyUrl") - if err != nil { - return nil, err - } + notifyUrl := g.Cfg().MustGet(nil, "ysepay.notifyUrl") jsonMap["notify_url"] = notifyUrl //交易成功异步通知到商户的后台地址 jsonMap["version"] = "3.0" //接口版本 @@ -155,10 +150,7 @@ func (t *Pay) ysePayRequestJson(shop *po.Shop, payOrder *po.PayOrder) ([]byte, e businessMap["timeout_express"] = "1h" //设置未付款交易的超时时间,一个小时 businessMap["sub_openid"] = payOrder.OpenId //微信OpenId businessMap["is_minipg"] = "1" //微信小程序支付:1 - appId, err := g.Cfg().Get(nil, "weixin.appId") - if err != nil { - return nil, err - } + appId := g.Cfg().MustGet(nil, "weixin.appId") businessMap["appid"] = appId //微信小程序APPID b, err := json.Marshal(businessMap) if err != nil { diff --git a/service/po/dict.go b/service/po/dict.go new file mode 100644 index 0000000..89ce566 --- /dev/null +++ b/service/po/dict.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package po + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// Dict is the golang structure for table dict. +type Dict struct { + Id int `json:"id" orm:"id" ` // id + Pid int `json:"pid" orm:"pid" ` // 父级id + Title string `json:"title" orm:"title" ` // 名称 + Value int `json:"value" orm:"value" ` // 值 + Desc string `json:"desc" orm:"desc" ` // 描述 + Type int `json:"type" orm:"type" ` // 分类 + Sort int `json:"sort" orm:"sort" ` // 排序 + DeleteFlag int `json:"deleteFlag" orm:"delete_flag" ` // 0:未删除 1:已删除 0 + CreateTime *gtime.Time `json:"createTime" orm:"create_time" ` // 创建时间 + UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" ` // 最后更新时间 +} diff --git a/service/po/district.go b/service/po/district.go new file mode 100644 index 0000000..c2fc069 --- /dev/null +++ b/service/po/district.go @@ -0,0 +1,22 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package po + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// District is the golang structure for table district. +type District struct { + Id int `json:"id" orm:"id" ` // 区划信息id + Pid int `json:"pid" orm:"pid" ` // 父级挂接id + Code int `json:"code" orm:"code" ` // 区划编码 + Name string `json:"name" orm:"name" ` // 区划名称 + Remark string `json:"remark" orm:"remark" ` // 备注 + CreateTime *gtime.Time `json:"createTime" orm:"create_time" ` // 创建时间 + UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" ` // 更新时间 + Status int `json:"status" orm:"status" ` // 状态 0 正常 -2 删除 -1 停用 + Level int `json:"level" orm:"level" ` // 级次id 0:省/自治区/直辖市 1:市级 2:县级 +} diff --git a/service/po/pay_order.go b/service/po/pay_order.go index 7f2dbc9..a098c19 100644 --- a/service/po/pay_order.go +++ b/service/po/pay_order.go @@ -1,3 +1,7 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + package po import ( @@ -6,13 +10,14 @@ import ( // PayOrder is the golang structure for table pay_order. type PayOrder struct { - OrderId string `json:"orderId" orm:"orderId" ` // 订单ID,主键 - Price float64 `json:"price" orm:"price" ` // 订单原价 - Amount float64 `json:"amount" orm:"amount" ` // 支付价格 - Bean float64 `json:"bean" orm:"bean" ` // 金豆抵扣价格 - OpenId string `json:"openId" orm:"openId" ` // 支付用户微信openId - Mobile string `json:"mobile" orm:"mobile" ` // 支付用户手机号 - ShopId string `json:"shopId" orm:"shopId" ` // 商户ID - Created *gtime.Time `json:"created" orm:"created" ` // 创建时间 - Updated *gtime.Time `json:"updated" orm:"updated" ` // 更新时间 + OrderId string `json:"orderId" orm:"order_id" ` // 订单ID,主键 + Price float64 `json:"price" orm:"price" ` // 订单原价 + Amount float64 `json:"amount" orm:"amount" ` // 支付价格 + Bean float64 `json:"bean" orm:"bean" ` // 金豆抵扣价格 + OpenId string `json:"openId" orm:"open_id" ` // 支付用户微信openId + Mobile string `json:"mobile" orm:"mobile" ` // 支付用户手机号 + ShopId string `json:"shopId" orm:"shop_id" ` // 商户ID + Created *gtime.Time `json:"created" orm:"created" ` // 创建时间 + Updated *gtime.Time `json:"updated" orm:"updated" ` // 更新时间 + YsepayStatus string `json:"ysepayStatus" orm:"ysepay_status" ` // 银盛交易状态 } diff --git a/service/vo/mqtt.go b/service/vo/mqtt.go index 8d90982..e557cbb 100644 --- a/service/vo/mqtt.go +++ b/service/vo/mqtt.go @@ -1,12 +1,15 @@ package vo type MQTTOrder struct { + Topic string `json:"topic"` //主题 + MsgId string `json:"msgId"` //消息ID OrderId string `json:"orderId"` //订单号 OrderEndTime int64 `json:"orderEndTime"` //支付完成时间,unix时间戳 Price string `json:"price"` //订单原价(小数点后6位) Amount string `json:"amount"` //支付金额(小数点后6位) Bean string `json:"bean"` //抵扣金豆 - ShopId int64 `json:"shopId"` //店铺ID + ShopId string `json:"shopId"` //店铺ID OpenId string `json:"openId"` //微信用户openId Mobile string `json:"mobile"` //付款用户手机号 + SendTime int64 `json:"sendTime"` //发送消息时间,unix时间戳 } diff --git a/service/ysepay.go b/service/ysepay.go index 80157bc..e86e0e5 100644 --- a/service/ysepay.go +++ b/service/ysepay.go @@ -1,12 +1,15 @@ package service import ( + "strconv" "time" + "yuleduiPay/common" "yuleduiPay/repo" "yuleduiPay/service/vo" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/util/guid" ) type YsePay struct { @@ -16,26 +19,52 @@ type YsePay struct { // 银盛 异步通知余乐兑 func (t *YsePay) NotifyWxPay(r *ghttp.Request) { - //r.Request + g.Log().Line().Print(nil, r.Request) req := vo.NotifyPayReq{} err := r.Parse(&req) if err != nil { r.SetError(err) return } - /* - payOrder,err := t.payOrderRepo.GetPayOrderByOrderId(req.OutTradeNo) //获取订单 - if err != nil { - r.SetError(err) - return - } - */ + + payOrder, err := t.payOrderRepo.GetPayOrderByOrderId(req.OutTradeNo) //获取订单 + if err != nil { + r.SetError(err) + return + } + updates := g.Map{"ysePayStatus": req.TradeStatus, "updated": time.Now()} err = t.payOrderRepo.UpdatePayOrderByOrderId(updates, req.OutTradeNo) if err != nil { r.SetError(err) return } + orderTime, err := time.Parse(common.Layout, req.NotifyTime) + if err != nil { + r.SetError(err) + return + } + topic := g.Cfg().MustGet(nil, "MQTT.topic") + //将支付结果写入MQTT中 + orderMsg := vo.MQTTOrder{} + orderMsg.Topic = topic.String() + orderMsg.MsgId = guid.S() + orderMsg.OrderId = payOrder.OrderId + + orderMsg.OrderEndTime = orderTime.Unix() + orderMsg.Price = strconv.FormatFloat(payOrder.Price, 'f', -1, 64) + orderMsg.Amount = strconv.FormatFloat(payOrder.Amount, 'f', -1, 64) + orderMsg.Bean = strconv.FormatFloat(payOrder.Bean, 'f', -1, 64) + orderMsg.ShopId = payOrder.ShopId + orderMsg.OpenId = payOrder.OpenId + orderMsg.Mobile = payOrder.Mobile + orderMsg.SendTime = time.Now().Unix() + + err = MQTTService.Publish(&orderMsg) + if err != nil { + r.SetError(err) + } return + }