From 1380b581bcd8719718599bb53389dc105d43d31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 21 Nov 2025 09:13:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=9F=E5=90=8D=E4=BF=AE=E6=94=B9=E5=9B=9E?= =?UTF-8?q?=E6=9D=A5=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/auth2/auth2.go | 10 +- business/auth2/auth_ctx.go | 4 +- business/auth2/auth_info.go | 2 +- business/auth2/authprovider/alipay/alipay.go | 10 +- business/auth2/authprovider/defauther.go | 12 +- .../auth2/authprovider/dingding/qrcode.go | 10 +- business/auth2/authprovider/dingding/staff.go | 12 +- business/auth2/authprovider/mobile/mobile.go | 8 +- .../auth2/authprovider/password/password.go | 12 +- business/auth2/authprovider/weixin/weixin.go | 12 +- .../auth2/authprovider/weixin/weixin_mini.go | 12 +- business/authz/authz.go | 2 +- business/authz/autils/authz_utils.go | 8 +- business/authz/casbinauth/adapter.go | 4 +- business/authz/casbinauth/casbinauth.go | 4 +- business/jxstore/cms/api_print.go | 10 +- business/jxstore/cms/authz.go | 16 +- business/jxstore/cms/cms.go | 24 +- business/jxstore/cms/job.go | 34 +- business/jxstore/cms/message.go | 10 +- business/jxstore/cms/order.go | 24 +- business/jxstore/cms/permission.go | 6 +- business/jxstore/cms/recharge_server.go | 10 +- business/jxstore/cms/temp.go | 2 +- business/jxstore/cms/user2.go | 28 +- business/jxstore/common/common.go | 2 +- business/jxstore/event/event.go | 14 +- business/jxstore/event/event_tcp.go | 8 +- business/jxstore/event/event_tcp_utils.go | 10 +- business/jxstore/event/print_test.go | 4 +- business/jxstore/financial/bill.go | 10 +- business/jxstore/financial/financial.go | 16 +- business/jxstore/financial/pay.go | 18 +- business/jxstore/initdata/initdata.go | 12 +- business/jxstore/misc/misc.go | 18 +- business/jxstore/partner/jds/jds.go | 10 +- business/jxstore/partner/jds/union.go | 6 +- business/jxstore/partner/mt/mt.go | 10 +- business/jxstore/partner/mt/union.go | 18 +- business/jxstore/partner/partner.go | 2 +- business/jxstore/partner/pdd/pdd.go | 10 +- business/jxstore/partner/pdd/union.go | 22 +- business/jxstore/partner/taobao/taobao.go | 10 +- business/jxstore/partner/taobao/union.go | 12 +- business/jxutils/cache/redis/redis.go | 2 +- business/jxutils/cache/redis/redis_test.go | 4 +- business/jxutils/configindb/configindb.go | 6 +- business/jxutils/datares/datares.go | 16 +- business/jxutils/datares/datares_test.go | 8 +- business/jxutils/ddmsg/ddmsg.go | 12 +- business/jxutils/ditu/ditu.go | 8 +- business/jxutils/ditu/ditu_test.go | 4 +- business/jxutils/dtask/dtask.go | 10 +- business/jxutils/dtask/dtask_test.go | 12 +- business/jxutils/eventhub/eventhub.go | 4 +- .../eventhub/syseventhub/syseventhub.go | 8 +- business/jxutils/excel/excel.go | 4 +- business/jxutils/jsonerr/jsonerr.go | 2 +- business/jxutils/jxcontext/jxcontext.go | 10 +- business/jxutils/jxutils.go | 16 +- business/jxutils/jxutils_act.go | 2 +- business/jxutils/jxutils_cms.go | 8 +- business/jxutils/jxutils_cms_test.go | 4 +- business/jxutils/jxutils_reflect_test.go | 4 +- business/jxutils/jxutils_sync_map.go | 2 +- business/jxutils/jxutils_test.go | 6 +- business/jxutils/msg/msg.go | 14 +- business/jxutils/smsmsg/smsmsg.go | 10 +- business/jxutils/smsmsg/smsmsg_test.go | 4 +- business/jxutils/tasks/configrefresh.go | 18 +- business/jxutils/tasksch/parallel_task.go | 8 +- .../jxutils/tasksch/parallel_task_test.go | 4 +- business/jxutils/tasksch/sequence_task.go | 6 +- .../jxutils/tasksch/sequence_task_test.go | 4 +- business/jxutils/tasksch/task.go | 10 +- business/jxutils/tasksch/task_man.go | 2 +- business/jxutils/weixinmsg/weixinmsg.go | 10 +- business/jxutils/weixinmsg/weixinmsg_test.go | 8 +- business/model/act.go | 2 +- business/model/const.go | 8 +- business/model/dao/act.go | 8 +- business/model/dao/act_test.go | 4 +- business/model/dao/common.go | 2 +- business/model/dao/dao.go | 4 +- business/model/dao/dao_auth2.go | 4 +- business/model/dao/dao_bill.go | 8 +- business/model/dao/dao_bz.go | 8 +- business/model/dao/dao_job.go | 6 +- business/model/dao/dao_matter.go | 4 +- business/model/dao/dao_order.go | 6 +- business/model/dao/dao_print.go | 6 +- business/model/dao/dao_print_activation.go | 2 +- business/model/dao/dao_print_ex.go | 4 +- business/model/dao/dao_print_setting.go | 4 +- business/model/dao/dao_print_temp.go | 4 +- business/model/dao/dao_user.go | 6 +- business/model/dao/dao_utils.go | 6 +- business/model/dao/event.go | 4 +- business/model/dao/new_config.go | 6 +- business/model/dao/permission.go | 4 +- business/model/dao/place.go | 2 +- business/model/dao/print_activation.go | 2 +- business/model/dao/print_bill.go | 2 +- business/model/dao/print_bill_record.go | 2 +- business/model/dao/print_bind_store.go | 2 +- business/model/dao/print_temp_utils.go | 6 +- business/model/dao/user_delivery_address.go | 2 +- business/model/job.go | 2 +- business/model/legacymodel/ebaishoplicence.go | 2 +- business/model/user.go | 2 +- business/q_bida/express_test.go | 2 +- business/q_bida/q_bida_server.go | 18 +- business/q_bida/q_bida_server_utils.go | 6 +- business/q_bida/withdrawal_record.go | 10 +- business/q_bida/withdrawal_record_utils.go | 10 +- controllers/api_controller.go | 10 +- controllers/api_controller_ex.go | 2 +- controllers/auth2_contoller.go | 16 +- controllers/bill_controller.go | 2 +- controllers/cms.go | 6 +- controllers/cms_task.go | 4 +- controllers/event_controller.go | 14 +- controllers/job_controller.go | 14 +- controllers/mtwm_callback.go | 10 +- controllers/order_controller.go | 6 +- controllers/print_controller.go | 4 +- controllers/q_bida.go | 8 +- controllers/recharge_callback.go | 8 +- controllers/recharge_controller.go | 6 +- controllers/tonglian_callback.go | 8 +- controllers/union_controller.go | 8 +- controllers/user2_controller.go | 22 +- controllers/user_balance.go | 2 +- controllers/withdrawal_record.go | 4 +- controllers/wxpay_callback.go | 10 +- globals/api/api.go | 52 +- globals/api2/api2.go | 6 +- globals/beegodb/beegodb.go | 4 +- globals/globals.go | 2 +- globals/refutil/refutil.go | 4 +- globals/refutil/refutil_test.go | 2 +- globals/testinit/testinit.go | 4 +- main.go | 44 +- routers/commentsRouter_controllers.go | 264 +- routers/router.go | 2 +- swagger/param_parser.go.txt | 23252 ++++++++-------- swagger/swagger.json | 2 +- swagger/swagger.yml | 2 +- tests/default_test.go | 2 +- 149 files changed, 12367 insertions(+), 12367 deletions(-) diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index f249c45b4..a3716b77b 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -9,12 +9,12 @@ import ( "strings" "time" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" "github.com/dchest/captcha" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" ) const ( diff --git a/business/auth2/auth_ctx.go b/business/auth2/auth_ctx.go index 560bba24f..02a441919 100644 --- a/business/auth2/auth_ctx.go +++ b/business/auth2/auth_ctx.go @@ -4,8 +4,8 @@ import ( "net/http" "strings" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" ) type Context struct { diff --git a/business/auth2/auth_info.go b/business/auth2/auth_info.go index 6e19a0d56..2cf07072d 100644 --- a/business/auth2/auth_info.go +++ b/business/auth2/auth_info.go @@ -3,7 +3,7 @@ package auth2 import ( "time" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) const ( diff --git a/business/auth2/authprovider/alipay/alipay.go b/business/auth2/authprovider/alipay/alipay.go index afc6295b9..64c60f144 100644 --- a/business/auth2/authprovider/alipay/alipay.go +++ b/business/auth2/authprovider/alipay/alipay.go @@ -1,11 +1,11 @@ package alipay import ( - "gitrosy.jxc4.com/baseapi/platformapi/alipayapi" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/alipayapi" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/auth2/authprovider/defauther.go b/business/auth2/authprovider/defauther.go index 66d13ed6d..510a0c17c 100644 --- a/business/auth2/authprovider/defauther.go +++ b/business/auth2/authprovider/defauther.go @@ -7,12 +7,12 @@ import ( "strings" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/auth2/authprovider/dingding/qrcode.go b/business/auth2/authprovider/dingding/qrcode.go index 0c7aa481a..8e84d4a35 100644 --- a/business/auth2/authprovider/dingding/qrcode.go +++ b/business/auth2/authprovider/dingding/qrcode.go @@ -1,11 +1,11 @@ package dingding import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) type QRCodeAuther struct { diff --git a/business/auth2/authprovider/dingding/staff.go b/business/auth2/authprovider/dingding/staff.go index 7a63908a3..c1630497b 100644 --- a/business/auth2/authprovider/dingding/staff.go +++ b/business/auth2/authprovider/dingding/staff.go @@ -1,12 +1,12 @@ package dingding import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) type StaffAuther struct { diff --git a/business/auth2/authprovider/mobile/mobile.go b/business/auth2/authprovider/mobile/mobile.go index 7a675de3a..c4a657c8f 100644 --- a/business/auth2/authprovider/mobile/mobile.go +++ b/business/auth2/authprovider/mobile/mobile.go @@ -5,11 +5,11 @@ import ( "fmt" "math/rand" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider" + "git.rosy.net.cn/jx-callback/globals" aliyunsmsclient "github.com/KenmyZhang/aliyun-communicate" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider" - "gitrosy.jxc4.com/jx-callback/globals" ) const ( diff --git a/business/auth2/authprovider/password/password.go b/business/auth2/authprovider/password/password.go index c7fcade87..5c5f97d17 100644 --- a/business/auth2/authprovider/password/password.go +++ b/business/auth2/authprovider/password/password.go @@ -5,12 +5,12 @@ import ( "errors" "fmt" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" ) const ( diff --git a/business/auth2/authprovider/weixin/weixin.go b/business/auth2/authprovider/weixin/weixin.go index 45eba9833..2f4b344a9 100644 --- a/business/auth2/authprovider/weixin/weixin.go +++ b/business/auth2/authprovider/weixin/weixin.go @@ -3,12 +3,12 @@ package weixin import ( "errors" - "gitrosy.jxc4.com/baseapi/platformapi/weixinapi" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/weixinapi" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/auth2/authprovider/weixin/weixin_mini.go b/business/auth2/authprovider/weixin/weixin_mini.go index c7e455086..6c8142201 100644 --- a/business/auth2/authprovider/weixin/weixin_mini.go +++ b/business/auth2/authprovider/weixin/weixin_mini.go @@ -4,12 +4,12 @@ import ( "errors" "strings" - "gitrosy.jxc4.com/baseapi/platformapi/weixinapi" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/weixinapi" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/authz/authz.go b/business/authz/authz.go index cbc1c097c..b6ec6406a 100644 --- a/business/authz/authz.go +++ b/business/authz/authz.go @@ -3,7 +3,7 @@ package authz import ( "strings" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" ) const ( diff --git a/business/authz/autils/authz_utils.go b/business/authz/autils/authz_utils.go index 6287ce5af..cb75f0149 100644 --- a/business/authz/autils/authz_utils.go +++ b/business/authz/autils/authz_utils.go @@ -4,10 +4,10 @@ import ( "fmt" "strings" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/authz" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/authz" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" ) func GetRoleDescription(name string, storeID int) (description string) { diff --git a/business/authz/casbinauth/adapter.go b/business/authz/casbinauth/adapter.go index 571325eb3..60207b267 100644 --- a/business/authz/casbinauth/adapter.go +++ b/business/authz/casbinauth/adapter.go @@ -1,11 +1,11 @@ package casbinauth import ( + jxmodel "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" "github.com/astaxie/beego/client/orm" "github.com/casbin/casbin/model" "github.com/casbin/casbin/persist" - jxmodel "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" ) type Adapter struct { diff --git a/business/authz/casbinauth/casbinauth.go b/business/authz/casbinauth/casbinauth.go index 21a11b5e7..59d04f2c6 100644 --- a/business/authz/casbinauth/casbinauth.go +++ b/business/authz/casbinauth/casbinauth.go @@ -1,10 +1,10 @@ package casbinauth import ( + "git.rosy.net.cn/jx-callback/business/authz" + "git.rosy.net.cn/jx-callback/business/authz/autils" "github.com/casbin/casbin" "github.com/casbin/casbin/errors" - "gitrosy.jxc4.com/jx-callback/business/authz" - "gitrosy.jxc4.com/jx-callback/business/authz/autils" ) type CasbinAuthz struct { diff --git a/business/jxstore/cms/api_print.go b/business/jxstore/cms/api_print.go index 16644e96d..72bdcfb0d 100644 --- a/business/jxstore/cms/api_print.go +++ b/business/jxstore/cms/api_print.go @@ -4,11 +4,11 @@ import ( "encoding/json" "errors" "fmt" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/event" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" "net" "regexp" "time" diff --git a/business/jxstore/cms/authz.go b/business/jxstore/cms/authz.go index 1df7951ad..695572cfd 100644 --- a/business/jxstore/cms/authz.go +++ b/business/jxstore/cms/authz.go @@ -1,14 +1,14 @@ package cms import ( - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/weixin" - "gitrosy.jxc4.com/jx-callback/business/authz/autils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/business/model/legacymodel" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api2" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" + "git.rosy.net.cn/jx-callback/business/authz/autils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/model/legacymodel" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api2" ) // todo 是否需要将Store.MarketManPhone与OperatorPhone成角色? diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index ea8b8f3ae..59c37f1ea 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -3,27 +3,27 @@ package cms import ( "encoding/json" "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/mtunionapi" - "gitrosy.jxc4.com/baseapi/platformapi/tbunionapi" + "git.rosy.net.cn/baseapi/platformapi/mtunionapi" + "git.rosy.net.cn/baseapi/platformapi/tbunionapi" "reflect" "regexp" "strconv" "time" - "gitrosy.jxc4.com/baseapi/platformapi/ejyapi" + "git.rosy.net.cn/baseapi/platformapi/ejyapi" - "gitrosy.jxc4.com/baseapi/utils/errlist" + "git.rosy.net.cn/baseapi/utils/errlist" - "gitrosy.jxc4.com/jx-callback/globals/api2" + "git.rosy.net.cn/jx-callback/globals/api2" - "gitrosy.jxc4.com/jx-callback/business/authz/autils" + "git.rosy.net.cn/jx-callback/business/authz/autils" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/jxutils/tasksch" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index a39e7a8fc..19af3f7f5 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -3,38 +3,38 @@ package cms import ( "encoding/json" "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/tbunionapi" + "git.rosy.net.cn/baseapi/platformapi/tbunionapi" "math" "regexp" "strings" "sync" "time" - "gitrosy.jxc4.com/jx-callback/business/jxstore/event" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/baseapi/platformapi/txcloudapi" + "git.rosy.net.cn/baseapi/platformapi/txcloudapi" - "gitrosy.jxc4.com/jx-callback/business/jxutils/ddmsg" + "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" - "gitrosy.jxc4.com/baseapi/platformapi/dingdingapi" - "gitrosy.jxc4.com/baseapi/platformapi/jdeclpapi" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" + "git.rosy.net.cn/baseapi/platformapi/jdeclpapi" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/jxstore/financial" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/jx-callback/globals/api" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/jxutils/tasksch" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" ) const ( diff --git a/business/jxstore/cms/message.go b/business/jxstore/cms/message.go index 00eb048a3..74113473b 100644 --- a/business/jxstore/cms/message.go +++ b/business/jxstore/cms/message.go @@ -3,11 +3,11 @@ package cms import ( "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" ) type MessageStatusExt struct { diff --git a/business/jxstore/cms/order.go b/business/jxstore/cms/order.go index c82340643..10e43459e 100644 --- a/business/jxstore/cms/order.go +++ b/business/jxstore/cms/order.go @@ -3,28 +3,28 @@ package cms import ( "errors" "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/recharge_phone_bill" - "gitrosy.jxc4.com/baseapi/platformapi/tonglianpayapi" - "gitrosy.jxc4.com/jx-callback/business/jxstore/event" - "gitrosy.jxc4.com/jx-callback/business/q_bida" + "git.rosy.net.cn/baseapi/platformapi/recharge_phone_bill" + "git.rosy.net.cn/baseapi/platformapi/tonglianpayapi" + "git.rosy.net.cn/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/q_bida" "regexp" "strings" "time" - "gitrosy.jxc4.com/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" - "gitrosy.jxc4.com/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) func CreateOrder(ctx *jxcontext.Context, type1, orderType int, way string, price int, lng, lat float64, mobile, flowCode string) (orderID, errCode string, err error) { diff --git a/business/jxstore/cms/permission.go b/business/jxstore/cms/permission.go index 256cab368..3c2317872 100644 --- a/business/jxstore/cms/permission.go +++ b/business/jxstore/cms/permission.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" ) func GetMenu(ctx *jxcontext.Context, userID string) (menus []*model.Menu, err error) { diff --git a/business/jxstore/cms/recharge_server.go b/business/jxstore/cms/recharge_server.go index acf1b89f4..8e8dd6ca5 100644 --- a/business/jxstore/cms/recharge_server.go +++ b/business/jxstore/cms/recharge_server.go @@ -2,11 +2,11 @@ package cms import ( "errors" - "gitrosy.jxc4.com/baseapi/platformapi/recharge_phone_bill" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/recharge_phone_bill" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" "time" ) diff --git a/business/jxstore/cms/temp.go b/business/jxstore/cms/temp.go index dab7f6899..073261f6c 100644 --- a/business/jxstore/cms/temp.go +++ b/business/jxstore/cms/temp.go @@ -3,7 +3,7 @@ package cms import ( "encoding/json" "fmt" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" "net" "os" ) diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index e1035a14b..110231b2a 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -6,23 +6,23 @@ import ( "sync" "time" - "gitrosy.jxc4.com/jx-callback/business/jxutils/smsmsg" + "git.rosy.net.cn/jx-callback/business/jxutils/smsmsg" - "gitrosy.jxc4.com/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/jxstore/event" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/jx-callback/business/jxstore/financial" - "gitrosy.jxc4.com/baseapi/platformapi/dingdingapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/dingding" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jsonerr" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jsonerr" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) var ( diff --git a/business/jxstore/common/common.go b/business/jxstore/common/common.go index 403a29fbb..b6dfa7617 100644 --- a/business/jxstore/common/common.go +++ b/business/jxstore/common/common.go @@ -1,7 +1,7 @@ package common import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) type Store4User struct { diff --git a/business/jxstore/event/event.go b/business/jxstore/event/event.go index b076227d9..f47a6f85d 100644 --- a/business/jxstore/event/event.go +++ b/business/jxstore/event/event.go @@ -7,14 +7,14 @@ import ( "sync" "time" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" "github.com/gorilla/websocket" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" ) var ( diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 27cf672db..fb2a20a19 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -4,10 +4,10 @@ import ( "encoding/hex" "errors" "fmt" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" "io" "net" "strings" diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index 7fbc6203c..65640fb50 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -3,11 +3,11 @@ package event import ( "encoding/hex" "fmt" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" "net" "regexp" "strconv" diff --git a/business/jxstore/event/print_test.go b/business/jxstore/event/print_test.go index 1d9fc5a48..90c388acd 100644 --- a/business/jxstore/event/print_test.go +++ b/business/jxstore/event/print_test.go @@ -3,8 +3,8 @@ package event import ( "encoding/hex" "fmt" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" "strconv" "strings" "testing" diff --git a/business/jxstore/financial/bill.go b/business/jxstore/financial/bill.go index 25c800630..396fda19e 100644 --- a/business/jxstore/financial/bill.go +++ b/business/jxstore/financial/bill.go @@ -2,12 +2,12 @@ package financial import ( _ "fmt" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" "github.com/astaxie/beego/client/orm" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" "time" ) diff --git a/business/jxstore/financial/financial.go b/business/jxstore/financial/financial.go index 870875a6f..905c19f18 100644 --- a/business/jxstore/financial/financial.go +++ b/business/jxstore/financial/financial.go @@ -11,14 +11,14 @@ import ( "strings" "time" - "gitrosy.jxc4.com/baseapi/platformapi/tonglianpayapi" - "gitrosy.jxc4.com/baseapi/platformapi/wxpayapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/weixin" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/tonglianpayapi" + "git.rosy.net.cn/baseapi/platformapi/wxpayapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/jxstore/financial/pay.go b/business/jxstore/financial/pay.go index b9406fbf7..cad1ebff2 100644 --- a/business/jxstore/financial/pay.go +++ b/business/jxstore/financial/pay.go @@ -2,15 +2,15 @@ package financial import ( "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/recharge_phone_bill" - "gitrosy.jxc4.com/baseapi/platformapi/tonglianpayapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/business/q_bida" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/recharge_phone_bill" + "git.rosy.net.cn/baseapi/platformapi/tonglianpayapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/q_bida" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) type PayHandler struct { diff --git a/business/jxstore/initdata/initdata.go b/business/jxstore/initdata/initdata.go index 8d3fa16ff..46ee3bc0c 100644 --- a/business/jxstore/initdata/initdata.go +++ b/business/jxstore/initdata/initdata.go @@ -3,12 +3,12 @@ package initdata import ( "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/autonavi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/autonavi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" ) func TruncateTable(db *dao.DaoDB, tableName string) (err error) { diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 47e348712..b34eaae2b 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -1,19 +1,19 @@ package misc import ( - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner/pdd" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - bidaServer "gitrosy.jxc4.com/jx-callback/business/q_bida" + "git.rosy.net.cn/jx-callback/business/jxstore/partner/pdd" + "git.rosy.net.cn/jx-callback/business/model/dao" + bidaServer "git.rosy.net.cn/jx-callback/business/q_bida" "time" - "gitrosy.jxc4.com/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/jxstore/event" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/globals" ) var ( diff --git a/business/jxstore/partner/jds/jds.go b/business/jxstore/partner/jds/jds.go index a2775013f..17ee29a09 100644 --- a/business/jxstore/partner/jds/jds.go +++ b/business/jxstore/partner/jds/jds.go @@ -1,11 +1,11 @@ package jds import ( - "gitrosy.jxc4.com/baseapi/platformapi/jdunionapi" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/jdunionapi" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" ) type UnionHandler struct { diff --git a/business/jxstore/partner/jds/union.go b/business/jxstore/partner/jds/union.go index bc5955bce..888b80c1d 100644 --- a/business/jxstore/partner/jds/union.go +++ b/business/jxstore/partner/jds/union.go @@ -1,9 +1,9 @@ package jds import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" ) func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int, goodsID string) (link string, err error) { diff --git a/business/jxstore/partner/mt/mt.go b/business/jxstore/partner/mt/mt.go index 72e98191d..6a578980a 100644 --- a/business/jxstore/partner/mt/mt.go +++ b/business/jxstore/partner/mt/mt.go @@ -1,11 +1,11 @@ package mt import ( - "gitrosy.jxc4.com/baseapi/platformapi/mtunionapi" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/mtunionapi" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" ) type UnionHandler struct { diff --git a/business/jxstore/partner/mt/union.go b/business/jxstore/partner/mt/union.go index fa633f47c..414bb4ef9 100644 --- a/business/jxstore/partner/mt/union.go +++ b/business/jxstore/partner/mt/union.go @@ -1,15 +1,15 @@ package mt import ( - "gitrosy.jxc4.com/baseapi/platformapi/mtunionapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/mtunionapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" "strings" "time" ) diff --git a/business/jxstore/partner/partner.go b/business/jxstore/partner/partner.go index f3b760cd8..41af9e940 100644 --- a/business/jxstore/partner/partner.go +++ b/business/jxstore/partner/partner.go @@ -3,7 +3,7 @@ package partner import ( "time" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" ) var ( diff --git a/business/jxstore/partner/pdd/pdd.go b/business/jxstore/partner/pdd/pdd.go index c3406a3a9..d28aeed39 100644 --- a/business/jxstore/partner/pdd/pdd.go +++ b/business/jxstore/partner/pdd/pdd.go @@ -1,11 +1,11 @@ package pdd import ( - "gitrosy.jxc4.com/baseapi/platformapi/pddapi" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/pddapi" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" ) type UnionHandler struct { diff --git a/business/jxstore/partner/pdd/union.go b/business/jxstore/partner/pdd/union.go index c96addcaf..c8c67c35c 100644 --- a/business/jxstore/partner/pdd/union.go +++ b/business/jxstore/partner/pdd/union.go @@ -2,17 +2,17 @@ package pdd import ( "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/pddapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/jxutils/tasksch" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/pddapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" "strings" "time" ) diff --git a/business/jxstore/partner/taobao/taobao.go b/business/jxstore/partner/taobao/taobao.go index 003ad4887..925f3757b 100644 --- a/business/jxstore/partner/taobao/taobao.go +++ b/business/jxstore/partner/taobao/taobao.go @@ -1,11 +1,11 @@ package taobao import ( - "gitrosy.jxc4.com/baseapi/platformapi/tbunionapi" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/tbunionapi" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" ) type UnionHandler struct { diff --git a/business/jxstore/partner/taobao/union.go b/business/jxstore/partner/taobao/union.go index cc0fa4984..3a2d4bec0 100644 --- a/business/jxstore/partner/taobao/union.go +++ b/business/jxstore/partner/taobao/union.go @@ -2,12 +2,12 @@ package taobao import ( "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/tbunionapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/tbunionapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/partner" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals/api" "strings" ) diff --git a/business/jxutils/cache/redis/redis.go b/business/jxutils/cache/redis/redis.go index 7ab42f1b3..37e6d0bb0 100644 --- a/business/jxutils/cache/redis/redis.go +++ b/business/jxutils/cache/redis/redis.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "git.rosy.net.cn/baseapi/utils" "github.com/go-redis/redis" - "gitrosy.jxc4.com/baseapi/utils" ) type Cacher struct { diff --git a/business/jxutils/cache/redis/redis_test.go b/business/jxutils/cache/redis/redis_test.go index 15f2b9fb4..0a314b783 100644 --- a/business/jxutils/cache/redis/redis_test.go +++ b/business/jxutils/cache/redis/redis_test.go @@ -3,8 +3,8 @@ package redis import ( "testing" - "gitrosy.jxc4.com/jx-callback/business/jxutils/cache" - "gitrosy.jxc4.com/jx-callback/globals/testinit1" + "git.rosy.net.cn/jx-callback/business/jxutils/cache" + "git.rosy.net.cn/jx-callback/globals/testinit1" ) var ( diff --git a/business/jxutils/configindb/configindb.go b/business/jxutils/configindb/configindb.go index 971600f3c..225586354 100644 --- a/business/jxutils/configindb/configindb.go +++ b/business/jxutils/configindb/configindb.go @@ -4,9 +4,9 @@ import ( "fmt" "sync" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/business/model/legacymodel" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/model/legacymodel" ) type ConfigNotifier func(key, value string) diff --git a/business/jxutils/datares/datares.go b/business/jxutils/datares/datares.go index 7f18c0e11..39b36950c 100644 --- a/business/jxutils/datares/datares.go +++ b/business/jxutils/datares/datares.go @@ -3,21 +3,21 @@ package datares import ( "bytes" "fmt" + "git.rosy.net.cn/jx-callback/globals/api" "github.com/qiniu/api.v7/storage" - "gitrosy.jxc4.com/jx-callback/globals/api" "image" "image/gif" "image/jpeg" "image/png" "net/http" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/jxutils/tasksch" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - //"gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + //"git.rosy.net.cn/jx-callback/globals/api" //"github.com/qiniu/api.v7/storage" ) diff --git a/business/jxutils/datares/datares_test.go b/business/jxutils/datares/datares_test.go index 0ceb5162f..a209a6f8c 100644 --- a/business/jxutils/datares/datares_test.go +++ b/business/jxutils/datares/datares_test.go @@ -3,10 +3,10 @@ package datares import ( "testing" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals/testinit" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals/testinit" ) func init() { diff --git a/business/jxutils/ddmsg/ddmsg.go b/business/jxutils/ddmsg/ddmsg.go index 1f6de4ac6..9ab3da3e0 100644 --- a/business/jxutils/ddmsg/ddmsg.go +++ b/business/jxutils/ddmsg/ddmsg.go @@ -3,12 +3,12 @@ package ddmsg import ( "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/dingdingapi" - "gitrosy.jxc4.com/baseapi/utils/errlist" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/dingding" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" + "git.rosy.net.cn/baseapi/utils/errlist" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) func SendDDUserMessage(msgType, ddUserID, title, content string) (err error) { diff --git a/business/jxutils/ditu/ditu.go b/business/jxutils/ditu/ditu.go index 49f7dd2af..2e8695649 100644 --- a/business/jxutils/ditu/ditu.go +++ b/business/jxutils/ditu/ditu.go @@ -4,10 +4,10 @@ import ( "math" "strings" - "gitrosy.jxc4.com/baseapi/platformapi/autonavi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/autonavi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/jxutils/ditu/ditu_test.go b/business/jxutils/ditu/ditu_test.go index f19557613..48de31f77 100644 --- a/business/jxutils/ditu/ditu_test.go +++ b/business/jxutils/ditu/ditu_test.go @@ -3,8 +3,8 @@ package ditu import ( "testing" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals/testinit" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals/testinit" ) func init() { diff --git a/business/jxutils/dtask/dtask.go b/business/jxutils/dtask/dtask.go index 0fa565c21..36d3dd597 100644 --- a/business/jxutils/dtask/dtask.go +++ b/business/jxutils/dtask/dtask.go @@ -6,11 +6,11 @@ import ( "reflect" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/business/partner" - "gitrosy.jxc4.com/jx-callback/globals/refutil" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/partner" + "git.rosy.net.cn/jx-callback/globals/refutil" ) var ( diff --git a/business/jxutils/dtask/dtask_test.go b/business/jxutils/dtask/dtask_test.go index 69bb19e3f..494a7bdef 100644 --- a/business/jxutils/dtask/dtask_test.go +++ b/business/jxutils/dtask/dtask_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "gitrosy.jxc4.com/baseapi/utils" - _ "gitrosy.jxc4.com/jx-callback/business/jxcallback/scheduler/defsch" - "gitrosy.jxc4.com/jx-callback/business/model" - _ "gitrosy.jxc4.com/jx-callback/business/partner/purchase/jd" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/testinit" + "git.rosy.net.cn/baseapi/utils" + _ "git.rosy.net.cn/jx-callback/business/jxcallback/scheduler/defsch" + "git.rosy.net.cn/jx-callback/business/model" + _ "git.rosy.net.cn/jx-callback/business/partner/purchase/jd" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/testinit" ) func init() { diff --git a/business/jxutils/eventhub/eventhub.go b/business/jxutils/eventhub/eventhub.go index 7b1a32002..3a4ca25f7 100644 --- a/business/jxutils/eventhub/eventhub.go +++ b/business/jxutils/eventhub/eventhub.go @@ -6,9 +6,9 @@ import ( "sync" "time" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" ) const ( diff --git a/business/jxutils/eventhub/syseventhub/syseventhub.go b/business/jxutils/eventhub/syseventhub/syseventhub.go index 26234ab05..99a21bcf1 100644 --- a/business/jxutils/eventhub/syseventhub/syseventhub.go +++ b/business/jxutils/eventhub/syseventhub/syseventhub.go @@ -3,11 +3,11 @@ package syseventhub import ( "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/business/jxutils/eventhub" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/jx-callback/business/jxutils/eventhub" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/jxutils/excel/excel.go b/business/jxutils/excel/excel.go index 6952067e3..23d3d45e0 100644 --- a/business/jxutils/excel/excel.go +++ b/business/jxutils/excel/excel.go @@ -3,9 +3,9 @@ package excel import ( "bytes" "fmt" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" "github.com/360EntSecGroup-Skylar/excelize" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" "io" "reflect" ) diff --git a/business/jxutils/jsonerr/jsonerr.go b/business/jxutils/jsonerr/jsonerr.go index c0d00324d..c055536e6 100644 --- a/business/jxutils/jsonerr/jsonerr.go +++ b/business/jxutils/jsonerr/jsonerr.go @@ -1,6 +1,6 @@ package jsonerr -import "gitrosy.jxc4.com/baseapi/utils" +import "git.rosy.net.cn/baseapi/utils" type Error struct { errCode string diff --git a/business/jxutils/jxcontext/jxcontext.go b/business/jxutils/jxcontext/jxcontext.go index 211f8bd82..0cbea845f 100644 --- a/business/jxutils/jxcontext/jxcontext.go +++ b/business/jxutils/jxcontext/jxcontext.go @@ -4,11 +4,11 @@ import ( "errors" "net/http" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" ) type IAuther interface { diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index 93e787ef5..9b3e70cf7 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -17,15 +17,15 @@ import ( "strings" "time" + "git.rosy.net.cn/baseapi" + "git.rosy.net.cn/baseapi/platformapi/autonavi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/baseapi/utils/routinepool" + "git.rosy.net.cn/jx-callback/business/jxutils/excel" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" "github.com/qiniu/api.v7/storage" - "gitrosy.jxc4.com/baseapi" - "gitrosy.jxc4.com/baseapi/platformapi/autonavi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/baseapi/utils/routinepool" - "gitrosy.jxc4.com/jx-callback/business/jxutils/excel" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" ) var ( diff --git a/business/jxutils/jxutils_act.go b/business/jxutils/jxutils_act.go index 2b30c66e6..575e8f650 100644 --- a/business/jxutils/jxutils_act.go +++ b/business/jxutils/jxutils_act.go @@ -1,7 +1,7 @@ package jxutils import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) type ActStoreSkuMap struct { diff --git a/business/jxutils/jxutils_cms.go b/business/jxutils/jxutils_cms.go index dd04b3bf3..421ee3999 100644 --- a/business/jxutils/jxutils_cms.go +++ b/business/jxutils/jxutils_cms.go @@ -17,13 +17,13 @@ import ( "sync" "time" + "git.rosy.net.cn/baseapi/platformapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" "github.com/boombuler/barcode" "github.com/boombuler/barcode/code128" "github.com/boombuler/barcode/qr" - "gitrosy.jxc4.com/baseapi/platformapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" ) const ( diff --git a/business/jxutils/jxutils_cms_test.go b/business/jxutils/jxutils_cms_test.go index b15f5fb00..fe078858e 100644 --- a/business/jxutils/jxutils_cms_test.go +++ b/business/jxutils/jxutils_cms_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) func TestSplitSlice(t *testing.T) { diff --git a/business/jxutils/jxutils_reflect_test.go b/business/jxutils/jxutils_reflect_test.go index 24cd16e7c..108766f12 100644 --- a/business/jxutils/jxutils_reflect_test.go +++ b/business/jxutils/jxutils_reflect_test.go @@ -3,8 +3,8 @@ package jxutils import ( "testing" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals/refutil" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals/refutil" ) func TestObjFieldByName(t *testing.T) { diff --git a/business/jxutils/jxutils_sync_map.go b/business/jxutils/jxutils_sync_map.go index 70462496d..99c2beeab 100644 --- a/business/jxutils/jxutils_sync_map.go +++ b/business/jxutils/jxutils_sync_map.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" ) type SyncMapWithTimeout struct { diff --git a/business/jxutils/jxutils_test.go b/business/jxutils/jxutils_test.go index 26b7755d4..2852010fe 100644 --- a/business/jxutils/jxutils_test.go +++ b/business/jxutils/jxutils_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals/testinit" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals/testinit" ) func init() { diff --git a/business/jxutils/msg/msg.go b/business/jxutils/msg/msg.go index 2cd950f6b..7067c8ab4 100644 --- a/business/jxutils/msg/msg.go +++ b/business/jxutils/msg/msg.go @@ -3,14 +3,14 @@ package msg import ( "fmt" - "gitrosy.jxc4.com/jx-callback/business/jxutils/ddmsg" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" + "git.rosy.net.cn/jx-callback/business/model" - "gitrosy.jxc4.com/baseapi/platformapi/dingdingapi" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/dingding" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/weixin" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" + "git.rosy.net.cn/jx-callback/globals" ) // todo msgType不依赖于钉钉 diff --git a/business/jxutils/smsmsg/smsmsg.go b/business/jxutils/smsmsg/smsmsg.go index 06e295548..2bd128845 100644 --- a/business/jxutils/smsmsg/smsmsg.go +++ b/business/jxutils/smsmsg/smsmsg.go @@ -5,11 +5,11 @@ import ( aliyunsmsclient "github.com/KenmyZhang/aliyun-communicate" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/baseapi/utils/errlist" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/baseapi/utils/errlist" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) var ( diff --git a/business/jxutils/smsmsg/smsmsg_test.go b/business/jxutils/smsmsg/smsmsg_test.go index cbc462e2b..98382eade 100644 --- a/business/jxutils/smsmsg/smsmsg_test.go +++ b/business/jxutils/smsmsg/smsmsg_test.go @@ -3,9 +3,9 @@ package smsmsg import ( "testing" - "gitrosy.jxc4.com/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/globals/testinit" + "git.rosy.net.cn/jx-callback/globals/testinit" ) func init() { diff --git a/business/jxutils/tasks/configrefresh.go b/business/jxutils/tasks/configrefresh.go index a886b6275..276eabfcb 100644 --- a/business/jxutils/tasks/configrefresh.go +++ b/business/jxutils/tasks/configrefresh.go @@ -6,17 +6,17 @@ import ( "net/http" "time" - "gitrosy.jxc4.com/baseapi/platformapi" + "git.rosy.net.cn/baseapi/platformapi" - "gitrosy.jxc4.com/jx-callback/business/jxutils/eventhub/syseventhub" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/business/model/legacymodel" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/jx-callback/business/jxutils/eventhub/syseventhub" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/model/legacymodel" + "git.rosy.net.cn/jx-callback/globals/api" - "gitrosy.jxc4.com/baseapi/platformapi/weimobapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/platformapi/weimobapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/client/orm" diff --git a/business/jxutils/tasksch/parallel_task.go b/business/jxutils/tasksch/parallel_task.go index b84a784e1..a396b84cc 100644 --- a/business/jxutils/tasksch/parallel_task.go +++ b/business/jxutils/tasksch/parallel_task.go @@ -3,10 +3,10 @@ package tasksch import ( "errors" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/globals" ) const ( diff --git a/business/jxutils/tasksch/parallel_task_test.go b/business/jxutils/tasksch/parallel_task_test.go index 78ae63b4e..5343f560a 100644 --- a/business/jxutils/tasksch/parallel_task_test.go +++ b/business/jxutils/tasksch/parallel_task_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" ) func TestRunParallelTask(t *testing.T) { diff --git a/business/jxutils/tasksch/sequence_task.go b/business/jxutils/tasksch/sequence_task.go index 47dad3a61..bd25d425c 100644 --- a/business/jxutils/tasksch/sequence_task.go +++ b/business/jxutils/tasksch/sequence_task.go @@ -1,9 +1,9 @@ package tasksch import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/globals" ) const ( diff --git a/business/jxutils/tasksch/sequence_task_test.go b/business/jxutils/tasksch/sequence_task_test.go index c975e51c9..29fff37f3 100644 --- a/business/jxutils/tasksch/sequence_task_test.go +++ b/business/jxutils/tasksch/sequence_task_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" ) func TestRunSeqTask(t *testing.T) { diff --git a/business/jxutils/tasksch/task.go b/business/jxutils/tasksch/task.go index e1c5638b6..90627c5b8 100644 --- a/business/jxutils/tasksch/task.go +++ b/business/jxutils/tasksch/task.go @@ -7,11 +7,11 @@ import ( "sync" "time" - "gitrosy.jxc4.com/baseapi/platformapi/dingdingapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/ddmsg" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/globals" ) const ( diff --git a/business/jxutils/tasksch/task_man.go b/business/jxutils/tasksch/task_man.go index 16e56e314..8b1fcfe29 100644 --- a/business/jxutils/tasksch/task_man.go +++ b/business/jxutils/tasksch/task_man.go @@ -4,7 +4,7 @@ import ( "sort" "time" - "gitrosy.jxc4.com/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils" ) const ( diff --git a/business/jxutils/weixinmsg/weixinmsg.go b/business/jxutils/weixinmsg/weixinmsg.go index b4003173a..7e79c7919 100644 --- a/business/jxutils/weixinmsg/weixinmsg.go +++ b/business/jxutils/weixinmsg/weixinmsg.go @@ -3,11 +3,11 @@ package weixinmsg import ( "fmt" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" ) const ( diff --git a/business/jxutils/weixinmsg/weixinmsg_test.go b/business/jxutils/weixinmsg/weixinmsg_test.go index c90a7aa00..5c9e27131 100644 --- a/business/jxutils/weixinmsg/weixinmsg_test.go +++ b/business/jxutils/weixinmsg/weixinmsg_test.go @@ -3,11 +3,11 @@ package weixinmsg import ( "testing" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/globals/api2" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/globals/api2" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals/testinit" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals/testinit" ) func init() { diff --git a/business/model/act.go b/business/model/act.go index b9a5ffbff..2eb89d230 100644 --- a/business/model/act.go +++ b/business/model/act.go @@ -3,7 +3,7 @@ package model import ( "time" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" ) const ( diff --git a/business/model/const.go b/business/model/const.go index a1304aec2..0f10cb444 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -3,10 +3,10 @@ package model import ( "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/ebaiapi" - "gitrosy.jxc4.com/baseapi/platformapi/jdapi" - "gitrosy.jxc4.com/baseapi/platformapi/mtwmapi" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/platformapi/ebaiapi" + "git.rosy.net.cn/baseapi/platformapi/jdapi" + "git.rosy.net.cn/baseapi/platformapi/mtwmapi" + "git.rosy.net.cn/jx-callback/globals" ) var ( diff --git a/business/model/dao/act.go b/business/model/dao/act.go index f92d6146d..6e470673c 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -4,11 +4,11 @@ import ( "fmt" "time" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" ) type ActMapPureInfo struct { diff --git a/business/model/dao/act_test.go b/business/model/dao/act_test.go index 3b1c6c35e..be48eee2a 100644 --- a/business/model/dao/act_test.go +++ b/business/model/dao/act_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) func TestGetEffectiveActStoreSkuInfo(t *testing.T) { diff --git a/business/model/dao/common.go b/business/model/dao/common.go index 9a8abb643..f3dbab71a 100644 --- a/business/model/dao/common.go +++ b/business/model/dao/common.go @@ -1,7 +1,7 @@ package dao import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) func GetDataResource(db *DaoDB, hashCode, fullURL string) (dataRes *model.DataResource, err error) { diff --git a/business/model/dao/dao.go b/business/model/dao/dao.go index ef8543452..e2ffca07b 100644 --- a/business/model/dao/dao.go +++ b/business/model/dao/dao.go @@ -6,9 +6,9 @@ import ( "runtime/debug" "time" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" "github.com/astaxie/beego/client/orm" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" ) const ( diff --git a/business/model/dao/dao_auth2.go b/business/model/dao/dao_auth2.go index 8cd60ac12..24f876168 100644 --- a/business/model/dao/dao_auth2.go +++ b/business/model/dao/dao_auth2.go @@ -3,8 +3,8 @@ package dao import ( "errors" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) func GetAuthBind(db *DaoDB, bindType int, authType, authID string) (authBind *model.AuthBind, err error) { diff --git a/business/model/dao/dao_bill.go b/business/model/dao/dao_bill.go index 8aff35e62..f00018442 100644 --- a/business/model/dao/dao_bill.go +++ b/business/model/dao/dao_bill.go @@ -1,12 +1,12 @@ package dao import ( - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" ) func GetUserBill(db *DaoDB, userID, billID string) (userBill *model.UserBill, err error) { diff --git a/business/model/dao/dao_bz.go b/business/model/dao/dao_bz.go index 958af3822..2af3a4ecd 100644 --- a/business/model/dao/dao_bz.go +++ b/business/model/dao/dao_bz.go @@ -4,10 +4,10 @@ import ( "reflect" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/refutil" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/refutil" ) type KVUpdateItem struct { diff --git a/business/model/dao/dao_job.go b/business/model/dao/dao_job.go index 3b7918c79..ee443b573 100644 --- a/business/model/dao/dao_job.go +++ b/business/model/dao/dao_job.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" ) const ( diff --git a/business/model/dao/dao_matter.go b/business/model/dao/dao_matter.go index f7fafc8ab..7837f5ea2 100644 --- a/business/model/dao/dao_matter.go +++ b/business/model/dao/dao_matter.go @@ -1,8 +1,8 @@ package dao import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) func GetVendorMatterCategory(db *DaoDB, vendorID int) (vendorMatterCat []*model.VendorMatterCategory, err error) { diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index 0710e7e91..9bacc0db3 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -4,10 +4,10 @@ import ( "github.com/astaxie/beego/client/orm" "time" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" ) func GetDeliveryOrdersNoPage(db *DaoDB, userIDs []string, statuss []int, fromTime, toTime time.Time, isWeights []int) (dOrders []*model.DeliveryOrder, err error) { diff --git a/business/model/dao/dao_print.go b/business/model/dao/dao_print.go index f7871f7b4..c7e8900ec 100644 --- a/business/model/dao/dao_print.go +++ b/business/model/dao/dao_print.go @@ -1,9 +1,9 @@ package dao import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" "time" ) diff --git a/business/model/dao/dao_print_activation.go b/business/model/dao/dao_print_activation.go index e4c7dcedc..9c12faf2d 100644 --- a/business/model/dao/dao_print_activation.go +++ b/business/model/dao/dao_print_activation.go @@ -1,7 +1,7 @@ package dao import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) func CheckHeard(printNo string) (bool, error) { diff --git a/business/model/dao/dao_print_ex.go b/business/model/dao/dao_print_ex.go index d794d842d..aa8f8c893 100644 --- a/business/model/dao/dao_print_ex.go +++ b/business/model/dao/dao_print_ex.go @@ -1,8 +1,8 @@ package dao import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) // QueryUserPrinter 查询用户打印机 diff --git a/business/model/dao/dao_print_setting.go b/business/model/dao/dao_print_setting.go index 5cdc79e3e..f4a3069b4 100644 --- a/business/model/dao/dao_print_setting.go +++ b/business/model/dao/dao_print_setting.go @@ -2,8 +2,8 @@ package dao import ( "errors" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) func GetPrintSetting(printNo string) (*model.PrintSettingObj, error) { diff --git a/business/model/dao/dao_print_temp.go b/business/model/dao/dao_print_temp.go index a19f4b92c..31da35837 100644 --- a/business/model/dao/dao_print_temp.go +++ b/business/model/dao/dao_print_temp.go @@ -2,8 +2,8 @@ package dao import ( "errors" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) // SelectUserDefaultTemp 查询用户默认模板 diff --git a/business/model/dao/dao_user.go b/business/model/dao/dao_user.go index f4bb362ab..9e3eb9c2a 100644 --- a/business/model/dao/dao_user.go +++ b/business/model/dao/dao_user.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" ) type UserDeliveryAddressEx struct { diff --git a/business/model/dao/dao_utils.go b/business/model/dao/dao_utils.go index e3c8e6d5a..eaca61326 100644 --- a/business/model/dao/dao_utils.go +++ b/business/model/dao/dao_utils.go @@ -6,9 +6,9 @@ import ( "strings" "time" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals/refutil" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals/refutil" ) func IDCULDFilterMapByStructObject(mapData map[string]interface{}, obj interface{}, isCheckValue bool) (valid map[string]interface{}, invalid map[string]interface{}) { diff --git a/business/model/dao/event.go b/business/model/dao/event.go index 08c555352..f2f531d04 100644 --- a/business/model/dao/event.go +++ b/business/model/dao/event.go @@ -4,9 +4,9 @@ import ( "strings" "time" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) type OperateEventExt struct { diff --git a/business/model/dao/new_config.go b/business/model/dao/new_config.go index 43bc6a854..aaeaa8a2d 100644 --- a/business/model/dao/new_config.go +++ b/business/model/dao/new_config.go @@ -3,10 +3,10 @@ package dao import ( "fmt" - "gitrosy.jxc4.com/baseapi/utils/errlist" + "git.rosy.net.cn/baseapi/utils/errlist" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) func QueryConfigs(db *DaoDB, key, configType, keyword string) (configList []*model.NewConfig, err error) { diff --git a/business/model/dao/permission.go b/business/model/dao/permission.go index a7d36af7a..70b125c82 100644 --- a/business/model/dao/permission.go +++ b/business/model/dao/permission.go @@ -1,8 +1,8 @@ package dao import ( - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" ) func GetMenu(db *DaoDB, name string, level int, userID string) (menus []*model.Menu, err error) { diff --git a/business/model/dao/place.go b/business/model/dao/place.go index b26b178a7..c332385c8 100644 --- a/business/model/dao/place.go +++ b/business/model/dao/place.go @@ -1,8 +1,8 @@ package dao import ( + "git.rosy.net.cn/jx-callback/business/model" "github.com/astaxie/beego/client/orm" - "gitrosy.jxc4.com/jx-callback/business/model" ) const ( diff --git a/business/model/dao/print_activation.go b/business/model/dao/print_activation.go index 08e50959e..6498bc9c4 100644 --- a/business/model/dao/print_activation.go +++ b/business/model/dao/print_activation.go @@ -1,7 +1,7 @@ package dao import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" "time" ) diff --git a/business/model/dao/print_bill.go b/business/model/dao/print_bill.go index 324df109f..ef47a0646 100644 --- a/business/model/dao/print_bill.go +++ b/business/model/dao/print_bill.go @@ -2,7 +2,7 @@ package dao import ( "errors" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) // DeductionPrintBalance 扣除打印机账号余额 diff --git a/business/model/dao/print_bill_record.go b/business/model/dao/print_bill_record.go index 6c26459df..6906e5676 100644 --- a/business/model/dao/print_bill_record.go +++ b/business/model/dao/print_bill_record.go @@ -1,7 +1,7 @@ package dao import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" "time" ) diff --git a/business/model/dao/print_bind_store.go b/business/model/dao/print_bind_store.go index 991b8ae64..e04fb73a8 100644 --- a/business/model/dao/print_bind_store.go +++ b/business/model/dao/print_bind_store.go @@ -1,7 +1,7 @@ package dao import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" "time" ) diff --git a/business/model/dao/print_temp_utils.go b/business/model/dao/print_temp_utils.go index 51eac819c..52defc8f8 100644 --- a/business/model/dao/print_temp_utils.go +++ b/business/model/dao/print_temp_utils.go @@ -3,9 +3,9 @@ package dao import ( "encoding/json" "fmt" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" "strings" "time" ) diff --git a/business/model/dao/user_delivery_address.go b/business/model/dao/user_delivery_address.go index 08d3212bb..5dab70a09 100644 --- a/business/model/dao/user_delivery_address.go +++ b/business/model/dao/user_delivery_address.go @@ -1,7 +1,7 @@ package dao import ( - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) func GetAddressDetail(id int) (*model.UserDeliveryAddress, error) { diff --git a/business/model/job.go b/business/model/job.go index 13ed3e3ca..d0933fde9 100644 --- a/business/model/job.go +++ b/business/model/job.go @@ -3,7 +3,7 @@ package model import ( "time" - "gitrosy.jxc4.com/baseapi/platformapi/txcloudapi" + "git.rosy.net.cn/baseapi/platformapi/txcloudapi" ) const ( diff --git a/business/model/legacymodel/ebaishoplicence.go b/business/model/legacymodel/ebaishoplicence.go index d72632967..bfe9dd3d1 100644 --- a/business/model/legacymodel/ebaishoplicence.go +++ b/business/model/legacymodel/ebaishoplicence.go @@ -1,6 +1,6 @@ package legacymodel -import "gitrosy.jxc4.com/jx-callback/business/model" +import "git.rosy.net.cn/jx-callback/business/model" type EbaiShopLicence struct { model.ModelIDCUL diff --git a/business/model/user.go b/business/model/user.go index 10d714195..bb64d2f67 100644 --- a/business/model/user.go +++ b/business/model/user.go @@ -3,7 +3,7 @@ package model import ( "time" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" ) const ( diff --git a/business/q_bida/express_test.go b/business/q_bida/express_test.go index 2cf45f9ca..5769ab8dc 100644 --- a/business/q_bida/express_test.go +++ b/business/q_bida/express_test.go @@ -2,7 +2,7 @@ package q_bida import ( "fmt" - bida "gitrosy.jxc4.com/baseapi/platformapi/q_bida" + bida "git.rosy.net.cn/baseapi/platformapi/q_bida" "testing" ) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 9df4160c1..e474b614e 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -3,15 +3,15 @@ package q_bida import ( "errors" "fmt" - bida "gitrosy.jxc4.com/baseapi/platformapi/q_bida" - "gitrosy.jxc4.com/baseapi/platformapi/tonglianpayapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" + bida "git.rosy.net.cn/baseapi/platformapi/q_bida" + "git.rosy.net.cn/baseapi/platformapi/tonglianpayapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" "strings" "time" ) diff --git a/business/q_bida/q_bida_server_utils.go b/business/q_bida/q_bida_server_utils.go index 0fe5de604..573dbda96 100644 --- a/business/q_bida/q_bida_server_utils.go +++ b/business/q_bida/q_bida_server_utils.go @@ -3,9 +3,9 @@ package q_bida import ( "errors" "fmt" - bida "gitrosy.jxc4.com/baseapi/platformapi/q_bida" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals/api" + bida "git.rosy.net.cn/baseapi/platformapi/q_bida" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals/api" "math/rand" ) diff --git a/business/q_bida/withdrawal_record.go b/business/q_bida/withdrawal_record.go index 587080820..5738575ce 100644 --- a/business/q_bida/withdrawal_record.go +++ b/business/q_bida/withdrawal_record.go @@ -3,11 +3,11 @@ package q_bida import ( "errors" "fmt" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" "time" ) diff --git a/business/q_bida/withdrawal_record_utils.go b/business/q_bida/withdrawal_record_utils.go index 934ef88fa..716430e92 100644 --- a/business/q_bida/withdrawal_record_utils.go +++ b/business/q_bida/withdrawal_record_utils.go @@ -1,11 +1,11 @@ package q_bida import ( - "gitrosy.jxc4.com/baseapi/platformapi/alipayapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/alipayapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" ) // SendPayInfo2Ali 发起支付 diff --git a/controllers/api_controller.go b/controllers/api_controller.go index d4ee8fe29..d70883f9b 100644 --- a/controllers/api_controller.go +++ b/controllers/api_controller.go @@ -6,13 +6,13 @@ import ( "encoding/json" "errors" "fmt" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" "github.com/astaxie/beego/client/orm" "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" "math/rand" "net/http" "net/url" diff --git a/controllers/api_controller_ex.go b/controllers/api_controller_ex.go index bad4ba2f8..692a1e7bc 100644 --- a/controllers/api_controller_ex.go +++ b/controllers/api_controller_ex.go @@ -2,7 +2,7 @@ package controllers import ( "fmt" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" ) type CallResult2 struct { diff --git a/controllers/auth2_contoller.go b/controllers/auth2_contoller.go index c6f39f6e1..9924daacf 100644 --- a/controllers/auth2_contoller.go +++ b/controllers/auth2_contoller.go @@ -6,15 +6,15 @@ import ( "net/http" "strings" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding" + _ "git.rosy.net.cn/jx-callback/business/auth2/authprovider/mobile" // 强制导入mobile认证方式 + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/password" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/dingding" - _ "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/mobile" // 强制导入mobile认证方式 - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/password" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/weixin" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/globals" ) func GetComposedCode(c *beego.Controller, code string) (composedCode string) { diff --git a/controllers/bill_controller.go b/controllers/bill_controller.go index 19ae0a3d5..1e5830089 100644 --- a/controllers/bill_controller.go +++ b/controllers/bill_controller.go @@ -1,8 +1,8 @@ package controllers import ( + "git.rosy.net.cn/jx-callback/business/jxstore/financial" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" ) type BillController struct { diff --git a/controllers/cms.go b/controllers/cms.go index 615496efb..c2f43996d 100644 --- a/controllers/cms.go +++ b/controllers/cms.go @@ -1,10 +1,10 @@ package controllers import ( + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxstore/initdata" + "git.rosy.net.cn/jx-callback/business/jxutils/datares" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxstore/initdata" - "gitrosy.jxc4.com/jx-callback/business/jxutils/datares" ) type CmsController struct { diff --git a/controllers/cms_task.go b/controllers/cms_task.go index 986751f27..966809d17 100644 --- a/controllers/cms_task.go +++ b/controllers/cms_task.go @@ -5,10 +5,10 @@ import ( "runtime" "time" - "gitrosy.jxc4.com/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/jx-callback/business/jxutils/tasksch" ) type TaskController struct { diff --git a/controllers/event_controller.go b/controllers/event_controller.go index b3fd53b05..6ec700cd3 100644 --- a/controllers/event_controller.go +++ b/controllers/event_controller.go @@ -9,19 +9,19 @@ import ( "path" "time" - "gitrosy.jxc4.com/jx-callback/business/jxstore/event" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model" "github.com/gorilla/websocket" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" beego "github.com/astaxie/beego/adapter" ) diff --git a/controllers/job_controller.go b/controllers/job_controller.go index 417179de4..88d46e624 100644 --- a/controllers/job_controller.go +++ b/controllers/job_controller.go @@ -3,15 +3,15 @@ package controllers import ( "fmt" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" ) type JobController struct { diff --git a/controllers/mtwm_callback.go b/controllers/mtwm_callback.go index 36d27dd69..56aa30645 100644 --- a/controllers/mtwm_callback.go +++ b/controllers/mtwm_callback.go @@ -1,12 +1,12 @@ package controllers import ( + "git.rosy.net.cn/baseapi/platformapi/mtunionapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/partner/mt" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/baseapi/platformapi/mtunionapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/partner/mt" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" "net/http" ) diff --git a/controllers/order_controller.go b/controllers/order_controller.go index 3deb5de1b..165868080 100644 --- a/controllers/order_controller.go +++ b/controllers/order_controller.go @@ -1,10 +1,10 @@ package controllers import ( + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/jx-callback/business/jxutils" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" - "gitrosy.jxc4.com/jx-callback/business/jxutils" ) type OrderController struct { diff --git a/controllers/print_controller.go b/controllers/print_controller.go index f1780a662..80c1b6613 100644 --- a/controllers/print_controller.go +++ b/controllers/print_controller.go @@ -1,9 +1,9 @@ package controllers import ( + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" beego "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" ) type PrintController struct { diff --git a/controllers/q_bida.go b/controllers/q_bida.go index 90e7d77aa..e16c7b240 100644 --- a/controllers/q_bida.go +++ b/controllers/q_bida.go @@ -2,11 +2,11 @@ package controllers import ( "fmt" + bida "git.rosy.net.cn/baseapi/platformapi/q_bida" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + bidaServer "git.rosy.net.cn/jx-callback/business/q_bida" "github.com/astaxie/beego/server/web" - bida "gitrosy.jxc4.com/baseapi/platformapi/q_bida" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - bidaServer "gitrosy.jxc4.com/jx-callback/business/q_bida" ) type QBiDaExpressController struct { diff --git a/controllers/recharge_callback.go b/controllers/recharge_callback.go index f2e11175f..797856d16 100644 --- a/controllers/recharge_callback.go +++ b/controllers/recharge_callback.go @@ -1,11 +1,11 @@ package controllers import ( + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" "io/ioutil" "net/http" ) diff --git a/controllers/recharge_controller.go b/controllers/recharge_controller.go index 49981a552..a45b334dd 100644 --- a/controllers/recharge_controller.go +++ b/controllers/recharge_controller.go @@ -3,10 +3,10 @@ package controllers import ( "errors" "fmt" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" ) type RechargeManagerController struct { diff --git a/controllers/tonglian_callback.go b/controllers/tonglian_callback.go index a5789b035..6572311de 100644 --- a/controllers/tonglian_callback.go +++ b/controllers/tonglian_callback.go @@ -5,12 +5,12 @@ import ( "io/ioutil" "net/http" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/jx-callback/business/jxstore/financial" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/jx-callback/globals/api" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web/context" diff --git a/controllers/union_controller.go b/controllers/union_controller.go index d0a929996..39eff4dca 100644 --- a/controllers/union_controller.go +++ b/controllers/union_controller.go @@ -1,11 +1,11 @@ package controllers import ( + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals/api" "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals/api" ) type UnionController struct { diff --git a/controllers/user2_controller.go b/controllers/user2_controller.go index dac25c518..b3c3a6c4d 100644 --- a/controllers/user2_controller.go +++ b/controllers/user2_controller.go @@ -1,18 +1,18 @@ package controllers import ( + "git.rosy.net.cn/baseapi/platformapi/weixinapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/auth2" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxutils" + "git.rosy.net.cn/jx-callback/business/jxutils/jsonerr" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/baseapi/platformapi/weixinapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/auth2" - "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/weixin" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxutils" - "gitrosy.jxc4.com/jx-callback/business/jxutils/jsonerr" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" "strings" ) diff --git a/controllers/user_balance.go b/controllers/user_balance.go index a115f5eb6..1e9fb6c59 100644 --- a/controllers/user_balance.go +++ b/controllers/user_balance.go @@ -2,8 +2,8 @@ package controllers import ( "errors" + "git.rosy.net.cn/jx-callback/business/model/dao" "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/jx-callback/business/model/dao" ) type UserBalanceController struct { diff --git a/controllers/withdrawal_record.go b/controllers/withdrawal_record.go index 631bea3c2..454262ab5 100644 --- a/controllers/withdrawal_record.go +++ b/controllers/withdrawal_record.go @@ -2,9 +2,9 @@ package controllers import ( "errors" + "git.rosy.net.cn/jx-callback/business/model" + withdreawal "git.rosy.net.cn/jx-callback/business/q_bida" "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/jx-callback/business/model" - withdreawal "gitrosy.jxc4.com/jx-callback/business/q_bida" ) type WithdrawalRecordController struct { diff --git a/controllers/wxpay_callback.go b/controllers/wxpay_callback.go index 6d8fd029b..519c8d45e 100644 --- a/controllers/wxpay_callback.go +++ b/controllers/wxpay_callback.go @@ -4,13 +4,13 @@ import ( "fmt" "net/http" - "gitrosy.jxc4.com/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/jx-callback/business/jxstore/financial" + "git.rosy.net.cn/baseapi/platformapi/wxpayapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/api" beego "github.com/astaxie/beego/adapter" - "gitrosy.jxc4.com/baseapi/platformapi/wxpayapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/api" ) type WXPayController struct { diff --git a/globals/api/api.go b/globals/api/api.go index c3b3d184f..f6f26ba57 100644 --- a/globals/api/api.go +++ b/globals/api/api.go @@ -1,44 +1,44 @@ package api import ( - "gitrosy.jxc4.com/baseapi/platformapi/jdunionapi" - "gitrosy.jxc4.com/baseapi/platformapi/pddapi" - "gitrosy.jxc4.com/baseapi/platformapi/q_bida" - "gitrosy.jxc4.com/baseapi/platformapi/recharge_phone_bill" - "gitrosy.jxc4.com/baseapi/platformapi/tbunionapi" + "git.rosy.net.cn/baseapi/platformapi/jdunionapi" + "git.rosy.net.cn/baseapi/platformapi/pddapi" + "git.rosy.net.cn/baseapi/platformapi/q_bida" + "git.rosy.net.cn/baseapi/platformapi/recharge_phone_bill" + "git.rosy.net.cn/baseapi/platformapi/tbunionapi" "io/ioutil" - "gitrosy.jxc4.com/baseapi/platformapi/mtunionapi" + "git.rosy.net.cn/baseapi/platformapi/mtunionapi" - "gitrosy.jxc4.com/baseapi/platformapi/txcloudapi" + "git.rosy.net.cn/baseapi/platformapi/txcloudapi" - "gitrosy.jxc4.com/baseapi/platformapi/ejyapi" + "git.rosy.net.cn/baseapi/platformapi/ejyapi" - "gitrosy.jxc4.com/baseapi/platformapi/mtmemberapi" + "git.rosy.net.cn/baseapi/platformapi/mtmemberapi" - "gitrosy.jxc4.com/baseapi/platformapi/jdshopapi" + "git.rosy.net.cn/baseapi/platformapi/jdshopapi" - "gitrosy.jxc4.com/baseapi/platformapi/aliupcapi" + "git.rosy.net.cn/baseapi/platformapi/aliupcapi" - "gitrosy.jxc4.com/baseapi/platformapi/jdeclpapi" + "git.rosy.net.cn/baseapi/platformapi/jdeclpapi" - "gitrosy.jxc4.com/baseapi/platformapi/tonglianpayapi" + "git.rosy.net.cn/baseapi/platformapi/tonglianpayapi" aliyunsmsclient "github.com/KenmyZhang/aliyun-communicate" - "gitrosy.jxc4.com/baseapi/platformapi/alipayapi" - "gitrosy.jxc4.com/baseapi/platformapi/autonavi" - "gitrosy.jxc4.com/baseapi/platformapi/baidunavi" - "gitrosy.jxc4.com/baseapi/platformapi/dingdingapi" - "gitrosy.jxc4.com/baseapi/platformapi/ebaiapi" - "gitrosy.jxc4.com/baseapi/platformapi/mtwmapi" - "gitrosy.jxc4.com/baseapi/platformapi/showapi" - "gitrosy.jxc4.com/baseapi/platformapi/weimobapi" - "gitrosy.jxc4.com/baseapi/platformapi/weixinapi" - "gitrosy.jxc4.com/baseapi/platformapi/wxpayapi" - "gitrosy.jxc4.com/jx-callback/business/jxutils/cache" - "gitrosy.jxc4.com/jx-callback/business/jxutils/cache/redis" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/platformapi/alipayapi" + "git.rosy.net.cn/baseapi/platformapi/autonavi" + "git.rosy.net.cn/baseapi/platformapi/baidunavi" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" + "git.rosy.net.cn/baseapi/platformapi/ebaiapi" + "git.rosy.net.cn/baseapi/platformapi/mtwmapi" + "git.rosy.net.cn/baseapi/platformapi/showapi" + "git.rosy.net.cn/baseapi/platformapi/weimobapi" + "git.rosy.net.cn/baseapi/platformapi/weixinapi" + "git.rosy.net.cn/baseapi/platformapi/wxpayapi" + "git.rosy.net.cn/jx-callback/business/jxutils/cache" + "git.rosy.net.cn/jx-callback/business/jxutils/cache/redis" + "git.rosy.net.cn/jx-callback/globals" beego "github.com/astaxie/beego/adapter" "github.com/qiniu/api.v7/auth/qbox" diff --git a/globals/api2/api2.go b/globals/api2/api2.go index e3c298cf7..25b901f0a 100644 --- a/globals/api2/api2.go +++ b/globals/api2/api2.go @@ -1,9 +1,9 @@ package api2 import ( - "gitrosy.jxc4.com/jx-callback/business/authz" - "gitrosy.jxc4.com/jx-callback/business/authz/casbinauth" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/jx-callback/business/authz" + "git.rosy.net.cn/jx-callback/business/authz/casbinauth" + "git.rosy.net.cn/jx-callback/globals" ) var ( diff --git a/globals/beegodb/beegodb.go b/globals/beegodb/beegodb.go index 86a8ec8f6..a4f8e9000 100644 --- a/globals/beegodb/beegodb.go +++ b/globals/beegodb/beegodb.go @@ -1,10 +1,10 @@ package beegodb import ( + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/business/model/legacymodel" beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/client/orm" - "gitrosy.jxc4.com/jx-callback/business/model" - "gitrosy.jxc4.com/jx-callback/business/model/legacymodel" ) func Init() { diff --git a/globals/globals.go b/globals/globals.go index 0cc6274de..33d46515c 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -1,10 +1,10 @@ package globals import ( + "git.rosy.net.cn/baseapi" beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/core/logs" _ "github.com/go-sql-driver/mysql" // import your used driver - "gitrosy.jxc4.com/baseapi" "go.uber.org/zap" ) diff --git a/globals/refutil/refutil.go b/globals/refutil/refutil.go index 4645b6fa2..e6c81127d 100644 --- a/globals/refutil/refutil.go +++ b/globals/refutil/refutil.go @@ -7,8 +7,8 @@ import ( "fmt" "reflect" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" ) func CheckAndGetStructValue(item interface{}) *reflect.Value { diff --git a/globals/refutil/refutil_test.go b/globals/refutil/refutil_test.go index 6f6aa25b8..e0596f4be 100644 --- a/globals/refutil/refutil_test.go +++ b/globals/refutil/refutil_test.go @@ -3,7 +3,7 @@ package refutil import ( "testing" - "gitrosy.jxc4.com/baseapi/utils" + "git.rosy.net.cn/baseapi/utils" ) func TestIsValueEqual(t *testing.T) { diff --git a/globals/testinit/testinit.go b/globals/testinit/testinit.go index 1cc517af3..9aa3e0d45 100644 --- a/globals/testinit/testinit.go +++ b/globals/testinit/testinit.go @@ -1,8 +1,8 @@ package testinit import ( - "gitrosy.jxc4.com/jx-callback/globals/api" - "gitrosy.jxc4.com/jx-callback/globals/testinit1" + "git.rosy.net.cn/jx-callback/globals/api" + "git.rosy.net.cn/jx-callback/globals/testinit1" ) func Init() { diff --git a/main.go b/main.go index 1f783644a..6a4b7286f 100644 --- a/main.go +++ b/main.go @@ -3,39 +3,39 @@ package main import ( "flag" "fmt" - "gitrosy.jxc4.com/baseapi/platformapi/dingdingapi" - "gitrosy.jxc4.com/baseapi/utils" - "gitrosy.jxc4.com/jx-callback/business/jxstore/event" - "gitrosy.jxc4.com/jx-callback/business/jxutils/tasks" - "gitrosy.jxc4.com/jx-callback/business/model/dao" - "gitrosy.jxc4.com/jx-callback/controllers" - "gitrosy.jxc4.com/jx-callback/globals/api" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/jxutils/tasks" + "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/controllers" + "git.rosy.net.cn/jx-callback/globals/api" "net/http" _ "net/http/pprof" "os" "time" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxstore/misc" beego "github.com/astaxie/beego/server/web" - "gitrosy.jxc4.com/jx-callback/business/jxstore/cms" - "gitrosy.jxc4.com/jx-callback/business/jxstore/misc" // 导入缺省订单调度器 - "gitrosy.jxc4.com/jx-callback/globals" - "gitrosy.jxc4.com/jx-callback/globals/beegodb" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/jx-callback/globals/beegodb" - _ "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/alipay" - _ "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/dingding" - _ "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/mobile" - _ "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/password" - _ "gitrosy.jxc4.com/jx-callback/business/auth2/authprovider/weixin" - //_ "gitrosy.jxc4.com/jx-callback/business/jxstore/partner/jds" - //_ "gitrosy.jxc4.com/jx-callback/business/jxstore/partner/mt" - //_ "gitrosy.jxc4.com/jx-callback/business/jxstore/partner/pdd" - //_ "gitrosy.jxc4.com/jx-callback/business/jxstore/partner/taobao" - _ "gitrosy.jxc4.com/jx-callback/globals/api" + _ "git.rosy.net.cn/jx-callback/business/auth2/authprovider/alipay" + _ "git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding" + _ "git.rosy.net.cn/jx-callback/business/auth2/authprovider/mobile" + _ "git.rosy.net.cn/jx-callback/business/auth2/authprovider/password" + _ "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" + //_ "git.rosy.net.cn/jx-callback/business/jxstore/partner/jds" + //_ "git.rosy.net.cn/jx-callback/business/jxstore/partner/mt" + //_ "git.rosy.net.cn/jx-callback/business/jxstore/partner/pdd" + //_ "git.rosy.net.cn/jx-callback/business/jxstore/partner/taobao" + _ "git.rosy.net.cn/jx-callback/globals/api" - _ "gitrosy.jxc4.com/jx-callback/routers" + _ "git.rosy.net.cn/jx-callback/routers" ) var ( diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index 8edd82e3f..c45dabb77 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -7,7 +7,7 @@ import ( func init() { - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "AddAuthBind", Router: "/AddAuthBind", @@ -16,7 +16,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "AddAuthBindWithMobile", Router: "/AddAuthBindWithMobile", @@ -25,7 +25,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "ChangePassword", Router: "/ChangePassword", @@ -34,7 +34,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "CreateCaptcha", Router: "/CreateCaptcha", @@ -43,7 +43,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "DeletedTokenInfoWithoutParam", Router: "/DeletedTokenInfoWithoutParam", @@ -52,7 +52,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "DingDingOAuth2", Router: "/DingDingOAuth2", @@ -61,7 +61,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "GetTokenInfo", Router: "/GetTokenInfo", @@ -70,7 +70,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "Login", Router: "/Login", @@ -79,7 +79,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "Logout", Router: "/Logout", @@ -88,7 +88,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "RemoveAuthBind", Router: "/RemoveAuthBind", @@ -97,7 +97,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "SendVerifyCode", Router: "/SendVerifyCode", @@ -106,7 +106,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "WeixinMPOAuth2", Router: "/WeixinMPOAuth2", @@ -115,7 +115,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:Auth2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"], beego.ControllerComments{ Method: "WeixinOAuth2", Router: "/WeixinOAuth2", @@ -124,7 +124,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:BillController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:BillController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BillController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BillController"], beego.ControllerComments{ Method: "GetUserBillDetail", Router: "/GetUserBillDetail", @@ -133,7 +133,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "DeleteConfig", Router: "/DeleteConfig", @@ -142,7 +142,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "GetPlaces", Router: "/GetPlaces", @@ -151,7 +151,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "GetQiniuUploadToken", Router: "/GetQiniuUploadToken", @@ -160,7 +160,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "GetServiceInfo", Router: "/GetServiceInfo", @@ -169,7 +169,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "InitPlace", Router: "/InitPlace", @@ -178,7 +178,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "InitStation", Router: "/InitStation", @@ -187,7 +187,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "NewConfig", Router: "/NewConfig", @@ -196,7 +196,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "QueryConfigs", Router: "/QueryConfigs", @@ -205,7 +205,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "UpdateConfig", Router: "/UpdateConfig", @@ -214,7 +214,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:CmsController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "UpdatePlace", Router: "/UpdatePlace", @@ -223,7 +223,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "AddMessageGroup", Router: "/AddMessageGroup", @@ -232,7 +232,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "CreateMessageGroup", Router: "/CreateMessageGroup", @@ -241,7 +241,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "DeleteMessageGroup", Router: "/DeleteMessageGroup", @@ -250,7 +250,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "GetImMessageRecord", Router: "/GetImMessageRecord", @@ -259,7 +259,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "GetMessageGroupByUser", Router: "/GetMessageGroupByUser", @@ -268,7 +268,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "GetMessageGroups", Router: "/GetMessageGroups", @@ -277,7 +277,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "GetUserStatistics", Router: "/GetUserStatistics", @@ -286,7 +286,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "SendSysMessage", Router: "/SendSysMessage", @@ -295,7 +295,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "TestWebsocket", Router: "/TestWebsocket", @@ -304,7 +304,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "TransferMessageGroupMaster", Router: "/TransferMessageGroupMaster", @@ -313,7 +313,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "UpdateMessageGroup", Router: "/UpdateMessageGroup", @@ -322,7 +322,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "UpdateUserMessageGroupRead", Router: "/UpdateUserMessageGroupRead", @@ -331,7 +331,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "UploadAudio", Router: "/UploadAudio", @@ -340,7 +340,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:EventController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:EventController"], beego.ControllerComments{ Method: "UploadImg", Router: "/UploadImg", @@ -349,7 +349,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "AcceptJob", Router: "/AcceptJob", @@ -358,7 +358,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "AddressDistinguish", Router: "/AddressDistinguish", @@ -367,7 +367,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "AuditJob", Router: "/AuditJob", @@ -376,7 +376,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "CancelAcceptJob", Router: "/CancelAcceptJob", @@ -385,7 +385,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "CancelJdDelivery", Router: "/CancelJdDelivery", @@ -394,7 +394,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "CancelPublishJob", Router: "/CancelPublishJob", @@ -403,7 +403,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "CheckJdDeliveryWeight", Router: "/CheckJdDeliveryWeight", @@ -412,7 +412,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "ConfirmDropShippingJob", Router: "/ConfirmDropShippingJob", @@ -421,7 +421,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "CreateJobSpan", Router: "/CreateJobSpan", @@ -430,7 +430,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetAllDeliveryDetail", Router: "/GetAllDeliveryDetail", @@ -439,7 +439,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetCoordinateFromAddress", Router: "/GetCoordinateFromAddress", @@ -448,7 +448,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetDeliveryDetail", Router: "/GetDeliveryDetail", @@ -457,7 +457,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetEjyOrders", Router: "/GetEjyOrders", @@ -466,7 +466,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetJdDelivery", Router: "/GetJdDelivery", @@ -475,7 +475,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetJobCategories", Router: "/GetJobCategories", @@ -484,7 +484,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetJobDetail", Router: "/GetJobDetail", @@ -493,7 +493,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetJobOrders", Router: "/GetJobOrders", @@ -502,7 +502,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetJobs", Router: "/GetJobs", @@ -511,7 +511,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetMtMembers", Router: "/GetMtMembers", @@ -520,7 +520,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetStationList", Router: "/GetStationList", @@ -529,7 +529,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetUnionActList", Router: "/GetUnionActList", @@ -538,7 +538,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "ImprotMtMembers", Router: "/ImprotMtMembers", @@ -547,7 +547,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "PublishJob", Router: "/PublishJob", @@ -556,7 +556,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "RechargeMtMembers", Router: "/RechargeMtMembers", @@ -565,7 +565,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "RefreshJdDelivery", Router: "/RefreshJdDelivery", @@ -574,7 +574,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "RefreshJobStatus", Router: "/RefreshJobStatus", @@ -583,7 +583,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "ReloadJobSpan", Router: "/ReloadJobSpan", @@ -592,7 +592,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "SendJdDelivery", Router: "/SendJdDelivery", @@ -601,7 +601,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "ShareUnionLink", Router: "/ShareUnionLink", @@ -610,7 +610,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetUnionJobOrderInfo", Router: "/GetUnionJobOrderInfo", @@ -619,7 +619,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetVendorMatterCategory", Router: "/GetVendorMatterCategory", @@ -628,7 +628,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetVendorMatters", Router: "/GetVendorMatters", @@ -637,7 +637,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetVendorMatterDetail", Router: "/GetVendorMatterDetail", @@ -646,7 +646,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetVendorMatterRcmmd", Router: "/GetVendorMatterRcmmd", @@ -655,7 +655,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetPddBindInfo", Router: "/GetPddBindInfo", @@ -664,7 +664,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UnionController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UnionController"], beego.ControllerComments{ Method: "GetUnionOrders", Router: "/GetUnionOrders", @@ -673,7 +673,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "SubmitJob", Router: "/SubmitJob", @@ -682,7 +682,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "TempJob", Router: "/TempJob", @@ -691,7 +691,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "TempJobTest", Router: "/TempJobTest", @@ -700,7 +700,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "UpdateJob", Router: "/UpdateJob", @@ -709,7 +709,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:JobController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "UserRefundEjy", Router: "/UserRefundEjy", @@ -718,7 +718,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "Cash", Router: "/Cash", @@ -727,7 +727,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "CreateOrder", Router: "/CreateOrder", @@ -736,7 +736,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "FinishedCashOrders", Router: "/FinishedCashOrders", @@ -745,7 +745,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "GetManageStatisticsImg", Router: "/GetManageStatisticsImg", @@ -754,7 +754,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "GetManageStatisticsJob", Router: "/GetManageStatisticsJob", @@ -763,7 +763,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "GetMyUnionOrders", Router: "/GetMyUnionOrders", @@ -772,7 +772,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "SettleUnionOrders", Router: "/SettleUnionOrders", @@ -781,7 +781,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "GetOrders", Router: "/GetOrders", @@ -790,7 +790,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "GetPayStatistics", Router: "/GetPayStatistics", @@ -799,7 +799,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "Pay", Router: "/Pay", @@ -808,7 +808,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:OrderController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "PayByBalance", Router: "/PayByBalance", @@ -817,7 +817,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:TaskController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:TaskController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:TaskController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:TaskController"], beego.ControllerComments{ Method: "CancelTask", Router: "/CancelTask", @@ -826,7 +826,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:TaskController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:TaskController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:TaskController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:TaskController"], beego.ControllerComments{ Method: "GetTasks", Router: "/GetTasks", @@ -835,7 +835,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:TaskController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:TaskController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:TaskController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:TaskController"], beego.ControllerComments{ Method: "UnmanageTasks", Router: "/UnmanageTasks", @@ -844,7 +844,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "AcceptAddGroup", Router: "/AcceptAddGroup", @@ -853,7 +853,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "AddMyDeliveryAddress", Router: "/AddMyDeliveryAddress", @@ -862,7 +862,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "AddUserCityManager", Router: "/AddUserCityManager", @@ -871,7 +871,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "DeleteMyDeliveryAddress", Router: "/DeleteMyDeliveryAddress", @@ -880,7 +880,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "DeleteUserCityManager", Router: "/DeleteUserCityManager", @@ -889,7 +889,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "GetBindAuthInfo", Router: "/GetBindAuthInfo", @@ -898,7 +898,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "GetSelfInfo", Router: "/GetSelfInfo", @@ -907,7 +907,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "GetUser", Router: "/GetUser", @@ -916,7 +916,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "GetUserByMiniInfo", Router: "/GetUserByMiniInfo", @@ -925,7 +925,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "GetUserCityManager", Router: "/GetUserCityManager", @@ -934,7 +934,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "GetUserSerachKeyword", Router: "/GetUserSerachKeyword", @@ -943,7 +943,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "GetUsers", Router: "/GetUsers", @@ -952,7 +952,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "InvestMember", Router: "/InvestMember", @@ -961,7 +961,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "LoadMyCart", Router: "/LoadMyCart", @@ -970,7 +970,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "QueryMyDeliveryAddress", Router: "/QueryMyDeliveryAddress", @@ -979,7 +979,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "RegisterUser", Router: "/RegisterUser", @@ -988,7 +988,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "SaveMyCart", Router: "/SaveMyCart", @@ -997,7 +997,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "UpdateMyDeliveryAddress", Router: "/UpdateMyDeliveryAddress", @@ -1006,7 +1006,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "UpdateUser", Router: "/UpdateUser", @@ -1015,7 +1015,7 @@ func init() { Filters: nil, Params: nil}) - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:User2Controller"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"], beego.ControllerComments{ Method: "UpdateUserByMiniInfo", Router: "/UpdateUserByMiniInfo", @@ -1025,7 +1025,7 @@ func init() { Params: nil}) // 快递运单,查询物流运费 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "QueryExpressPrice", Router: "/QueryExpressPrice", @@ -1034,7 +1034,7 @@ func init() { Filters: nil, Params: nil}) // 创建物流订单 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "CreateWayOrder", Router: "/CreateWayOrder", @@ -1043,7 +1043,7 @@ func init() { Filters: nil, Params: nil}) // 取消物流运单 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "CancelWayVendorOrder", Router: "/CancelWayVendorOrder", @@ -1052,7 +1052,7 @@ func init() { Filters: nil, Params: nil}) // 获取用户订单列表 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "QueryUserOrderList", Router: "/QueryUserOrderList", @@ -1061,7 +1061,7 @@ func init() { Filters: nil, Params: nil}) // 获取用户订单详情 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "GetOrderDetail", Router: "/GetOrderDetail", @@ -1070,7 +1070,7 @@ func init() { Filters: nil, Params: nil}) // 管理系统获取订单详情 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "GetOrderList", Router: "/GetOrderList", @@ -1079,7 +1079,7 @@ func init() { Filters: nil, Params: nil}) // 删除订单 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "DeleteOrder", Router: "/DeleteOrder", @@ -1088,7 +1088,7 @@ func init() { Filters: nil, Params: nil}) // 再来一单 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:QBiDaExpressController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"], beego.ControllerComments{ Method: "TryAgainOrderByOldOrder", Router: "/TryAgainOrderByOldOrder", @@ -1098,7 +1098,7 @@ func init() { Params: nil}) // 修改用户账户余额 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UserBalanceController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:UserBalanceController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UserBalanceController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:UserBalanceController"], beego.ControllerComments{ Method: "UpdateUserBalance", Router: "/UpdateUserBalance", @@ -1108,7 +1108,7 @@ func init() { Params: nil}) // 提现申请:用户发起提现申请 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"], beego.ControllerComments{ Method: "AddWithdrawalRecord", Router: "/AddWithdrawalRecord", @@ -1117,7 +1117,7 @@ func init() { Filters: nil, Params: nil}) // 提现申请:取消或者删除提现生情 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"], beego.ControllerComments{ Method: "DeleteWithdrawalRecord", Router: "/DeleteWithdrawalRecord", @@ -1126,7 +1126,7 @@ func init() { Filters: nil, Params: nil}) // 提现申请:用户查询申请列表 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"], beego.ControllerComments{ Method: "GetWithdrawalRecord", Router: "/GetWithdrawalRecord", @@ -1135,7 +1135,7 @@ func init() { Filters: nil, Params: nil}) // 提现申请:管理系统查询列表 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"], beego.ControllerComments{ Method: "GetWithdrawalList", Router: "/GetWithdrawalList", @@ -1144,7 +1144,7 @@ func init() { Filters: nil, Params: nil}) // 提现申请:审核提现申请 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:WithdrawalRecordController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:WithdrawalRecordController"], beego.ControllerComments{ Method: "ExamineWithdrawalOrder", Router: "/ExamineWithdrawalOrder", @@ -1154,7 +1154,7 @@ func init() { Params: nil}) // 用户查询充值列表 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"], beego.ControllerComments{ Method: "GetUserRecharge", Router: "/GetUserRecharge", @@ -1164,7 +1164,7 @@ func init() { Params: nil}) // 用户查询平台订单详情 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"], beego.ControllerComments{ Method: "GetRechargeOrderDetail", Router: "/GetRechargeOrderDetail", @@ -1174,7 +1174,7 @@ func init() { Params: nil}) // 管理系统查询平台订单 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"], beego.ControllerComments{ Method: "SystemQueryRechargeList", Router: "/SystemQueryRechargeList", @@ -1184,7 +1184,7 @@ func init() { Params: nil}) // 查询当前账号余额 - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:RechargeManagerController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:RechargeManagerController"], beego.ControllerComments{ Method: "QueryAccountBill", Router: "/QueryAccountBill", @@ -1194,7 +1194,7 @@ func init() { Params: nil}) // 打印机api - beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:ApiController"] = append(beego.GlobalControllerRouter["gitrosy.jxc4.com/jx-callback/controllers:ApiController"], + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ApiController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ApiController"], beego.ControllerComments{ Method: "CallOpenAPI", Router: "/CallOpenAPI", diff --git a/routers/router.go b/routers/router.go index b91c71905..b42f3212d 100644 --- a/routers/router.go +++ b/routers/router.go @@ -8,9 +8,9 @@ package routers import ( + "git.rosy.net.cn/jx-callback/controllers" "github.com/astaxie/beego/server/web" beecontext "github.com/astaxie/beego/server/web/context" - "gitrosy.jxc4.com/jx-callback/controllers" ) func init() { diff --git a/swagger/param_parser.go.txt b/swagger/param_parser.go.txt index a7929d92f..e5de0de30 100644 --- a/swagger/param_parser.go.txt +++ b/swagger/param_parser.go.txt @@ -10,49 +10,40 @@ import ( "strings" "time" "net/http" - ""gitrosy.jxc4.com/jx-callback/business/jxstore/event" - ""gitrosy.jxc4.com/jx-callback/business/jxstore/cms" + "git.rosy.net.cn/jx-callback/business/jxstore/event" + "git.rosy.net.cn/jx-callback/business/jxstore/cms" - ""gitrosy.jxc4.com/baseapi/utils" - ""gitrosy.jxc4.com/jx-callback/business/jxutils/jsonerr" - ""gitrosy.jxc4.com/jx-callback/business/jxutils/jxcontext" - ""gitrosy.jxc4.com/jx-callback/business/model" - ""gitrosy.jxc4.com/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/jxutils/jsonerr" + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-callback/globals" ) const ( strRequiredParamIsEmpty = "参数[%s]为空或数值不合法!" ) -type tJobGetJobsParams struct { +type tOrderPayParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - UserIDs string - CategoryIDs string - Statuss string - VendorIDs string - CityCodes string - IncludeStep bool - FromTime string - ToTime string - Lng float64 - Lat float64 - Span int - Keyword string - SortType int - Offset int - PageSize int + OrderID string + PayType int + VendorPayType string + OrderType string + AppId string + IsChoose int } -// func (c *JobController) GetJobs() { -// c.callGetJobs(func(params *tJobGetJobsParams) (retVal interface{}, errCode string, err error) { +// func (c *OrderController) Pay() { +// c.callPay(func(params *tOrderPayParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callGetJobs(handler func(params *tJobGetJobsParams) (interface{}, string, error)) { +func (c *OrderController) callPay(handler func(params *tOrderPayParams) (interface{}, string, error)) { var err error - params := &tJobGetJobsParams{ + params := &tOrderPayParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -60,82 +51,549 @@ func (c *JobController) callGetJobs(handler func(params *tJobGetJobsParams) (int errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserIDs = utils.TrimBlankChar(c.GetString("userIDs")) - params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs")) - params.Statuss = utils.TrimBlankChar(c.GetString("statuss")) - params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs")) - params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) - if params.IncludeStep, err = c.GetBool("includeStep", false); err != nil { - errParams = append(errParams, "includeStep") + params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) + if params.PayType, err = c.GetInt("payType", 0); err != nil { + errParams = append(errParams, "payType") } - params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) - params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) - if params.Lng, err = c.GetFloat("lng", 0); err != nil { - errParams = append(errParams, "lng") + params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType")) + params.OrderType = utils.TrimBlankChar(c.GetString("orderType")) + params.AppId = utils.TrimBlankChar(c.GetString("appId")) + if params.IsChoose, err = c.GetInt("isChoose", 0); err != nil { + errParams = append(errParams, "isChoose") } - if params.Lat, err = c.GetFloat("lat", 0); err != nil { - errParams = append(errParams, "lat") + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid } - if params.Span, err = c.GetInt("span", 0); err != nil { - errParams = append(errParams, "span") + params.MapData["token"] = params.Token + if c.GetString("orderID") == "" { + errParams = append(errParams, "orderID") } - params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) - if params.SortType, err = c.GetInt("sortType", 0); err != nil { - errParams = append(errParams, "sortType") + params.MapData["orderID"] = params.OrderID + if c.GetString("payType") == "" { + errParams = append(errParams, "payType") } - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") + params.MapData["payType"] = params.PayType + if c.GetString("vendorPayType") == "" { + errParams = append(errParams, "vendorPayType") + } + params.MapData["vendorPayType"] = params.VendorPayType + if c.GetString("orderType") == "" { + errParams = append(errParams, "orderType") + } + params.MapData["orderType"] = params.OrderType + if c.GetString("appId") == "" { + errParams = append(errParams, "appId") + } + params.MapData["appId"] = params.AppId + if c.GetString("isChoose") == "" { + errParams = append(errParams, "isChoose") + } + params.MapData["isChoose"] = params.IsChoose + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.Pay, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.Pay, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.Pay error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventUploadImgParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *EventController) UploadImg() { +// c.callUploadImg(func(params *tEventUploadImgParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callUploadImg(handler func(params *tEventUploadImgParams) (interface{}, string, error)) { + var err error + params := &tEventUploadImgParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.UploadImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.UploadImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.UploadImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUnionShareUnionLinkParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobID int + ShareType int + ResourceType int + LinkType int + GoodsID string +} + +// func (c *UnionController) ShareUnionLink() { +// c.callShareUnionLink(func(params *tUnionShareUnionLinkParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *UnionController) callShareUnionLink(handler func(params *tUnionShareUnionLinkParams) (interface{}, string, error)) { + var err error + params := &tUnionShareUnionLinkParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobID, err = c.GetInt("jobID", 0); err != nil { + errParams = append(errParams, "jobID") + } + if params.ShareType, err = c.GetInt("shareType", 0); err != nil { + errParams = append(errParams, "shareType") + } + if params.ResourceType, err = c.GetInt("resourceType", 0); err != nil { + errParams = append(errParams, "resourceType") + } + if params.LinkType, err = c.GetInt("linkType", 0); err != nil { + errParams = append(errParams, "linkType") + } + params.GoodsID = utils.TrimBlankChar(c.GetString("goodsID")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobID") == "" { + errParams = append(errParams, "jobID") + } + params.MapData["jobID"] = params.JobID + if c.GetString("shareType") == "" { + errParams = append(errParams, "shareType") + } + params.MapData["shareType"] = params.ShareType + if utils.TrimBlankChar(c.GetString("resourceType")) != "" { + params.MapData["resourceType"] = params.ResourceType + } + if c.GetString("linkType") == "" { + errParams = append(errParams, "linkType") + } + params.MapData["linkType"] = params.LinkType + if utils.TrimBlankChar(c.GetString("goodsID")) != "" { + params.MapData["goodsID"] = params.GoodsID + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API UnionController.ShareUnionLink, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API UnionController.ShareUnionLink, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API UnionController.ShareUnionLink error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tWithdrawalGetWithdrawalRecordParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Status int + PageSize int + PageNum int +} + +// func (c *WithdrawalRecordController) GetWithdrawalRecord() { +// c.callGetWithdrawalRecord(func(params *tWithdrawalGetWithdrawalRecordParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *WithdrawalRecordController) callGetWithdrawalRecord(handler func(params *tWithdrawalGetWithdrawalRecordParams) (interface{}, string, error)) { + var err error + params := &tWithdrawalGetWithdrawalRecordParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Status, err = c.GetInt("status", 0); err != nil { + errParams = append(errParams, "status") } if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { errParams = append(errParams, "pageSize") } - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token + if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { + errParams = append(errParams, "pageNum") } - if utils.TrimBlankChar(c.GetString("userIDs")) != "" { - params.MapData["userIDs"] = params.UserIDs + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid } - if utils.TrimBlankChar(c.GetString("categoryIDs")) != "" { - params.MapData["categoryIDs"] = params.CategoryIDs + params.MapData["token"] = params.Token + if c.GetString("status") == "" { + errParams = append(errParams, "status") } - if utils.TrimBlankChar(c.GetString("statuss")) != "" { - params.MapData["statuss"] = params.Statuss + params.MapData["status"] = params.Status + if c.GetString("pageSize") == "" { + errParams = append(errParams, "pageSize") } - if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" { - params.MapData["vendorIDs"] = params.VendorIDs + params.MapData["pageSize"] = params.PageSize + if c.GetString("pageNum") == "" { + errParams = append(errParams, "pageNum") } - if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { - params.MapData["cityCodes"] = params.CityCodes + params.MapData["pageNum"] = params.PageNum + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } - if utils.TrimBlankChar(c.GetString("includeStep")) != "" { - params.MapData["includeStep"] = params.IncludeStep + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.GetWithdrawalRecord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API WithdrawalRecordController.GetWithdrawalRecord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API WithdrawalRecordController.GetWithdrawalRecord error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } } - if utils.TrimBlankChar(c.GetString("fromTime")) != "" { - params.MapData["fromTime"] = params.FromTime + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() } - if utils.TrimBlankChar(c.GetString("toTime")) != "" { - params.MapData["toTime"] = params.ToTime +} + +type tAuth2DingDingOAuth2Params struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Code string + Block string + State string +} + +// func (c *Auth2Controller) DingDingOAuth2() { +// c.callDingDingOAuth2(func(params *tAuth2DingDingOAuth2Params) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callDingDingOAuth2(handler func(params *tAuth2DingDingOAuth2Params) (interface{}, string, error)) { + var err error + params := &tAuth2DingDingOAuth2Params{ + MapData : make(map[string]interface{}), } - if utils.TrimBlankChar(c.GetString("lng")) != "" { - params.MapData["lng"] = params.Lng + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Code = utils.TrimBlankChar(c.GetString("code")) + params.Block = utils.TrimBlankChar(c.GetString("block")) + params.State = utils.TrimBlankChar(c.GetString("state")) + if c.GetString("code") == "" { + errParams = append(errParams, "code") } - if utils.TrimBlankChar(c.GetString("lat")) != "" { - params.MapData["lat"] = params.Lat + params.MapData["code"] = params.Code + if utils.TrimBlankChar(c.GetString("block")) != "" { + params.MapData["block"] = params.Block } - if utils.TrimBlankChar(c.GetString("span")) != "" { - params.MapData["span"] = params.Span - } - if utils.TrimBlankChar(c.GetString("keyword")) != "" { - params.MapData["keyword"] = params.Keyword - } - if utils.TrimBlankChar(c.GetString("sortType")) != "" { - params.MapData["sortType"] = params.SortType - } - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if utils.TrimBlankChar(c.GetString("pageSize")) != "" { - params.MapData["pageSize"] = params.PageSize + if utils.TrimBlankChar(c.GetString("state")) != "" { + params.MapData["state"] = params.State } if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) @@ -149,7 +607,7 @@ func (c *JobController) callGetJobs(handler func(params *tJobGetJobsParams) (int ) params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetJobs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API Auth2Controller.DingDingOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -195,7 +653,7 @@ func (c *JobController) callGetJobs(handler func(params *tJobGetJobsParams) (int } } } - globals.SugarLogger.Debugf("End API JobController.GetJobs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API Auth2Controller.DingDingOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -203,7 +661,7 @@ func (c *JobController) callGetJobs(handler func(params *tJobGetJobsParams) (int errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.GetJobs error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API Auth2Controller.DingDingOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -220,21 +678,26 @@ func (c *JobController) callGetJobs(handler func(params *tJobGetJobsParams) (int } } -type tWithdrawalDeleteWithdrawalRecordParams struct { +type tOrderPayByBalanceParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Id int + OrderID string + PayType int + VendorPayType string + OrderType string + AppId string + IsChoose int } -// func (c *WithdrawalRecordController) DeleteWithdrawalRecord() { -// c.callDeleteWithdrawalRecord(func(params *tWithdrawalDeleteWithdrawalRecordParams) (retVal interface{}, errCode string, err error) { +// func (c *OrderController) PayByBalance() { +// c.callPayByBalance(func(params *tOrderPayByBalanceParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *WithdrawalRecordController) callDeleteWithdrawalRecord(handler func(params *tWithdrawalDeleteWithdrawalRecordParams) (interface{}, string, error)) { +func (c *OrderController) callPayByBalance(handler func(params *tOrderPayByBalanceParams) (interface{}, string, error)) { var err error - params := &tWithdrawalDeleteWithdrawalRecordParams{ + params := &tOrderPayByBalanceParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -242,18 +705,45 @@ func (c *WithdrawalRecordController) callDeleteWithdrawalRecord(handler func(par errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Id, err = c.GetInt("id", 0); err != nil { - errParams = append(errParams, "id") + params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) + if params.PayType, err = c.GetInt("payType", 0); err != nil { + errParams = append(errParams, "payType") + } + params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType")) + params.OrderType = utils.TrimBlankChar(c.GetString("orderType")) + params.AppId = utils.TrimBlankChar(c.GetString("appId")) + if params.IsChoose, err = c.GetInt("isChoose", 0); err != nil { + errParams = append(errParams, "isChoose") } if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("id") == "" { - errParams = append(errParams, "id") + if c.GetString("orderID") == "" { + errParams = append(errParams, "orderID") } - params.MapData["id"] = params.Id + params.MapData["orderID"] = params.OrderID + if c.GetString("payType") == "" { + errParams = append(errParams, "payType") + } + params.MapData["payType"] = params.PayType + if c.GetString("vendorPayType") == "" { + errParams = append(errParams, "vendorPayType") + } + params.MapData["vendorPayType"] = params.VendorPayType + if c.GetString("orderType") == "" { + errParams = append(errParams, "orderType") + } + params.MapData["orderType"] = params.OrderType + if c.GetString("appId") == "" { + errParams = append(errParams, "appId") + } + params.MapData["appId"] = params.AppId + if c.GetString("isChoose") == "" { + errParams = append(errParams, "isChoose") + } + params.MapData["isChoose"] = params.IsChoose if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -266,7 +756,7 @@ func (c *WithdrawalRecordController) callDeleteWithdrawalRecord(handler func(par ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.DeleteWithdrawalRecord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API OrderController.PayByBalance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -312,7 +802,7 @@ func (c *WithdrawalRecordController) callDeleteWithdrawalRecord(handler func(par } } } - globals.SugarLogger.Debugf("End API WithdrawalRecordController.DeleteWithdrawalRecord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API OrderController.PayByBalance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -320,7 +810,7 @@ func (c *WithdrawalRecordController) callDeleteWithdrawalRecord(handler func(par errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API WithdrawalRecordController.DeleteWithdrawalRecord error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API OrderController.PayByBalance error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -337,22 +827,21 @@ func (c *WithdrawalRecordController) callDeleteWithdrawalRecord(handler func(par } } -type tRechargeGetRechargeOrderDetailParams struct { +type tJobUpdateJobParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - OrderId string - Mobile string + Payload string } -// func (c *RechargeManagerController) GetRechargeOrderDetail() { -// c.callGetRechargeOrderDetail(func(params *tRechargeGetRechargeOrderDetailParams) (retVal interface{}, errCode string, err error) { +// func (c *JobController) UpdateJob() { +// c.callUpdateJob(func(params *tJobUpdateJobParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *RechargeManagerController) callGetRechargeOrderDetail(handler func(params *tRechargeGetRechargeOrderDetailParams) (interface{}, string, error)) { +func (c *JobController) callUpdateJob(handler func(params *tJobUpdateJobParams) (interface{}, string, error)) { var err error - params := &tRechargeGetRechargeOrderDetailParams{ + params := &tJobUpdateJobParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -360,21 +849,16 @@ func (c *RechargeManagerController) callGetRechargeOrderDetail(handler func(para errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) - params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) + params.Payload = utils.TrimBlankChar(c.GetString("payload")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("orderId") == "" { - errParams = append(errParams, "orderId") + if c.GetString("payload") == "" { + errParams = append(errParams, "payload") } - params.MapData["orderId"] = params.OrderId - if c.GetString("mobile") == "" { - errParams = append(errParams, "mobile") - } - params.MapData["mobile"] = params.Mobile + params.MapData["payload"] = params.Payload if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -387,7 +871,7 @@ func (c *RechargeManagerController) callGetRechargeOrderDetail(handler func(para ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API RechargeManagerController.GetRechargeOrderDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API JobController.UpdateJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -433,7 +917,7 @@ func (c *RechargeManagerController) callGetRechargeOrderDetail(handler func(para } } } - globals.SugarLogger.Debugf("End API RechargeManagerController.GetRechargeOrderDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API JobController.UpdateJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -441,124 +925,7 @@ func (c *RechargeManagerController) callGetRechargeOrderDetail(handler func(para errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API RechargeManagerController.GetRechargeOrderDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2InvestMemberParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - MemberID int -} - -// func (c *User2Controller) InvestMember() { -// c.callInvestMember(func(params *tUser2InvestMemberParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callInvestMember(handler func(params *tUser2InvestMemberParams) (interface{}, string, error)) { - var err error - params := &tUser2InvestMemberParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.MemberID, err = c.GetInt("memberID", 0); err != nil { - errParams = append(errParams, "memberID") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("memberID") == "" { - errParams = append(errParams, "memberID") - } - params.MapData["memberID"] = params.MemberID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.InvestMember, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.InvestMember, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.InvestMember error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API JobController.UpdateJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -735,23 +1102,21 @@ func (c *JobController) callGetJobOrders(handler func(params *tJobGetJobOrdersPa } } -type tJobAcceptJobParams struct { +type tUnionGetVendorMatterCategoryParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - JobID int - DropShippingDeliveryID int - DropShippingCount int + VendorID int } -// func (c *JobController) AcceptJob() { -// c.callAcceptJob(func(params *tJobAcceptJobParams) (retVal interface{}, errCode string, err error) { +// func (c *UnionController) GetVendorMatterCategory() { +// c.callGetVendorMatterCategory(func(params *tUnionGetVendorMatterCategoryParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callAcceptJob(handler func(params *tJobAcceptJobParams) (interface{}, string, error)) { +func (c *UnionController) callGetVendorMatterCategory(handler func(params *tUnionGetVendorMatterCategoryParams) (interface{}, string, error)) { var err error - params := &tJobAcceptJobParams{ + params := &tUnionGetVendorMatterCategoryParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -759,148 +1124,16 @@ func (c *JobController) callAcceptJob(handler func(params *tJobAcceptJobParams) errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobID, err = c.GetInt("jobID", 0); err != nil { - errParams = append(errParams, "jobID") + if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { + errParams = append(errParams, "vendorID") } - if params.DropShippingDeliveryID, err = c.GetInt("dropShippingDeliveryID", 0); err != nil { - errParams = append(errParams, "dropShippingDeliveryID") + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token } - if params.DropShippingCount, err = c.GetInt("dropShippingCount", 0); err != nil { - errParams = append(errParams, "dropShippingCount") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobID") == "" { - errParams = append(errParams, "jobID") - } - params.MapData["jobID"] = params.JobID - if utils.TrimBlankChar(c.GetString("dropShippingDeliveryID")) != "" { - params.MapData["dropShippingDeliveryID"] = params.DropShippingDeliveryID - } - if utils.TrimBlankChar(c.GetString("dropShippingCount")) != "" { - params.MapData["dropShippingCount"] = params.DropShippingCount - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.AcceptJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.AcceptJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.AcceptJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tAuth2DingDingOAuth2Params struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Code string - Block string - State string -} - -// func (c *Auth2Controller) DingDingOAuth2() { -// c.callDingDingOAuth2(func(params *tAuth2DingDingOAuth2Params) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callDingDingOAuth2(handler func(params *tAuth2DingDingOAuth2Params) (interface{}, string, error)) { - var err error - params := &tAuth2DingDingOAuth2Params{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Code = utils.TrimBlankChar(c.GetString("code")) - params.Block = utils.TrimBlankChar(c.GetString("block")) - params.State = utils.TrimBlankChar(c.GetString("state")) - if c.GetString("code") == "" { - errParams = append(errParams, "code") - } - params.MapData["code"] = params.Code - if utils.TrimBlankChar(c.GetString("block")) != "" { - params.MapData["block"] = params.Block - } - if utils.TrimBlankChar(c.GetString("state")) != "" { - params.MapData["state"] = params.State + if c.GetString("vendorID") == "" { + errParams = append(errParams, "vendorID") } + params.MapData["vendorID"] = params.VendorID if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -913,7 +1146,7 @@ func (c *Auth2Controller) callDingDingOAuth2(handler func(params *tAuth2DingDing ) params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.DingDingOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API UnionController.GetVendorMatterCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -959,7 +1192,7 @@ func (c *Auth2Controller) callDingDingOAuth2(handler func(params *tAuth2DingDing } } } - globals.SugarLogger.Debugf("End API Auth2Controller.DingDingOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API UnionController.GetVendorMatterCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -967,7 +1200,7 @@ func (c *Auth2Controller) callDingDingOAuth2(handler func(params *tAuth2DingDing errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.DingDingOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API UnionController.GetVendorMatterCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -984,21 +1217,21 @@ func (c *Auth2Controller) callDingDingOAuth2(handler func(params *tAuth2DingDing } } -type tUser2AcceptAddGroupParams struct { +type tWithdrawalDeleteWithdrawalRecordParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Flag int + Id int } -// func (c *User2Controller) AcceptAddGroup() { -// c.callAcceptAddGroup(func(params *tUser2AcceptAddGroupParams) (retVal interface{}, errCode string, err error) { +// func (c *WithdrawalRecordController) DeleteWithdrawalRecord() { +// c.callDeleteWithdrawalRecord(func(params *tWithdrawalDeleteWithdrawalRecordParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *User2Controller) callAcceptAddGroup(handler func(params *tUser2AcceptAddGroupParams) (interface{}, string, error)) { +func (c *WithdrawalRecordController) callDeleteWithdrawalRecord(handler func(params *tWithdrawalDeleteWithdrawalRecordParams) (interface{}, string, error)) { var err error - params := &tUser2AcceptAddGroupParams{ + params := &tWithdrawalDeleteWithdrawalRecordParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -1006,18 +1239,18 @@ func (c *User2Controller) callAcceptAddGroup(handler func(params *tUser2AcceptAd errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Flag, err = c.GetInt("flag", 0); err != nil { - errParams = append(errParams, "flag") + if params.Id, err = c.GetInt("id", 0); err != nil { + errParams = append(errParams, "id") } if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("flag") == "" { - errParams = append(errParams, "flag") + if c.GetString("id") == "" { + errParams = append(errParams, "id") } - params.MapData["flag"] = params.Flag + params.MapData["id"] = params.Id if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -1030,7 +1263,7 @@ func (c *User2Controller) callAcceptAddGroup(handler func(params *tUser2AcceptAd ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.AcceptAddGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.DeleteWithdrawalRecord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -1076,7 +1309,7 @@ func (c *User2Controller) callAcceptAddGroup(handler func(params *tUser2AcceptAd } } } - globals.SugarLogger.Debugf("End API User2Controller.AcceptAddGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API WithdrawalRecordController.DeleteWithdrawalRecord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -1084,7 +1317,7 @@ func (c *User2Controller) callAcceptAddGroup(handler func(params *tUser2AcceptAd errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API User2Controller.AcceptAddGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API WithdrawalRecordController.DeleteWithdrawalRecord error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -1101,267 +1334,31 @@ func (c *User2Controller) callAcceptAddGroup(handler func(params *tUser2AcceptAd } } -type tJobAuditJobParams struct { +type tUser2AddMyDeliveryAddressParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - JobOrderID int - Status int - Comment string - VendorWaybillID string -} - -// func (c *JobController) AuditJob() { -// c.callAuditJob(func(params *tJobAuditJobParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callAuditJob(handler func(params *tJobAuditJobParams) (interface{}, string, error)) { - var err error - params := &tJobAuditJobParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { - errParams = append(errParams, "jobOrderID") - } - if params.Status, err = c.GetInt("status", 0); err != nil { - errParams = append(errParams, "status") - } - params.Comment = utils.TrimBlankChar(c.GetString("comment")) - params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobOrderID") == "" { - errParams = append(errParams, "jobOrderID") - } - params.MapData["jobOrderID"] = params.JobOrderID - if c.GetString("status") == "" { - errParams = append(errParams, "status") - } - params.MapData["status"] = params.Status - if utils.TrimBlankChar(c.GetString("comment")) != "" { - params.MapData["comment"] = params.Comment - } - if utils.TrimBlankChar(c.GetString("vendorWaybillID")) != "" { - params.MapData["vendorWaybillID"] = params.VendorWaybillID - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.AuditJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.AuditJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.AuditJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tCmsInitStationParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *CmsController) InitStation() { -// c.callInitStation(func(params *tCmsInitStationParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *CmsController) callInitStation(handler func(params *tCmsInitStationParams) (interface{}, string, error)) { - var err error - params := &tCmsInitStationParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.InitStation, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.InitStation, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.InitStation error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tExpressCancelWayVendorOrderParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Genre int - OrderNo string + ConsigneeName string + ConsigneeMobile string + Address string + DetailAddress string + Lng float64 + Lat float64 + Tag string + Remark string + IsDefault int Type int + AutoAddress string } -// func (c *QBiDaExpressController) CancelWayVendorOrder() { -// c.callCancelWayVendorOrder(func(params *tExpressCancelWayVendorOrderParams) (retVal interface{}, errCode string, err error) { +// func (c *User2Controller) AddMyDeliveryAddress() { +// c.callAddMyDeliveryAddress(func(params *tUser2AddMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *QBiDaExpressController) callCancelWayVendorOrder(handler func(params *tExpressCancelWayVendorOrderParams) (interface{}, string, error)) { +func (c *User2Controller) callAddMyDeliveryAddress(handler func(params *tUser2AddMyDeliveryAddressParams) (interface{}, string, error)) { var err error - params := &tExpressCancelWayVendorOrderParams{ + params := &tUser2AddMyDeliveryAddressParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -1369,30 +1366,65 @@ func (c *QBiDaExpressController) callCancelWayVendorOrder(handler func(params *t errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Genre, err = c.GetInt("genre", 0); err != nil { - errParams = append(errParams, "genre") + params.ConsigneeName = utils.TrimBlankChar(c.GetString("consigneeName")) + params.ConsigneeMobile = utils.TrimBlankChar(c.GetString("consigneeMobile")) + params.Address = utils.TrimBlankChar(c.GetString("address")) + params.DetailAddress = utils.TrimBlankChar(c.GetString("detailAddress")) + if params.Lng, err = c.GetFloat("lng", 0); err != nil { + errParams = append(errParams, "lng") + } + if params.Lat, err = c.GetFloat("lat", 0); err != nil { + errParams = append(errParams, "lat") + } + params.Tag = utils.TrimBlankChar(c.GetString("tag")) + params.Remark = utils.TrimBlankChar(c.GetString("remark")) + if params.IsDefault, err = c.GetInt("isDefault", 0); err != nil { + errParams = append(errParams, "isDefault") } - params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) if params.Type, err = c.GetInt("type", 0); err != nil { errParams = append(errParams, "type") } + params.AutoAddress = utils.TrimBlankChar(c.GetString("autoAddress")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("genre") == "" { - errParams = append(errParams, "genre") + if c.GetString("consigneeName") == "" { + errParams = append(errParams, "consigneeName") } - params.MapData["genre"] = params.Genre - if c.GetString("orderNo") == "" { - errParams = append(errParams, "orderNo") + params.MapData["consigneeName"] = params.ConsigneeName + if c.GetString("consigneeMobile") == "" { + errParams = append(errParams, "consigneeMobile") } - params.MapData["orderNo"] = params.OrderNo - if c.GetString("type") == "" { - errParams = append(errParams, "type") + params.MapData["consigneeMobile"] = params.ConsigneeMobile + if utils.TrimBlankChar(c.GetString("address")) != "" { + params.MapData["address"] = params.Address + } + if utils.TrimBlankChar(c.GetString("detailAddress")) != "" { + params.MapData["detailAddress"] = params.DetailAddress + } + if utils.TrimBlankChar(c.GetString("lng")) != "" { + params.MapData["lng"] = params.Lng + } + if utils.TrimBlankChar(c.GetString("lat")) != "" { + params.MapData["lat"] = params.Lat + } + if utils.TrimBlankChar(c.GetString("tag")) != "" { + params.MapData["tag"] = params.Tag + } + if utils.TrimBlankChar(c.GetString("remark")) != "" { + params.MapData["remark"] = params.Remark + } + if utils.TrimBlankChar(c.GetString("isDefault")) != "" { + params.MapData["isDefault"] = params.IsDefault + } + if utils.TrimBlankChar(c.GetString("type")) != "" { + params.MapData["type"] = params.Type + } + if utils.TrimBlankChar(c.GetString("autoAddress")) != "" { + params.MapData["autoAddress"] = params.AutoAddress } - params.MapData["type"] = params.Type if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -1405,7 +1437,7 @@ func (c *QBiDaExpressController) callCancelWayVendorOrder(handler func(params *t ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API QBiDaExpressController.CancelWayVendorOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API User2Controller.AddMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -1451,7 +1483,7 @@ func (c *QBiDaExpressController) callCancelWayVendorOrder(handler func(params *t } } } - globals.SugarLogger.Debugf("End API QBiDaExpressController.CancelWayVendorOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API User2Controller.AddMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -1459,7 +1491,7 @@ func (c *QBiDaExpressController) callCancelWayVendorOrder(handler func(params *t errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API QBiDaExpressController.CancelWayVendorOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API User2Controller.AddMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -1476,20 +1508,20 @@ func (c *QBiDaExpressController) callCancelWayVendorOrder(handler func(params *t } } -type tCmsInitPlaceParams struct { +type tUser2GetBindAuthInfoParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string } -// func (c *CmsController) InitPlace() { -// c.callInitPlace(func(params *tCmsInitPlaceParams) (retVal interface{}, errCode string, err error) { +// func (c *User2Controller) GetBindAuthInfo() { +// c.callGetBindAuthInfo(func(params *tUser2GetBindAuthInfoParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *CmsController) callInitPlace(handler func(params *tCmsInitPlaceParams) (interface{}, string, error)) { +func (c *User2Controller) callGetBindAuthInfo(handler func(params *tUser2GetBindAuthInfoParams) (interface{}, string, error)) { var err error - params := &tCmsInitPlaceParams{ + params := &tUser2GetBindAuthInfoParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -1514,7 +1546,7 @@ func (c *CmsController) callInitPlace(handler func(params *tCmsInitPlaceParams) ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.InitPlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API User2Controller.GetBindAuthInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -1560,7 +1592,7 @@ func (c *CmsController) callInitPlace(handler func(params *tCmsInitPlaceParams) } } } - globals.SugarLogger.Debugf("End API CmsController.InitPlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API User2Controller.GetBindAuthInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -1568,7 +1600,7 @@ func (c *CmsController) callInitPlace(handler func(params *tCmsInitPlaceParams) errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API CmsController.InitPlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API User2Controller.GetBindAuthInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -1585,47 +1617,38 @@ func (c *CmsController) callInitPlace(handler func(params *tCmsInitPlaceParams) } } -type tOpenapiCallOpenAPIParams struct { +type tEventUpdateUserMessageGroupReadParams struct { MapData map[string]interface{} Ctx *jxcontext.Context - App_id string - Timestamp int - Sign string - Method string + Token string + Payload string } -// func (c *ApiController) CallOpenAPI() { -// c.callCallOpenAPI(func(params *tOpenapiCallOpenAPIParams) (retVal interface{}, errCode string, err error) { +// func (c *EventController) UpdateUserMessageGroupRead() { +// c.callUpdateUserMessageGroupRead(func(params *tEventUpdateUserMessageGroupReadParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *ApiController) callCallOpenAPI(handler func(params *tOpenapiCallOpenAPIParams) (interface{}, string, error)) { +func (c *EventController) callUpdateUserMessageGroupRead(handler func(params *tEventUpdateUserMessageGroupReadParams) (interface{}, string, error)) { var err error - params := &tOpenapiCallOpenAPIParams{ + params := &tEventUpdateUserMessageGroupReadParams{ MapData : make(map[string]interface{}), } errParams := []string{} token := c.Ctx.Input.Header("token") errCode := model.ErrCodeGeneralFailed - params.App_id = utils.TrimBlankChar(c.GetString("app_id")) - if params.Timestamp, err = c.GetInt("timestamp", 0); err != nil { - errParams = append(errParams, "timestamp") + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Payload = utils.TrimBlankChar(c.GetString("payload")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid } - params.Sign = utils.TrimBlankChar(c.GetString("sign")) - params.Method = utils.TrimBlankChar(c.GetString("method")) - if utils.TrimBlankChar(c.GetString("app_id")) != "" { - params.MapData["app_id"] = params.App_id - } - if utils.TrimBlankChar(c.GetString("timestamp")) != "" { - params.MapData["timestamp"] = params.Timestamp - } - if utils.TrimBlankChar(c.GetString("sign")) != "" { - params.MapData["sign"] = params.Sign - } - if utils.TrimBlankChar(c.GetString("method")) != "" { - params.MapData["method"] = params.Method + params.MapData["token"] = params.Token + if c.GetString("payload") == "" { + errParams = append(errParams, "payload") } + params.MapData["payload"] = params.Payload if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -1636,9 +1659,9 @@ func (c *ApiController) callCallOpenAPI(handler func(params *tOpenapiCallOpenAPI err2 error result interface{} ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API ApiController.CallOpenAPI, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API EventController.UpdateUserMessageGroupRead, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -1684,7 +1707,7 @@ func (c *ApiController) callCallOpenAPI(handler func(params *tOpenapiCallOpenAPI } } } - globals.SugarLogger.Debugf("End API ApiController.CallOpenAPI, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API EventController.UpdateUserMessageGroupRead, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -1692,7 +1715,7 @@ func (c *ApiController) callCallOpenAPI(handler func(params *tOpenapiCallOpenAPI errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API ApiController.CallOpenAPI error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API EventController.UpdateUserMessageGroupRead error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -1848,22 +1871,25 @@ func (c *EventController) callCreateMessageGroup(handler func(params *tEventCrea } } -type tCmsDeleteConfigParams struct { +type tUser2GetUserByMiniInfoParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Type string - Key string + Data string + Iv string + JsCode string + AuthType string + AppID string } -// func (c *CmsController) DeleteConfig() { -// c.callDeleteConfig(func(params *tCmsDeleteConfigParams) (retVal interface{}, errCode string, err error) { +// func (c *User2Controller) GetUserByMiniInfo() { +// c.callGetUserByMiniInfo(func(params *tUser2GetUserByMiniInfoParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *CmsController) callDeleteConfig(handler func(params *tCmsDeleteConfigParams) (interface{}, string, error)) { +func (c *User2Controller) callGetUserByMiniInfo(handler func(params *tUser2GetUserByMiniInfoParams) (interface{}, string, error)) { var err error - params := &tCmsDeleteConfigParams{ + params := &tUser2GetUserByMiniInfoParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -1871,532 +1897,31 @@ func (c *CmsController) callDeleteConfig(handler func(params *tCmsDeleteConfigPa errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Type = utils.TrimBlankChar(c.GetString("type")) - params.Key = utils.TrimBlankChar(c.GetString("key")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("type") == "" { - errParams = append(errParams, "type") - } - params.MapData["type"] = params.Type - if c.GetString("key") == "" { - errParams = append(errParams, "key") - } - params.MapData["key"] = params.Key - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.DeleteConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.DeleteConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.DeleteConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tRechargeSystemQueryRechargeListParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - OrderId string - Mobile string - RechargeStatus int - Page int - PageSize int - StartTime string - EndTime string - UserName string -} - -// func (c *RechargeManagerController) SystemQueryRechargeList() { -// c.callSystemQueryRechargeList(func(params *tRechargeSystemQueryRechargeListParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *RechargeManagerController) callSystemQueryRechargeList(handler func(params *tRechargeSystemQueryRechargeListParams) (interface{}, string, error)) { - var err error - params := &tRechargeSystemQueryRechargeListParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) - params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) - if params.RechargeStatus, err = c.GetInt("rechargeStatus", 0); err != nil { - errParams = append(errParams, "rechargeStatus") - } - if params.Page, err = c.GetInt("page", 0); err != nil { - errParams = append(errParams, "page") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - params.StartTime = utils.TrimBlankChar(c.GetString("startTime")) - params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) - params.UserName = utils.TrimBlankChar(c.GetString("userName")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("orderId")) != "" { - params.MapData["orderId"] = params.OrderId - } - if utils.TrimBlankChar(c.GetString("mobile")) != "" { - params.MapData["mobile"] = params.Mobile - } - if utils.TrimBlankChar(c.GetString("rechargeStatus")) != "" { - params.MapData["rechargeStatus"] = params.RechargeStatus - } - if c.GetString("page") == "" { - errParams = append(errParams, "page") - } - params.MapData["page"] = params.Page - if c.GetString("pageSize") == "" { - errParams = append(errParams, "pageSize") - } - params.MapData["pageSize"] = params.PageSize - if c.GetString("startTime") == "" { - errParams = append(errParams, "startTime") - } - params.MapData["startTime"] = params.StartTime - if c.GetString("endTime") == "" { - errParams = append(errParams, "endTime") - } - params.MapData["endTime"] = params.EndTime - if utils.TrimBlankChar(c.GetString("userName")) != "" { - params.MapData["userName"] = params.UserName - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API RechargeManagerController.SystemQueryRechargeList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API RechargeManagerController.SystemQueryRechargeList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API RechargeManagerController.SystemQueryRechargeList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2SaveMyCartParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - StoreID int - Payload string -} - -// func (c *User2Controller) SaveMyCart() { -// c.callSaveMyCart(func(params *tUser2SaveMyCartParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callSaveMyCart(handler func(params *tUser2SaveMyCartParams) (interface{}, string, error)) { - var err error - params := &tUser2SaveMyCartParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.StoreID, err = c.GetInt("storeID", 0); err != nil { - errParams = append(errParams, "storeID") - } - params.Payload = utils.TrimBlankChar(c.GetString("payload")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("storeID") == "" { - errParams = append(errParams, "storeID") - } - params.MapData["storeID"] = params.StoreID - if utils.TrimBlankChar(c.GetString("payload")) != "" { - params.MapData["payload"] = params.Payload - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.SaveMyCart, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.SaveMyCart, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.SaveMyCart error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2DeleteMyDeliveryAddressParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Id int -} - -// func (c *User2Controller) DeleteMyDeliveryAddress() { -// c.callDeleteMyDeliveryAddress(func(params *tUser2DeleteMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callDeleteMyDeliveryAddress(handler func(params *tUser2DeleteMyDeliveryAddressParams) (interface{}, string, error)) { - var err error - params := &tUser2DeleteMyDeliveryAddressParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Id, err = c.GetInt("id", 0); err != nil { - errParams = append(errParams, "id") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("id") == "" { - errParams = append(errParams, "id") - } - params.MapData["id"] = params.Id - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.DeleteMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.DeleteMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.DeleteMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobImprotMtMembersParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Payload string -} - -// func (c *JobController) ImprotMtMembers() { -// c.callImprotMtMembers(func(params *tJobImprotMtMembersParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callImprotMtMembers(handler func(params *tJobImprotMtMembersParams) (interface{}, string, error)) { - var err error - params := &tJobImprotMtMembersParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Payload = utils.TrimBlankChar(c.GetString("payload")) + params.Data = utils.TrimBlankChar(c.GetString("data")) + params.Iv = utils.TrimBlankChar(c.GetString("iv")) + params.JsCode = utils.TrimBlankChar(c.GetString("jsCode")) + params.AuthType = utils.TrimBlankChar(c.GetString("authType")) + params.AppID = utils.TrimBlankChar(c.GetString("appID")) if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { params.MapData["token"] = params.Token } - if c.GetString("payload") == "" { - errParams = append(errParams, "payload") + if c.GetString("data") == "" { + errParams = append(errParams, "data") + } + params.MapData["data"] = params.Data + if c.GetString("iv") == "" { + errParams = append(errParams, "iv") + } + params.MapData["iv"] = params.Iv + if utils.TrimBlankChar(c.GetString("jsCode")) != "" { + params.MapData["jsCode"] = params.JsCode + } + if utils.TrimBlankChar(c.GetString("authType")) != "" { + params.MapData["authType"] = params.AuthType + } + if utils.TrimBlankChar(c.GetString("appID")) != "" { + params.MapData["appID"] = params.AppID } - params.MapData["payload"] = params.Payload if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -2409,7 +1934,7 @@ func (c *JobController) callImprotMtMembers(handler func(params *tJobImprotMtMem ) params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.ImprotMtMembers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API User2Controller.GetUserByMiniInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -2455,7 +1980,7 @@ func (c *JobController) callImprotMtMembers(handler func(params *tJobImprotMtMem } } } - globals.SugarLogger.Debugf("End API JobController.ImprotMtMembers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API User2Controller.GetUserByMiniInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -2463,7 +1988,7 @@ func (c *JobController) callImprotMtMembers(handler func(params *tJobImprotMtMem errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.ImprotMtMembers error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API User2Controller.GetUserByMiniInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -2480,20 +2005,21 @@ func (c *JobController) callImprotMtMembers(handler func(params *tJobImprotMtMem } } -type tJobRefreshJdDeliveryParams struct { +type tOrderFinishedCashOrdersParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string + OrderIDs string } -// func (c *JobController) RefreshJdDelivery() { -// c.callRefreshJdDelivery(func(params *tJobRefreshJdDeliveryParams) (retVal interface{}, errCode string, err error) { +// func (c *OrderController) FinishedCashOrders() { +// c.callFinishedCashOrders(func(params *tOrderFinishedCashOrdersParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callRefreshJdDelivery(handler func(params *tJobRefreshJdDeliveryParams) (interface{}, string, error)) { +func (c *OrderController) callFinishedCashOrders(handler func(params *tOrderFinishedCashOrdersParams) (interface{}, string, error)) { var err error - params := &tJobRefreshJdDeliveryParams{ + params := &tOrderFinishedCashOrdersParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -2501,11 +2027,16 @@ func (c *JobController) callRefreshJdDelivery(handler func(params *tJobRefreshJd errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.OrderIDs = utils.TrimBlankChar(c.GetString("orderIDs")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token + if c.GetString("orderIDs") == "" { + errParams = append(errParams, "orderIDs") + } + params.MapData["orderIDs"] = params.OrderIDs if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -2518,7 +2049,7 @@ func (c *JobController) callRefreshJdDelivery(handler func(params *tJobRefreshJd ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.RefreshJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API OrderController.FinishedCashOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -2564,7 +2095,7 @@ func (c *JobController) callRefreshJdDelivery(handler func(params *tJobRefreshJd } } } - globals.SugarLogger.Debugf("End API JobController.RefreshJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API OrderController.FinishedCashOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -2572,354 +2103,7 @@ func (c *JobController) callRefreshJdDelivery(handler func(params *tJobRefreshJd errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.RefreshJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventGetUserStatisticsParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *EventController) GetUserStatistics() { -// c.callGetUserStatistics(func(params *tEventGetUserStatisticsParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callGetUserStatistics(handler func(params *tEventGetUserStatisticsParams) (interface{}, string, error)) { - var err error - params := &tEventGetUserStatisticsParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.GetUserStatistics, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.GetUserStatistics, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.GetUserStatistics error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tAuth2AddAuthBindParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - AuthToken string -} - -// func (c *Auth2Controller) AddAuthBind() { -// c.callAddAuthBind(func(params *tAuth2AddAuthBindParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callAddAuthBind(handler func(params *tAuth2AddAuthBindParams) (interface{}, string, error)) { - var err error - params := &tAuth2AddAuthBindParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.AuthToken = utils.TrimBlankChar(c.GetString("authToken")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("authToken") == "" { - errParams = append(errParams, "authToken") - } - params.MapData["authToken"] = params.AuthToken - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.AddAuthBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API Auth2Controller.AddAuthBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.AddAuthBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2AddUserCityManagerParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - UserID string - CityCode int -} - -// func (c *User2Controller) AddUserCityManager() { -// c.callAddUserCityManager(func(params *tUser2AddUserCityManagerParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callAddUserCityManager(handler func(params *tUser2AddUserCityManagerParams) (interface{}, string, error)) { - var err error - params := &tUser2AddUserCityManagerParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { - errParams = append(errParams, "cityCode") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if c.GetString("cityCode") == "" { - errParams = append(errParams, "cityCode") - } - params.MapData["cityCode"] = params.CityCode - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.AddUserCityManager, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.AddUserCityManager, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.AddUserCityManager error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API OrderController.FinishedCashOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -3071,22 +2255,20 @@ func (c *OrderController) callGetMyUnionOrders(handler func(params *tOrderGetMyU } } -type tAuth2AddAuthBindWithMobileParams struct { +type tJobRefreshJobStatusParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - AuthToken string - Mobile string } -// func (c *Auth2Controller) AddAuthBindWithMobile() { -// c.callAddAuthBindWithMobile(func(params *tAuth2AddAuthBindWithMobileParams) (retVal interface{}, errCode string, err error) { +// func (c *JobController) RefreshJobStatus() { +// c.callRefreshJobStatus(func(params *tJobRefreshJobStatusParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2AddAuthBindWithMobileParams) (interface{}, string, error)) { +func (c *JobController) callRefreshJobStatus(handler func(params *tJobRefreshJobStatusParams) (interface{}, string, error)) { var err error - params := &tAuth2AddAuthBindWithMobileParams{ + params := &tJobRefreshJobStatusParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -3094,21 +2276,11 @@ func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2A errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.AuthToken = utils.TrimBlankChar(c.GetString("authToken")) - params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("authToken") == "" { - errParams = append(errParams, "authToken") - } - params.MapData["authToken"] = params.AuthToken - if c.GetString("mobile") == "" { - errParams = append(errParams, "mobile") - } - params.MapData["mobile"] = params.Mobile if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -3121,7 +2293,7 @@ func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2A ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.AddAuthBindWithMobile, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API JobController.RefreshJobStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -3167,7 +2339,7 @@ func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2A } } } - globals.SugarLogger.Debugf("End API Auth2Controller.AddAuthBindWithMobile, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API JobController.RefreshJobStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -3175,7 +2347,7 @@ func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2A errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.AddAuthBindWithMobile error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API JobController.RefreshJobStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -3192,1048 +2364,28 @@ func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2A } } -type tAuth2WeixinOAuth2Params struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Code string - Block string - State string -} - -// func (c *Auth2Controller) WeixinOAuth2() { -// c.callWeixinOAuth2(func(params *tAuth2WeixinOAuth2Params) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callWeixinOAuth2(handler func(params *tAuth2WeixinOAuth2Params) (interface{}, string, error)) { - var err error - params := &tAuth2WeixinOAuth2Params{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Code = utils.TrimBlankChar(c.GetString("code")) - params.Block = utils.TrimBlankChar(c.GetString("block")) - params.State = utils.TrimBlankChar(c.GetString("state")) - if c.GetString("code") == "" { - errParams = append(errParams, "code") - } - params.MapData["code"] = params.Code - if c.GetString("block") == "" { - errParams = append(errParams, "block") - } - params.MapData["block"] = params.Block - if utils.TrimBlankChar(c.GetString("state")) != "" { - params.MapData["state"] = params.State - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.WeixinOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API Auth2Controller.WeixinOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.WeixinOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tOrderCreateOrderParams struct { +type tJobGetStationListParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Type int - OrderType int - Way string - Price int - Lng float64 + StationName string + CityCode int Lat float64 - Mobile string - FlowCode string -} - -// func (c *OrderController) CreateOrder() { -// c.callCreateOrder(func(params *tOrderCreateOrderParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *OrderController) callCreateOrder(handler func(params *tOrderCreateOrderParams) (interface{}, string, error)) { - var err error - params := &tOrderCreateOrderParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Type, err = c.GetInt("type", 0); err != nil { - errParams = append(errParams, "type") - } - if params.OrderType, err = c.GetInt("orderType", 0); err != nil { - errParams = append(errParams, "orderType") - } - params.Way = utils.TrimBlankChar(c.GetString("way")) - if params.Price, err = c.GetInt("price", 0); err != nil { - errParams = append(errParams, "price") - } - if params.Lng, err = c.GetFloat("lng", 0); err != nil { - errParams = append(errParams, "lng") - } - if params.Lat, err = c.GetFloat("lat", 0); err != nil { - errParams = append(errParams, "lat") - } - params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) - params.FlowCode = utils.TrimBlankChar(c.GetString("flowCode")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("type") == "" { - errParams = append(errParams, "type") - } - params.MapData["type"] = params.Type - if c.GetString("orderType") == "" { - errParams = append(errParams, "orderType") - } - params.MapData["orderType"] = params.OrderType - if c.GetString("way") == "" { - errParams = append(errParams, "way") - } - params.MapData["way"] = params.Way - if c.GetString("price") == "" { - errParams = append(errParams, "price") - } - params.MapData["price"] = params.Price - if c.GetString("lng") == "" { - errParams = append(errParams, "lng") - } - params.MapData["lng"] = params.Lng - if c.GetString("lat") == "" { - errParams = append(errParams, "lat") - } - params.MapData["lat"] = params.Lat - if utils.TrimBlankChar(c.GetString("mobile")) != "" { - params.MapData["mobile"] = params.Mobile - } - if utils.TrimBlankChar(c.GetString("flowCode")) != "" { - params.MapData["flowCode"] = params.FlowCode - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.CreateOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API OrderController.CreateOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API OrderController.CreateOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobCancelAcceptJobParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobID int - JobOrderID int -} - -// func (c *JobController) CancelAcceptJob() { -// c.callCancelAcceptJob(func(params *tJobCancelAcceptJobParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callCancelAcceptJob(handler func(params *tJobCancelAcceptJobParams) (interface{}, string, error)) { - var err error - params := &tJobCancelAcceptJobParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobID, err = c.GetInt("jobID", 0); err != nil { - errParams = append(errParams, "jobID") - } - if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { - errParams = append(errParams, "jobOrderID") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobID") == "" { - errParams = append(errParams, "jobID") - } - params.MapData["jobID"] = params.JobID - if c.GetString("jobOrderID") == "" { - errParams = append(errParams, "jobOrderID") - } - params.MapData["jobOrderID"] = params.JobOrderID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.CancelAcceptJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.CancelAcceptJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.CancelAcceptJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobCheckJdDeliveryWeightParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *JobController) CheckJdDeliveryWeight() { -// c.callCheckJdDeliveryWeight(func(params *tJobCheckJdDeliveryWeightParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callCheckJdDeliveryWeight(handler func(params *tJobCheckJdDeliveryWeightParams) (interface{}, string, error)) { - var err error - params := &tJobCheckJdDeliveryWeightParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.CheckJdDeliveryWeight, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.CheckJdDeliveryWeight, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.CheckJdDeliveryWeight error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetJobDetailParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobID int Lng float64 - Lat float64 -} - -// func (c *JobController) GetJobDetail() { -// c.callGetJobDetail(func(params *tJobGetJobDetailParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callGetJobDetail(handler func(params *tJobGetJobDetailParams) (interface{}, string, error)) { - var err error - params := &tJobGetJobDetailParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobID, err = c.GetInt("jobID", 0); err != nil { - errParams = append(errParams, "jobID") - } - if params.Lng, err = c.GetFloat("lng", 0); err != nil { - errParams = append(errParams, "lng") - } - if params.Lat, err = c.GetFloat("lat", 0); err != nil { - errParams = append(errParams, "lat") - } - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if utils.TrimBlankChar(c.GetString("jobID")) != "" { - params.MapData["jobID"] = params.JobID - } - if utils.TrimBlankChar(c.GetString("lng")) != "" { - params.MapData["lng"] = params.Lng - } - if utils.TrimBlankChar(c.GetString("lat")) != "" { - params.MapData["lat"] = params.Lat - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetJobDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.GetJobDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.GetJobDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tTaskUnmanageTasksParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - TaskIDs string -} - -// func (c *TaskController) UnmanageTasks() { -// c.callUnmanageTasks(func(params *tTaskUnmanageTasksParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *TaskController) callUnmanageTasks(handler func(params *tTaskUnmanageTasksParams) (interface{}, string, error)) { - var err error - params := &tTaskUnmanageTasksParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.TaskIDs = utils.TrimBlankChar(c.GetString("taskIDs")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("taskIDs")) != "" { - params.MapData["taskIDs"] = params.TaskIDs - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API TaskController.UnmanageTasks, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API TaskController.UnmanageTasks, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API TaskController.UnmanageTasks error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tOrderPayParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - OrderID string - PayType int - VendorPayType string - OrderType string - AppId string - IsChoose int -} - -// func (c *OrderController) Pay() { -// c.callPay(func(params *tOrderPayParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *OrderController) callPay(handler func(params *tOrderPayParams) (interface{}, string, error)) { - var err error - params := &tOrderPayParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) - if params.PayType, err = c.GetInt("payType", 0); err != nil { - errParams = append(errParams, "payType") - } - params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType")) - params.OrderType = utils.TrimBlankChar(c.GetString("orderType")) - params.AppId = utils.TrimBlankChar(c.GetString("appId")) - if params.IsChoose, err = c.GetInt("isChoose", 0); err != nil { - errParams = append(errParams, "isChoose") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("orderID") == "" { - errParams = append(errParams, "orderID") - } - params.MapData["orderID"] = params.OrderID - if c.GetString("payType") == "" { - errParams = append(errParams, "payType") - } - params.MapData["payType"] = params.PayType - if c.GetString("vendorPayType") == "" { - errParams = append(errParams, "vendorPayType") - } - params.MapData["vendorPayType"] = params.VendorPayType - if c.GetString("orderType") == "" { - errParams = append(errParams, "orderType") - } - params.MapData["orderType"] = params.OrderType - if c.GetString("appId") == "" { - errParams = append(errParams, "appId") - } - params.MapData["appId"] = params.AppId - if c.GetString("isChoose") == "" { - errParams = append(errParams, "isChoose") - } - params.MapData["isChoose"] = params.IsChoose - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.Pay, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API OrderController.Pay, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API OrderController.Pay error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobAddressDistinguishParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Address string -} - -// func (c *JobController) AddressDistinguish() { -// c.callAddressDistinguish(func(params *tJobAddressDistinguishParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callAddressDistinguish(handler func(params *tJobAddressDistinguishParams) (interface{}, string, error)) { - var err error - params := &tJobAddressDistinguishParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Address = utils.TrimBlankChar(c.GetString("address")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("address")) != "" { - params.MapData["address"] = params.Address - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.AddressDistinguish, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.AddressDistinguish, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.AddressDistinguish error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetJdDeliveryParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Status int - FromTime string - ToTime string + OilCode string + SortType int Offset int PageSize int } -// func (c *JobController) GetJdDelivery() { -// c.callGetJdDelivery(func(params *tJobGetJdDeliveryParams) (retVal interface{}, errCode string, err error) { +// func (c *JobController) GetStationList() { +// c.callGetStationList(func(params *tJobGetStationListParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callGetJdDelivery(handler func(params *tJobGetJdDeliveryParams) (interface{}, string, error)) { +func (c *JobController) callGetStationList(handler func(params *tJobGetStationListParams) (interface{}, string, error)) { var err error - params := &tJobGetJdDeliveryParams{ + params := &tJobGetStationListParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -4241,11 +2393,20 @@ func (c *JobController) callGetJdDelivery(handler func(params *tJobGetJdDelivery errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Status, err = c.GetInt("status", 0); err != nil { - errParams = append(errParams, "status") + params.StationName = utils.TrimBlankChar(c.GetString("stationName")) + if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { + errParams = append(errParams, "cityCode") + } + if params.Lat, err = c.GetFloat("lat", 0); err != nil { + errParams = append(errParams, "lat") + } + if params.Lng, err = c.GetFloat("lng", 0); err != nil { + errParams = append(errParams, "lng") + } + params.OilCode = utils.TrimBlankChar(c.GetString("oilCode")) + if params.SortType, err = c.GetInt("sortType", 0); err != nil { + errParams = append(errParams, "sortType") } - params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) - params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) if params.Offset, err = c.GetInt("offset", 0); err != nil { errParams = append(errParams, "offset") } @@ -4257,14 +2418,23 @@ func (c *JobController) callGetJdDelivery(handler func(params *tJobGetJdDelivery err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("status")) != "" { - params.MapData["status"] = params.Status + if utils.TrimBlankChar(c.GetString("stationName")) != "" { + params.MapData["stationName"] = params.StationName } - if utils.TrimBlankChar(c.GetString("fromTime")) != "" { - params.MapData["fromTime"] = params.FromTime + if utils.TrimBlankChar(c.GetString("cityCode")) != "" { + params.MapData["cityCode"] = params.CityCode } - if utils.TrimBlankChar(c.GetString("toTime")) != "" { - params.MapData["toTime"] = params.ToTime + if utils.TrimBlankChar(c.GetString("lat")) != "" { + params.MapData["lat"] = params.Lat + } + if utils.TrimBlankChar(c.GetString("lng")) != "" { + params.MapData["lng"] = params.Lng + } + if utils.TrimBlankChar(c.GetString("oilCode")) != "" { + params.MapData["oilCode"] = params.OilCode + } + if utils.TrimBlankChar(c.GetString("sortType")) != "" { + params.MapData["sortType"] = params.SortType } if utils.TrimBlankChar(c.GetString("offset")) != "" { params.MapData["offset"] = params.Offset @@ -4284,7 +2454,7 @@ func (c *JobController) callGetJdDelivery(handler func(params *tJobGetJdDelivery ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API JobController.GetStationList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -4330,7 +2500,7 @@ func (c *JobController) callGetJdDelivery(handler func(params *tJobGetJdDelivery } } } - globals.SugarLogger.Debugf("End API JobController.GetJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API JobController.GetStationList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -4338,358 +2508,7 @@ func (c *JobController) callGetJdDelivery(handler func(params *tJobGetJdDelivery errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.GetJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetJobCategoriesParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Name string -} - -// func (c *JobController) GetJobCategories() { -// c.callGetJobCategories(func(params *tJobGetJobCategoriesParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callGetJobCategories(handler func(params *tJobGetJobCategoriesParams) (interface{}, string, error)) { - var err error - params := &tJobGetJobCategoriesParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Name = utils.TrimBlankChar(c.GetString("name")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("name")) != "" { - params.MapData["name"] = params.Name - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetJobCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.GetJobCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.GetJobCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tBalanceUpdateUserBalanceParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Phone string - UserID string - Money int -} - -// func (c *UserBalanceController) UpdateUserBalance() { -// c.callUpdateUserBalance(func(params *tBalanceUpdateUserBalanceParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UserBalanceController) callUpdateUserBalance(handler func(params *tBalanceUpdateUserBalanceParams) (interface{}, string, error)) { - var err error - params := &tBalanceUpdateUserBalanceParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Phone = utils.TrimBlankChar(c.GetString("phone")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.Money, err = c.GetInt("money", 0); err != nil { - errParams = append(errParams, "money") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("phone") == "" { - errParams = append(errParams, "phone") - } - params.MapData["phone"] = params.Phone - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if utils.TrimBlankChar(c.GetString("money")) != "" { - params.MapData["money"] = params.Money - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UserBalanceController.UpdateUserBalance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UserBalanceController.UpdateUserBalance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UserBalanceController.UpdateUserBalance error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventUploadImgParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *EventController) UploadImg() { -// c.callUploadImg(func(params *tEventUploadImgParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callUploadImg(handler func(params *tEventUploadImgParams) (interface{}, string, error)) { - var err error - params := &tEventUploadImgParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.UploadImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.UploadImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.UploadImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API JobController.GetStationList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -5012,20 +2831,22 @@ func (c *QBiDaExpressController) callCreateWayOrder(handler func(params *tExpres } } -type tAuth2GetTokenInfoParams struct { +type tUnionGetUnionActListParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string + VendorID int + ActType int } -// func (c *Auth2Controller) GetTokenInfo() { -// c.callGetTokenInfo(func(params *tAuth2GetTokenInfoParams) (retVal interface{}, errCode string, err error) { +// func (c *UnionController) GetUnionActList() { +// c.callGetUnionActList(func(params *tUnionGetUnionActListParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenInfoParams) (interface{}, string, error)) { +func (c *UnionController) callGetUnionActList(handler func(params *tUnionGetUnionActListParams) (interface{}, string, error)) { var err error - params := &tAuth2GetTokenInfoParams{ + params := &tUnionGetUnionActListParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -5033,11 +2854,25 @@ func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenIn errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { + errParams = append(errParams, "vendorID") + } + if params.ActType, err = c.GetInt("actType", 0); err != nil { + errParams = append(errParams, "actType") + } if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token + if c.GetString("vendorID") == "" { + errParams = append(errParams, "vendorID") + } + params.MapData["vendorID"] = params.VendorID + if c.GetString("actType") == "" { + errParams = append(errParams, "actType") + } + params.MapData["actType"] = params.ActType if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -5050,7 +2885,7 @@ func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenIn ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.GetTokenInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API UnionController.GetUnionActList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -5096,7 +2931,7 @@ func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenIn } } } - globals.SugarLogger.Debugf("End API Auth2Controller.GetTokenInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API UnionController.GetUnionActList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -5104,7 +2939,7 @@ func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenIn errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.GetTokenInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API UnionController.GetUnionActList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -5121,21 +2956,972 @@ func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenIn } } -type tJobSubmitJobParams struct { +type tAuth2WeixinMPOAuth2Params struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Code string + Block string + State string +} + +// func (c *Auth2Controller) WeixinMPOAuth2() { +// c.callWeixinMPOAuth2(func(params *tAuth2WeixinMPOAuth2Params) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callWeixinMPOAuth2(handler func(params *tAuth2WeixinMPOAuth2Params) (interface{}, string, error)) { + var err error + params := &tAuth2WeixinMPOAuth2Params{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Code = utils.TrimBlankChar(c.GetString("code")) + params.Block = utils.TrimBlankChar(c.GetString("block")) + params.State = utils.TrimBlankChar(c.GetString("state")) + if c.GetString("code") == "" { + errParams = append(errParams, "code") + } + params.MapData["code"] = params.Code + if c.GetString("block") == "" { + errParams = append(errParams, "block") + } + params.MapData["block"] = params.Block + if utils.TrimBlankChar(c.GetString("state")) != "" { + params.MapData["state"] = params.State + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.WeixinMPOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.WeixinMPOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.WeixinMPOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tOrderGetOrdersParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + OrderID string + UserID string + OrderType int + CityCodes string + FromTime string + ToTime string + Keyword string + Offset int + PageSize int +} + +// func (c *OrderController) GetOrders() { +// c.callGetOrders(func(params *tOrderGetOrdersParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *OrderController) callGetOrders(handler func(params *tOrderGetOrdersParams) (interface{}, string, error)) { + var err error + params := &tOrderGetOrdersParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.OrderType, err = c.GetInt("orderType", 0); err != nil { + errParams = append(errParams, "orderType") + } + params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) + params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) + params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) + params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("orderID")) != "" { + params.MapData["orderID"] = params.OrderID + } + if utils.TrimBlankChar(c.GetString("userID")) != "" { + params.MapData["userID"] = params.UserID + } + if utils.TrimBlankChar(c.GetString("orderType")) != "" { + params.MapData["orderType"] = params.OrderType + } + if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { + params.MapData["cityCodes"] = params.CityCodes + } + if utils.TrimBlankChar(c.GetString("fromTime")) != "" { + params.MapData["fromTime"] = params.FromTime + } + if utils.TrimBlankChar(c.GetString("toTime")) != "" { + params.MapData["toTime"] = params.ToTime + } + if utils.TrimBlankChar(c.GetString("keyword")) != "" { + params.MapData["keyword"] = params.Keyword + } + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if utils.TrimBlankChar(c.GetString("pageSize")) != "" { + params.MapData["pageSize"] = params.PageSize + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.GetOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.GetOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.GetOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobCheckJdDeliveryWeightParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *JobController) CheckJdDeliveryWeight() { +// c.callCheckJdDeliveryWeight(func(params *tJobCheckJdDeliveryWeightParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callCheckJdDeliveryWeight(handler func(params *tJobCheckJdDeliveryWeightParams) (interface{}, string, error)) { + var err error + params := &tJobCheckJdDeliveryWeightParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.CheckJdDeliveryWeight, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.CheckJdDeliveryWeight, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.CheckJdDeliveryWeight error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventUpdateMessageGroupParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + GroupID int + Payload string +} + +// func (c *EventController) UpdateMessageGroup() { +// c.callUpdateMessageGroup(func(params *tEventUpdateMessageGroupParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callUpdateMessageGroup(handler func(params *tEventUpdateMessageGroupParams) (interface{}, string, error)) { + var err error + params := &tEventUpdateMessageGroupParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.GroupID, err = c.GetInt("groupID", 0); err != nil { + errParams = append(errParams, "groupID") + } + params.Payload = utils.TrimBlankChar(c.GetString("payload")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("groupID") == "" { + errParams = append(errParams, "groupID") + } + params.MapData["groupID"] = params.GroupID + if c.GetString("payload") == "" { + errParams = append(errParams, "payload") + } + params.MapData["payload"] = params.Payload + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.UpdateMessageGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.UpdateMessageGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.UpdateMessageGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsNewConfigParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Type string + Key string + Value string +} + +// func (c *CmsController) NewConfig() { +// c.callNewConfig(func(params *tCmsNewConfigParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callNewConfig(handler func(params *tCmsNewConfigParams) (interface{}, string, error)) { + var err error + params := &tCmsNewConfigParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Type = utils.TrimBlankChar(c.GetString("type")) + params.Key = utils.TrimBlankChar(c.GetString("key")) + params.Value = utils.TrimBlankChar(c.GetString("value")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("type") == "" { + errParams = append(errParams, "type") + } + params.MapData["type"] = params.Type + if c.GetString("key") == "" { + errParams = append(errParams, "key") + } + params.MapData["key"] = params.Key + if c.GetString("value") == "" { + errParams = append(errParams, "value") + } + params.MapData["value"] = params.Value + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.NewConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.NewConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.NewConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUnionGetUnionOrdersParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + VendorIDs string + Statuss string + BeginTime string + EndTime string + Keyword string + Offset int + PageSize int +} + +// func (c *UnionController) GetUnionOrders() { +// c.callGetUnionOrders(func(params *tUnionGetUnionOrdersParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *UnionController) callGetUnionOrders(handler func(params *tUnionGetUnionOrdersParams) (interface{}, string, error)) { + var err error + params := &tUnionGetUnionOrdersParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs")) + params.Statuss = utils.TrimBlankChar(c.GetString("statuss")) + params.BeginTime = utils.TrimBlankChar(c.GetString("beginTime")) + params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) + params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" { + params.MapData["vendorIDs"] = params.VendorIDs + } + if utils.TrimBlankChar(c.GetString("statuss")) != "" { + params.MapData["statuss"] = params.Statuss + } + if utils.TrimBlankChar(c.GetString("beginTime")) != "" { + params.MapData["beginTime"] = params.BeginTime + } + if utils.TrimBlankChar(c.GetString("endTime")) != "" { + params.MapData["endTime"] = params.EndTime + } + if utils.TrimBlankChar(c.GetString("keyword")) != "" { + params.MapData["keyword"] = params.Keyword + } + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if utils.TrimBlankChar(c.GetString("pageSize")) != "" { + params.MapData["pageSize"] = params.PageSize + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API UnionController.GetUnionOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API UnionController.GetUnionOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API UnionController.GetUnionOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tOrderCreateOrderParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Type int + OrderType int + Way string + Price int + Lng float64 + Lat float64 + Mobile string + FlowCode string +} + +// func (c *OrderController) CreateOrder() { +// c.callCreateOrder(func(params *tOrderCreateOrderParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *OrderController) callCreateOrder(handler func(params *tOrderCreateOrderParams) (interface{}, string, error)) { + var err error + params := &tOrderCreateOrderParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Type, err = c.GetInt("type", 0); err != nil { + errParams = append(errParams, "type") + } + if params.OrderType, err = c.GetInt("orderType", 0); err != nil { + errParams = append(errParams, "orderType") + } + params.Way = utils.TrimBlankChar(c.GetString("way")) + if params.Price, err = c.GetInt("price", 0); err != nil { + errParams = append(errParams, "price") + } + if params.Lng, err = c.GetFloat("lng", 0); err != nil { + errParams = append(errParams, "lng") + } + if params.Lat, err = c.GetFloat("lat", 0); err != nil { + errParams = append(errParams, "lat") + } + params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) + params.FlowCode = utils.TrimBlankChar(c.GetString("flowCode")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("type") == "" { + errParams = append(errParams, "type") + } + params.MapData["type"] = params.Type + if c.GetString("orderType") == "" { + errParams = append(errParams, "orderType") + } + params.MapData["orderType"] = params.OrderType + if c.GetString("way") == "" { + errParams = append(errParams, "way") + } + params.MapData["way"] = params.Way + if c.GetString("price") == "" { + errParams = append(errParams, "price") + } + params.MapData["price"] = params.Price + if c.GetString("lng") == "" { + errParams = append(errParams, "lng") + } + params.MapData["lng"] = params.Lng + if c.GetString("lat") == "" { + errParams = append(errParams, "lat") + } + params.MapData["lat"] = params.Lat + if utils.TrimBlankChar(c.GetString("mobile")) != "" { + params.MapData["mobile"] = params.Mobile + } + if utils.TrimBlankChar(c.GetString("flowCode")) != "" { + params.MapData["flowCode"] = params.FlowCode + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.CreateOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.CreateOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.CreateOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobPublishJobParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string Payload string } -// func (c *JobController) SubmitJob() { -// c.callSubmitJob(func(params *tJobSubmitJobParams) (retVal interface{}, errCode string, err error) { +// func (c *JobController) PublishJob() { +// c.callPublishJob(func(params *tJobPublishJobParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callSubmitJob(handler func(params *tJobSubmitJobParams) (interface{}, string, error)) { +func (c *JobController) callPublishJob(handler func(params *tJobPublishJobParams) (interface{}, string, error)) { var err error - params := &tJobSubmitJobParams{ + params := &tJobPublishJobParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -5165,7 +3951,7 @@ func (c *JobController) callSubmitJob(handler func(params *tJobSubmitJobParams) ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.SubmitJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API JobController.PublishJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -5211,7 +3997,7 @@ func (c *JobController) callSubmitJob(handler func(params *tJobSubmitJobParams) } } } - globals.SugarLogger.Debugf("End API JobController.SubmitJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API JobController.PublishJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -5219,7 +4005,114 @@ func (c *JobController) callSubmitJob(handler func(params *tJobSubmitJobParams) errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.SubmitJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API JobController.PublishJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetMtMembersParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *JobController) GetMtMembers() { +// c.callGetMtMembers(func(params *tJobGetMtMembersParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetMtMembers(handler func(params *tJobGetMtMembersParams) (interface{}, string, error)) { + var err error + params := &tJobGetMtMembersParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetMtMembers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetMtMembers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetMtMembers error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -5377,20 +4270,481 @@ func (c *EventController) callGetImMessageRecord(handler func(params *tEventGetI } } -type tJobGetMtMembersParams struct { +type tTaskUnmanageTasksParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + TaskIDs string +} + +// func (c *TaskController) UnmanageTasks() { +// c.callUnmanageTasks(func(params *tTaskUnmanageTasksParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *TaskController) callUnmanageTasks(handler func(params *tTaskUnmanageTasksParams) (interface{}, string, error)) { + var err error + params := &tTaskUnmanageTasksParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.TaskIDs = utils.TrimBlankChar(c.GetString("taskIDs")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("taskIDs")) != "" { + params.MapData["taskIDs"] = params.TaskIDs + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API TaskController.UnmanageTasks, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API TaskController.UnmanageTasks, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API TaskController.UnmanageTasks error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tTaskCancelTaskParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + TaskID string +} + +// func (c *TaskController) CancelTask() { +// c.callCancelTask(func(params *tTaskCancelTaskParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *TaskController) callCancelTask(handler func(params *tTaskCancelTaskParams) (interface{}, string, error)) { + var err error + params := &tTaskCancelTaskParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.TaskID = utils.TrimBlankChar(c.GetString("taskID")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("taskID") == "" { + errParams = append(errParams, "taskID") + } + params.MapData["taskID"] = params.TaskID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API TaskController.CancelTask, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API TaskController.CancelTask, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API TaskController.CancelTask error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsInitStationParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string } -// func (c *JobController) GetMtMembers() { -// c.callGetMtMembers(func(params *tJobGetMtMembersParams) (retVal interface{}, errCode string, err error) { +// func (c *CmsController) InitStation() { +// c.callInitStation(func(params *tCmsInitStationParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callGetMtMembers(handler func(params *tJobGetMtMembersParams) (interface{}, string, error)) { +func (c *CmsController) callInitStation(handler func(params *tCmsInitStationParams) (interface{}, string, error)) { var err error - params := &tJobGetMtMembersParams{ + params := &tCmsInitStationParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.InitStation, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.InitStation, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.InitStation error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventAddMessageGroupParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + GroupID int + UserID string +} + +// func (c *EventController) AddMessageGroup() { +// c.callAddMessageGroup(func(params *tEventAddMessageGroupParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callAddMessageGroup(handler func(params *tEventAddMessageGroupParams) (interface{}, string, error)) { + var err error + params := &tEventAddMessageGroupParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.GroupID, err = c.GetInt("groupID", 0); err != nil { + errParams = append(errParams, "groupID") + } + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("groupID") == "" { + errParams = append(errParams, "groupID") + } + params.MapData["groupID"] = params.GroupID + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.AddMessageGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.AddMessageGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.AddMessageGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsGetServiceInfoParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *CmsController) GetServiceInfo() { +// c.callGetServiceInfo(func(params *tCmsGetServiceInfoParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callGetServiceInfo(handler func(params *tCmsGetServiceInfoParams) (interface{}, string, error)) { + var err error + params := &tCmsGetServiceInfoParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -5413,7 +4767,7 @@ func (c *JobController) callGetMtMembers(handler func(params *tJobGetMtMembersPa ) params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetMtMembers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API CmsController.GetServiceInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -5459,7 +4813,7 @@ func (c *JobController) callGetMtMembers(handler func(params *tJobGetMtMembersPa } } } - globals.SugarLogger.Debugf("End API JobController.GetMtMembers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API CmsController.GetServiceInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -5467,401 +4821,7 @@ func (c *JobController) callGetMtMembers(handler func(params *tJobGetMtMembersPa errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.GetMtMembers error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tExpressGetOrderListParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - ExpressType int - OrderNo string - OrderStatus int - PageNum int - PageSize int - StartTime string - EndTime string -} - -// func (c *QBiDaExpressController) GetOrderList() { -// c.callGetOrderList(func(params *tExpressGetOrderListParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *QBiDaExpressController) callGetOrderList(handler func(params *tExpressGetOrderListParams) (interface{}, string, error)) { - var err error - params := &tExpressGetOrderListParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.ExpressType, err = c.GetInt("expressType", 0); err != nil { - errParams = append(errParams, "expressType") - } - params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) - if params.OrderStatus, err = c.GetInt("orderStatus", 0); err != nil { - errParams = append(errParams, "orderStatus") - } - if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { - errParams = append(errParams, "pageNum") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - params.StartTime = utils.TrimBlankChar(c.GetString("startTime")) - params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("expressType")) != "" { - params.MapData["expressType"] = params.ExpressType - } - if utils.TrimBlankChar(c.GetString("orderNo")) != "" { - params.MapData["orderNo"] = params.OrderNo - } - if utils.TrimBlankChar(c.GetString("orderStatus")) != "" { - params.MapData["orderStatus"] = params.OrderStatus - } - if c.GetString("pageNum") == "" { - errParams = append(errParams, "pageNum") - } - params.MapData["pageNum"] = params.PageNum - if c.GetString("pageSize") == "" { - errParams = append(errParams, "pageSize") - } - params.MapData["pageSize"] = params.PageSize - if c.GetString("startTime") == "" { - errParams = append(errParams, "startTime") - } - params.MapData["startTime"] = params.StartTime - if c.GetString("endTime") == "" { - errParams = append(errParams, "endTime") - } - params.MapData["endTime"] = params.EndTime - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API QBiDaExpressController.GetOrderList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API QBiDaExpressController.GetOrderList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API QBiDaExpressController.GetOrderList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tExpressTryAgainOrderByOldOrderParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - OldNo string -} - -// func (c *QBiDaExpressController) TryAgainOrderByOldOrder() { -// c.callTryAgainOrderByOldOrder(func(params *tExpressTryAgainOrderByOldOrderParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *QBiDaExpressController) callTryAgainOrderByOldOrder(handler func(params *tExpressTryAgainOrderByOldOrderParams) (interface{}, string, error)) { - var err error - params := &tExpressTryAgainOrderByOldOrderParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OldNo = utils.TrimBlankChar(c.GetString("oldNo")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("oldNo") == "" { - errParams = append(errParams, "oldNo") - } - params.MapData["oldNo"] = params.OldNo - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API QBiDaExpressController.TryAgainOrderByOldOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API QBiDaExpressController.TryAgainOrderByOldOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API QBiDaExpressController.TryAgainOrderByOldOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tAuth2SendVerifyCodeParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - CaptchaID string - CaptchaValue string - AuthToken string - AuthID string -} - -// func (c *Auth2Controller) SendVerifyCode() { -// c.callSendVerifyCode(func(params *tAuth2SendVerifyCodeParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callSendVerifyCode(handler func(params *tAuth2SendVerifyCodeParams) (interface{}, string, error)) { - var err error - params := &tAuth2SendVerifyCodeParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.CaptchaID = utils.TrimBlankChar(c.GetString("captchaID")) - params.CaptchaValue = utils.TrimBlankChar(c.GetString("captchaValue")) - params.AuthToken = utils.TrimBlankChar(c.GetString("authToken")) - params.AuthID = utils.TrimBlankChar(c.GetString("authID")) - if utils.TrimBlankChar(c.GetString("captchaID")) != "" { - params.MapData["captchaID"] = params.CaptchaID - } - if utils.TrimBlankChar(c.GetString("captchaValue")) != "" { - params.MapData["captchaValue"] = params.CaptchaValue - } - if utils.TrimBlankChar(c.GetString("authToken")) != "" { - params.MapData["authToken"] = params.AuthToken - } - if c.GetString("authID") == "" { - errParams = append(errParams, "authID") - } - params.MapData["authID"] = params.AuthID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.SendVerifyCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API Auth2Controller.SendVerifyCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.SendVerifyCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API CmsController.GetServiceInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -5993,21 +4953,656 @@ func (c *User2Controller) callLoadMyCart(handler func(params *tUser2LoadMyCartPa } } -type tJobPublishJobParams struct { +type tOrderGetManageStatisticsJobParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + CityCodes string + FromTime string + ToTime string + JobIDs string + Offset int + PageSize int +} + +// func (c *OrderController) GetManageStatisticsJob() { +// c.callGetManageStatisticsJob(func(params *tOrderGetManageStatisticsJobParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *OrderController) callGetManageStatisticsJob(handler func(params *tOrderGetManageStatisticsJobParams) (interface{}, string, error)) { + var err error + params := &tOrderGetManageStatisticsJobParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) + params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) + params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) + params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { + params.MapData["cityCodes"] = params.CityCodes + } + if utils.TrimBlankChar(c.GetString("fromTime")) != "" { + params.MapData["fromTime"] = params.FromTime + } + if utils.TrimBlankChar(c.GetString("toTime")) != "" { + params.MapData["toTime"] = params.ToTime + } + if utils.TrimBlankChar(c.GetString("jobIDs")) != "" { + params.MapData["jobIDs"] = params.JobIDs + } + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if utils.TrimBlankChar(c.GetString("pageSize")) != "" { + params.MapData["pageSize"] = params.PageSize + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.GetManageStatisticsJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.GetManageStatisticsJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.GetManageStatisticsJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetJobCategoriesParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Name string +} + +// func (c *JobController) GetJobCategories() { +// c.callGetJobCategories(func(params *tJobGetJobCategoriesParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetJobCategories(handler func(params *tJobGetJobCategoriesParams) (interface{}, string, error)) { + var err error + params := &tJobGetJobCategoriesParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Name = utils.TrimBlankChar(c.GetString("name")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("name")) != "" { + params.MapData["name"] = params.Name + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetJobCategories, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetJobCategories, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetJobCategories error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetJdDeliveryParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Status int + FromTime string + ToTime string + Offset int + PageSize int +} + +// func (c *JobController) GetJdDelivery() { +// c.callGetJdDelivery(func(params *tJobGetJdDeliveryParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetJdDelivery(handler func(params *tJobGetJdDeliveryParams) (interface{}, string, error)) { + var err error + params := &tJobGetJdDeliveryParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Status, err = c.GetInt("status", 0); err != nil { + errParams = append(errParams, "status") + } + params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) + params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("status")) != "" { + params.MapData["status"] = params.Status + } + if utils.TrimBlankChar(c.GetString("fromTime")) != "" { + params.MapData["fromTime"] = params.FromTime + } + if utils.TrimBlankChar(c.GetString("toTime")) != "" { + params.MapData["toTime"] = params.ToTime + } + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if utils.TrimBlankChar(c.GetString("pageSize")) != "" { + params.MapData["pageSize"] = params.PageSize + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2LogoutParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *Auth2Controller) Logout() { +// c.callLogout(func(params *tAuth2LogoutParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callLogout(handler func(params *tAuth2LogoutParams) (interface{}, string, error)) { + var err error + params := &tAuth2LogoutParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.Logout, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.Logout, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.Logout error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tOrderCashParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + OrderID string + PayType int + VendorPayType string +} + +// func (c *OrderController) Cash() { +// c.callCash(func(params *tOrderCashParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *OrderController) callCash(handler func(params *tOrderCashParams) (interface{}, string, error)) { + var err error + params := &tOrderCashParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) + if params.PayType, err = c.GetInt("payType", 0); err != nil { + errParams = append(errParams, "payType") + } + params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("orderID") == "" { + errParams = append(errParams, "orderID") + } + params.MapData["orderID"] = params.OrderID + if c.GetString("payType") == "" { + errParams = append(errParams, "payType") + } + params.MapData["payType"] = params.PayType + if c.GetString("vendorPayType") == "" { + errParams = append(errParams, "vendorPayType") + } + params.MapData["vendorPayType"] = params.VendorPayType + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.Cash, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.Cash, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.Cash error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobImprotMtMembersParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string Payload string } -// func (c *JobController) PublishJob() { -// c.callPublishJob(func(params *tJobPublishJobParams) (retVal interface{}, errCode string, err error) { +// func (c *JobController) ImprotMtMembers() { +// c.callImprotMtMembers(func(params *tJobImprotMtMembersParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callPublishJob(handler func(params *tJobPublishJobParams) (interface{}, string, error)) { +func (c *JobController) callImprotMtMembers(handler func(params *tJobImprotMtMembersParams) (interface{}, string, error)) { var err error - params := &tJobPublishJobParams{ + params := &tJobImprotMtMembersParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -6016,11 +5611,9 @@ func (c *JobController) callPublishJob(handler func(params *tJobPublishJobParams params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) params.Payload = utils.TrimBlankChar(c.GetString("payload")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token } - params.MapData["token"] = params.Token if c.GetString("payload") == "" { errParams = append(errParams, "payload") } @@ -6035,9 +5628,9 @@ func (c *JobController) callPublishJob(handler func(params *tJobPublishJobParams err2 error result interface{} ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.PublishJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API JobController.ImprotMtMembers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -6083,7 +5676,7 @@ func (c *JobController) callPublishJob(handler func(params *tJobPublishJobParams } } } - globals.SugarLogger.Debugf("End API JobController.PublishJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API JobController.ImprotMtMembers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -6091,7 +5684,7 @@ func (c *JobController) callPublishJob(handler func(params *tJobPublishJobParams errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.PublishJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API JobController.ImprotMtMembers error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -6108,21 +5701,22 @@ func (c *JobController) callPublishJob(handler func(params *tJobPublishJobParams } } -type tEventUpdateUserMessageGroupReadParams struct { +type tEventTransferMessageGroupMasterParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Payload string + GroupID int + UserID string } -// func (c *EventController) UpdateUserMessageGroupRead() { -// c.callUpdateUserMessageGroupRead(func(params *tEventUpdateUserMessageGroupReadParams) (retVal interface{}, errCode string, err error) { +// func (c *EventController) TransferMessageGroupMaster() { +// c.callTransferMessageGroupMaster(func(params *tEventTransferMessageGroupMasterParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *EventController) callUpdateUserMessageGroupRead(handler func(params *tEventUpdateUserMessageGroupReadParams) (interface{}, string, error)) { +func (c *EventController) callTransferMessageGroupMaster(handler func(params *tEventTransferMessageGroupMasterParams) (interface{}, string, error)) { var err error - params := &tEventUpdateUserMessageGroupReadParams{ + params := &tEventTransferMessageGroupMasterParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -6130,16 +5724,23 @@ func (c *EventController) callUpdateUserMessageGroupRead(handler func(params *tE errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Payload = utils.TrimBlankChar(c.GetString("payload")) + if params.GroupID, err = c.GetInt("groupID", 0); err != nil { + errParams = append(errParams, "groupID") + } + params.UserID = utils.TrimBlankChar(c.GetString("userID")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("payload") == "" { - errParams = append(errParams, "payload") + if c.GetString("groupID") == "" { + errParams = append(errParams, "groupID") } - params.MapData["payload"] = params.Payload + params.MapData["groupID"] = params.GroupID + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -6152,7 +5753,7 @@ func (c *EventController) callUpdateUserMessageGroupRead(handler func(params *tE ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.UpdateUserMessageGroupRead, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API EventController.TransferMessageGroupMaster, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -6198,7 +5799,7 @@ func (c *EventController) callUpdateUserMessageGroupRead(handler func(params *tE } } } - globals.SugarLogger.Debugf("End API EventController.UpdateUserMessageGroupRead, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API EventController.TransferMessageGroupMaster, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -6206,388 +5807,7 @@ func (c *EventController) callUpdateUserMessageGroupRead(handler func(params *tE errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API EventController.UpdateUserMessageGroupRead error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tCmsNewConfigParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Type string - Key string - Value string -} - -// func (c *CmsController) NewConfig() { -// c.callNewConfig(func(params *tCmsNewConfigParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *CmsController) callNewConfig(handler func(params *tCmsNewConfigParams) (interface{}, string, error)) { - var err error - params := &tCmsNewConfigParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Type = utils.TrimBlankChar(c.GetString("type")) - params.Key = utils.TrimBlankChar(c.GetString("key")) - params.Value = utils.TrimBlankChar(c.GetString("value")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("type") == "" { - errParams = append(errParams, "type") - } - params.MapData["type"] = params.Type - if c.GetString("key") == "" { - errParams = append(errParams, "key") - } - params.MapData["key"] = params.Key - if c.GetString("value") == "" { - errParams = append(errParams, "value") - } - params.MapData["value"] = params.Value - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.NewConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.NewConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.NewConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUnionShareUnionLinkParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobID int - ShareType int - ResourceType int - LinkType int - GoodsID string -} - -// func (c *UnionController) ShareUnionLink() { -// c.callShareUnionLink(func(params *tUnionShareUnionLinkParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UnionController) callShareUnionLink(handler func(params *tUnionShareUnionLinkParams) (interface{}, string, error)) { - var err error - params := &tUnionShareUnionLinkParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobID, err = c.GetInt("jobID", 0); err != nil { - errParams = append(errParams, "jobID") - } - if params.ShareType, err = c.GetInt("shareType", 0); err != nil { - errParams = append(errParams, "shareType") - } - if params.ResourceType, err = c.GetInt("resourceType", 0); err != nil { - errParams = append(errParams, "resourceType") - } - if params.LinkType, err = c.GetInt("linkType", 0); err != nil { - errParams = append(errParams, "linkType") - } - params.GoodsID = utils.TrimBlankChar(c.GetString("goodsID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobID") == "" { - errParams = append(errParams, "jobID") - } - params.MapData["jobID"] = params.JobID - if c.GetString("shareType") == "" { - errParams = append(errParams, "shareType") - } - params.MapData["shareType"] = params.ShareType - if utils.TrimBlankChar(c.GetString("resourceType")) != "" { - params.MapData["resourceType"] = params.ResourceType - } - if c.GetString("linkType") == "" { - errParams = append(errParams, "linkType") - } - params.MapData["linkType"] = params.LinkType - if utils.TrimBlankChar(c.GetString("goodsID")) != "" { - params.MapData["goodsID"] = params.GoodsID - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.ShareUnionLink, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.ShareUnionLink, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.ShareUnionLink error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2GetSelfInfoParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *User2Controller) GetSelfInfo() { -// c.callGetSelfInfo(func(params *tUser2GetSelfInfoParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callGetSelfInfo(handler func(params *tUser2GetSelfInfoParams) (interface{}, string, error)) { - var err error - params := &tUser2GetSelfInfoParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.GetSelfInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.GetSelfInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.GetSelfInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API EventController.TransferMessageGroupMaster error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -6727,273 +5947,46 @@ func (c *User2Controller) callRegisterUser(handler func(params *tUser2RegisterUs } } -type tJobRefreshJobStatusParams struct { +type tOpenapiCallOpenAPIParams struct { MapData map[string]interface{} Ctx *jxcontext.Context - Token string + App_id string + Timestamp int + Sign string + Method string } -// func (c *JobController) RefreshJobStatus() { -// c.callRefreshJobStatus(func(params *tJobRefreshJobStatusParams) (retVal interface{}, errCode string, err error) { +// func (c *ApiController) CallOpenAPI() { +// c.callCallOpenAPI(func(params *tOpenapiCallOpenAPIParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callRefreshJobStatus(handler func(params *tJobRefreshJobStatusParams) (interface{}, string, error)) { +func (c *ApiController) callCallOpenAPI(handler func(params *tOpenapiCallOpenAPIParams) (interface{}, string, error)) { var err error - params := &tJobRefreshJobStatusParams{ + params := &tOpenapiCallOpenAPIParams{ MapData : make(map[string]interface{}), } errParams := []string{} token := c.Ctx.Input.Header("token") errCode := model.ErrCodeGeneralFailed - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid + params.App_id = utils.TrimBlankChar(c.GetString("app_id")) + if params.Timestamp, err = c.GetInt("timestamp", 0); err != nil { + errParams = append(errParams, "timestamp") } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + params.Sign = utils.TrimBlankChar(c.GetString("sign")) + params.Method = utils.TrimBlankChar(c.GetString("method")) + if utils.TrimBlankChar(c.GetString("app_id")) != "" { + params.MapData["app_id"] = params.App_id } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.RefreshJobStatus, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.RefreshJobStatus, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.RefreshJobStatus error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } + if utils.TrimBlankChar(c.GetString("timestamp")) != "" { + params.MapData["timestamp"] = params.Timestamp } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() + if utils.TrimBlankChar(c.GetString("sign")) != "" { + params.MapData["sign"] = params.Sign } -} - -type tJobCancelPublishJobParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobID int -} - -// func (c *JobController) CancelPublishJob() { -// c.callCancelPublishJob(func(params *tJobCancelPublishJobParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callCancelPublishJob(handler func(params *tJobCancelPublishJobParams) (interface{}, string, error)) { - var err error - params := &tJobCancelPublishJobParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobID, err = c.GetInt("jobID", 0); err != nil { - errParams = append(errParams, "jobID") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobID") == "" { - errParams = append(errParams, "jobID") - } - params.MapData["jobID"] = params.JobID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.CancelPublishJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.CancelPublishJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.CancelPublishJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tAuth2CreateCaptchaParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Width int - Height int - CaptchaLen int -} - -// func (c *Auth2Controller) CreateCaptcha() { -// c.callCreateCaptcha(func(params *tAuth2CreateCaptchaParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callCreateCaptcha(handler func(params *tAuth2CreateCaptchaParams) (interface{}, string, error)) { - var err error - params := &tAuth2CreateCaptchaParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - if params.Width, err = c.GetInt("width", 0); err != nil { - errParams = append(errParams, "width") - } - if params.Height, err = c.GetInt("height", 0); err != nil { - errParams = append(errParams, "height") - } - if params.CaptchaLen, err = c.GetInt("captchaLen", 0); err != nil { - errParams = append(errParams, "captchaLen") - } - if c.GetString("width") == "" { - errParams = append(errParams, "width") - } - params.MapData["width"] = params.Width - if c.GetString("height") == "" { - errParams = append(errParams, "height") - } - params.MapData["height"] = params.Height - if utils.TrimBlankChar(c.GetString("captchaLen")) != "" { - params.MapData["captchaLen"] = params.CaptchaLen + if utils.TrimBlankChar(c.GetString("method")) != "" { + params.MapData["method"] = params.Method } if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) @@ -7007,7 +6000,7 @@ func (c *Auth2Controller) callCreateCaptcha(handler func(params *tAuth2CreateCap ) params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.CreateCaptcha, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API ApiController.CallOpenAPI, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -7053,7 +6046,7 @@ func (c *Auth2Controller) callCreateCaptcha(handler func(params *tAuth2CreateCap } } } - globals.SugarLogger.Debugf("End API Auth2Controller.CreateCaptcha, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API ApiController.CallOpenAPI, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -7061,7 +6054,7 @@ func (c *Auth2Controller) callCreateCaptcha(handler func(params *tAuth2CreateCap errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.CreateCaptcha error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API ApiController.CallOpenAPI error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -7078,762 +6071,25 @@ func (c *Auth2Controller) callCreateCaptcha(handler func(params *tAuth2CreateCap } } -type tAuth2ChangePasswordParams struct { +type tWithdrawalExamineWithdrawalOrderParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - OldPwd string - NewPwd string -} - -// func (c *Auth2Controller) ChangePassword() { -// c.callChangePassword(func(params *tAuth2ChangePasswordParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callChangePassword(handler func(params *tAuth2ChangePasswordParams) (interface{}, string, error)) { - var err error - params := &tAuth2ChangePasswordParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OldPwd = utils.TrimBlankChar(c.GetString("oldPwd")) - params.NewPwd = utils.TrimBlankChar(c.GetString("newPwd")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("oldPwd")) != "" { - params.MapData["oldPwd"] = params.OldPwd - } - if c.GetString("newPwd") == "" { - errParams = append(errParams, "newPwd") - } - params.MapData["newPwd"] = params.NewPwd - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.ChangePassword, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API Auth2Controller.ChangePassword, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.ChangePassword error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tAuth2LoginParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - AuthType string - AuthSecret string - AuthID string - AuthIDType string -} - -// func (c *Auth2Controller) Login() { -// c.callLogin(func(params *tAuth2LoginParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callLogin(handler func(params *tAuth2LoginParams) (interface{}, string, error)) { - var err error - params := &tAuth2LoginParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.AuthType = utils.TrimBlankChar(c.GetString("authType")) - params.AuthSecret = utils.TrimBlankChar(c.GetString("authSecret")) - params.AuthID = utils.TrimBlankChar(c.GetString("authID")) - params.AuthIDType = utils.TrimBlankChar(c.GetString("authIDType")) - if c.GetString("authType") == "" { - errParams = append(errParams, "authType") - } - params.MapData["authType"] = params.AuthType - if c.GetString("authSecret") == "" { - errParams = append(errParams, "authSecret") - } - params.MapData["authSecret"] = params.AuthSecret - if utils.TrimBlankChar(c.GetString("authID")) != "" { - params.MapData["authID"] = params.AuthID - } - if utils.TrimBlankChar(c.GetString("authIDType")) != "" { - params.MapData["authIDType"] = params.AuthIDType - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.Login, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API Auth2Controller.Login, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.Login error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2GetUserSerachKeywordParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *User2Controller) GetUserSerachKeyword() { -// c.callGetUserSerachKeyword(func(params *tUser2GetUserSerachKeywordParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callGetUserSerachKeyword(handler func(params *tUser2GetUserSerachKeywordParams) (interface{}, string, error)) { - var err error - params := &tUser2GetUserSerachKeywordParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.GetUserSerachKeyword, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.GetUserSerachKeyword, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.GetUserSerachKeyword error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUnionGetVendorMattersParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorID int - VendorCatID string - Keyword string - Offset int - PageSize int - ListID string - SortType int -} - -// func (c *UnionController) GetVendorMatters() { -// c.callGetVendorMatters(func(params *tUnionGetVendorMattersParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UnionController) callGetVendorMatters(handler func(params *tUnionGetVendorMattersParams) (interface{}, string, error)) { - var err error - params := &tUnionGetVendorMattersParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { - errParams = append(errParams, "vendorID") - } - params.VendorCatID = utils.TrimBlankChar(c.GetString("vendorCatID")) - params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - params.ListID = utils.TrimBlankChar(c.GetString("listID")) - if params.SortType, err = c.GetInt("sortType", 0); err != nil { - errParams = append(errParams, "sortType") - } - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if c.GetString("vendorID") == "" { - errParams = append(errParams, "vendorID") - } - params.MapData["vendorID"] = params.VendorID - if utils.TrimBlankChar(c.GetString("vendorCatID")) != "" { - params.MapData["vendorCatID"] = params.VendorCatID - } - if utils.TrimBlankChar(c.GetString("keyword")) != "" { - params.MapData["keyword"] = params.Keyword - } - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if utils.TrimBlankChar(c.GetString("pageSize")) != "" { - params.MapData["pageSize"] = params.PageSize - } - if utils.TrimBlankChar(c.GetString("listID")) != "" { - params.MapData["listID"] = params.ListID - } - if utils.TrimBlankChar(c.GetString("sortType")) != "" { - params.MapData["sortType"] = params.SortType - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.GetVendorMatters, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.GetVendorMatters, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.GetVendorMatters error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUnionGetPddBindInfoParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *UnionController) GetPddBindInfo() { -// c.callGetPddBindInfo(func(params *tUnionGetPddBindInfoParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UnionController) callGetPddBindInfo(handler func(params *tUnionGetPddBindInfoParams) (interface{}, string, error)) { - var err error - params := &tUnionGetPddBindInfoParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.GetPddBindInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.GetPddBindInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.GetPddBindInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tCmsGetQiniuUploadTokenParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Suffix string - HashCode string -} - -// func (c *CmsController) GetQiniuUploadToken() { -// c.callGetQiniuUploadToken(func(params *tCmsGetQiniuUploadTokenParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *CmsController) callGetQiniuUploadToken(handler func(params *tCmsGetQiniuUploadTokenParams) (interface{}, string, error)) { - var err error - params := &tCmsGetQiniuUploadTokenParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Suffix = utils.TrimBlankChar(c.GetString("suffix")) - params.HashCode = utils.TrimBlankChar(c.GetString("hashCode")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("suffix") == "" { - errParams = append(errParams, "suffix") - } - params.MapData["suffix"] = params.Suffix - if utils.TrimBlankChar(c.GetString("hashCode")) != "" { - params.MapData["hashCode"] = params.HashCode - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.GetQiniuUploadToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.GetQiniuUploadToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.GetQiniuUploadToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tWithdrawalGetWithdrawalListParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - PageSize int - PageNum int - UserName string - UserId string - OrderId string - StartTime string - EndTime string Phone string - OrderStatus int + OrderId string + ExamineStatus int + Remark string + UserId string } -// func (c *WithdrawalRecordController) GetWithdrawalList() { -// c.callGetWithdrawalList(func(params *tWithdrawalGetWithdrawalListParams) (retVal interface{}, errCode string, err error) { +// func (c *WithdrawalRecordController) ExamineWithdrawalOrder() { +// c.callExamineWithdrawalOrder(func(params *tWithdrawalExamineWithdrawalOrderParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *WithdrawalRecordController) callGetWithdrawalList(handler func(params *tWithdrawalGetWithdrawalListParams) (interface{}, string, error)) { +func (c *WithdrawalRecordController) callExamineWithdrawalOrder(handler func(params *tWithdrawalExamineWithdrawalOrderParams) (interface{}, string, error)) { var err error - params := &tWithdrawalGetWithdrawalListParams{ + params := &tWithdrawalExamineWithdrawalOrderParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -7841,55 +6097,36 @@ func (c *WithdrawalRecordController) callGetWithdrawalList(handler func(params * errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { - errParams = append(errParams, "pageNum") - } - params.UserName = utils.TrimBlankChar(c.GetString("userName")) - params.UserId = utils.TrimBlankChar(c.GetString("userId")) - params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) - params.StartTime = utils.TrimBlankChar(c.GetString("startTime")) - params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) params.Phone = utils.TrimBlankChar(c.GetString("phone")) - if params.OrderStatus, err = c.GetInt("orderStatus", 0); err != nil { - errParams = append(errParams, "orderStatus") + params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) + if params.ExamineStatus, err = c.GetInt("examineStatus", 0); err != nil { + errParams = append(errParams, "examineStatus") } + params.Remark = utils.TrimBlankChar(c.GetString("remark")) + params.UserId = utils.TrimBlankChar(c.GetString("userId")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("pageSize") == "" { - errParams = append(errParams, "pageSize") + if c.GetString("phone") == "" { + errParams = append(errParams, "phone") } - params.MapData["pageSize"] = params.PageSize - if c.GetString("pageNum") == "" { - errParams = append(errParams, "pageNum") + params.MapData["phone"] = params.Phone + if c.GetString("orderId") == "" { + errParams = append(errParams, "orderId") } - params.MapData["pageNum"] = params.PageNum - if utils.TrimBlankChar(c.GetString("userName")) != "" { - params.MapData["userName"] = params.UserName + params.MapData["orderId"] = params.OrderId + if c.GetString("examineStatus") == "" { + errParams = append(errParams, "examineStatus") + } + params.MapData["examineStatus"] = params.ExamineStatus + if utils.TrimBlankChar(c.GetString("remark")) != "" { + params.MapData["remark"] = params.Remark } if utils.TrimBlankChar(c.GetString("userId")) != "" { params.MapData["userId"] = params.UserId } - if utils.TrimBlankChar(c.GetString("orderId")) != "" { - params.MapData["orderId"] = params.OrderId - } - if utils.TrimBlankChar(c.GetString("startTime")) != "" { - params.MapData["startTime"] = params.StartTime - } - if utils.TrimBlankChar(c.GetString("endTime")) != "" { - params.MapData["endTime"] = params.EndTime - } - if utils.TrimBlankChar(c.GetString("phone")) != "" { - params.MapData["phone"] = params.Phone - } - if utils.TrimBlankChar(c.GetString("orderStatus")) != "" { - params.MapData["orderStatus"] = params.OrderStatus - } if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -7902,7 +6139,7 @@ func (c *WithdrawalRecordController) callGetWithdrawalList(handler func(params * ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.GetWithdrawalList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.ExamineWithdrawalOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -7948,7 +6185,7 @@ func (c *WithdrawalRecordController) callGetWithdrawalList(handler func(params * } } } - globals.SugarLogger.Debugf("End API WithdrawalRecordController.GetWithdrawalList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API WithdrawalRecordController.ExamineWithdrawalOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -7956,7 +6193,7 @@ func (c *WithdrawalRecordController) callGetWithdrawalList(handler func(params * errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API WithdrawalRecordController.GetWithdrawalList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API WithdrawalRecordController.ExamineWithdrawalOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -7973,20 +6210,25 @@ func (c *WithdrawalRecordController) callGetWithdrawalList(handler func(params * } } -type tAuth2LogoutParams struct { +type tTaskGetTasksParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string + TaskID string + FromStatus int + ToStatus int + LastHours int + CreatedBy string } -// func (c *Auth2Controller) Logout() { -// c.callLogout(func(params *tAuth2LogoutParams) (retVal interface{}, errCode string, err error) { +// func (c *TaskController) GetTasks() { +// c.callGetTasks(func(params *tTaskGetTasksParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *Auth2Controller) callLogout(handler func(params *tAuth2LogoutParams) (interface{}, string, error)) { +func (c *TaskController) callGetTasks(handler func(params *tTaskGetTasksParams) (interface{}, string, error)) { var err error - params := &tAuth2LogoutParams{ + params := &tTaskGetTasksParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -7994,11 +6236,37 @@ func (c *Auth2Controller) callLogout(handler func(params *tAuth2LogoutParams) (i errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.TaskID = utils.TrimBlankChar(c.GetString("taskID")) + if params.FromStatus, err = c.GetInt("fromStatus", 0); err != nil { + errParams = append(errParams, "fromStatus") + } + if params.ToStatus, err = c.GetInt("toStatus", 0); err != nil { + errParams = append(errParams, "toStatus") + } + if params.LastHours, err = c.GetInt("lastHours", 0); err != nil { + errParams = append(errParams, "lastHours") + } + params.CreatedBy = utils.TrimBlankChar(c.GetString("createdBy")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("taskID")) != "" { + params.MapData["taskID"] = params.TaskID + } + if utils.TrimBlankChar(c.GetString("fromStatus")) != "" { + params.MapData["fromStatus"] = params.FromStatus + } + if utils.TrimBlankChar(c.GetString("toStatus")) != "" { + params.MapData["toStatus"] = params.ToStatus + } + if utils.TrimBlankChar(c.GetString("lastHours")) != "" { + params.MapData["lastHours"] = params.LastHours + } + if utils.TrimBlankChar(c.GetString("createdBy")) != "" { + params.MapData["createdBy"] = params.CreatedBy + } if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -8011,7 +6279,7 @@ func (c *Auth2Controller) callLogout(handler func(params *tAuth2LogoutParams) (i ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.Logout, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API TaskController.GetTasks, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -8057,7 +6325,7 @@ func (c *Auth2Controller) callLogout(handler func(params *tAuth2LogoutParams) (i } } } - globals.SugarLogger.Debugf("End API Auth2Controller.Logout, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API TaskController.GetTasks, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -8065,636 +6333,7 @@ func (c *Auth2Controller) callLogout(handler func(params *tAuth2LogoutParams) (i errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.Logout error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2QueryMyDeliveryAddressParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Type int -} - -// func (c *User2Controller) QueryMyDeliveryAddress() { -// c.callQueryMyDeliveryAddress(func(params *tUser2QueryMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callQueryMyDeliveryAddress(handler func(params *tUser2QueryMyDeliveryAddressParams) (interface{}, string, error)) { - var err error - params := &tUser2QueryMyDeliveryAddressParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Type, err = c.GetInt("type", 0); err != nil { - errParams = append(errParams, "type") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("type")) != "" { - params.MapData["type"] = params.Type - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.QueryMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.QueryMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.QueryMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobCreateJobSpanParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobIDs string - EndAt string - Span int -} - -// func (c *JobController) CreateJobSpan() { -// c.callCreateJobSpan(func(params *tJobCreateJobSpanParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callCreateJobSpan(handler func(params *tJobCreateJobSpanParams) (interface{}, string, error)) { - var err error - params := &tJobCreateJobSpanParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) - params.EndAt = utils.TrimBlankChar(c.GetString("endAt")) - if params.Span, err = c.GetInt("span", 0); err != nil { - errParams = append(errParams, "span") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobIDs") == "" { - errParams = append(errParams, "jobIDs") - } - params.MapData["jobIDs"] = params.JobIDs - if c.GetString("endAt") == "" { - errParams = append(errParams, "endAt") - } - params.MapData["endAt"] = params.EndAt - if c.GetString("span") == "" { - errParams = append(errParams, "span") - } - params.MapData["span"] = params.Span - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.CreateJobSpan, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.CreateJobSpan, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.CreateJobSpan error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tOrderGetManageStatisticsImgParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - CityCodes string - FromTime string - ToTime string - JobIDs string -} - -// func (c *OrderController) GetManageStatisticsImg() { -// c.callGetManageStatisticsImg(func(params *tOrderGetManageStatisticsImgParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *OrderController) callGetManageStatisticsImg(handler func(params *tOrderGetManageStatisticsImgParams) (interface{}, string, error)) { - var err error - params := &tOrderGetManageStatisticsImgParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) - params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) - params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) - params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { - params.MapData["cityCodes"] = params.CityCodes - } - if c.GetString("fromTime") == "" { - errParams = append(errParams, "fromTime") - } - params.MapData["fromTime"] = params.FromTime - if c.GetString("toTime") == "" { - errParams = append(errParams, "toTime") - } - params.MapData["toTime"] = params.ToTime - if utils.TrimBlankChar(c.GetString("jobIDs")) != "" { - params.MapData["jobIDs"] = params.JobIDs - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.GetManageStatisticsImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API OrderController.GetManageStatisticsImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API OrderController.GetManageStatisticsImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventUpdateMessageGroupParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - GroupID int - Payload string -} - -// func (c *EventController) UpdateMessageGroup() { -// c.callUpdateMessageGroup(func(params *tEventUpdateMessageGroupParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callUpdateMessageGroup(handler func(params *tEventUpdateMessageGroupParams) (interface{}, string, error)) { - var err error - params := &tEventUpdateMessageGroupParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.GroupID, err = c.GetInt("groupID", 0); err != nil { - errParams = append(errParams, "groupID") - } - params.Payload = utils.TrimBlankChar(c.GetString("payload")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("groupID") == "" { - errParams = append(errParams, "groupID") - } - params.MapData["groupID"] = params.GroupID - if c.GetString("payload") == "" { - errParams = append(errParams, "payload") - } - params.MapData["payload"] = params.Payload - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.UpdateMessageGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.UpdateMessageGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.UpdateMessageGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventDeleteMessageGroupParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - GroupID int - UserID string - Flag bool -} - -// func (c *EventController) DeleteMessageGroup() { -// c.callDeleteMessageGroup(func(params *tEventDeleteMessageGroupParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callDeleteMessageGroup(handler func(params *tEventDeleteMessageGroupParams) (interface{}, string, error)) { - var err error - params := &tEventDeleteMessageGroupParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.GroupID, err = c.GetInt("groupID", 0); err != nil { - errParams = append(errParams, "groupID") - } - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.Flag, err = c.GetBool("flag", false); err != nil { - errParams = append(errParams, "flag") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("groupID") == "" { - errParams = append(errParams, "groupID") - } - params.MapData["groupID"] = params.GroupID - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if utils.TrimBlankChar(c.GetString("flag")) != "" { - params.MapData["flag"] = params.Flag - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.DeleteMessageGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.DeleteMessageGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.DeleteMessageGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API TaskController.GetTasks error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -8883,138 +6522,24 @@ func (c *User2Controller) callGetUsers(handler func(params *tUser2GetUsersParams } } -type tEventGetMessageGroupByUserParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - UserID string -} - -// func (c *EventController) GetMessageGroupByUser() { -// c.callGetMessageGroupByUser(func(params *tEventGetMessageGroupByUserParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callGetMessageGroupByUser(handler func(params *tEventGetMessageGroupByUserParams) (interface{}, string, error)) { - var err error - params := &tEventGetMessageGroupByUserParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.GetMessageGroupByUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.GetMessageGroupByUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.GetMessageGroupByUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tWithdrawalGetWithdrawalRecordParams struct { +type tJobAuditJobParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string + JobOrderID int Status int - PageSize int - PageNum int + Comment string + VendorWaybillID string } -// func (c *WithdrawalRecordController) GetWithdrawalRecord() { -// c.callGetWithdrawalRecord(func(params *tWithdrawalGetWithdrawalRecordParams) (retVal interface{}, errCode string, err error) { +// func (c *JobController) AuditJob() { +// c.callAuditJob(func(params *tJobAuditJobParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *WithdrawalRecordController) callGetWithdrawalRecord(handler func(params *tWithdrawalGetWithdrawalRecordParams) (interface{}, string, error)) { +func (c *JobController) callAuditJob(handler func(params *tJobAuditJobParams) (interface{}, string, error)) { var err error - params := &tWithdrawalGetWithdrawalRecordParams{ + params := &tJobAuditJobParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -9022,2286 +6547,30 @@ func (c *WithdrawalRecordController) callGetWithdrawalRecord(handler func(params errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { + errParams = append(errParams, "jobOrderID") + } if params.Status, err = c.GetInt("status", 0); err != nil { errParams = append(errParams, "status") } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { - errParams = append(errParams, "pageNum") - } + params.Comment = utils.TrimBlankChar(c.GetString("comment")) + params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token + if c.GetString("jobOrderID") == "" { + errParams = append(errParams, "jobOrderID") + } + params.MapData["jobOrderID"] = params.JobOrderID if c.GetString("status") == "" { errParams = append(errParams, "status") } params.MapData["status"] = params.Status - if c.GetString("pageSize") == "" { - errParams = append(errParams, "pageSize") + if utils.TrimBlankChar(c.GetString("comment")) != "" { + params.MapData["comment"] = params.Comment } - params.MapData["pageSize"] = params.PageSize - if c.GetString("pageNum") == "" { - errParams = append(errParams, "pageNum") - } - params.MapData["pageNum"] = params.PageNum - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.GetWithdrawalRecord, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API WithdrawalRecordController.GetWithdrawalRecord, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API WithdrawalRecordController.GetWithdrawalRecord error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2UpdateUserParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Payload string -} - -// func (c *User2Controller) UpdateUser() { -// c.callUpdateUser(func(params *tUser2UpdateUserParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callUpdateUser(handler func(params *tUser2UpdateUserParams) (interface{}, string, error)) { - var err error - params := &tUser2UpdateUserParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Payload = utils.TrimBlankChar(c.GetString("payload")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("payload") == "" { - errParams = append(errParams, "payload") - } - params.MapData["payload"] = params.Payload - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.UpdateUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.UpdateUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.UpdateUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2DeleteUserCityManagerParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - UserID string - CityCode int -} - -// func (c *User2Controller) DeleteUserCityManager() { -// c.callDeleteUserCityManager(func(params *tUser2DeleteUserCityManagerParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callDeleteUserCityManager(handler func(params *tUser2DeleteUserCityManagerParams) (interface{}, string, error)) { - var err error - params := &tUser2DeleteUserCityManagerParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { - errParams = append(errParams, "cityCode") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if c.GetString("cityCode") == "" { - errParams = append(errParams, "cityCode") - } - params.MapData["cityCode"] = params.CityCode - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.DeleteUserCityManager, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.DeleteUserCityManager, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.DeleteUserCityManager error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2AddMyDeliveryAddressParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - ConsigneeName string - ConsigneeMobile string - Address string - DetailAddress string - Lng float64 - Lat float64 - Tag string - Remark string - IsDefault int - Type int - AutoAddress string -} - -// func (c *User2Controller) AddMyDeliveryAddress() { -// c.callAddMyDeliveryAddress(func(params *tUser2AddMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callAddMyDeliveryAddress(handler func(params *tUser2AddMyDeliveryAddressParams) (interface{}, string, error)) { - var err error - params := &tUser2AddMyDeliveryAddressParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.ConsigneeName = utils.TrimBlankChar(c.GetString("consigneeName")) - params.ConsigneeMobile = utils.TrimBlankChar(c.GetString("consigneeMobile")) - params.Address = utils.TrimBlankChar(c.GetString("address")) - params.DetailAddress = utils.TrimBlankChar(c.GetString("detailAddress")) - if params.Lng, err = c.GetFloat("lng", 0); err != nil { - errParams = append(errParams, "lng") - } - if params.Lat, err = c.GetFloat("lat", 0); err != nil { - errParams = append(errParams, "lat") - } - params.Tag = utils.TrimBlankChar(c.GetString("tag")) - params.Remark = utils.TrimBlankChar(c.GetString("remark")) - if params.IsDefault, err = c.GetInt("isDefault", 0); err != nil { - errParams = append(errParams, "isDefault") - } - if params.Type, err = c.GetInt("type", 0); err != nil { - errParams = append(errParams, "type") - } - params.AutoAddress = utils.TrimBlankChar(c.GetString("autoAddress")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("consigneeName") == "" { - errParams = append(errParams, "consigneeName") - } - params.MapData["consigneeName"] = params.ConsigneeName - if c.GetString("consigneeMobile") == "" { - errParams = append(errParams, "consigneeMobile") - } - params.MapData["consigneeMobile"] = params.ConsigneeMobile - if utils.TrimBlankChar(c.GetString("address")) != "" { - params.MapData["address"] = params.Address - } - if utils.TrimBlankChar(c.GetString("detailAddress")) != "" { - params.MapData["detailAddress"] = params.DetailAddress - } - if utils.TrimBlankChar(c.GetString("lng")) != "" { - params.MapData["lng"] = params.Lng - } - if utils.TrimBlankChar(c.GetString("lat")) != "" { - params.MapData["lat"] = params.Lat - } - if utils.TrimBlankChar(c.GetString("tag")) != "" { - params.MapData["tag"] = params.Tag - } - if utils.TrimBlankChar(c.GetString("remark")) != "" { - params.MapData["remark"] = params.Remark - } - if utils.TrimBlankChar(c.GetString("isDefault")) != "" { - params.MapData["isDefault"] = params.IsDefault - } - if utils.TrimBlankChar(c.GetString("type")) != "" { - params.MapData["type"] = params.Type - } - if utils.TrimBlankChar(c.GetString("autoAddress")) != "" { - params.MapData["autoAddress"] = params.AutoAddress - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.AddMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.AddMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.AddMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tExpressQueryUserOrderListParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - ExpressType int - OrderStatus int - OrderNo string - PageNum int - PageSize int -} - -// func (c *QBiDaExpressController) QueryUserOrderList() { -// c.callQueryUserOrderList(func(params *tExpressQueryUserOrderListParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *QBiDaExpressController) callQueryUserOrderList(handler func(params *tExpressQueryUserOrderListParams) (interface{}, string, error)) { - var err error - params := &tExpressQueryUserOrderListParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.ExpressType, err = c.GetInt("expressType", 0); err != nil { - errParams = append(errParams, "expressType") - } - if params.OrderStatus, err = c.GetInt("orderStatus", 0); err != nil { - errParams = append(errParams, "orderStatus") - } - params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) - if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { - errParams = append(errParams, "pageNum") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("expressType")) != "" { - params.MapData["expressType"] = params.ExpressType - } - if utils.TrimBlankChar(c.GetString("orderStatus")) != "" { - params.MapData["orderStatus"] = params.OrderStatus - } - if utils.TrimBlankChar(c.GetString("orderNo")) != "" { - params.MapData["orderNo"] = params.OrderNo - } - if c.GetString("pageNum") == "" { - errParams = append(errParams, "pageNum") - } - params.MapData["pageNum"] = params.PageNum - if c.GetString("pageSize") == "" { - errParams = append(errParams, "pageSize") - } - params.MapData["pageSize"] = params.PageSize - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API QBiDaExpressController.QueryUserOrderList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API QBiDaExpressController.QueryUserOrderList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API QBiDaExpressController.QueryUserOrderList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2GetUserCityManagerParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - UserID string - CityCode int -} - -// func (c *User2Controller) GetUserCityManager() { -// c.callGetUserCityManager(func(params *tUser2GetUserCityManagerParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callGetUserCityManager(handler func(params *tUser2GetUserCityManagerParams) (interface{}, string, error)) { - var err error - params := &tUser2GetUserCityManagerParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { - errParams = append(errParams, "cityCode") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("userID")) != "" { - params.MapData["userID"] = params.UserID - } - if utils.TrimBlankChar(c.GetString("cityCode")) != "" { - params.MapData["cityCode"] = params.CityCode - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.GetUserCityManager, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.GetUserCityManager, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.GetUserCityManager error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventAddMessageGroupParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - GroupID int - UserID string -} - -// func (c *EventController) AddMessageGroup() { -// c.callAddMessageGroup(func(params *tEventAddMessageGroupParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callAddMessageGroup(handler func(params *tEventAddMessageGroupParams) (interface{}, string, error)) { - var err error - params := &tEventAddMessageGroupParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.GroupID, err = c.GetInt("groupID", 0); err != nil { - errParams = append(errParams, "groupID") - } - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("groupID") == "" { - errParams = append(errParams, "groupID") - } - params.MapData["groupID"] = params.GroupID - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.AddMessageGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.AddMessageGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.AddMessageGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUnionGetUnionJobOrderInfoParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobOrderID int -} - -// func (c *UnionController) GetUnionJobOrderInfo() { -// c.callGetUnionJobOrderInfo(func(params *tUnionGetUnionJobOrderInfoParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UnionController) callGetUnionJobOrderInfo(handler func(params *tUnionGetUnionJobOrderInfoParams) (interface{}, string, error)) { - var err error - params := &tUnionGetUnionJobOrderInfoParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { - errParams = append(errParams, "jobOrderID") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobOrderID") == "" { - errParams = append(errParams, "jobOrderID") - } - params.MapData["jobOrderID"] = params.JobOrderID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.GetUnionJobOrderInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.GetUnionJobOrderInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.GetUnionJobOrderInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tExpressDeleteOrderParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - LocalOrderId string -} - -// func (c *QBiDaExpressController) DeleteOrder() { -// c.callDeleteOrder(func(params *tExpressDeleteOrderParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *QBiDaExpressController) callDeleteOrder(handler func(params *tExpressDeleteOrderParams) (interface{}, string, error)) { - var err error - params := &tExpressDeleteOrderParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.LocalOrderId = utils.TrimBlankChar(c.GetString("localOrderId")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("localOrderId") == "" { - errParams = append(errParams, "localOrderId") - } - params.MapData["localOrderId"] = params.LocalOrderId - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API QBiDaExpressController.DeleteOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API QBiDaExpressController.DeleteOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API QBiDaExpressController.DeleteOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobReloadJobSpanParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobIDs string - Span int -} - -// func (c *JobController) ReloadJobSpan() { -// c.callReloadJobSpan(func(params *tJobReloadJobSpanParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callReloadJobSpan(handler func(params *tJobReloadJobSpanParams) (interface{}, string, error)) { - var err error - params := &tJobReloadJobSpanParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) - if params.Span, err = c.GetInt("span", 0); err != nil { - errParams = append(errParams, "span") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobIDs") == "" { - errParams = append(errParams, "jobIDs") - } - params.MapData["jobIDs"] = params.JobIDs - if c.GetString("span") == "" { - errParams = append(errParams, "span") - } - params.MapData["span"] = params.Span - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.ReloadJobSpan, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.ReloadJobSpan, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.ReloadJobSpan error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetAllDeliveryDetailParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorWaybillID string - ComType string -} - -// func (c *JobController) GetAllDeliveryDetail() { -// c.callGetAllDeliveryDetail(func(params *tJobGetAllDeliveryDetailParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callGetAllDeliveryDetail(handler func(params *tJobGetAllDeliveryDetailParams) (interface{}, string, error)) { - var err error - params := &tJobGetAllDeliveryDetailParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) - params.ComType = utils.TrimBlankChar(c.GetString("comType")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("vendorWaybillID")) != "" { - params.MapData["vendorWaybillID"] = params.VendorWaybillID - } - if utils.TrimBlankChar(c.GetString("comType")) != "" { - params.MapData["comType"] = params.ComType - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetAllDeliveryDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.GetAllDeliveryDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.GetAllDeliveryDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUnionGetVendorMatterCategoryParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorID int -} - -// func (c *UnionController) GetVendorMatterCategory() { -// c.callGetVendorMatterCategory(func(params *tUnionGetVendorMatterCategoryParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UnionController) callGetVendorMatterCategory(handler func(params *tUnionGetVendorMatterCategoryParams) (interface{}, string, error)) { - var err error - params := &tUnionGetVendorMatterCategoryParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { - errParams = append(errParams, "vendorID") - } - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if c.GetString("vendorID") == "" { - errParams = append(errParams, "vendorID") - } - params.MapData["vendorID"] = params.VendorID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.GetVendorMatterCategory, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.GetVendorMatterCategory, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.GetVendorMatterCategory error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUnionGetUnionOrdersParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorIDs string - Statuss string - BeginTime string - EndTime string - Keyword string - Offset int - PageSize int -} - -// func (c *UnionController) GetUnionOrders() { -// c.callGetUnionOrders(func(params *tUnionGetUnionOrdersParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UnionController) callGetUnionOrders(handler func(params *tUnionGetUnionOrdersParams) (interface{}, string, error)) { - var err error - params := &tUnionGetUnionOrdersParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs")) - params.Statuss = utils.TrimBlankChar(c.GetString("statuss")) - params.BeginTime = utils.TrimBlankChar(c.GetString("beginTime")) - params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) - params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" { - params.MapData["vendorIDs"] = params.VendorIDs - } - if utils.TrimBlankChar(c.GetString("statuss")) != "" { - params.MapData["statuss"] = params.Statuss - } - if utils.TrimBlankChar(c.GetString("beginTime")) != "" { - params.MapData["beginTime"] = params.BeginTime - } - if utils.TrimBlankChar(c.GetString("endTime")) != "" { - params.MapData["endTime"] = params.EndTime - } - if utils.TrimBlankChar(c.GetString("keyword")) != "" { - params.MapData["keyword"] = params.Keyword - } - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if utils.TrimBlankChar(c.GetString("pageSize")) != "" { - params.MapData["pageSize"] = params.PageSize - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.GetUnionOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.GetUnionOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.GetUnionOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tAuth2DeletedTokenInfoWithoutParamParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *Auth2Controller) DeletedTokenInfoWithoutParam() { -// c.callDeletedTokenInfoWithoutParam(func(params *tAuth2DeletedTokenInfoWithoutParamParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callDeletedTokenInfoWithoutParam(handler func(params *tAuth2DeletedTokenInfoWithoutParamParams) (interface{}, string, error)) { - var err error - params := &tAuth2DeletedTokenInfoWithoutParamParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.DeletedTokenInfoWithoutParam, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API Auth2Controller.DeletedTokenInfoWithoutParam, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.DeletedTokenInfoWithoutParam error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobConfirmDropShippingJobParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - JobOrderID int -} - -// func (c *JobController) ConfirmDropShippingJob() { -// c.callConfirmDropShippingJob(func(params *tJobConfirmDropShippingJobParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callConfirmDropShippingJob(handler func(params *tJobConfirmDropShippingJobParams) (interface{}, string, error)) { - var err error - params := &tJobConfirmDropShippingJobParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { - errParams = append(errParams, "jobOrderID") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("jobOrderID") == "" { - errParams = append(errParams, "jobOrderID") - } - params.MapData["jobOrderID"] = params.JobOrderID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.ConfirmDropShippingJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.ConfirmDropShippingJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.ConfirmDropShippingJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventSendSysMessageParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Payload string -} - -// func (c *EventController) SendSysMessage() { -// c.callSendSysMessage(func(params *tEventSendSysMessageParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callSendSysMessage(handler func(params *tEventSendSysMessageParams) (interface{}, string, error)) { - var err error - params := &tEventSendSysMessageParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Payload = utils.TrimBlankChar(c.GetString("payload")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("payload") == "" { - errParams = append(errParams, "payload") - } - params.MapData["payload"] = params.Payload - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.SendSysMessage, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.SendSysMessage, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.SendSysMessage error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tTaskGetTasksParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - TaskID string - FromStatus int - ToStatus int - LastHours int - CreatedBy string -} - -// func (c *TaskController) GetTasks() { -// c.callGetTasks(func(params *tTaskGetTasksParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *TaskController) callGetTasks(handler func(params *tTaskGetTasksParams) (interface{}, string, error)) { - var err error - params := &tTaskGetTasksParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.TaskID = utils.TrimBlankChar(c.GetString("taskID")) - if params.FromStatus, err = c.GetInt("fromStatus", 0); err != nil { - errParams = append(errParams, "fromStatus") - } - if params.ToStatus, err = c.GetInt("toStatus", 0); err != nil { - errParams = append(errParams, "toStatus") - } - if params.LastHours, err = c.GetInt("lastHours", 0); err != nil { - errParams = append(errParams, "lastHours") - } - params.CreatedBy = utils.TrimBlankChar(c.GetString("createdBy")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("taskID")) != "" { - params.MapData["taskID"] = params.TaskID - } - if utils.TrimBlankChar(c.GetString("fromStatus")) != "" { - params.MapData["fromStatus"] = params.FromStatus - } - if utils.TrimBlankChar(c.GetString("toStatus")) != "" { - params.MapData["toStatus"] = params.ToStatus - } - if utils.TrimBlankChar(c.GetString("lastHours")) != "" { - params.MapData["lastHours"] = params.LastHours - } - if utils.TrimBlankChar(c.GetString("createdBy")) != "" { - params.MapData["createdBy"] = params.CreatedBy - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API TaskController.GetTasks, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API TaskController.GetTasks, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API TaskController.GetTasks error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobSendJdDeliveryParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Payload string - PickUpStartTime string - PickUpEndTime string -} - -// func (c *JobController) SendJdDelivery() { -// c.callSendJdDelivery(func(params *tJobSendJdDeliveryParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callSendJdDelivery(handler func(params *tJobSendJdDeliveryParams) (interface{}, string, error)) { - var err error - params := &tJobSendJdDeliveryParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Payload = utils.TrimBlankChar(c.GetString("payload")) - params.PickUpStartTime = utils.TrimBlankChar(c.GetString("pickUpStartTime")) - params.PickUpEndTime = utils.TrimBlankChar(c.GetString("pickUpEndTime")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("payload") == "" { - errParams = append(errParams, "payload") - } - params.MapData["payload"] = params.Payload - if utils.TrimBlankChar(c.GetString("pickUpStartTime")) != "" { - params.MapData["pickUpStartTime"] = params.PickUpStartTime - } - if utils.TrimBlankChar(c.GetString("pickUpEndTime")) != "" { - params.MapData["pickUpEndTime"] = params.PickUpEndTime - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.SendJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.SendJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.SendJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetDeliveryDetailParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorWaybillID string -} - -// func (c *JobController) GetDeliveryDetail() { -// c.callGetDeliveryDetail(func(params *tJobGetDeliveryDetailParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callGetDeliveryDetail(handler func(params *tJobGetDeliveryDetailParams) (interface{}, string, error)) { - var err error - params := &tJobGetDeliveryDetailParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token if utils.TrimBlankChar(c.GetString("vendorWaybillID")) != "" { params.MapData["vendorWaybillID"] = params.VendorWaybillID } @@ -11317,7 +6586,7 @@ func (c *JobController) callGetDeliveryDetail(handler func(params *tJobGetDelive ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetDeliveryDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API JobController.AuditJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -11363,7 +6632,7 @@ func (c *JobController) callGetDeliveryDetail(handler func(params *tJobGetDelive } } } - globals.SugarLogger.Debugf("End API JobController.GetDeliveryDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API JobController.AuditJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -11371,1742 +6640,7 @@ func (c *JobController) callGetDeliveryDetail(handler func(params *tJobGetDelive errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.GetDeliveryDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetEjyOrdersParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Offset int -} - -// func (c *JobController) GetEjyOrders() { -// c.callGetEjyOrders(func(params *tJobGetEjyOrdersParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callGetEjyOrders(handler func(params *tJobGetEjyOrdersParams) (interface{}, string, error)) { - var err error - params := &tJobGetEjyOrdersParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetEjyOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.GetEjyOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.GetEjyOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tCmsQueryConfigsParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Type string - Key string - Keyword string -} - -// func (c *CmsController) QueryConfigs() { -// c.callQueryConfigs(func(params *tCmsQueryConfigsParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *CmsController) callQueryConfigs(handler func(params *tCmsQueryConfigsParams) (interface{}, string, error)) { - var err error - params := &tCmsQueryConfigsParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Type = utils.TrimBlankChar(c.GetString("type")) - params.Key = utils.TrimBlankChar(c.GetString("key")) - params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if utils.TrimBlankChar(c.GetString("type")) != "" { - params.MapData["type"] = params.Type - } - if utils.TrimBlankChar(c.GetString("key")) != "" { - params.MapData["key"] = params.Key - } - if utils.TrimBlankChar(c.GetString("keyword")) != "" { - params.MapData["keyword"] = params.Keyword - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.QueryConfigs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.QueryConfigs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.QueryConfigs error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tAuth2WeixinMPOAuth2Params struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Code string - Block string - State string -} - -// func (c *Auth2Controller) WeixinMPOAuth2() { -// c.callWeixinMPOAuth2(func(params *tAuth2WeixinMPOAuth2Params) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *Auth2Controller) callWeixinMPOAuth2(handler func(params *tAuth2WeixinMPOAuth2Params) (interface{}, string, error)) { - var err error - params := &tAuth2WeixinMPOAuth2Params{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Code = utils.TrimBlankChar(c.GetString("code")) - params.Block = utils.TrimBlankChar(c.GetString("block")) - params.State = utils.TrimBlankChar(c.GetString("state")) - if c.GetString("code") == "" { - errParams = append(errParams, "code") - } - params.MapData["code"] = params.Code - if c.GetString("block") == "" { - errParams = append(errParams, "block") - } - params.MapData["block"] = params.Block - if utils.TrimBlankChar(c.GetString("state")) != "" { - params.MapData["state"] = params.State - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API Auth2Controller.WeixinMPOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API Auth2Controller.WeixinMPOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API Auth2Controller.WeixinMPOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobTempJobParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *JobController) TempJob() { -// c.callTempJob(func(params *tJobTempJobParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callTempJob(handler func(params *tJobTempJobParams) (interface{}, string, error)) { - var err error - params := &tJobTempJobParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.TempJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.TempJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.TempJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobRechargeMtMembersParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Phone int -} - -// func (c *JobController) RechargeMtMembers() { -// c.callRechargeMtMembers(func(params *tJobRechargeMtMembersParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callRechargeMtMembers(handler func(params *tJobRechargeMtMembersParams) (interface{}, string, error)) { - var err error - params := &tJobRechargeMtMembersParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Phone, err = c.GetInt("phone", 0); err != nil { - errParams = append(errParams, "phone") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("phone") == "" { - errParams = append(errParams, "phone") - } - params.MapData["phone"] = params.Phone - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.RechargeMtMembers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.RechargeMtMembers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.RechargeMtMembers error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetCoordinateFromAddressParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Address string - CityCode int -} - -// func (c *JobController) GetCoordinateFromAddress() { -// c.callGetCoordinateFromAddress(func(params *tJobGetCoordinateFromAddressParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callGetCoordinateFromAddress(handler func(params *tJobGetCoordinateFromAddressParams) (interface{}, string, error)) { - var err error - params := &tJobGetCoordinateFromAddressParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Address = utils.TrimBlankChar(c.GetString("address")) - if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { - errParams = append(errParams, "cityCode") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("address") == "" { - errParams = append(errParams, "address") - } - params.MapData["address"] = params.Address - if c.GetString("cityCode") == "" { - errParams = append(errParams, "cityCode") - } - params.MapData["cityCode"] = params.CityCode - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetCoordinateFromAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.GetCoordinateFromAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.GetCoordinateFromAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobUserRefundEjyParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorOrderID string - Reason string -} - -// func (c *JobController) UserRefundEjy() { -// c.callUserRefundEjy(func(params *tJobUserRefundEjyParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callUserRefundEjy(handler func(params *tJobUserRefundEjyParams) (interface{}, string, error)) { - var err error - params := &tJobUserRefundEjyParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID")) - params.Reason = utils.TrimBlankChar(c.GetString("reason")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("vendorOrderID") == "" { - errParams = append(errParams, "vendorOrderID") - } - params.MapData["vendorOrderID"] = params.VendorOrderID - if c.GetString("reason") == "" { - errParams = append(errParams, "reason") - } - params.MapData["reason"] = params.Reason - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.UserRefundEjy, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.UserRefundEjy, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.UserRefundEjy error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventUploadAudioParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *EventController) UploadAudio() { -// c.callUploadAudio(func(params *tEventUploadAudioParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callUploadAudio(handler func(params *tEventUploadAudioParams) (interface{}, string, error)) { - var err error - params := &tEventUploadAudioParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.UploadAudio, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.UploadAudio, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.UploadAudio error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventGetMessageGroupsParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - GroupID int - IsMember bool -} - -// func (c *EventController) GetMessageGroups() { -// c.callGetMessageGroups(func(params *tEventGetMessageGroupsParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callGetMessageGroups(handler func(params *tEventGetMessageGroupsParams) (interface{}, string, error)) { - var err error - params := &tEventGetMessageGroupsParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.GroupID, err = c.GetInt("groupID", 0); err != nil { - errParams = append(errParams, "groupID") - } - if params.IsMember, err = c.GetBool("isMember", false); err != nil { - errParams = append(errParams, "isMember") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("groupID") == "" { - errParams = append(errParams, "groupID") - } - params.MapData["groupID"] = params.GroupID - if c.GetString("isMember") == "" { - errParams = append(errParams, "isMember") - } - params.MapData["isMember"] = params.IsMember - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.GetMessageGroups, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.GetMessageGroups, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.GetMessageGroups error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tBillGetUserBillDetailParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - UserID string - FromTime string - ToTime string - Offset int - PageSize int -} - -// func (c *BillController) GetUserBillDetail() { -// c.callGetUserBillDetail(func(params *tBillGetUserBillDetailParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *BillController) callGetUserBillDetail(handler func(params *tBillGetUserBillDetailParams) (interface{}, string, error)) { - var err error - params := &tBillGetUserBillDetailParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) - params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if utils.TrimBlankChar(c.GetString("fromTime")) != "" { - params.MapData["fromTime"] = params.FromTime - } - if utils.TrimBlankChar(c.GetString("toTime")) != "" { - params.MapData["toTime"] = params.ToTime - } - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if utils.TrimBlankChar(c.GetString("pageSize")) != "" { - params.MapData["pageSize"] = params.PageSize - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API BillController.GetUserBillDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API BillController.GetUserBillDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API BillController.GetUserBillDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tTaskCancelTaskParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - TaskID string -} - -// func (c *TaskController) CancelTask() { -// c.callCancelTask(func(params *tTaskCancelTaskParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *TaskController) callCancelTask(handler func(params *tTaskCancelTaskParams) (interface{}, string, error)) { - var err error - params := &tTaskCancelTaskParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.TaskID = utils.TrimBlankChar(c.GetString("taskID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("taskID") == "" { - errParams = append(errParams, "taskID") - } - params.MapData["taskID"] = params.TaskID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API TaskController.CancelTask, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API TaskController.CancelTask, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API TaskController.CancelTask error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2UpdateMyDeliveryAddressParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Id int - ConsigneeName string - ConsigneeMobile string - Address string - DetailAddress string - Lng float64 - Lat float64 - Tag string - Remark string - IsDefault int -} - -// func (c *User2Controller) UpdateMyDeliveryAddress() { -// c.callUpdateMyDeliveryAddress(func(params *tUser2UpdateMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callUpdateMyDeliveryAddress(handler func(params *tUser2UpdateMyDeliveryAddressParams) (interface{}, string, error)) { - var err error - params := &tUser2UpdateMyDeliveryAddressParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Id, err = c.GetInt("id", 0); err != nil { - errParams = append(errParams, "id") - } - params.ConsigneeName = utils.TrimBlankChar(c.GetString("consigneeName")) - params.ConsigneeMobile = utils.TrimBlankChar(c.GetString("consigneeMobile")) - params.Address = utils.TrimBlankChar(c.GetString("address")) - params.DetailAddress = utils.TrimBlankChar(c.GetString("detailAddress")) - if params.Lng, err = c.GetFloat("lng", 0); err != nil { - errParams = append(errParams, "lng") - } - if params.Lat, err = c.GetFloat("lat", 0); err != nil { - errParams = append(errParams, "lat") - } - params.Tag = utils.TrimBlankChar(c.GetString("tag")) - params.Remark = utils.TrimBlankChar(c.GetString("remark")) - if params.IsDefault, err = c.GetInt("isDefault", 0); err != nil { - errParams = append(errParams, "isDefault") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("id") == "" { - errParams = append(errParams, "id") - } - params.MapData["id"] = params.Id - if utils.TrimBlankChar(c.GetString("consigneeName")) != "" { - params.MapData["consigneeName"] = params.ConsigneeName - } - if utils.TrimBlankChar(c.GetString("consigneeMobile")) != "" { - params.MapData["consigneeMobile"] = params.ConsigneeMobile - } - if utils.TrimBlankChar(c.GetString("address")) != "" { - params.MapData["address"] = params.Address - } - if utils.TrimBlankChar(c.GetString("detailAddress")) != "" { - params.MapData["detailAddress"] = params.DetailAddress - } - if utils.TrimBlankChar(c.GetString("lng")) != "" { - params.MapData["lng"] = params.Lng - } - if utils.TrimBlankChar(c.GetString("lat")) != "" { - params.MapData["lat"] = params.Lat - } - if utils.TrimBlankChar(c.GetString("tag")) != "" { - params.MapData["tag"] = params.Tag - } - if utils.TrimBlankChar(c.GetString("remark")) != "" { - params.MapData["remark"] = params.Remark - } - if utils.TrimBlankChar(c.GetString("isDefault")) != "" { - params.MapData["isDefault"] = params.IsDefault - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.UpdateMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.UpdateMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.UpdateMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tOrderCashParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - OrderID string - PayType int - VendorPayType string -} - -// func (c *OrderController) Cash() { -// c.callCash(func(params *tOrderCashParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *OrderController) callCash(handler func(params *tOrderCashParams) (interface{}, string, error)) { - var err error - params := &tOrderCashParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) - if params.PayType, err = c.GetInt("payType", 0); err != nil { - errParams = append(errParams, "payType") - } - params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("orderID") == "" { - errParams = append(errParams, "orderID") - } - params.MapData["orderID"] = params.OrderID - if c.GetString("payType") == "" { - errParams = append(errParams, "payType") - } - params.MapData["payType"] = params.PayType - if c.GetString("vendorPayType") == "" { - errParams = append(errParams, "vendorPayType") - } - params.MapData["vendorPayType"] = params.VendorPayType - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.Cash, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API OrderController.Cash, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API OrderController.Cash error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUnionGetUnionActListParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorID int - ActType int -} - -// func (c *UnionController) GetUnionActList() { -// c.callGetUnionActList(func(params *tUnionGetUnionActListParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *UnionController) callGetUnionActList(handler func(params *tUnionGetUnionActListParams) (interface{}, string, error)) { - var err error - params := &tUnionGetUnionActListParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { - errParams = append(errParams, "vendorID") - } - if params.ActType, err = c.GetInt("actType", 0); err != nil { - errParams = append(errParams, "actType") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("vendorID") == "" { - errParams = append(errParams, "vendorID") - } - params.MapData["vendorID"] = params.VendorID - if c.GetString("actType") == "" { - errParams = append(errParams, "actType") - } - params.MapData["actType"] = params.ActType - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.GetUnionActList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.GetUnionActList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.GetUnionActList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API JobController.AuditJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -13250,22 +6784,21 @@ func (c *CmsController) callUpdateConfig(handler func(params *tCmsUpdateConfigPa } } -type tUnionGetVendorMatterDetailParams struct { +type tUser2DeleteMyDeliveryAddressParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - VendorID int - GoodsID string + Id int } -// func (c *UnionController) GetVendorMatterDetail() { -// c.callGetVendorMatterDetail(func(params *tUnionGetVendorMatterDetailParams) (retVal interface{}, errCode string, err error) { +// func (c *User2Controller) DeleteMyDeliveryAddress() { +// c.callDeleteMyDeliveryAddress(func(params *tUser2DeleteMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *UnionController) callGetVendorMatterDetail(handler func(params *tUnionGetVendorMatterDetailParams) (interface{}, string, error)) { +func (c *User2Controller) callDeleteMyDeliveryAddress(handler func(params *tUser2DeleteMyDeliveryAddressParams) (interface{}, string, error)) { var err error - params := &tUnionGetVendorMatterDetailParams{ + params := &tUser2DeleteMyDeliveryAddressParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -13273,144 +6806,18 @@ func (c *UnionController) callGetVendorMatterDetail(handler func(params *tUnionG errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { - errParams = append(errParams, "vendorID") + if params.Id, err = c.GetInt("id", 0); err != nil { + errParams = append(errParams, "id") } - params.GoodsID = utils.TrimBlankChar(c.GetString("goodsID")) - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if c.GetString("vendorID") == "" { - errParams = append(errParams, "vendorID") - } - params.MapData["vendorID"] = params.VendorID - if c.GetString("goodsID") == "" { - errParams = append(errParams, "goodsID") - } - params.MapData["goodsID"] = params.GoodsID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API UnionController.GetVendorMatterDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API UnionController.GetVendorMatterDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API UnionController.GetVendorMatterDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tExpressGetOrderDetailParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - ExpressType int - OrderNo string -} - -// func (c *QBiDaExpressController) GetOrderDetail() { -// c.callGetOrderDetail(func(params *tExpressGetOrderDetailParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *QBiDaExpressController) callGetOrderDetail(handler func(params *tExpressGetOrderDetailParams) (interface{}, string, error)) { - var err error - params := &tExpressGetOrderDetailParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.ExpressType, err = c.GetInt("expressType", 0); err != nil { - errParams = append(errParams, "expressType") - } - params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("expressType") == "" { - errParams = append(errParams, "expressType") + if c.GetString("id") == "" { + errParams = append(errParams, "id") } - params.MapData["expressType"] = params.ExpressType - if c.GetString("orderNo") == "" { - errParams = append(errParams, "orderNo") - } - params.MapData["orderNo"] = params.OrderNo + params.MapData["id"] = params.Id if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -13423,7 +6830,7 @@ func (c *QBiDaExpressController) callGetOrderDetail(handler func(params *tExpres ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API QBiDaExpressController.GetOrderDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API User2Controller.DeleteMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -13469,7 +6876,7 @@ func (c *QBiDaExpressController) callGetOrderDetail(handler func(params *tExpres } } } - globals.SugarLogger.Debugf("End API QBiDaExpressController.GetOrderDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API User2Controller.DeleteMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -13477,1198 +6884,7 @@ func (c *QBiDaExpressController) callGetOrderDetail(handler func(params *tExpres errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API QBiDaExpressController.GetOrderDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tWithdrawalExamineWithdrawalOrderParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Phone string - OrderId string - ExamineStatus int - Remark string - UserId string -} - -// func (c *WithdrawalRecordController) ExamineWithdrawalOrder() { -// c.callExamineWithdrawalOrder(func(params *tWithdrawalExamineWithdrawalOrderParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *WithdrawalRecordController) callExamineWithdrawalOrder(handler func(params *tWithdrawalExamineWithdrawalOrderParams) (interface{}, string, error)) { - var err error - params := &tWithdrawalExamineWithdrawalOrderParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Phone = utils.TrimBlankChar(c.GetString("phone")) - params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) - if params.ExamineStatus, err = c.GetInt("examineStatus", 0); err != nil { - errParams = append(errParams, "examineStatus") - } - params.Remark = utils.TrimBlankChar(c.GetString("remark")) - params.UserId = utils.TrimBlankChar(c.GetString("userId")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("phone") == "" { - errParams = append(errParams, "phone") - } - params.MapData["phone"] = params.Phone - if c.GetString("orderId") == "" { - errParams = append(errParams, "orderId") - } - params.MapData["orderId"] = params.OrderId - if c.GetString("examineStatus") == "" { - errParams = append(errParams, "examineStatus") - } - params.MapData["examineStatus"] = params.ExamineStatus - if utils.TrimBlankChar(c.GetString("remark")) != "" { - params.MapData["remark"] = params.Remark - } - if utils.TrimBlankChar(c.GetString("userId")) != "" { - params.MapData["userId"] = params.UserId - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.ExamineWithdrawalOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API WithdrawalRecordController.ExamineWithdrawalOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API WithdrawalRecordController.ExamineWithdrawalOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2GetUserParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - UserID string -} - -// func (c *User2Controller) GetUser() { -// c.callGetUser(func(params *tUser2GetUserParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callGetUser(handler func(params *tUser2GetUserParams) (interface{}, string, error)) { - var err error - params := &tUser2GetUserParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.GetUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.GetUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.GetUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tOrderGetOrdersParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - OrderID string - UserID string - OrderType int - CityCodes string - FromTime string - ToTime string - Keyword string - Offset int - PageSize int -} - -// func (c *OrderController) GetOrders() { -// c.callGetOrders(func(params *tOrderGetOrdersParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *OrderController) callGetOrders(handler func(params *tOrderGetOrdersParams) (interface{}, string, error)) { - var err error - params := &tOrderGetOrdersParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.OrderType, err = c.GetInt("orderType", 0); err != nil { - errParams = append(errParams, "orderType") - } - params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) - params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) - params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) - params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("orderID")) != "" { - params.MapData["orderID"] = params.OrderID - } - if utils.TrimBlankChar(c.GetString("userID")) != "" { - params.MapData["userID"] = params.UserID - } - if utils.TrimBlankChar(c.GetString("orderType")) != "" { - params.MapData["orderType"] = params.OrderType - } - if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { - params.MapData["cityCodes"] = params.CityCodes - } - if utils.TrimBlankChar(c.GetString("fromTime")) != "" { - params.MapData["fromTime"] = params.FromTime - } - if utils.TrimBlankChar(c.GetString("toTime")) != "" { - params.MapData["toTime"] = params.ToTime - } - if utils.TrimBlankChar(c.GetString("keyword")) != "" { - params.MapData["keyword"] = params.Keyword - } - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if utils.TrimBlankChar(c.GetString("pageSize")) != "" { - params.MapData["pageSize"] = params.PageSize - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.GetOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API OrderController.GetOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API OrderController.GetOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tEventTransferMessageGroupMasterParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - GroupID int - UserID string -} - -// func (c *EventController) TransferMessageGroupMaster() { -// c.callTransferMessageGroupMaster(func(params *tEventTransferMessageGroupMasterParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callTransferMessageGroupMaster(handler func(params *tEventTransferMessageGroupMasterParams) (interface{}, string, error)) { - var err error - params := &tEventTransferMessageGroupMasterParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.GroupID, err = c.GetInt("groupID", 0); err != nil { - errParams = append(errParams, "groupID") - } - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("groupID") == "" { - errParams = append(errParams, "groupID") - } - params.MapData["groupID"] = params.GroupID - if c.GetString("userID") == "" { - errParams = append(errParams, "userID") - } - params.MapData["userID"] = params.UserID - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.TransferMessageGroupMaster, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.TransferMessageGroupMaster, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.TransferMessageGroupMaster error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tCmsGetServiceInfoParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string -} - -// func (c *CmsController) GetServiceInfo() { -// c.callGetServiceInfo(func(params *tCmsGetServiceInfoParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *CmsController) callGetServiceInfo(handler func(params *tCmsGetServiceInfoParams) (interface{}, string, error)) { - var err error - params := &tCmsGetServiceInfoParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.GetServiceInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.GetServiceInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.GetServiceInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tCmsUpdatePlaceParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Code int -} - -// func (c *CmsController) UpdatePlace() { -// c.callUpdatePlace(func(params *tCmsUpdatePlaceParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *CmsController) callUpdatePlace(handler func(params *tCmsUpdatePlaceParams) (interface{}, string, error)) { - var err error - params := &tCmsUpdatePlaceParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Code, err = c.GetInt("code", 0); err != nil { - errParams = append(errParams, "code") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("code") == "" { - errParams = append(errParams, "code") - } - params.MapData["code"] = params.Code - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.UpdatePlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.UpdatePlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.UpdatePlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tUser2UpdateUserByMiniInfoParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Data string - Iv string - JsCode string -} - -// func (c *User2Controller) UpdateUserByMiniInfo() { -// c.callUpdateUserByMiniInfo(func(params *tUser2UpdateUserByMiniInfoParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *User2Controller) callUpdateUserByMiniInfo(handler func(params *tUser2UpdateUserByMiniInfoParams) (interface{}, string, error)) { - var err error - params := &tUser2UpdateUserByMiniInfoParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Data = utils.TrimBlankChar(c.GetString("data")) - params.Iv = utils.TrimBlankChar(c.GetString("iv")) - params.JsCode = utils.TrimBlankChar(c.GetString("jsCode")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("data") == "" { - errParams = append(errParams, "data") - } - params.MapData["data"] = params.Data - if c.GetString("iv") == "" { - errParams = append(errParams, "iv") - } - params.MapData["iv"] = params.Iv - if utils.TrimBlankChar(c.GetString("jsCode")) != "" { - params.MapData["jsCode"] = params.JsCode - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.UpdateUserByMiniInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.UpdateUserByMiniInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.UpdateUserByMiniInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tOrderGetManageStatisticsJobParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - CityCodes string - FromTime string - ToTime string - JobIDs string - Offset int - PageSize int -} - -// func (c *OrderController) GetManageStatisticsJob() { -// c.callGetManageStatisticsJob(func(params *tOrderGetManageStatisticsJobParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *OrderController) callGetManageStatisticsJob(handler func(params *tOrderGetManageStatisticsJobParams) (interface{}, string, error)) { - var err error - params := &tOrderGetManageStatisticsJobParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) - params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) - params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) - params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { - params.MapData["cityCodes"] = params.CityCodes - } - if utils.TrimBlankChar(c.GetString("fromTime")) != "" { - params.MapData["fromTime"] = params.FromTime - } - if utils.TrimBlankChar(c.GetString("toTime")) != "" { - params.MapData["toTime"] = params.ToTime - } - if utils.TrimBlankChar(c.GetString("jobIDs")) != "" { - params.MapData["jobIDs"] = params.JobIDs - } - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if utils.TrimBlankChar(c.GetString("pageSize")) != "" { - params.MapData["pageSize"] = params.PageSize - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.GetManageStatisticsJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API OrderController.GetManageStatisticsJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API OrderController.GetManageStatisticsJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobGetStationListParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - StationName string - CityCode int - Lat float64 - Lng float64 - OilCode string - SortType int - Offset int - PageSize int -} - -// func (c *JobController) GetStationList() { -// c.callGetStationList(func(params *tJobGetStationListParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callGetStationList(handler func(params *tJobGetStationListParams) (interface{}, string, error)) { - var err error - params := &tJobGetStationListParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.StationName = utils.TrimBlankChar(c.GetString("stationName")) - if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { - errParams = append(errParams, "cityCode") - } - if params.Lat, err = c.GetFloat("lat", 0); err != nil { - errParams = append(errParams, "lat") - } - if params.Lng, err = c.GetFloat("lng", 0); err != nil { - errParams = append(errParams, "lng") - } - params.OilCode = utils.TrimBlankChar(c.GetString("oilCode")) - if params.SortType, err = c.GetInt("sortType", 0); err != nil { - errParams = append(errParams, "sortType") - } - if params.Offset, err = c.GetInt("offset", 0); err != nil { - errParams = append(errParams, "offset") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("stationName")) != "" { - params.MapData["stationName"] = params.StationName - } - if utils.TrimBlankChar(c.GetString("cityCode")) != "" { - params.MapData["cityCode"] = params.CityCode - } - if utils.TrimBlankChar(c.GetString("lat")) != "" { - params.MapData["lat"] = params.Lat - } - if utils.TrimBlankChar(c.GetString("lng")) != "" { - params.MapData["lng"] = params.Lng - } - if utils.TrimBlankChar(c.GetString("oilCode")) != "" { - params.MapData["oilCode"] = params.OilCode - } - if utils.TrimBlankChar(c.GetString("sortType")) != "" { - params.MapData["sortType"] = params.SortType - } - if utils.TrimBlankChar(c.GetString("offset")) != "" { - params.MapData["offset"] = params.Offset - } - if utils.TrimBlankChar(c.GetString("pageSize")) != "" { - params.MapData["pageSize"] = params.PageSize - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.GetStationList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.GetStationList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.GetStationList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API User2Controller.DeleteMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -14877,24 +7093,22 @@ func (c *QBiDaExpressController) callQueryExpressPrice(handler func(params *tExp } } -type tRechargeGetUserRechargeParams struct { +type tRechargeGetRechargeOrderDetailParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Page int - PageSize int - Mobile string OrderId string + Mobile string } -// func (c *RechargeManagerController) GetUserRecharge() { -// c.callGetUserRecharge(func(params *tRechargeGetUserRechargeParams) (retVal interface{}, errCode string, err error) { +// func (c *RechargeManagerController) GetRechargeOrderDetail() { +// c.callGetRechargeOrderDetail(func(params *tRechargeGetRechargeOrderDetailParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *RechargeManagerController) callGetUserRecharge(handler func(params *tRechargeGetUserRechargeParams) (interface{}, string, error)) { +func (c *RechargeManagerController) callGetRechargeOrderDetail(handler func(params *tRechargeGetRechargeOrderDetailParams) (interface{}, string, error)) { var err error - params := &tRechargeGetUserRechargeParams{ + params := &tRechargeGetRechargeOrderDetailParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -14902,33 +7116,21 @@ func (c *RechargeManagerController) callGetUserRecharge(handler func(params *tRe errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - if params.Page, err = c.GetInt("page", 0); err != nil { - errParams = append(errParams, "page") - } - if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { - errParams = append(errParams, "pageSize") - } - params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) + params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("page") == "" { - errParams = append(errParams, "page") + if c.GetString("orderId") == "" { + errParams = append(errParams, "orderId") } - params.MapData["page"] = params.Page - if c.GetString("pageSize") == "" { - errParams = append(errParams, "pageSize") - } - params.MapData["pageSize"] = params.PageSize - if utils.TrimBlankChar(c.GetString("mobile")) != "" { - params.MapData["mobile"] = params.Mobile - } - if utils.TrimBlankChar(c.GetString("orderId")) != "" { - params.MapData["orderId"] = params.OrderId + params.MapData["orderId"] = params.OrderId + if c.GetString("mobile") == "" { + errParams = append(errParams, "mobile") } + params.MapData["mobile"] = params.Mobile if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -14941,7 +7143,7 @@ func (c *RechargeManagerController) callGetUserRecharge(handler func(params *tRe ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API RechargeManagerController.GetUserRecharge, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API RechargeManagerController.GetRechargeOrderDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -14987,7 +7189,7 @@ func (c *RechargeManagerController) callGetUserRecharge(handler func(params *tRe } } } - globals.SugarLogger.Debugf("End API RechargeManagerController.GetUserRecharge, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API RechargeManagerController.GetRechargeOrderDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -14995,7 +7197,7 @@ func (c *RechargeManagerController) callGetUserRecharge(handler func(params *tRe errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API RechargeManagerController.GetUserRecharge error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API RechargeManagerController.GetRechargeOrderDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -15012,20 +7214,257 @@ func (c *RechargeManagerController) callGetUserRecharge(handler func(params *tRe } } -type tUser2GetBindAuthInfoParams struct { +type tUser2DeleteUserCityManagerParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + UserID string + CityCode int +} + +// func (c *User2Controller) DeleteUserCityManager() { +// c.callDeleteUserCityManager(func(params *tUser2DeleteUserCityManagerParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callDeleteUserCityManager(handler func(params *tUser2DeleteUserCityManagerParams) (interface{}, string, error)) { + var err error + params := &tUser2DeleteUserCityManagerParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { + errParams = append(errParams, "cityCode") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if c.GetString("cityCode") == "" { + errParams = append(errParams, "cityCode") + } + params.MapData["cityCode"] = params.CityCode + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.DeleteUserCityManager, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.DeleteUserCityManager, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.DeleteUserCityManager error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tOrderSettleUnionOrdersParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + VendorIDs string +} + +// func (c *OrderController) SettleUnionOrders() { +// c.callSettleUnionOrders(func(params *tOrderSettleUnionOrdersParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *OrderController) callSettleUnionOrders(handler func(params *tOrderSettleUnionOrdersParams) (interface{}, string, error)) { + var err error + params := &tOrderSettleUnionOrdersParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" { + params.MapData["vendorIDs"] = params.VendorIDs + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.SettleUnionOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.SettleUnionOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.SettleUnionOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tRechargeQueryAccountBillParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string } -// func (c *User2Controller) GetBindAuthInfo() { -// c.callGetBindAuthInfo(func(params *tUser2GetBindAuthInfoParams) (retVal interface{}, errCode string, err error) { +// func (c *RechargeManagerController) QueryAccountBill() { +// c.callQueryAccountBill(func(params *tRechargeQueryAccountBillParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *User2Controller) callGetBindAuthInfo(handler func(params *tUser2GetBindAuthInfoParams) (interface{}, string, error)) { +func (c *RechargeManagerController) callQueryAccountBill(handler func(params *tRechargeQueryAccountBillParams) (interface{}, string, error)) { var err error - params := &tUser2GetBindAuthInfoParams{ + params := &tRechargeQueryAccountBillParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -15050,7 +7489,7 @@ func (c *User2Controller) callGetBindAuthInfo(handler func(params *tUser2GetBind ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.GetBindAuthInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API RechargeManagerController.QueryAccountBill, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -15096,7 +7535,7 @@ func (c *User2Controller) callGetBindAuthInfo(handler func(params *tUser2GetBind } } } - globals.SugarLogger.Debugf("End API User2Controller.GetBindAuthInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API RechargeManagerController.QueryAccountBill, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -15104,7 +7543,7 @@ func (c *User2Controller) callGetBindAuthInfo(handler func(params *tUser2GetBind errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API User2Controller.GetBindAuthInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API RechargeManagerController.QueryAccountBill error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -15121,21 +7560,21 @@ func (c *User2Controller) callGetBindAuthInfo(handler func(params *tUser2GetBind } } -type tOrderFinishedCashOrdersParams struct { +type tEventSendSysMessageParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - OrderIDs string + Payload string } -// func (c *OrderController) FinishedCashOrders() { -// c.callFinishedCashOrders(func(params *tOrderFinishedCashOrdersParams) (retVal interface{}, errCode string, err error) { +// func (c *EventController) SendSysMessage() { +// c.callSendSysMessage(func(params *tEventSendSysMessageParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *OrderController) callFinishedCashOrders(handler func(params *tOrderFinishedCashOrdersParams) (interface{}, string, error)) { +func (c *EventController) callSendSysMessage(handler func(params *tEventSendSysMessageParams) (interface{}, string, error)) { var err error - params := &tOrderFinishedCashOrdersParams{ + params := &tEventSendSysMessageParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -15143,16 +7582,16 @@ func (c *OrderController) callFinishedCashOrders(handler func(params *tOrderFini errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OrderIDs = utils.TrimBlankChar(c.GetString("orderIDs")) + params.Payload = utils.TrimBlankChar(c.GetString("payload")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("orderIDs") == "" { - errParams = append(errParams, "orderIDs") + if c.GetString("payload") == "" { + errParams = append(errParams, "payload") } - params.MapData["orderIDs"] = params.OrderIDs + params.MapData["payload"] = params.Payload if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -15165,7 +7604,7 @@ func (c *OrderController) callFinishedCashOrders(handler func(params *tOrderFini ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.FinishedCashOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API EventController.SendSysMessage, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -15211,7 +7650,7 @@ func (c *OrderController) callFinishedCashOrders(handler func(params *tOrderFini } } } - globals.SugarLogger.Debugf("End API OrderController.FinishedCashOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API EventController.SendSysMessage, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -15219,7 +7658,7 @@ func (c *OrderController) callFinishedCashOrders(handler func(params *tOrderFini errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API OrderController.FinishedCashOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API EventController.SendSysMessage error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -15236,26 +7675,22 @@ func (c *OrderController) callFinishedCashOrders(handler func(params *tOrderFini } } -type tOrderPayByBalanceParams struct { +type tUnionGetVendorMatterDetailParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - OrderID string - PayType int - VendorPayType string - OrderType string - AppId string - IsChoose int + VendorID int + GoodsID string } -// func (c *OrderController) PayByBalance() { -// c.callPayByBalance(func(params *tOrderPayByBalanceParams) (retVal interface{}, errCode string, err error) { +// func (c *UnionController) GetVendorMatterDetail() { +// c.callGetVendorMatterDetail(func(params *tUnionGetVendorMatterDetailParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *OrderController) callPayByBalance(handler func(params *tOrderPayByBalanceParams) (interface{}, string, error)) { +func (c *UnionController) callGetVendorMatterDetail(handler func(params *tUnionGetVendorMatterDetailParams) (interface{}, string, error)) { var err error - params := &tOrderPayByBalanceParams{ + params := &tUnionGetVendorMatterDetailParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -15263,45 +7698,21 @@ func (c *OrderController) callPayByBalance(handler func(params *tOrderPayByBalan errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.OrderID = utils.TrimBlankChar(c.GetString("orderID")) - if params.PayType, err = c.GetInt("payType", 0); err != nil { - errParams = append(errParams, "payType") + if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { + errParams = append(errParams, "vendorID") } - params.VendorPayType = utils.TrimBlankChar(c.GetString("vendorPayType")) - params.OrderType = utils.TrimBlankChar(c.GetString("orderType")) - params.AppId = utils.TrimBlankChar(c.GetString("appId")) - if params.IsChoose, err = c.GetInt("isChoose", 0); err != nil { - errParams = append(errParams, "isChoose") + params.GoodsID = utils.TrimBlankChar(c.GetString("goodsID")) + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token } - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid + if c.GetString("vendorID") == "" { + errParams = append(errParams, "vendorID") } - params.MapData["token"] = params.Token - if c.GetString("orderID") == "" { - errParams = append(errParams, "orderID") + params.MapData["vendorID"] = params.VendorID + if c.GetString("goodsID") == "" { + errParams = append(errParams, "goodsID") } - params.MapData["orderID"] = params.OrderID - if c.GetString("payType") == "" { - errParams = append(errParams, "payType") - } - params.MapData["payType"] = params.PayType - if c.GetString("vendorPayType") == "" { - errParams = append(errParams, "vendorPayType") - } - params.MapData["vendorPayType"] = params.VendorPayType - if c.GetString("orderType") == "" { - errParams = append(errParams, "orderType") - } - params.MapData["orderType"] = params.OrderType - if c.GetString("appId") == "" { - errParams = append(errParams, "appId") - } - params.MapData["appId"] = params.AppId - if c.GetString("isChoose") == "" { - errParams = append(errParams, "isChoose") - } - params.MapData["isChoose"] = params.IsChoose + params.MapData["goodsID"] = params.GoodsID if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -15312,9 +7723,9 @@ func (c *OrderController) callPayByBalance(handler func(params *tOrderPayByBalan err2 error result interface{} ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.PayByBalance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API UnionController.GetVendorMatterDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -15360,7 +7771,7 @@ func (c *OrderController) callPayByBalance(handler func(params *tOrderPayByBalan } } } - globals.SugarLogger.Debugf("End API OrderController.PayByBalance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API UnionController.GetVendorMatterDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -15368,7 +7779,832 @@ func (c *OrderController) callPayByBalance(handler func(params *tOrderPayByBalan errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API OrderController.PayByBalance error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API UnionController.GetVendorMatterDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2LoginParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + AuthType string + AuthSecret string + AuthID string + AuthIDType string +} + +// func (c *Auth2Controller) Login() { +// c.callLogin(func(params *tAuth2LoginParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callLogin(handler func(params *tAuth2LoginParams) (interface{}, string, error)) { + var err error + params := &tAuth2LoginParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.AuthType = utils.TrimBlankChar(c.GetString("authType")) + params.AuthSecret = utils.TrimBlankChar(c.GetString("authSecret")) + params.AuthID = utils.TrimBlankChar(c.GetString("authID")) + params.AuthIDType = utils.TrimBlankChar(c.GetString("authIDType")) + if c.GetString("authType") == "" { + errParams = append(errParams, "authType") + } + params.MapData["authType"] = params.AuthType + if c.GetString("authSecret") == "" { + errParams = append(errParams, "authSecret") + } + params.MapData["authSecret"] = params.AuthSecret + if utils.TrimBlankChar(c.GetString("authID")) != "" { + params.MapData["authID"] = params.AuthID + } + if utils.TrimBlankChar(c.GetString("authIDType")) != "" { + params.MapData["authIDType"] = params.AuthIDType + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.Login, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.Login, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.Login error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobRefreshJdDeliveryParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *JobController) RefreshJdDelivery() { +// c.callRefreshJdDelivery(func(params *tJobRefreshJdDeliveryParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callRefreshJdDelivery(handler func(params *tJobRefreshJdDeliveryParams) (interface{}, string, error)) { + var err error + params := &tJobRefreshJdDeliveryParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.RefreshJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.RefreshJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.RefreshJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobTempJobParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *JobController) TempJob() { +// c.callTempJob(func(params *tJobTempJobParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callTempJob(handler func(params *tJobTempJobParams) (interface{}, string, error)) { + var err error + params := &tJobTempJobParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.TempJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.TempJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.TempJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobSubmitJobParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Payload string +} + +// func (c *JobController) SubmitJob() { +// c.callSubmitJob(func(params *tJobSubmitJobParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callSubmitJob(handler func(params *tJobSubmitJobParams) (interface{}, string, error)) { + var err error + params := &tJobSubmitJobParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Payload = utils.TrimBlankChar(c.GetString("payload")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("payload") == "" { + errParams = append(errParams, "payload") + } + params.MapData["payload"] = params.Payload + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.SubmitJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.SubmitJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.SubmitJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobAddressDistinguishParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Address string +} + +// func (c *JobController) AddressDistinguish() { +// c.callAddressDistinguish(func(params *tJobAddressDistinguishParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callAddressDistinguish(handler func(params *tJobAddressDistinguishParams) (interface{}, string, error)) { + var err error + params := &tJobAddressDistinguishParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Address = utils.TrimBlankChar(c.GetString("address")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("address")) != "" { + params.MapData["address"] = params.Address + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.AddressDistinguish, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.AddressDistinguish, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.AddressDistinguish error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobCancelAcceptJobParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobID int + JobOrderID int +} + +// func (c *JobController) CancelAcceptJob() { +// c.callCancelAcceptJob(func(params *tJobCancelAcceptJobParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callCancelAcceptJob(handler func(params *tJobCancelAcceptJobParams) (interface{}, string, error)) { + var err error + params := &tJobCancelAcceptJobParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobID, err = c.GetInt("jobID", 0); err != nil { + errParams = append(errParams, "jobID") + } + if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { + errParams = append(errParams, "jobOrderID") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobID") == "" { + errParams = append(errParams, "jobID") + } + params.MapData["jobID"] = params.JobID + if c.GetString("jobOrderID") == "" { + errParams = append(errParams, "jobOrderID") + } + params.MapData["jobOrderID"] = params.JobOrderID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.CancelAcceptJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.CancelAcceptJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.CancelAcceptJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tExpressCancelWayVendorOrderParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Genre int + OrderNo string + Type int +} + +// func (c *QBiDaExpressController) CancelWayVendorOrder() { +// c.callCancelWayVendorOrder(func(params *tExpressCancelWayVendorOrderParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *QBiDaExpressController) callCancelWayVendorOrder(handler func(params *tExpressCancelWayVendorOrderParams) (interface{}, string, error)) { + var err error + params := &tExpressCancelWayVendorOrderParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Genre, err = c.GetInt("genre", 0); err != nil { + errParams = append(errParams, "genre") + } + params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) + if params.Type, err = c.GetInt("type", 0); err != nil { + errParams = append(errParams, "type") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("genre") == "" { + errParams = append(errParams, "genre") + } + params.MapData["genre"] = params.Genre + if c.GetString("orderNo") == "" { + errParams = append(errParams, "orderNo") + } + params.MapData["orderNo"] = params.OrderNo + if c.GetString("type") == "" { + errParams = append(errParams, "type") + } + params.MapData["type"] = params.Type + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API QBiDaExpressController.CancelWayVendorOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API QBiDaExpressController.CancelWayVendorOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API QBiDaExpressController.CancelWayVendorOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -15546,27 +8782,22 @@ func (c *WithdrawalRecordController) callAddWithdrawalRecord(handler func(params } } -type tOrderGetPayStatisticsParams struct { +type tAuth2ChangePasswordParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - UserID string - Pop int - CityCodes string - Mobile string - FromTime string - ToTime string - OrderTypes string + OldPwd string + NewPwd string } -// func (c *OrderController) GetPayStatistics() { -// c.callGetPayStatistics(func(params *tOrderGetPayStatisticsParams) (retVal interface{}, errCode string, err error) { +// func (c *Auth2Controller) ChangePassword() { +// c.callChangePassword(func(params *tAuth2ChangePasswordParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *OrderController) callGetPayStatistics(handler func(params *tOrderGetPayStatisticsParams) (interface{}, string, error)) { +func (c *Auth2Controller) callChangePassword(handler func(params *tAuth2ChangePasswordParams) (interface{}, string, error)) { var err error - params := &tOrderGetPayStatisticsParams{ + params := &tAuth2ChangePasswordParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -15574,41 +8805,20 @@ func (c *OrderController) callGetPayStatistics(handler func(params *tOrderGetPay errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.UserID = utils.TrimBlankChar(c.GetString("userID")) - if params.Pop, err = c.GetInt("pop", 0); err != nil { - errParams = append(errParams, "pop") - } - params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) - params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) - params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) - params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) - params.OrderTypes = utils.TrimBlankChar(c.GetString("orderTypes")) + params.OldPwd = utils.TrimBlankChar(c.GetString("oldPwd")) + params.NewPwd = utils.TrimBlankChar(c.GetString("newPwd")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("userID")) != "" { - params.MapData["userID"] = params.UserID + if utils.TrimBlankChar(c.GetString("oldPwd")) != "" { + params.MapData["oldPwd"] = params.OldPwd } - if utils.TrimBlankChar(c.GetString("pop")) != "" { - params.MapData["pop"] = params.Pop - } - if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { - params.MapData["cityCodes"] = params.CityCodes - } - if utils.TrimBlankChar(c.GetString("mobile")) != "" { - params.MapData["mobile"] = params.Mobile - } - if utils.TrimBlankChar(c.GetString("fromTime")) != "" { - params.MapData["fromTime"] = params.FromTime - } - if utils.TrimBlankChar(c.GetString("toTime")) != "" { - params.MapData["toTime"] = params.ToTime - } - if utils.TrimBlankChar(c.GetString("orderTypes")) != "" { - params.MapData["orderTypes"] = params.OrderTypes + if c.GetString("newPwd") == "" { + errParams = append(errParams, "newPwd") } + params.MapData["newPwd"] = params.NewPwd if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -15621,7 +8831,7 @@ func (c *OrderController) callGetPayStatistics(handler func(params *tOrderGetPay ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.GetPayStatistics, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API Auth2Controller.ChangePassword, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -15667,7 +8877,7 @@ func (c *OrderController) callGetPayStatistics(handler func(params *tOrderGetPay } } } - globals.SugarLogger.Debugf("End API OrderController.GetPayStatistics, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API Auth2Controller.ChangePassword, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -15675,7 +8885,7 @@ func (c *OrderController) callGetPayStatistics(handler func(params *tOrderGetPay errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API OrderController.GetPayStatistics error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API Auth2Controller.ChangePassword error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -15692,21 +8902,22 @@ func (c *OrderController) callGetPayStatistics(handler func(params *tOrderGetPay } } -type tJobUpdateJobParams struct { +type tUser2GetUserCityManagerParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Payload string + UserID string + CityCode int } -// func (c *JobController) UpdateJob() { -// c.callUpdateJob(func(params *tJobUpdateJobParams) (retVal interface{}, errCode string, err error) { +// func (c *User2Controller) GetUserCityManager() { +// c.callGetUserCityManager(func(params *tUser2GetUserCityManagerParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *JobController) callUpdateJob(handler func(params *tJobUpdateJobParams) (interface{}, string, error)) { +func (c *User2Controller) callGetUserCityManager(handler func(params *tUser2GetUserCityManagerParams) (interface{}, string, error)) { var err error - params := &tJobUpdateJobParams{ + params := &tUser2GetUserCityManagerParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -15714,16 +8925,21 @@ func (c *JobController) callUpdateJob(handler func(params *tJobUpdateJobParams) errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Payload = utils.TrimBlankChar(c.GetString("payload")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { + errParams = append(errParams, "cityCode") + } if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if c.GetString("payload") == "" { - errParams = append(errParams, "payload") + if utils.TrimBlankChar(c.GetString("userID")) != "" { + params.MapData["userID"] = params.UserID + } + if utils.TrimBlankChar(c.GetString("cityCode")) != "" { + params.MapData["cityCode"] = params.CityCode } - params.MapData["payload"] = params.Payload if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -15736,7 +8952,7 @@ func (c *JobController) callUpdateJob(handler func(params *tJobUpdateJobParams) ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.UpdateJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API User2Controller.GetUserCityManager, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -15782,7 +8998,7 @@ func (c *JobController) callUpdateJob(handler func(params *tJobUpdateJobParams) } } } - globals.SugarLogger.Debugf("End API JobController.UpdateJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API User2Controller.GetUserCityManager, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -15790,7 +9006,1899 @@ func (c *JobController) callUpdateJob(handler func(params *tJobUpdateJobParams) errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API JobController.UpdateJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API User2Controller.GetUserCityManager error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2SaveMyCartParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + StoreID int + Payload string +} + +// func (c *User2Controller) SaveMyCart() { +// c.callSaveMyCart(func(params *tUser2SaveMyCartParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callSaveMyCart(handler func(params *tUser2SaveMyCartParams) (interface{}, string, error)) { + var err error + params := &tUser2SaveMyCartParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.StoreID, err = c.GetInt("storeID", 0); err != nil { + errParams = append(errParams, "storeID") + } + params.Payload = utils.TrimBlankChar(c.GetString("payload")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("storeID") == "" { + errParams = append(errParams, "storeID") + } + params.MapData["storeID"] = params.StoreID + if utils.TrimBlankChar(c.GetString("payload")) != "" { + params.MapData["payload"] = params.Payload + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.SaveMyCart, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.SaveMyCart, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.SaveMyCart error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetCoordinateFromAddressParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Address string + CityCode int +} + +// func (c *JobController) GetCoordinateFromAddress() { +// c.callGetCoordinateFromAddress(func(params *tJobGetCoordinateFromAddressParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetCoordinateFromAddress(handler func(params *tJobGetCoordinateFromAddressParams) (interface{}, string, error)) { + var err error + params := &tJobGetCoordinateFromAddressParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Address = utils.TrimBlankChar(c.GetString("address")) + if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { + errParams = append(errParams, "cityCode") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("address") == "" { + errParams = append(errParams, "address") + } + params.MapData["address"] = params.Address + if c.GetString("cityCode") == "" { + errParams = append(errParams, "cityCode") + } + params.MapData["cityCode"] = params.CityCode + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetCoordinateFromAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetCoordinateFromAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetCoordinateFromAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUnionGetVendorMattersParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + VendorID int + VendorCatID string + Keyword string + Offset int + PageSize int + ListID string + SortType int +} + +// func (c *UnionController) GetVendorMatters() { +// c.callGetVendorMatters(func(params *tUnionGetVendorMattersParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *UnionController) callGetVendorMatters(handler func(params *tUnionGetVendorMattersParams) (interface{}, string, error)) { + var err error + params := &tUnionGetVendorMattersParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.VendorID, err = c.GetInt("vendorID", 0); err != nil { + errParams = append(errParams, "vendorID") + } + params.VendorCatID = utils.TrimBlankChar(c.GetString("vendorCatID")) + params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + params.ListID = utils.TrimBlankChar(c.GetString("listID")) + if params.SortType, err = c.GetInt("sortType", 0); err != nil { + errParams = append(errParams, "sortType") + } + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token + } + if c.GetString("vendorID") == "" { + errParams = append(errParams, "vendorID") + } + params.MapData["vendorID"] = params.VendorID + if utils.TrimBlankChar(c.GetString("vendorCatID")) != "" { + params.MapData["vendorCatID"] = params.VendorCatID + } + if utils.TrimBlankChar(c.GetString("keyword")) != "" { + params.MapData["keyword"] = params.Keyword + } + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if utils.TrimBlankChar(c.GetString("pageSize")) != "" { + params.MapData["pageSize"] = params.PageSize + } + if utils.TrimBlankChar(c.GetString("listID")) != "" { + params.MapData["listID"] = params.ListID + } + if utils.TrimBlankChar(c.GetString("sortType")) != "" { + params.MapData["sortType"] = params.SortType + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API UnionController.GetVendorMatters, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API UnionController.GetVendorMatters, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API UnionController.GetVendorMatters error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2AddAuthBindWithMobileParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + AuthToken string + Mobile string +} + +// func (c *Auth2Controller) AddAuthBindWithMobile() { +// c.callAddAuthBindWithMobile(func(params *tAuth2AddAuthBindWithMobileParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callAddAuthBindWithMobile(handler func(params *tAuth2AddAuthBindWithMobileParams) (interface{}, string, error)) { + var err error + params := &tAuth2AddAuthBindWithMobileParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.AuthToken = utils.TrimBlankChar(c.GetString("authToken")) + params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("authToken") == "" { + errParams = append(errParams, "authToken") + } + params.MapData["authToken"] = params.AuthToken + if c.GetString("mobile") == "" { + errParams = append(errParams, "mobile") + } + params.MapData["mobile"] = params.Mobile + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.AddAuthBindWithMobile, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.AddAuthBindWithMobile, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.AddAuthBindWithMobile error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2DeletedTokenInfoWithoutParamParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *Auth2Controller) DeletedTokenInfoWithoutParam() { +// c.callDeletedTokenInfoWithoutParam(func(params *tAuth2DeletedTokenInfoWithoutParamParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callDeletedTokenInfoWithoutParam(handler func(params *tAuth2DeletedTokenInfoWithoutParamParams) (interface{}, string, error)) { + var err error + params := &tAuth2DeletedTokenInfoWithoutParamParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.DeletedTokenInfoWithoutParam, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.DeletedTokenInfoWithoutParam, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.DeletedTokenInfoWithoutParam error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobCancelPublishJobParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobID int +} + +// func (c *JobController) CancelPublishJob() { +// c.callCancelPublishJob(func(params *tJobCancelPublishJobParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callCancelPublishJob(handler func(params *tJobCancelPublishJobParams) (interface{}, string, error)) { + var err error + params := &tJobCancelPublishJobParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobID, err = c.GetInt("jobID", 0); err != nil { + errParams = append(errParams, "jobID") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobID") == "" { + errParams = append(errParams, "jobID") + } + params.MapData["jobID"] = params.JobID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.CancelPublishJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.CancelPublishJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.CancelPublishJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventUploadAudioParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *EventController) UploadAudio() { +// c.callUploadAudio(func(params *tEventUploadAudioParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callUploadAudio(handler func(params *tEventUploadAudioParams) (interface{}, string, error)) { + var err error + params := &tEventUploadAudioParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.UploadAudio, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.UploadAudio, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.UploadAudio error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tExpressQueryUserOrderListParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + ExpressType int + OrderStatus int + OrderNo string + PageNum int + PageSize int +} + +// func (c *QBiDaExpressController) QueryUserOrderList() { +// c.callQueryUserOrderList(func(params *tExpressQueryUserOrderListParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *QBiDaExpressController) callQueryUserOrderList(handler func(params *tExpressQueryUserOrderListParams) (interface{}, string, error)) { + var err error + params := &tExpressQueryUserOrderListParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.ExpressType, err = c.GetInt("expressType", 0); err != nil { + errParams = append(errParams, "expressType") + } + if params.OrderStatus, err = c.GetInt("orderStatus", 0); err != nil { + errParams = append(errParams, "orderStatus") + } + params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) + if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { + errParams = append(errParams, "pageNum") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("expressType")) != "" { + params.MapData["expressType"] = params.ExpressType + } + if utils.TrimBlankChar(c.GetString("orderStatus")) != "" { + params.MapData["orderStatus"] = params.OrderStatus + } + if utils.TrimBlankChar(c.GetString("orderNo")) != "" { + params.MapData["orderNo"] = params.OrderNo + } + if c.GetString("pageNum") == "" { + errParams = append(errParams, "pageNum") + } + params.MapData["pageNum"] = params.PageNum + if c.GetString("pageSize") == "" { + errParams = append(errParams, "pageSize") + } + params.MapData["pageSize"] = params.PageSize + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API QBiDaExpressController.QueryUserOrderList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API QBiDaExpressController.QueryUserOrderList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API QBiDaExpressController.QueryUserOrderList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2CreateCaptchaParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Width int + Height int + CaptchaLen int +} + +// func (c *Auth2Controller) CreateCaptcha() { +// c.callCreateCaptcha(func(params *tAuth2CreateCaptchaParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callCreateCaptcha(handler func(params *tAuth2CreateCaptchaParams) (interface{}, string, error)) { + var err error + params := &tAuth2CreateCaptchaParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + if params.Width, err = c.GetInt("width", 0); err != nil { + errParams = append(errParams, "width") + } + if params.Height, err = c.GetInt("height", 0); err != nil { + errParams = append(errParams, "height") + } + if params.CaptchaLen, err = c.GetInt("captchaLen", 0); err != nil { + errParams = append(errParams, "captchaLen") + } + if c.GetString("width") == "" { + errParams = append(errParams, "width") + } + params.MapData["width"] = params.Width + if c.GetString("height") == "" { + errParams = append(errParams, "height") + } + params.MapData["height"] = params.Height + if utils.TrimBlankChar(c.GetString("captchaLen")) != "" { + params.MapData["captchaLen"] = params.CaptchaLen + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.CreateCaptcha, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.CreateCaptcha, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.CreateCaptcha error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2GetUserParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + UserID string +} + +// func (c *User2Controller) GetUser() { +// c.callGetUser(func(params *tUser2GetUserParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callGetUser(handler func(params *tUser2GetUserParams) (interface{}, string, error)) { + var err error + params := &tUser2GetUserParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.GetUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.GetUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.GetUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2UpdateMyDeliveryAddressParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Id int + ConsigneeName string + ConsigneeMobile string + Address string + DetailAddress string + Lng float64 + Lat float64 + Tag string + Remark string + IsDefault int +} + +// func (c *User2Controller) UpdateMyDeliveryAddress() { +// c.callUpdateMyDeliveryAddress(func(params *tUser2UpdateMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callUpdateMyDeliveryAddress(handler func(params *tUser2UpdateMyDeliveryAddressParams) (interface{}, string, error)) { + var err error + params := &tUser2UpdateMyDeliveryAddressParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Id, err = c.GetInt("id", 0); err != nil { + errParams = append(errParams, "id") + } + params.ConsigneeName = utils.TrimBlankChar(c.GetString("consigneeName")) + params.ConsigneeMobile = utils.TrimBlankChar(c.GetString("consigneeMobile")) + params.Address = utils.TrimBlankChar(c.GetString("address")) + params.DetailAddress = utils.TrimBlankChar(c.GetString("detailAddress")) + if params.Lng, err = c.GetFloat("lng", 0); err != nil { + errParams = append(errParams, "lng") + } + if params.Lat, err = c.GetFloat("lat", 0); err != nil { + errParams = append(errParams, "lat") + } + params.Tag = utils.TrimBlankChar(c.GetString("tag")) + params.Remark = utils.TrimBlankChar(c.GetString("remark")) + if params.IsDefault, err = c.GetInt("isDefault", 0); err != nil { + errParams = append(errParams, "isDefault") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("id") == "" { + errParams = append(errParams, "id") + } + params.MapData["id"] = params.Id + if utils.TrimBlankChar(c.GetString("consigneeName")) != "" { + params.MapData["consigneeName"] = params.ConsigneeName + } + if utils.TrimBlankChar(c.GetString("consigneeMobile")) != "" { + params.MapData["consigneeMobile"] = params.ConsigneeMobile + } + if utils.TrimBlankChar(c.GetString("address")) != "" { + params.MapData["address"] = params.Address + } + if utils.TrimBlankChar(c.GetString("detailAddress")) != "" { + params.MapData["detailAddress"] = params.DetailAddress + } + if utils.TrimBlankChar(c.GetString("lng")) != "" { + params.MapData["lng"] = params.Lng + } + if utils.TrimBlankChar(c.GetString("lat")) != "" { + params.MapData["lat"] = params.Lat + } + if utils.TrimBlankChar(c.GetString("tag")) != "" { + params.MapData["tag"] = params.Tag + } + if utils.TrimBlankChar(c.GetString("remark")) != "" { + params.MapData["remark"] = params.Remark + } + if utils.TrimBlankChar(c.GetString("isDefault")) != "" { + params.MapData["isDefault"] = params.IsDefault + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.UpdateMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.UpdateMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.UpdateMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2InvestMemberParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + MemberID int +} + +// func (c *User2Controller) InvestMember() { +// c.callInvestMember(func(params *tUser2InvestMemberParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callInvestMember(handler func(params *tUser2InvestMemberParams) (interface{}, string, error)) { + var err error + params := &tUser2InvestMemberParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.MemberID, err = c.GetInt("memberID", 0); err != nil { + errParams = append(errParams, "memberID") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("memberID") == "" { + errParams = append(errParams, "memberID") + } + params.MapData["memberID"] = params.MemberID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.InvestMember, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.InvestMember, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.InvestMember error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2AcceptAddGroupParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Flag int +} + +// func (c *User2Controller) AcceptAddGroup() { +// c.callAcceptAddGroup(func(params *tUser2AcceptAddGroupParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callAcceptAddGroup(handler func(params *tUser2AcceptAddGroupParams) (interface{}, string, error)) { + var err error + params := &tUser2AcceptAddGroupParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Flag, err = c.GetInt("flag", 0); err != nil { + errParams = append(errParams, "flag") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("flag") == "" { + errParams = append(errParams, "flag") + } + params.MapData["flag"] = params.Flag + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.AcceptAddGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.AcceptAddGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.AcceptAddGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsGetPlacesParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Keyword string + ParentCode int + Level int + IncludeDisabled bool +} + +// func (c *CmsController) GetPlaces() { +// c.callGetPlaces(func(params *tCmsGetPlacesParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callGetPlaces(handler func(params *tCmsGetPlacesParams) (interface{}, string, error)) { + var err error + params := &tCmsGetPlacesParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) + if params.ParentCode, err = c.GetInt("parentCode", 0); err != nil { + errParams = append(errParams, "parentCode") + } + if params.Level, err = c.GetInt("level", 0); err != nil { + errParams = append(errParams, "level") + } + if params.IncludeDisabled, err = c.GetBool("includeDisabled", false); err != nil { + errParams = append(errParams, "includeDisabled") + } + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token + } + if utils.TrimBlankChar(c.GetString("keyword")) != "" { + params.MapData["keyword"] = params.Keyword + } + if utils.TrimBlankChar(c.GetString("parentCode")) != "" { + params.MapData["parentCode"] = params.ParentCode + } + if utils.TrimBlankChar(c.GetString("level")) != "" { + params.MapData["level"] = params.Level + } + if utils.TrimBlankChar(c.GetString("includeDisabled")) != "" { + params.MapData["includeDisabled"] = params.IncludeDisabled + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.GetPlaces, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.GetPlaces, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.GetPlaces error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsDeleteConfigParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Type string + Key string +} + +// func (c *CmsController) DeleteConfig() { +// c.callDeleteConfig(func(params *tCmsDeleteConfigParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callDeleteConfig(handler func(params *tCmsDeleteConfigParams) (interface{}, string, error)) { + var err error + params := &tCmsDeleteConfigParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Type = utils.TrimBlankChar(c.GetString("type")) + params.Key = utils.TrimBlankChar(c.GetString("key")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("type") == "" { + errParams = append(errParams, "type") + } + params.MapData["type"] = params.Type + if c.GetString("key") == "" { + errParams = append(errParams, "key") + } + params.MapData["key"] = params.Key + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.DeleteConfig, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.DeleteConfig, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.DeleteConfig error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -15950,122 +11058,22 @@ func (c *UnionController) callGetVendorMatterRcmmd(handler func(params *tUnionGe } } -type tEventTestWebsocketParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context -} - -// func (c *EventController) TestWebsocket() { -// c.callTestWebsocket(func(params *tEventTestWebsocketParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *EventController) callTestWebsocket(handler func(params *tEventTestWebsocketParams) (interface{}, string, error)) { - var err error - params := &tEventTestWebsocketParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API EventController.TestWebsocket, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API EventController.TestWebsocket, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API EventController.TestWebsocket error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tRechargeQueryAccountBillParams struct { +type tExpressGetOrderDetailParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string + ExpressType int + OrderNo string } -// func (c *RechargeManagerController) QueryAccountBill() { -// c.callQueryAccountBill(func(params *tRechargeQueryAccountBillParams) (retVal interface{}, errCode string, err error) { +// func (c *QBiDaExpressController) GetOrderDetail() { +// c.callGetOrderDetail(func(params *tExpressGetOrderDetailParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *RechargeManagerController) callQueryAccountBill(handler func(params *tRechargeQueryAccountBillParams) (interface{}, string, error)) { +func (c *QBiDaExpressController) callGetOrderDetail(handler func(params *tExpressGetOrderDetailParams) (interface{}, string, error)) { var err error - params := &tRechargeQueryAccountBillParams{ + params := &tExpressGetOrderDetailParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -16073,11 +11081,23 @@ func (c *RechargeManagerController) callQueryAccountBill(handler func(params *tR errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.ExpressType, err = c.GetInt("expressType", 0); err != nil { + errParams = append(errParams, "expressType") + } + params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token + if c.GetString("expressType") == "" { + errParams = append(errParams, "expressType") + } + params.MapData["expressType"] = params.ExpressType + if c.GetString("orderNo") == "" { + errParams = append(errParams, "orderNo") + } + params.MapData["orderNo"] = params.OrderNo if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) } @@ -16090,7 +11110,7 @@ func (c *RechargeManagerController) callQueryAccountBill(handler func(params *tR ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API RechargeManagerController.QueryAccountBill, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API QBiDaExpressController.GetOrderDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -16136,7 +11156,7 @@ func (c *RechargeManagerController) callQueryAccountBill(handler func(params *tR } } } - globals.SugarLogger.Debugf("End API RechargeManagerController.QueryAccountBill, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API QBiDaExpressController.GetOrderDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -16144,7 +11164,7 @@ func (c *RechargeManagerController) callQueryAccountBill(handler func(params *tR errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API RechargeManagerController.QueryAccountBill error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API QBiDaExpressController.GetOrderDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -16161,25 +11181,24 @@ func (c *RechargeManagerController) callQueryAccountBill(handler func(params *tR } } -type tUser2GetUserByMiniInfoParams struct { +type tRechargeGetUserRechargeParams struct { MapData map[string]interface{} Ctx *jxcontext.Context Token string - Data string - Iv string - JsCode string - AuthType string - AppID string + Page int + PageSize int + Mobile string + OrderId string } -// func (c *User2Controller) GetUserByMiniInfo() { -// c.callGetUserByMiniInfo(func(params *tUser2GetUserByMiniInfoParams) (retVal interface{}, errCode string, err error) { +// func (c *RechargeManagerController) GetUserRecharge() { +// c.callGetUserRecharge(func(params *tRechargeGetUserRechargeParams) (retVal interface{}, errCode string, err error) { // return retVal, "", err // }) // } -func (c *User2Controller) callGetUserByMiniInfo(handler func(params *tUser2GetUserByMiniInfoParams) (interface{}, string, error)) { +func (c *RechargeManagerController) callGetUserRecharge(handler func(params *tRechargeGetUserRechargeParams) (interface{}, string, error)) { var err error - params := &tUser2GetUserByMiniInfoParams{ + params := &tRechargeGetUserRechargeParams{ MapData : make(map[string]interface{}), } errParams := []string{} @@ -16187,144 +11206,32 @@ func (c *User2Controller) callGetUserByMiniInfo(handler func(params *tUser2GetUs errCode := model.ErrCodeGeneralFailed params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Data = utils.TrimBlankChar(c.GetString("data")) - params.Iv = utils.TrimBlankChar(c.GetString("iv")) - params.JsCode = utils.TrimBlankChar(c.GetString("jsCode")) - params.AuthType = utils.TrimBlankChar(c.GetString("authType")) - params.AppID = utils.TrimBlankChar(c.GetString("appID")) - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token + if params.Page, err = c.GetInt("page", 0); err != nil { + errParams = append(errParams, "page") } - if c.GetString("data") == "" { - errParams = append(errParams, "data") + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") } - params.MapData["data"] = params.Data - if c.GetString("iv") == "" { - errParams = append(errParams, "iv") - } - params.MapData["iv"] = params.Iv - if utils.TrimBlankChar(c.GetString("jsCode")) != "" { - params.MapData["jsCode"] = params.JsCode - } - if utils.TrimBlankChar(c.GetString("authType")) != "" { - params.MapData["authType"] = params.AuthType - } - if utils.TrimBlankChar(c.GetString("appID")) != "" { - params.MapData["appID"] = params.AppID - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API User2Controller.GetUserByMiniInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API User2Controller.GetUserByMiniInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API User2Controller.GetUserByMiniInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tOrderSettleUnionOrdersParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorIDs string -} - -// func (c *OrderController) SettleUnionOrders() { -// c.callSettleUnionOrders(func(params *tOrderSettleUnionOrdersParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *OrderController) callSettleUnionOrders(handler func(params *tOrderSettleUnionOrdersParams) (interface{}, string, error)) { - var err error - params := &tOrderSettleUnionOrdersParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs")) + params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) + params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) if params.Token == "" { errCode = model.ErrCodeTokenIsInvalid err = model.ErrTokenIsInvalid } params.MapData["token"] = params.Token - if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" { - params.MapData["vendorIDs"] = params.VendorIDs + if c.GetString("page") == "" { + errParams = append(errParams, "page") + } + params.MapData["page"] = params.Page + if c.GetString("pageSize") == "" { + errParams = append(errParams, "pageSize") + } + params.MapData["pageSize"] = params.PageSize + if utils.TrimBlankChar(c.GetString("mobile")) != "" { + params.MapData["mobile"] = params.Mobile + } + if utils.TrimBlankChar(c.GetString("orderId")) != "" { + params.MapData["orderId"] = params.OrderId } if len(errParams) > 0 && err == nil { err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) @@ -16338,7 +11245,7 @@ func (c *OrderController) callSettleUnionOrders(handler func(params *tOrderSettl ) params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API OrderController.SettleUnionOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("Begin API RechargeManagerController.GetUserRecharge, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) beginTime := time.Now() result, errCode2, err2 = handler(params) resultStr := "" @@ -16384,7 +11291,7 @@ func (c *OrderController) callSettleUnionOrders(handler func(params *tOrderSettl } } } - globals.SugarLogger.Debugf("End API OrderController.SettleUnionOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + globals.SugarLogger.Debugf("End API RechargeManagerController.GetUserRecharge, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), utils.Format4Output(params.MapData, true), err, errCode2, resultStr) } @@ -16392,261 +11299,7 @@ func (c *OrderController) callSettleUnionOrders(handler func(params *tOrderSettl errCode = errCode2 } if err != nil { - globals.SugarLogger.Debugf("API OrderController.SettleUnionOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tJobCancelJdDeliveryParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - VendorWaybillID string - Reason string -} - -// func (c *JobController) CancelJdDelivery() { -// c.callCancelJdDelivery(func(params *tJobCancelJdDeliveryParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *JobController) callCancelJdDelivery(handler func(params *tJobCancelJdDeliveryParams) (interface{}, string, error)) { - var err error - params := &tJobCancelJdDeliveryParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) - params.Reason = utils.TrimBlankChar(c.GetString("reason")) - if params.Token == "" { - errCode = model.ErrCodeTokenIsInvalid - err = model.ErrTokenIsInvalid - } - params.MapData["token"] = params.Token - if c.GetString("vendorWaybillID") == "" { - errParams = append(errParams, "vendorWaybillID") - } - params.MapData["vendorWaybillID"] = params.VendorWaybillID - if c.GetString("reason") == "" { - errParams = append(errParams, "reason") - } - params.MapData["reason"] = params.Reason - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API JobController.CancelJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API JobController.CancelJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API JobController.CancelJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) - } - } - if errCode != model.ErrorCodeIgnore { - if err != nil { - if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { - errCode = err.(*jsonerr.Error).ErrCode() - } - c.Data["json"] = &CallResult{ - Code: errCode, - Desc: err.Error(), - } - } - c.ServeJSON() - } -} - -type tCmsGetPlacesParams struct { - MapData map[string]interface{} - Ctx *jxcontext.Context - Token string - Keyword string - ParentCode int - Level int - IncludeDisabled bool -} - -// func (c *CmsController) GetPlaces() { -// c.callGetPlaces(func(params *tCmsGetPlacesParams) (retVal interface{}, errCode string, err error) { -// return retVal, "", err -// }) -// } -func (c *CmsController) callGetPlaces(handler func(params *tCmsGetPlacesParams) (interface{}, string, error)) { - var err error - params := &tCmsGetPlacesParams{ - MapData : make(map[string]interface{}), - } - errParams := []string{} - token := c.Ctx.Input.Header("token") - errCode := model.ErrCodeGeneralFailed - - params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) - params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) - if params.ParentCode, err = c.GetInt("parentCode", 0); err != nil { - errParams = append(errParams, "parentCode") - } - if params.Level, err = c.GetInt("level", 0); err != nil { - errParams = append(errParams, "level") - } - if params.IncludeDisabled, err = c.GetBool("includeDisabled", false); err != nil { - errParams = append(errParams, "includeDisabled") - } - if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { - params.MapData["token"] = params.Token - } - if utils.TrimBlankChar(c.GetString("keyword")) != "" { - params.MapData["keyword"] = params.Keyword - } - if utils.TrimBlankChar(c.GetString("parentCode")) != "" { - params.MapData["parentCode"] = params.ParentCode - } - if utils.TrimBlankChar(c.GetString("level")) != "" { - params.MapData["level"] = params.Level - } - if utils.TrimBlankChar(c.GetString("includeDisabled")) != "" { - params.MapData["includeDisabled"] = params.IncludeDisabled - } - if len(errParams) > 0 && err == nil { - err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) - } - - if err == nil { - var ( - errCode2 string - err2 error - result interface{} - ) - params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) - if err = err2; err == nil { - globals.SugarLogger.Debugf("Begin API CmsController.GetPlaces, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) - beginTime := time.Now() - result, errCode2, err2 = handler(params) - resultStr := "" - if err = err2; err == nil { - if globals.OutputDebugMsgLevel > 0 { - resultStr = utils.Format4Output(result, true) - } - if len(resultStr) > 2000000 { - resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) - } - if errCode2 != model.ErrorCodeIgnore { - resultMarshal, _ := json.Marshal(result) - c.Data["json"] = &CallResult{ - Code: model.ErrCodeSuccess, - Data: string(resultMarshal), - } - } else { - errCode = errCode2 - } - }else { - if errSync, ok := err2.(*cms.SyncError); ok { - if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ - errCode2 = model.ErrCodeJsonSyncErr - errCode = errCode2 - } - } - } - if globals.IsAddEvent { - if params.Ctx != nil { - if params.Ctx.GetRequest().Method != http.MethodGet{ - var ( - errMsg string - errCodeEvent string - ) - if err2 != nil { - errMsg = err2.Error() - errCodeEvent = errCode - }else { - errMsg = "" - errCodeEvent = model.ErrCodeSuccess - } - event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") - } - } - } - globals.SugarLogger.Debugf("End API CmsController.GetPlaces, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", - params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), - utils.Format4Output(params.MapData, true), err, errCode2, resultStr) - } - if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { - errCode = errCode2 - } - if err != nil { - globals.SugarLogger.Debugf("API CmsController.GetPlaces error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + globals.SugarLogger.Debugf("API RechargeManagerController.GetUserRecharge error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) } } if errCode != model.ErrorCodeIgnore { @@ -16783,6 +11436,2223 @@ func (c *Auth2Controller) callRemoveAuthBind(handler func(params *tAuth2RemoveAu } } +type tAuth2SendVerifyCodeParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + CaptchaID string + CaptchaValue string + AuthToken string + AuthID string +} + +// func (c *Auth2Controller) SendVerifyCode() { +// c.callSendVerifyCode(func(params *tAuth2SendVerifyCodeParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callSendVerifyCode(handler func(params *tAuth2SendVerifyCodeParams) (interface{}, string, error)) { + var err error + params := &tAuth2SendVerifyCodeParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.CaptchaID = utils.TrimBlankChar(c.GetString("captchaID")) + params.CaptchaValue = utils.TrimBlankChar(c.GetString("captchaValue")) + params.AuthToken = utils.TrimBlankChar(c.GetString("authToken")) + params.AuthID = utils.TrimBlankChar(c.GetString("authID")) + if utils.TrimBlankChar(c.GetString("captchaID")) != "" { + params.MapData["captchaID"] = params.CaptchaID + } + if utils.TrimBlankChar(c.GetString("captchaValue")) != "" { + params.MapData["captchaValue"] = params.CaptchaValue + } + if utils.TrimBlankChar(c.GetString("authToken")) != "" { + params.MapData["authToken"] = params.AuthToken + } + if c.GetString("authID") == "" { + errParams = append(errParams, "authID") + } + params.MapData["authID"] = params.AuthID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.SendVerifyCode, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.SendVerifyCode, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.SendVerifyCode error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2QueryMyDeliveryAddressParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Type int +} + +// func (c *User2Controller) QueryMyDeliveryAddress() { +// c.callQueryMyDeliveryAddress(func(params *tUser2QueryMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callQueryMyDeliveryAddress(handler func(params *tUser2QueryMyDeliveryAddressParams) (interface{}, string, error)) { + var err error + params := &tUser2QueryMyDeliveryAddressParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Type, err = c.GetInt("type", 0); err != nil { + errParams = append(errParams, "type") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("type")) != "" { + params.MapData["type"] = params.Type + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.QueryMyDeliveryAddress, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.QueryMyDeliveryAddress, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.QueryMyDeliveryAddress error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tExpressDeleteOrderParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + LocalOrderId string +} + +// func (c *QBiDaExpressController) DeleteOrder() { +// c.callDeleteOrder(func(params *tExpressDeleteOrderParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *QBiDaExpressController) callDeleteOrder(handler func(params *tExpressDeleteOrderParams) (interface{}, string, error)) { + var err error + params := &tExpressDeleteOrderParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.LocalOrderId = utils.TrimBlankChar(c.GetString("localOrderId")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("localOrderId") == "" { + errParams = append(errParams, "localOrderId") + } + params.MapData["localOrderId"] = params.LocalOrderId + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API QBiDaExpressController.DeleteOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API QBiDaExpressController.DeleteOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API QBiDaExpressController.DeleteOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tOrderGetManageStatisticsImgParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + CityCodes string + FromTime string + ToTime string + JobIDs string +} + +// func (c *OrderController) GetManageStatisticsImg() { +// c.callGetManageStatisticsImg(func(params *tOrderGetManageStatisticsImgParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *OrderController) callGetManageStatisticsImg(handler func(params *tOrderGetManageStatisticsImgParams) (interface{}, string, error)) { + var err error + params := &tOrderGetManageStatisticsImgParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) + params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) + params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) + params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { + params.MapData["cityCodes"] = params.CityCodes + } + if c.GetString("fromTime") == "" { + errParams = append(errParams, "fromTime") + } + params.MapData["fromTime"] = params.FromTime + if c.GetString("toTime") == "" { + errParams = append(errParams, "toTime") + } + params.MapData["toTime"] = params.ToTime + if utils.TrimBlankChar(c.GetString("jobIDs")) != "" { + params.MapData["jobIDs"] = params.JobIDs + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.GetManageStatisticsImg, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.GetManageStatisticsImg, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.GetManageStatisticsImg error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobConfirmDropShippingJobParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobOrderID int +} + +// func (c *JobController) ConfirmDropShippingJob() { +// c.callConfirmDropShippingJob(func(params *tJobConfirmDropShippingJobParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callConfirmDropShippingJob(handler func(params *tJobConfirmDropShippingJobParams) (interface{}, string, error)) { + var err error + params := &tJobConfirmDropShippingJobParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { + errParams = append(errParams, "jobOrderID") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobOrderID") == "" { + errParams = append(errParams, "jobOrderID") + } + params.MapData["jobOrderID"] = params.JobOrderID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.ConfirmDropShippingJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.ConfirmDropShippingJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.ConfirmDropShippingJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobSendJdDeliveryParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Payload string + PickUpStartTime string + PickUpEndTime string +} + +// func (c *JobController) SendJdDelivery() { +// c.callSendJdDelivery(func(params *tJobSendJdDeliveryParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callSendJdDelivery(handler func(params *tJobSendJdDeliveryParams) (interface{}, string, error)) { + var err error + params := &tJobSendJdDeliveryParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Payload = utils.TrimBlankChar(c.GetString("payload")) + params.PickUpStartTime = utils.TrimBlankChar(c.GetString("pickUpStartTime")) + params.PickUpEndTime = utils.TrimBlankChar(c.GetString("pickUpEndTime")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("payload") == "" { + errParams = append(errParams, "payload") + } + params.MapData["payload"] = params.Payload + if utils.TrimBlankChar(c.GetString("pickUpStartTime")) != "" { + params.MapData["pickUpStartTime"] = params.PickUpStartTime + } + if utils.TrimBlankChar(c.GetString("pickUpEndTime")) != "" { + params.MapData["pickUpEndTime"] = params.PickUpEndTime + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.SendJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.SendJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.SendJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tBillGetUserBillDetailParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + UserID string + FromTime string + ToTime string + Offset int + PageSize int +} + +// func (c *BillController) GetUserBillDetail() { +// c.callGetUserBillDetail(func(params *tBillGetUserBillDetailParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *BillController) callGetUserBillDetail(handler func(params *tBillGetUserBillDetailParams) (interface{}, string, error)) { + var err error + params := &tBillGetUserBillDetailParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) + params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if utils.TrimBlankChar(c.GetString("fromTime")) != "" { + params.MapData["fromTime"] = params.FromTime + } + if utils.TrimBlankChar(c.GetString("toTime")) != "" { + params.MapData["toTime"] = params.ToTime + } + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if utils.TrimBlankChar(c.GetString("pageSize")) != "" { + params.MapData["pageSize"] = params.PageSize + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API BillController.GetUserBillDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API BillController.GetUserBillDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API BillController.GetUserBillDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tExpressGetOrderListParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + ExpressType int + OrderNo string + OrderStatus int + PageNum int + PageSize int + StartTime string + EndTime string +} + +// func (c *QBiDaExpressController) GetOrderList() { +// c.callGetOrderList(func(params *tExpressGetOrderListParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *QBiDaExpressController) callGetOrderList(handler func(params *tExpressGetOrderListParams) (interface{}, string, error)) { + var err error + params := &tExpressGetOrderListParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.ExpressType, err = c.GetInt("expressType", 0); err != nil { + errParams = append(errParams, "expressType") + } + params.OrderNo = utils.TrimBlankChar(c.GetString("orderNo")) + if params.OrderStatus, err = c.GetInt("orderStatus", 0); err != nil { + errParams = append(errParams, "orderStatus") + } + if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { + errParams = append(errParams, "pageNum") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + params.StartTime = utils.TrimBlankChar(c.GetString("startTime")) + params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("expressType")) != "" { + params.MapData["expressType"] = params.ExpressType + } + if utils.TrimBlankChar(c.GetString("orderNo")) != "" { + params.MapData["orderNo"] = params.OrderNo + } + if utils.TrimBlankChar(c.GetString("orderStatus")) != "" { + params.MapData["orderStatus"] = params.OrderStatus + } + if c.GetString("pageNum") == "" { + errParams = append(errParams, "pageNum") + } + params.MapData["pageNum"] = params.PageNum + if c.GetString("pageSize") == "" { + errParams = append(errParams, "pageSize") + } + params.MapData["pageSize"] = params.PageSize + if c.GetString("startTime") == "" { + errParams = append(errParams, "startTime") + } + params.MapData["startTime"] = params.StartTime + if c.GetString("endTime") == "" { + errParams = append(errParams, "endTime") + } + params.MapData["endTime"] = params.EndTime + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API QBiDaExpressController.GetOrderList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API QBiDaExpressController.GetOrderList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API QBiDaExpressController.GetOrderList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2GetTokenInfoParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *Auth2Controller) GetTokenInfo() { +// c.callGetTokenInfo(func(params *tAuth2GetTokenInfoParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callGetTokenInfo(handler func(params *tAuth2GetTokenInfoParams) (interface{}, string, error)) { + var err error + params := &tAuth2GetTokenInfoParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.GetTokenInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.GetTokenInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.GetTokenInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2UpdateUserByMiniInfoParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Data string + Iv string + JsCode string +} + +// func (c *User2Controller) UpdateUserByMiniInfo() { +// c.callUpdateUserByMiniInfo(func(params *tUser2UpdateUserByMiniInfoParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callUpdateUserByMiniInfo(handler func(params *tUser2UpdateUserByMiniInfoParams) (interface{}, string, error)) { + var err error + params := &tUser2UpdateUserByMiniInfoParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Data = utils.TrimBlankChar(c.GetString("data")) + params.Iv = utils.TrimBlankChar(c.GetString("iv")) + params.JsCode = utils.TrimBlankChar(c.GetString("jsCode")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("data") == "" { + errParams = append(errParams, "data") + } + params.MapData["data"] = params.Data + if c.GetString("iv") == "" { + errParams = append(errParams, "iv") + } + params.MapData["iv"] = params.Iv + if utils.TrimBlankChar(c.GetString("jsCode")) != "" { + params.MapData["jsCode"] = params.JsCode + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.UpdateUserByMiniInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.UpdateUserByMiniInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.UpdateUserByMiniInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2UpdateUserParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Payload string +} + +// func (c *User2Controller) UpdateUser() { +// c.callUpdateUser(func(params *tUser2UpdateUserParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callUpdateUser(handler func(params *tUser2UpdateUserParams) (interface{}, string, error)) { + var err error + params := &tUser2UpdateUserParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Payload = utils.TrimBlankChar(c.GetString("payload")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("payload") == "" { + errParams = append(errParams, "payload") + } + params.MapData["payload"] = params.Payload + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.UpdateUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.UpdateUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.UpdateUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetAllDeliveryDetailParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + VendorWaybillID string + ComType string +} + +// func (c *JobController) GetAllDeliveryDetail() { +// c.callGetAllDeliveryDetail(func(params *tJobGetAllDeliveryDetailParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetAllDeliveryDetail(handler func(params *tJobGetAllDeliveryDetailParams) (interface{}, string, error)) { + var err error + params := &tJobGetAllDeliveryDetailParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) + params.ComType = utils.TrimBlankChar(c.GetString("comType")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("vendorWaybillID")) != "" { + params.MapData["vendorWaybillID"] = params.VendorWaybillID + } + if utils.TrimBlankChar(c.GetString("comType")) != "" { + params.MapData["comType"] = params.ComType + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetAllDeliveryDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetAllDeliveryDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetAllDeliveryDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventGetMessageGroupsParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + GroupID int + IsMember bool +} + +// func (c *EventController) GetMessageGroups() { +// c.callGetMessageGroups(func(params *tEventGetMessageGroupsParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callGetMessageGroups(handler func(params *tEventGetMessageGroupsParams) (interface{}, string, error)) { + var err error + params := &tEventGetMessageGroupsParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.GroupID, err = c.GetInt("groupID", 0); err != nil { + errParams = append(errParams, "groupID") + } + if params.IsMember, err = c.GetBool("isMember", false); err != nil { + errParams = append(errParams, "isMember") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("groupID") == "" { + errParams = append(errParams, "groupID") + } + params.MapData["groupID"] = params.GroupID + if c.GetString("isMember") == "" { + errParams = append(errParams, "isMember") + } + params.MapData["isMember"] = params.IsMember + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.GetMessageGroups, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.GetMessageGroups, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.GetMessageGroups error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUnionGetUnionJobOrderInfoParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobOrderID int +} + +// func (c *UnionController) GetUnionJobOrderInfo() { +// c.callGetUnionJobOrderInfo(func(params *tUnionGetUnionJobOrderInfoParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *UnionController) callGetUnionJobOrderInfo(handler func(params *tUnionGetUnionJobOrderInfoParams) (interface{}, string, error)) { + var err error + params := &tUnionGetUnionJobOrderInfoParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobOrderID, err = c.GetInt("jobOrderID", 0); err != nil { + errParams = append(errParams, "jobOrderID") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobOrderID") == "" { + errParams = append(errParams, "jobOrderID") + } + params.MapData["jobOrderID"] = params.JobOrderID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API UnionController.GetUnionJobOrderInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API UnionController.GetUnionJobOrderInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API UnionController.GetUnionJobOrderInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUnionGetPddBindInfoParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *UnionController) GetPddBindInfo() { +// c.callGetPddBindInfo(func(params *tUnionGetPddBindInfoParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *UnionController) callGetPddBindInfo(handler func(params *tUnionGetPddBindInfoParams) (interface{}, string, error)) { + var err error + params := &tUnionGetPddBindInfoParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API UnionController.GetPddBindInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API UnionController.GetPddBindInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API UnionController.GetPddBindInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2AddUserCityManagerParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + UserID string + CityCode int +} + +// func (c *User2Controller) AddUserCityManager() { +// c.callAddUserCityManager(func(params *tUser2AddUserCityManagerParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callAddUserCityManager(handler func(params *tUser2AddUserCityManagerParams) (interface{}, string, error)) { + var err error + params := &tUser2AddUserCityManagerParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.CityCode, err = c.GetInt("cityCode", 0); err != nil { + errParams = append(errParams, "cityCode") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if c.GetString("cityCode") == "" { + errParams = append(errParams, "cityCode") + } + params.MapData["cityCode"] = params.CityCode + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.AddUserCityManager, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.AddUserCityManager, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.AddUserCityManager error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobAcceptJobParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobID int + DropShippingDeliveryID int + DropShippingCount int +} + +// func (c *JobController) AcceptJob() { +// c.callAcceptJob(func(params *tJobAcceptJobParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callAcceptJob(handler func(params *tJobAcceptJobParams) (interface{}, string, error)) { + var err error + params := &tJobAcceptJobParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobID, err = c.GetInt("jobID", 0); err != nil { + errParams = append(errParams, "jobID") + } + if params.DropShippingDeliveryID, err = c.GetInt("dropShippingDeliveryID", 0); err != nil { + errParams = append(errParams, "dropShippingDeliveryID") + } + if params.DropShippingCount, err = c.GetInt("dropShippingCount", 0); err != nil { + errParams = append(errParams, "dropShippingCount") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobID") == "" { + errParams = append(errParams, "jobID") + } + params.MapData["jobID"] = params.JobID + if utils.TrimBlankChar(c.GetString("dropShippingDeliveryID")) != "" { + params.MapData["dropShippingDeliveryID"] = params.DropShippingDeliveryID + } + if utils.TrimBlankChar(c.GetString("dropShippingCount")) != "" { + params.MapData["dropShippingCount"] = params.DropShippingCount + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.AcceptJob, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.AcceptJob, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.AcceptJob error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobUserRefundEjyParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + VendorOrderID string + Reason string +} + +// func (c *JobController) UserRefundEjy() { +// c.callUserRefundEjy(func(params *tJobUserRefundEjyParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callUserRefundEjy(handler func(params *tJobUserRefundEjyParams) (interface{}, string, error)) { + var err error + params := &tJobUserRefundEjyParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.VendorOrderID = utils.TrimBlankChar(c.GetString("vendorOrderID")) + params.Reason = utils.TrimBlankChar(c.GetString("reason")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("vendorOrderID") == "" { + errParams = append(errParams, "vendorOrderID") + } + params.MapData["vendorOrderID"] = params.VendorOrderID + if c.GetString("reason") == "" { + errParams = append(errParams, "reason") + } + params.MapData["reason"] = params.Reason + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.UserRefundEjy, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.UserRefundEjy, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.UserRefundEjy error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + type tJobTempJobTestParams struct { MapData map[string]interface{} Ctx *jxcontext.Context @@ -16894,3 +13764,3133 @@ func (c *JobController) callTempJobTest(handler func(params *tJobTempJobTestPara c.ServeJSON() } } + +type tJobGetJobDetailParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobID int + Lng float64 + Lat float64 +} + +// func (c *JobController) GetJobDetail() { +// c.callGetJobDetail(func(params *tJobGetJobDetailParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetJobDetail(handler func(params *tJobGetJobDetailParams) (interface{}, string, error)) { + var err error + params := &tJobGetJobDetailParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.JobID, err = c.GetInt("jobID", 0); err != nil { + errParams = append(errParams, "jobID") + } + if params.Lng, err = c.GetFloat("lng", 0); err != nil { + errParams = append(errParams, "lng") + } + if params.Lat, err = c.GetFloat("lat", 0); err != nil { + errParams = append(errParams, "lat") + } + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token + } + if utils.TrimBlankChar(c.GetString("jobID")) != "" { + params.MapData["jobID"] = params.JobID + } + if utils.TrimBlankChar(c.GetString("lng")) != "" { + params.MapData["lng"] = params.Lng + } + if utils.TrimBlankChar(c.GetString("lat")) != "" { + params.MapData["lat"] = params.Lat + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetJobDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetJobDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetJobDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventGetUserStatisticsParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *EventController) GetUserStatistics() { +// c.callGetUserStatistics(func(params *tEventGetUserStatisticsParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callGetUserStatistics(handler func(params *tEventGetUserStatisticsParams) (interface{}, string, error)) { + var err error + params := &tEventGetUserStatisticsParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.GetUserStatistics, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.GetUserStatistics, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.GetUserStatistics error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventDeleteMessageGroupParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + GroupID int + UserID string + Flag bool +} + +// func (c *EventController) DeleteMessageGroup() { +// c.callDeleteMessageGroup(func(params *tEventDeleteMessageGroupParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callDeleteMessageGroup(handler func(params *tEventDeleteMessageGroupParams) (interface{}, string, error)) { + var err error + params := &tEventDeleteMessageGroupParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.GroupID, err = c.GetInt("groupID", 0); err != nil { + errParams = append(errParams, "groupID") + } + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.Flag, err = c.GetBool("flag", false); err != nil { + errParams = append(errParams, "flag") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("groupID") == "" { + errParams = append(errParams, "groupID") + } + params.MapData["groupID"] = params.GroupID + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if utils.TrimBlankChar(c.GetString("flag")) != "" { + params.MapData["flag"] = params.Flag + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.DeleteMessageGroup, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.DeleteMessageGroup, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.DeleteMessageGroup error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsQueryConfigsParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Type string + Key string + Keyword string +} + +// func (c *CmsController) QueryConfigs() { +// c.callQueryConfigs(func(params *tCmsQueryConfigsParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callQueryConfigs(handler func(params *tCmsQueryConfigsParams) (interface{}, string, error)) { + var err error + params := &tCmsQueryConfigsParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Type = utils.TrimBlankChar(c.GetString("type")) + params.Key = utils.TrimBlankChar(c.GetString("key")) + params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token + } + if utils.TrimBlankChar(c.GetString("type")) != "" { + params.MapData["type"] = params.Type + } + if utils.TrimBlankChar(c.GetString("key")) != "" { + params.MapData["key"] = params.Key + } + if utils.TrimBlankChar(c.GetString("keyword")) != "" { + params.MapData["keyword"] = params.Keyword + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.QueryConfigs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.QueryConfigs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.QueryConfigs error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsInitPlaceParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *CmsController) InitPlace() { +// c.callInitPlace(func(params *tCmsInitPlaceParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callInitPlace(handler func(params *tCmsInitPlaceParams) (interface{}, string, error)) { + var err error + params := &tCmsInitPlaceParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.InitPlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.InitPlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.InitPlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tExpressTryAgainOrderByOldOrderParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + OldNo string +} + +// func (c *QBiDaExpressController) TryAgainOrderByOldOrder() { +// c.callTryAgainOrderByOldOrder(func(params *tExpressTryAgainOrderByOldOrderParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *QBiDaExpressController) callTryAgainOrderByOldOrder(handler func(params *tExpressTryAgainOrderByOldOrderParams) (interface{}, string, error)) { + var err error + params := &tExpressTryAgainOrderByOldOrderParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.OldNo = utils.TrimBlankChar(c.GetString("oldNo")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("oldNo") == "" { + errParams = append(errParams, "oldNo") + } + params.MapData["oldNo"] = params.OldNo + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API QBiDaExpressController.TryAgainOrderByOldOrder, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API QBiDaExpressController.TryAgainOrderByOldOrder, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API QBiDaExpressController.TryAgainOrderByOldOrder error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2GetUserSerachKeywordParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *User2Controller) GetUserSerachKeyword() { +// c.callGetUserSerachKeyword(func(params *tUser2GetUserSerachKeywordParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callGetUserSerachKeyword(handler func(params *tUser2GetUserSerachKeywordParams) (interface{}, string, error)) { + var err error + params := &tUser2GetUserSerachKeywordParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.GetUserSerachKeyword, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.GetUserSerachKeyword, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.GetUserSerachKeyword error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobReloadJobSpanParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobIDs string + Span int +} + +// func (c *JobController) ReloadJobSpan() { +// c.callReloadJobSpan(func(params *tJobReloadJobSpanParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callReloadJobSpan(handler func(params *tJobReloadJobSpanParams) (interface{}, string, error)) { + var err error + params := &tJobReloadJobSpanParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) + if params.Span, err = c.GetInt("span", 0); err != nil { + errParams = append(errParams, "span") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobIDs") == "" { + errParams = append(errParams, "jobIDs") + } + params.MapData["jobIDs"] = params.JobIDs + if c.GetString("span") == "" { + errParams = append(errParams, "span") + } + params.MapData["span"] = params.Span + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.ReloadJobSpan, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.ReloadJobSpan, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.ReloadJobSpan error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobCreateJobSpanParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + JobIDs string + EndAt string + Span int +} + +// func (c *JobController) CreateJobSpan() { +// c.callCreateJobSpan(func(params *tJobCreateJobSpanParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callCreateJobSpan(handler func(params *tJobCreateJobSpanParams) (interface{}, string, error)) { + var err error + params := &tJobCreateJobSpanParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.JobIDs = utils.TrimBlankChar(c.GetString("jobIDs")) + params.EndAt = utils.TrimBlankChar(c.GetString("endAt")) + if params.Span, err = c.GetInt("span", 0); err != nil { + errParams = append(errParams, "span") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("jobIDs") == "" { + errParams = append(errParams, "jobIDs") + } + params.MapData["jobIDs"] = params.JobIDs + if c.GetString("endAt") == "" { + errParams = append(errParams, "endAt") + } + params.MapData["endAt"] = params.EndAt + if c.GetString("span") == "" { + errParams = append(errParams, "span") + } + params.MapData["span"] = params.Span + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.CreateJobSpan, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.CreateJobSpan, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.CreateJobSpan error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetJobsParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + UserIDs string + CategoryIDs string + Statuss string + VendorIDs string + CityCodes string + IncludeStep bool + FromTime string + ToTime string + Lng float64 + Lat float64 + Span int + Keyword string + SortType int + Offset int + PageSize int +} + +// func (c *JobController) GetJobs() { +// c.callGetJobs(func(params *tJobGetJobsParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetJobs(handler func(params *tJobGetJobsParams) (interface{}, string, error)) { + var err error + params := &tJobGetJobsParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.UserIDs = utils.TrimBlankChar(c.GetString("userIDs")) + params.CategoryIDs = utils.TrimBlankChar(c.GetString("categoryIDs")) + params.Statuss = utils.TrimBlankChar(c.GetString("statuss")) + params.VendorIDs = utils.TrimBlankChar(c.GetString("vendorIDs")) + params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) + if params.IncludeStep, err = c.GetBool("includeStep", false); err != nil { + errParams = append(errParams, "includeStep") + } + params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) + params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) + if params.Lng, err = c.GetFloat("lng", 0); err != nil { + errParams = append(errParams, "lng") + } + if params.Lat, err = c.GetFloat("lat", 0); err != nil { + errParams = append(errParams, "lat") + } + if params.Span, err = c.GetInt("span", 0); err != nil { + errParams = append(errParams, "span") + } + params.Keyword = utils.TrimBlankChar(c.GetString("keyword")) + if params.SortType, err = c.GetInt("sortType", 0); err != nil { + errParams = append(errParams, "sortType") + } + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if utils.TrimBlankChar(c.Ctx.Input.Header("token")) != "" { + params.MapData["token"] = params.Token + } + if utils.TrimBlankChar(c.GetString("userIDs")) != "" { + params.MapData["userIDs"] = params.UserIDs + } + if utils.TrimBlankChar(c.GetString("categoryIDs")) != "" { + params.MapData["categoryIDs"] = params.CategoryIDs + } + if utils.TrimBlankChar(c.GetString("statuss")) != "" { + params.MapData["statuss"] = params.Statuss + } + if utils.TrimBlankChar(c.GetString("vendorIDs")) != "" { + params.MapData["vendorIDs"] = params.VendorIDs + } + if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { + params.MapData["cityCodes"] = params.CityCodes + } + if utils.TrimBlankChar(c.GetString("includeStep")) != "" { + params.MapData["includeStep"] = params.IncludeStep + } + if utils.TrimBlankChar(c.GetString("fromTime")) != "" { + params.MapData["fromTime"] = params.FromTime + } + if utils.TrimBlankChar(c.GetString("toTime")) != "" { + params.MapData["toTime"] = params.ToTime + } + if utils.TrimBlankChar(c.GetString("lng")) != "" { + params.MapData["lng"] = params.Lng + } + if utils.TrimBlankChar(c.GetString("lat")) != "" { + params.MapData["lat"] = params.Lat + } + if utils.TrimBlankChar(c.GetString("span")) != "" { + params.MapData["span"] = params.Span + } + if utils.TrimBlankChar(c.GetString("keyword")) != "" { + params.MapData["keyword"] = params.Keyword + } + if utils.TrimBlankChar(c.GetString("sortType")) != "" { + params.MapData["sortType"] = params.SortType + } + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if utils.TrimBlankChar(c.GetString("pageSize")) != "" { + params.MapData["pageSize"] = params.PageSize + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetJobs, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetJobs, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetJobs error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetEjyOrdersParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Offset int +} + +// func (c *JobController) GetEjyOrders() { +// c.callGetEjyOrders(func(params *tJobGetEjyOrdersParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetEjyOrders(handler func(params *tJobGetEjyOrdersParams) (interface{}, string, error)) { + var err error + params := &tJobGetEjyOrdersParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Offset, err = c.GetInt("offset", 0); err != nil { + errParams = append(errParams, "offset") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("offset")) != "" { + params.MapData["offset"] = params.Offset + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetEjyOrders, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetEjyOrders, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetEjyOrders error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsUpdatePlaceParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Code int +} + +// func (c *CmsController) UpdatePlace() { +// c.callUpdatePlace(func(params *tCmsUpdatePlaceParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callUpdatePlace(handler func(params *tCmsUpdatePlaceParams) (interface{}, string, error)) { + var err error + params := &tCmsUpdatePlaceParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Code, err = c.GetInt("code", 0); err != nil { + errParams = append(errParams, "code") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("code") == "" { + errParams = append(errParams, "code") + } + params.MapData["code"] = params.Code + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.UpdatePlace, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.UpdatePlace, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.UpdatePlace error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tRechargeSystemQueryRechargeListParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + OrderId string + Mobile string + RechargeStatus int + Page int + PageSize int + StartTime string + EndTime string + UserName string +} + +// func (c *RechargeManagerController) SystemQueryRechargeList() { +// c.callSystemQueryRechargeList(func(params *tRechargeSystemQueryRechargeListParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *RechargeManagerController) callSystemQueryRechargeList(handler func(params *tRechargeSystemQueryRechargeListParams) (interface{}, string, error)) { + var err error + params := &tRechargeSystemQueryRechargeListParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) + params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) + if params.RechargeStatus, err = c.GetInt("rechargeStatus", 0); err != nil { + errParams = append(errParams, "rechargeStatus") + } + if params.Page, err = c.GetInt("page", 0); err != nil { + errParams = append(errParams, "page") + } + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + params.StartTime = utils.TrimBlankChar(c.GetString("startTime")) + params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) + params.UserName = utils.TrimBlankChar(c.GetString("userName")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("orderId")) != "" { + params.MapData["orderId"] = params.OrderId + } + if utils.TrimBlankChar(c.GetString("mobile")) != "" { + params.MapData["mobile"] = params.Mobile + } + if utils.TrimBlankChar(c.GetString("rechargeStatus")) != "" { + params.MapData["rechargeStatus"] = params.RechargeStatus + } + if c.GetString("page") == "" { + errParams = append(errParams, "page") + } + params.MapData["page"] = params.Page + if c.GetString("pageSize") == "" { + errParams = append(errParams, "pageSize") + } + params.MapData["pageSize"] = params.PageSize + if c.GetString("startTime") == "" { + errParams = append(errParams, "startTime") + } + params.MapData["startTime"] = params.StartTime + if c.GetString("endTime") == "" { + errParams = append(errParams, "endTime") + } + params.MapData["endTime"] = params.EndTime + if utils.TrimBlankChar(c.GetString("userName")) != "" { + params.MapData["userName"] = params.UserName + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API RechargeManagerController.SystemQueryRechargeList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API RechargeManagerController.SystemQueryRechargeList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API RechargeManagerController.SystemQueryRechargeList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tUser2GetSelfInfoParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string +} + +// func (c *User2Controller) GetSelfInfo() { +// c.callGetSelfInfo(func(params *tUser2GetSelfInfoParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *User2Controller) callGetSelfInfo(handler func(params *tUser2GetSelfInfoParams) (interface{}, string, error)) { + var err error + params := &tUser2GetSelfInfoParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API User2Controller.GetSelfInfo, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API User2Controller.GetSelfInfo, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API User2Controller.GetSelfInfo error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobGetDeliveryDetailParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + VendorWaybillID string +} + +// func (c *JobController) GetDeliveryDetail() { +// c.callGetDeliveryDetail(func(params *tJobGetDeliveryDetailParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callGetDeliveryDetail(handler func(params *tJobGetDeliveryDetailParams) (interface{}, string, error)) { + var err error + params := &tJobGetDeliveryDetailParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("vendorWaybillID")) != "" { + params.MapData["vendorWaybillID"] = params.VendorWaybillID + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.GetDeliveryDetail, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.GetDeliveryDetail, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.GetDeliveryDetail error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2AddAuthBindParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + AuthToken string +} + +// func (c *Auth2Controller) AddAuthBind() { +// c.callAddAuthBind(func(params *tAuth2AddAuthBindParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callAddAuthBind(handler func(params *tAuth2AddAuthBindParams) (interface{}, string, error)) { + var err error + params := &tAuth2AddAuthBindParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.AuthToken = utils.TrimBlankChar(c.GetString("authToken")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("authToken") == "" { + errParams = append(errParams, "authToken") + } + params.MapData["authToken"] = params.AuthToken + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.AddAuthBind, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.AddAuthBind, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.AddAuthBind error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tBalanceUpdateUserBalanceParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Phone string + UserID string + Money int +} + +// func (c *UserBalanceController) UpdateUserBalance() { +// c.callUpdateUserBalance(func(params *tBalanceUpdateUserBalanceParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *UserBalanceController) callUpdateUserBalance(handler func(params *tBalanceUpdateUserBalanceParams) (interface{}, string, error)) { + var err error + params := &tBalanceUpdateUserBalanceParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Phone = utils.TrimBlankChar(c.GetString("phone")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.Money, err = c.GetInt("money", 0); err != nil { + errParams = append(errParams, "money") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("phone") == "" { + errParams = append(errParams, "phone") + } + params.MapData["phone"] = params.Phone + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if utils.TrimBlankChar(c.GetString("money")) != "" { + params.MapData["money"] = params.Money + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API UserBalanceController.UpdateUserBalance, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API UserBalanceController.UpdateUserBalance, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API UserBalanceController.UpdateUserBalance error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tWithdrawalGetWithdrawalListParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + PageSize int + PageNum int + UserName string + UserId string + OrderId string + StartTime string + EndTime string + Phone string + OrderStatus int +} + +// func (c *WithdrawalRecordController) GetWithdrawalList() { +// c.callGetWithdrawalList(func(params *tWithdrawalGetWithdrawalListParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *WithdrawalRecordController) callGetWithdrawalList(handler func(params *tWithdrawalGetWithdrawalListParams) (interface{}, string, error)) { + var err error + params := &tWithdrawalGetWithdrawalListParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.PageSize, err = c.GetInt("pageSize", 0); err != nil { + errParams = append(errParams, "pageSize") + } + if params.PageNum, err = c.GetInt("pageNum", 0); err != nil { + errParams = append(errParams, "pageNum") + } + params.UserName = utils.TrimBlankChar(c.GetString("userName")) + params.UserId = utils.TrimBlankChar(c.GetString("userId")) + params.OrderId = utils.TrimBlankChar(c.GetString("orderId")) + params.StartTime = utils.TrimBlankChar(c.GetString("startTime")) + params.EndTime = utils.TrimBlankChar(c.GetString("endTime")) + params.Phone = utils.TrimBlankChar(c.GetString("phone")) + if params.OrderStatus, err = c.GetInt("orderStatus", 0); err != nil { + errParams = append(errParams, "orderStatus") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("pageSize") == "" { + errParams = append(errParams, "pageSize") + } + params.MapData["pageSize"] = params.PageSize + if c.GetString("pageNum") == "" { + errParams = append(errParams, "pageNum") + } + params.MapData["pageNum"] = params.PageNum + if utils.TrimBlankChar(c.GetString("userName")) != "" { + params.MapData["userName"] = params.UserName + } + if utils.TrimBlankChar(c.GetString("userId")) != "" { + params.MapData["userId"] = params.UserId + } + if utils.TrimBlankChar(c.GetString("orderId")) != "" { + params.MapData["orderId"] = params.OrderId + } + if utils.TrimBlankChar(c.GetString("startTime")) != "" { + params.MapData["startTime"] = params.StartTime + } + if utils.TrimBlankChar(c.GetString("endTime")) != "" { + params.MapData["endTime"] = params.EndTime + } + if utils.TrimBlankChar(c.GetString("phone")) != "" { + params.MapData["phone"] = params.Phone + } + if utils.TrimBlankChar(c.GetString("orderStatus")) != "" { + params.MapData["orderStatus"] = params.OrderStatus + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API WithdrawalRecordController.GetWithdrawalList, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API WithdrawalRecordController.GetWithdrawalList, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API WithdrawalRecordController.GetWithdrawalList error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tCmsGetQiniuUploadTokenParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Suffix string + HashCode string +} + +// func (c *CmsController) GetQiniuUploadToken() { +// c.callGetQiniuUploadToken(func(params *tCmsGetQiniuUploadTokenParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *CmsController) callGetQiniuUploadToken(handler func(params *tCmsGetQiniuUploadTokenParams) (interface{}, string, error)) { + var err error + params := &tCmsGetQiniuUploadTokenParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.Suffix = utils.TrimBlankChar(c.GetString("suffix")) + params.HashCode = utils.TrimBlankChar(c.GetString("hashCode")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("suffix") == "" { + errParams = append(errParams, "suffix") + } + params.MapData["suffix"] = params.Suffix + if utils.TrimBlankChar(c.GetString("hashCode")) != "" { + params.MapData["hashCode"] = params.HashCode + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API CmsController.GetQiniuUploadToken, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API CmsController.GetQiniuUploadToken, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API CmsController.GetQiniuUploadToken error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventTestWebsocketParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context +} + +// func (c *EventController) TestWebsocket() { +// c.callTestWebsocket(func(params *tEventTestWebsocketParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callTestWebsocket(handler func(params *tEventTestWebsocketParams) (interface{}, string, error)) { + var err error + params := &tEventTestWebsocketParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.TestWebsocket, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.TestWebsocket, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.TestWebsocket error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tEventGetMessageGroupByUserParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + UserID string +} + +// func (c *EventController) GetMessageGroupByUser() { +// c.callGetMessageGroupByUser(func(params *tEventGetMessageGroupByUserParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *EventController) callGetMessageGroupByUser(handler func(params *tEventGetMessageGroupByUserParams) (interface{}, string, error)) { + var err error + params := &tEventGetMessageGroupByUserParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("userID") == "" { + errParams = append(errParams, "userID") + } + params.MapData["userID"] = params.UserID + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API EventController.GetMessageGroupByUser, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API EventController.GetMessageGroupByUser, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API EventController.GetMessageGroupByUser error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tAuth2WeixinOAuth2Params struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Code string + Block string + State string +} + +// func (c *Auth2Controller) WeixinOAuth2() { +// c.callWeixinOAuth2(func(params *tAuth2WeixinOAuth2Params) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *Auth2Controller) callWeixinOAuth2(handler func(params *tAuth2WeixinOAuth2Params) (interface{}, string, error)) { + var err error + params := &tAuth2WeixinOAuth2Params{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Code = utils.TrimBlankChar(c.GetString("code")) + params.Block = utils.TrimBlankChar(c.GetString("block")) + params.State = utils.TrimBlankChar(c.GetString("state")) + if c.GetString("code") == "" { + errParams = append(errParams, "code") + } + params.MapData["code"] = params.Code + if c.GetString("block") == "" { + errParams = append(errParams, "block") + } + params.MapData["block"] = params.Block + if utils.TrimBlankChar(c.GetString("state")) != "" { + params.MapData["state"] = params.State + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx = jxcontext.NewWithUserName(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API Auth2Controller.WeixinOAuth2, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API Auth2Controller.WeixinOAuth2, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API Auth2Controller.WeixinOAuth2 error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tOrderGetPayStatisticsParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + UserID string + Pop int + CityCodes string + Mobile string + FromTime string + ToTime string + OrderTypes string +} + +// func (c *OrderController) GetPayStatistics() { +// c.callGetPayStatistics(func(params *tOrderGetPayStatisticsParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *OrderController) callGetPayStatistics(handler func(params *tOrderGetPayStatisticsParams) (interface{}, string, error)) { + var err error + params := &tOrderGetPayStatisticsParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.UserID = utils.TrimBlankChar(c.GetString("userID")) + if params.Pop, err = c.GetInt("pop", 0); err != nil { + errParams = append(errParams, "pop") + } + params.CityCodes = utils.TrimBlankChar(c.GetString("cityCodes")) + params.Mobile = utils.TrimBlankChar(c.GetString("mobile")) + params.FromTime = utils.TrimBlankChar(c.GetString("fromTime")) + params.ToTime = utils.TrimBlankChar(c.GetString("toTime")) + params.OrderTypes = utils.TrimBlankChar(c.GetString("orderTypes")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if utils.TrimBlankChar(c.GetString("userID")) != "" { + params.MapData["userID"] = params.UserID + } + if utils.TrimBlankChar(c.GetString("pop")) != "" { + params.MapData["pop"] = params.Pop + } + if utils.TrimBlankChar(c.GetString("cityCodes")) != "" { + params.MapData["cityCodes"] = params.CityCodes + } + if utils.TrimBlankChar(c.GetString("mobile")) != "" { + params.MapData["mobile"] = params.Mobile + } + if utils.TrimBlankChar(c.GetString("fromTime")) != "" { + params.MapData["fromTime"] = params.FromTime + } + if utils.TrimBlankChar(c.GetString("toTime")) != "" { + params.MapData["toTime"] = params.ToTime + } + if utils.TrimBlankChar(c.GetString("orderTypes")) != "" { + params.MapData["orderTypes"] = params.OrderTypes + } + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API OrderController.GetPayStatistics, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API OrderController.GetPayStatistics, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API OrderController.GetPayStatistics error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobRechargeMtMembersParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + Phone int +} + +// func (c *JobController) RechargeMtMembers() { +// c.callRechargeMtMembers(func(params *tJobRechargeMtMembersParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callRechargeMtMembers(handler func(params *tJobRechargeMtMembersParams) (interface{}, string, error)) { + var err error + params := &tJobRechargeMtMembersParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + if params.Phone, err = c.GetInt("phone", 0); err != nil { + errParams = append(errParams, "phone") + } + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("phone") == "" { + errParams = append(errParams, "phone") + } + params.MapData["phone"] = params.Phone + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.RechargeMtMembers, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.RechargeMtMembers, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.RechargeMtMembers error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} + +type tJobCancelJdDeliveryParams struct { + MapData map[string]interface{} + Ctx *jxcontext.Context + Token string + VendorWaybillID string + Reason string +} + +// func (c *JobController) CancelJdDelivery() { +// c.callCancelJdDelivery(func(params *tJobCancelJdDeliveryParams) (retVal interface{}, errCode string, err error) { +// return retVal, "", err +// }) +// } +func (c *JobController) callCancelJdDelivery(handler func(params *tJobCancelJdDeliveryParams) (interface{}, string, error)) { + var err error + params := &tJobCancelJdDeliveryParams{ + MapData : make(map[string]interface{}), + } + errParams := []string{} + token := c.Ctx.Input.Header("token") + errCode := model.ErrCodeGeneralFailed + + params.Token = utils.TrimBlankChar(c.Ctx.Input.Header("token")) + params.VendorWaybillID = utils.TrimBlankChar(c.GetString("vendorWaybillID")) + params.Reason = utils.TrimBlankChar(c.GetString("reason")) + if params.Token == "" { + errCode = model.ErrCodeTokenIsInvalid + err = model.ErrTokenIsInvalid + } + params.MapData["token"] = params.Token + if c.GetString("vendorWaybillID") == "" { + errParams = append(errParams, "vendorWaybillID") + } + params.MapData["vendorWaybillID"] = params.VendorWaybillID + if c.GetString("reason") == "" { + errParams = append(errParams, "reason") + } + params.MapData["reason"] = params.Reason + if len(errParams) > 0 && err == nil { + err = fmt.Errorf(strRequiredParamIsEmpty, strings.Join(errParams, ",")) + } + + if err == nil { + var ( + errCode2 string + err2 error + result interface{} + ) + params.Ctx, errCode2, err2 = jxcontext.New(nil, token, c.Ctx.ResponseWriter, c.Ctx.Request) + if err = err2; err == nil { + globals.SugarLogger.Debugf("Begin API JobController.CancelJdDelivery, username:%s, accessUUID:%s, data:%s\n", params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), utils.Format4Output(params.MapData, true)) + beginTime := time.Now() + result, errCode2, err2 = handler(params) + resultStr := "" + if err = err2; err == nil { + if globals.OutputDebugMsgLevel > 0 { + resultStr = utils.Format4Output(result, true) + } + if len(resultStr) > 2000000 { + resultStr = fmt.Sprintf("result len is:%d", len(resultStr)) + } + if errCode2 != model.ErrorCodeIgnore { + resultMarshal, _ := json.Marshal(result) + c.Data["json"] = &CallResult{ + Code: model.ErrCodeSuccess, + Data: string(resultMarshal), + } + } else { + errCode = errCode2 + } + }else { + if errSync, ok := err2.(*cms.SyncError); ok { + if _,ok := errSync.Original.(*cms.SpecSyncError);ok{ + errCode2 = model.ErrCodeJsonSyncErr + errCode = errCode2 + } + } + } + if globals.IsAddEvent { + if params.Ctx != nil { + if params.Ctx.GetRequest().Method != http.MethodGet{ + var ( + errMsg string + errCodeEvent string + ) + if err2 != nil { + errMsg = err2.Error() + errCodeEvent = errCode + }else { + errMsg = "" + errCodeEvent = model.ErrCodeSuccess + } + event.AddOperateEvent(params.Ctx, params.Ctx.GetTrackInfo(), string(utils.MustMarshal(params.MapData)), errCodeEvent, errMsg, int(time.Now().Sub(beginTime) / time.Millisecond), "") + } + } + } + globals.SugarLogger.Debugf("End API JobController.CancelJdDelivery, username:%s, accessUUID:%s, elapsed time:%d, data:%s, err:%v, errCode:%s, result:%s\n", + params.Ctx.GetUserName(), params.Ctx.GetTrackInfo(), int(time.Now().Sub(beginTime) / time.Millisecond), + utils.Format4Output(params.MapData, true), err, errCode2, resultStr) + } + if err != nil && errCode2 != model.ErrCodeSuccess && errCode2 != "" { + errCode = errCode2 + } + if err != nil { + globals.SugarLogger.Debugf("API JobController.CancelJdDelivery error:%v, data:%s", err, utils.Format4Output(params.MapData, true)) + } + } + if errCode != model.ErrorCodeIgnore { + if err != nil { + if errCode == model.ErrCodeGeneralFailed && jsonerr.IsJsonErr(err) { + errCode = err.(*jsonerr.Error).ErrCode() + } + c.Data["json"] = &CallResult{ + Code: errCode, + Desc: err.Error(), + } + } + c.ServeJSON() + } +} diff --git a/swagger/swagger.json b/swagger/swagger.json index e76f8dab6..a708b4445 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -5801,7 +5801,7 @@ "type": "string" }, "data": { - "$ref": "#/definitions/13611.0xc000aa5b90.false" + "$ref": "#/definitions/13611.0xc000aceab0.false" }, "desc": { "type": "string" diff --git a/swagger/swagger.yml b/swagger/swagger.yml index fdafdb5b3..fda3103b6 100644 --- a/swagger/swagger.yml +++ b/swagger/swagger.yml @@ -3936,7 +3936,7 @@ definitions: code: type: string data: - $ref: '#/definitions/13611.0xc000aa5b90.false' + $ref: '#/definitions/13611.0xc000aceab0.false' desc: type: string tags: diff --git a/tests/default_test.go b/tests/default_test.go index a7e241c96..73be76e32 100644 --- a/tests/default_test.go +++ b/tests/default_test.go @@ -7,7 +7,7 @@ import ( "runtime" "testing" - _ "gitrosy.jxc4.com/jx-callback/routers" + _ "git.rosy.net.cn/jx-callback/routers" "github.com/astaxie/beego" )