From dd3e342b2be5e6f8cd8354dbbeb17b1edecff010 Mon Sep 17 00:00:00 2001 From: wlhet <780999757@qq.com> Date: Mon, 8 Mar 2021 16:25:57 +0800 Subject: [PATCH] 2 --- Api_Tk.go | 21 +++++ Api_Vip.go | 174 +++++++++++++++++++++++++++++++++++++++++ LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++ ProcessOrder.go | 49 ++++++++++++ burgeon.go | 72 +++++++++++++++++ go.mod | 8 ++ go.sum | 163 +++++++++++++++++++++++++++++++++++++++ objectModify.go | 16 ++++ objectcreate.go | 15 ++++ publicUtil.go | 111 ++++++++++++++++++++++++++ query.go | 28 +++++++ 11 files changed, 858 insertions(+) create mode 100644 Api_Tk.go create mode 100644 Api_Vip.go create mode 100644 LICENSE create mode 100644 ProcessOrder.go create mode 100644 burgeon.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 objectModify.go create mode 100644 objectcreate.go create mode 100644 publicUtil.go create mode 100644 query.go diff --git a/Api_Tk.go b/Api_Tk.go new file mode 100644 index 0000000..a3a47a7 --- /dev/null +++ b/Api_Tk.go @@ -0,0 +1,21 @@ +package burgeonsdk + +func (bg *BurgeonConnection) AddNewTk(tkno string, card string, price int64, start, end, remark string) (string, error) { + pts := bg.NewProcessOrder() + pts.ProcessOrderMasterObjSetTable("C_V_VOUCHERS") + pts.ProcessOrderIfSubmit(true) + pts.ProcessOrderMasterObjSetColumn("VOUCHERS_NO", tkno) //券号 + pts.ProcessOrderMasterObjSetColumn("C_VIP_ID__CARDNO", card) //VIP卡号 + pts.ProcessOrderMasterObjSetColumn("VOU_TYPE", "VOU5") //优惠券类别(购物券) + pts.ProcessOrderMasterObjSetColumn("IS_OFFLINE", "Y") //是否线下 + pts.ProcessOrderMasterObjSetColumn("AMT_DISCOUNT", price) //优惠金额 + pts.ProcessOrderMasterObjSetColumn("START_DATE", start) //开始日期 + pts.ProcessOrderMasterObjSetColumn("DELTYPE", "AND") //排除方式 + pts.ProcessOrderMasterObjSetColumn("VALID_DATE", end) //过期日期 + pts.ProcessOrderMasterObjSetColumn("C_CUSTOMER_ID__NAME", NewVipCardInfo.Customer) //经销商名 + pts.ProcessOrderMasterObjSetColumn("IS_ALLSTORE", "Y") //是否所有店铺 + pts.ProcessOrderMasterObjSetColumn("ISSHARE_PAYTYPE", "Y") //付款方式是否共用 + pts.ProcessOrderMasterObjSetColumn("IS_MDAMT", "N") //消费时允许修改金额 + pts.ProcessOrderMasterObjSetColumn("DESCRIPTION", remark) //备注 + return bg.Post(pts) +} diff --git a/Api_Vip.go b/Api_Vip.go new file mode 100644 index 0000000..0553454 --- /dev/null +++ b/Api_Vip.go @@ -0,0 +1,174 @@ +package burgeonsdk + +import ( + "fmt" + + "github.com/tidwall/gjson" +) + +const ( + EmptyString = "" + ApiErrCode = -1 +) + +var NewVipCardInfo *VipCardConfig + +func InitVipCardConfig(viptype, customer, store, area, validdate string) { + NewVipCardInfo = &VipCardConfig{ + VipType: viptype, + Customer: customer, + Store: store, + IntegralArea: area, + ValidDate: validdate, + } +} + +//获取Vip当前积分 +func (bg *BurgeonConnection) GetVipIntegralByCardNO(card string) (int64, error) { + pst := bg.NewQuery() + pst.QuerySetTable("C_VIP") + pst.QuerySetCondition("CARDNO", card) + pst.QuerySetResult("INTEGRAL") + s, err := bg.Post(pst) + if err != nil { + return -1, err + } else { + return gjson.Get(s, "0.rows.0.0").Int(), nil + } +} + +//获取Vip等级 +func (bg *BurgeonConnection) GetVipLevelByCardNO(card string) (int64, error) { + pst := bg.NewQuery() + pst.QuerySetTable("C_VIP") + pst.QuerySetCondition("CARDNO", card) + pst.QuerySetResult("VIP_LEVEL") + s, err := bg.Post(pst) + if err != nil { + return ApiErrCode, err + } else { + return gjson.Get(s, "0.rows.0.0").Int(), nil + } +} + +//获取VIP等级名称 +func (bg *BurgeonConnection) GetVipLevelNameByCard(card string) (string, error) { + pst := bg.NewQuery() + pst.QuerySetTable("C_VIP") + pst.QuerySetCondition("CARDNO", card) + pst.QuerySetResult("C_VIPTYPE_ID;NAME") + s, err := bg.Post(pst) + if err != nil { + return EmptyString, err + } else { + name := gjson.Get(s, "0.rows.0.0").String() + return name, nil + } +} + +func (bg *BurgeonConnection) GetVipLevelUpMRetail(card string) (string, error) { + pst := bg.NewQuery() + pst.QuerySetTable("C_VIP") + pst.QuerySetCondition("CARDNO", card) + pst.QuerySetResult("M_RETAIL_ID;NAME") + s, err := bg.Post(pst) + fmt.Println(s) + if err != nil { + return EmptyString, err + } else { + name := gjson.Get(s, "0.rows.0.0").String() + return name, nil + } +} + +//获取Vip消费记录/返回消费金额,积分,日期[[2165,44,20210304]] +func (bg *BurgeonConnection) GetVipRecordsOfConsumptionByCard(card string) ([][]int64, error) { + pst := bg.NewQuery() + pst.QuerySetTable("FA_VIPINTEGRAL_FTP") + pst.QuerySetCondition("C_VIP_ID;CARDNO", card) + pst.QuerySetResult("AMT_ACTUAL", "INTEGRAL", "CHANGDATE") + s, err := bg.Post(pst) + result := make([][]int64, 0) + if err != nil { + return result, err + } else { + array := gjson.Get(s, "0.rows").Array() + for _, v := range array { + vv := v.Array() + result = append(result, []int64{vv[0].Int(), vv[1].Int(), vv[2].Int()}) + } + return result, nil + } +} + +//获新增VIP +func (bg *BurgeonConnection) CreateVip(card, mobil, name, birthday, sex, remark string) (string, error) { + switch sex { + case "M": + case "W": + case "男": + sex = "M" + case "女": + sex = "W" + default: + sex = "N" + } + pst := bg.NewObjectCreate() + pst.ObjectCreateSetTable("C_V_ADDVIP") + pst.ObjectCreateSetColumn("C_VIPTYPE_ID__NAME", NewVipCardInfo.VipType) + pst.ObjectCreateSetColumn("CARDNO", card) + pst.ObjectCreateSetColumn("C_CUSTOMER_ID__NAME", NewVipCardInfo.Customer) + pst.ObjectCreateSetColumn("C_STORE_ID__NAME", NewVipCardInfo.Store) + pst.ObjectCreateSetColumn("MOBIL", mobil) + pst.ObjectCreateSetColumn("SEX", sex) + pst.ObjectCreateSetColumn("VIPNAME", name) + pst.ObjectCreateSetColumn("BIRTHDAY", birthday) + pst.ObjectCreateSetColumn("C_INTEGRALAREA_ID__NAME", NewVipCardInfo.IntegralArea) + pst.ObjectCreateSetColumn("OPENID", " ") + pst.ObjectCreateSetColumn("DESCRIPTION", remark) + return bg.Post(pst) +} + +func (bg *BurgeonConnection) ChangeVipBirthday(card string, birthday string) (string, error) { + pts := bg.NewObjectModify() + pts.ObjectModifySetTable("c_vip") + pts.ObjectModifySetColumn("ak", card) + pts.ObjectModifySetColumn("birthday", birthday) + pts.ObjectModifySetColumn("partial_update", true) //partial_update*boolean缺省值:true,表示仅修改传入的对应的列 + return bg.Post(pts) +} + +func (bg *BurgeonConnection) ChangeVipName(card string, name string) (string, error) { + pts := bg.NewObjectModify() + pts.ObjectModifySetTable("c_vip") + pts.ObjectModifySetColumn("ak", card) + pts.ObjectModifySetColumn("vipname", name) + pts.ObjectModifySetColumn("partial_update", true) //partial_update*boolean缺省值:true,表示仅修改传入的对应的列 + return bg.Post(pts) +} + +func (bg *BurgeonConnection) ChangeVipSex(card string, sex string) (string, error) { + pts := bg.NewObjectModify() + pts.ObjectModifySetTable("c_vip") + pts.ObjectModifySetColumn("ak", card) + pts.ObjectModifySetColumn("sex", sex) + pts.ObjectModifySetColumn("partial_update", true) //partial_update*boolean缺省值:true,表示仅修改传入的对应的列 + return bg.Post(pts) +} + +//新增VIP积分调整单 +func (bg *BurgeonConnection) AddVipIntegral(card, billdate, remark string, integral int64) (string, error) { + pts := bg.NewProcessOrder() + pts.ProcessOrderMasterObjSetTable("C_VIPINTEGRALADJ") + pts.ProcessOrderIfSubmit(true) + pts.ProcessOrderMasterObjSetColumn("BILLDATE", billdate) + pts.ProcessOrderMasterObjSetColumn("ADJTYPE", 1) + pts.ProcessOrderDetailObjsSetTables("C_VIPINTEGRALADJITEM") + pts.ProcessOrderDetailObjsAddrefobjs("C_VIPINTEGRALADJITEM", + map[string]interface{}{ + "C_VIP_ID__CARDNO": card, + "INTEGRALADJ": integral, + "DESCRIPTION": remark, + }) + return bg.Post(pts) +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/ProcessOrder.go b/ProcessOrder.go new file mode 100644 index 0000000..2df1358 --- /dev/null +++ b/ProcessOrder.go @@ -0,0 +1,49 @@ +package burgeonsdk + +func (this *BurgeonConnection) NewProcessOrder() PostData { + return PostData{Id: 3, Command: "ProcessOrder", Params: map[string]interface{}{ + "submit": false, + "id": -1, + "masterobj": make(map[string]interface{}), + "detailobjs": map[string]interface{}{ + "tables": make([]string, 0), + "refobjs": make([]map[string]interface{}, 0), + }, + }} +} + +//存储过程单据是否提交 +func (this *PostData) ProcessOrderIfSubmit(b bool) { + this.Params["submit"] = b +} + +//设置主表名称 +func (this *PostData) ProcessOrderMasterObjSetTable(table string) { + masterobj := this.Params["masterobj"].(map[string]interface{}) + masterobj["table"] = table +} + +//设置主表字段 +func (this *PostData) ProcessOrderMasterObjSetColumn(k string, v interface{}) { + masterobj := this.Params["masterobj"].(map[string]interface{}) + masterobj[k] = v +} + +//子表名称 可是复数 多表 +func (this *PostData) ProcessOrderDetailObjsSetTables(t ...string) { + detailobjs := this.Params["detailobjs"].(map[string]interface{}) + detailobjs["tables"] = t +} + +//设置子表提交数据 表名 各个字段 +func (this *PostData) ProcessOrderDetailObjsAddrefobjs(reftable string, list ...map[string]interface{}) { + pdetailobjs := this.Params["detailobjs"].(map[string]interface{}) + refobjs := pdetailobjs["refobjs"].([]map[string]interface{}) + dobi := make([]map[string]interface{}, 0) + dobi = append(dobi, refobjs...) + ref := make(map[string]interface{}) + ref["table"] = reftable + ref["addList"] = list + dobi = append(dobi, ref) + pdetailobjs["refobjs"] = dobi +} diff --git a/burgeon.go b/burgeon.go new file mode 100644 index 0000000..7abc657 --- /dev/null +++ b/burgeon.go @@ -0,0 +1,72 @@ +package burgeonsdk + +import ( + "encoding/json" + "errors" + "fmt" + "time" + + "github.com/astaxie/beego/httplib" + "github.com/tidwall/gjson" +) + +type BurgeonConnection struct { + AppId string + AppKey string + ApiUrl string +} + +type VipCardConfig struct { + VipType string //"ECCO会员卡" 会员卡类型 + Customer string //"爱步" 经销商 + Store string //"ECCO公司仓" 所属仓 + ValidDate string ////"20301231" 过期时间 + IntegralArea string //"ECCO区域" 积分区域 + VipBrandName string //Vip品牌名 + TkEndDate string //新用户送的券的有效期 +} + +type PostData struct { + Id int `json:"id"` + Command string `json:"command"` + Params map[string]interface{} `json:"params"` +} + +//Burgeon-------------------------------------------------------------------------- +//APP_KEY_2 + tmp + app_ser_md5s +//将密码MD5后和账号时间戳按照 账号 时间戳 密码MD5 拼接 返回 +func (bg *BurgeonConnection) GetSign() (string, string) { + tmp := bg.GetTimeMillisecondString() + md5key := StringToMd5(bg.AppKey) + return tmp, StringToMd5(bg.AppId + tmp + md5key) +} + +//2020-09-26 15:06:23.000 +func (bg *BurgeonConnection) GetTimeMillisecondString() string { + tmp := time.Now().Format("2006-01-02 15:04:05.000") + return tmp +} + +//封装了请求提交函数 只需传入 transactions即可 返回json字符串 +func (bg *BurgeonConnection) Post(comm ...PostData) (string, error) { + data_json_byte, _ := json.Marshal(&comm) + data_json_str := string(data_json_byte) + tmp, sign := bg.GetSign() + req := httplib.Post(bg.ApiUrl) + req.Param("sip_appkey", bg.AppId) + req.Param("sip_timestamp", tmp) + req.Param("sip_sign", sign) + req.Param("transactions", data_json_str) + fmt.Println(data_json_str) + response, err := req.String() + if err != nil { + return "", err + } + code := gjson.Get(response, "0.code").Int() + errmsg := gjson.Get(response, "0.message").String() + if code == 0 { + return errmsg, nil + } else { + return errmsg, errors.New(errmsg) + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..01f581b --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/Wlhet/burgeonsdk + +go 1.16 + +require ( + github.com/astaxie/beego v1.12.3 + github.com/tidwall/gjson v1.6.8 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..5881ba1 --- /dev/null +++ b/go.sum @@ -0,0 +1,163 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk= +github.com/astaxie/beego v1.12.3 h1:SAQkdD2ePye+v8Gn1r4X6IKZM1wd28EyUOVQ3PDSOOQ= +github.com/astaxie/beego v1.12.3/go.mod h1:p3qIm0Ryx7zeBHLljmd7omloyca1s4yu1a8kM1FkpIA= +github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ= +github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= +github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= +github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U= +github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= +github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs= +github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= +github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= +github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= +github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s= +github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= +github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= +github.com/tidwall/gjson v1.6.8 h1:CTmXMClGYPAmln7652e69B7OLXfTi5ABcPPwjIWUv7w= +github.com/tidwall/gjson v1.6.8/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= +github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE= +github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= +github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc= +github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/objectModify.go b/objectModify.go new file mode 100644 index 0000000..ca0fda7 --- /dev/null +++ b/objectModify.go @@ -0,0 +1,16 @@ +package burgeonsdk + +func (this *BurgeonConnection) NewObjectModify() PostData { + return PostData{Id: 2, Command: "ObjectModify", Params: make(map[string]interface{})} +} + +//设置查询的表 +func (this *PostData) ObjectModifySetTable(t string) { + this.Params["table"] = t +} + +//设置返回结果 +//partial_update*boolean缺省值:true,表示仅修改传入的对应的列 +func (this *PostData) ObjectModifySetColumn(k string, v interface{}) { + this.Params[k] = v +} diff --git a/objectcreate.go b/objectcreate.go new file mode 100644 index 0000000..fb6eb51 --- /dev/null +++ b/objectcreate.go @@ -0,0 +1,15 @@ +package burgeonsdk + +func (this *BurgeonConnection) NewObjectCreate() PostData { + return PostData{Id: 2, Command: "ObjectCreate", Params: make(map[string]interface{})} +} + +//设置查询的表 +func (this *PostData) ObjectCreateSetTable(t string) { + this.Params["table"] = t +} + +//设置返回结果 +func (this *PostData) ObjectCreateSetColumn(k string, v interface{}) { + this.Params[k] = v +} diff --git a/publicUtil.go b/publicUtil.go new file mode 100644 index 0000000..9b1c166 --- /dev/null +++ b/publicUtil.go @@ -0,0 +1,111 @@ +package burgeonsdk + +import ( + "crypto/md5" + "crypto/sha1" + "encoding/hex" + "fmt" + "math/rand" + "sort" + "strings" + "time" +) + +func StringToMd5(s string) string { + h := md5.New() + h.Write([]byte(s)) + return hex.EncodeToString(h.Sum(nil)) +} + +//2020-09-26 15:06:23.000 +func GetTimeStringMillisecond() string { + return time.Now().Format("2006-01-02 15:04:05.000") + +} + +//2020-09-26 15:06:23 +func GetTimeStringSecond() string { + tmp := time.Now().Format("2006-01-02 15:04:05") + return tmp +} + +func GetTimeStringDay() string { + tmp := time.Now().Format("20060102") + return tmp +} + +//当月最后一天 +func GetNowLastStringDay() string { + da := time.Now() //当前时间 + nextMonth := da.AddDate(0, 1, 0) //月份加一 + LastDay := nextMonth.AddDate(0, 0, -da.Day()) //减去当前的日数,就是本月最后一天 + return LastDay.Format("20060102") +} + +//当月第一一天 +func GetNowFirstStringDay() string { + da := time.Now() //当前时间 //月份加一 + FirstDay := da.AddDate(0, 0, -da.Day()+1) //减去当前的日数,就是本月最后一天 + return FirstDay.Format("20060102") +} + +//微信获取的生日1999-7-1 需要转换为19990707此类型 +func HandleBirthday(b string) string { + if len(b) < 8 { + return "19900101" + } + rs := strings.Split(b, "-") + year := rs[0] + month := rs[1] + day := rs[2] + if len(month) == 1 { + month = "0" + month + } + if len(day) == 1 { + day = "0" + day + } + return year + month + day +} + +// Substr 截取字符串 start 起点下标 end 终点下标(不包括) +func Substr(str string, start int, end int) string { + rs := []rune(str) + length := len(rs) + + if start < 0 || start > length || end < 0 { + return "" + } + + if end > length { + return string(rs[start:]) + } + return string(rs[start:end]) +} + +// SortSha1 排序并sha1,主要用于计算signature +func SortSha1(s ...string) string { + sort.Strings(s) + h := sha1.New() + h.Write([]byte(strings.Join(s, ""))) + return fmt.Sprintf("%x", h.Sum(nil)) +} + +// SortMd5 排序并md5,主要用于计算sign +func SortMd5(s ...string) string { + sort.Strings(s) + h := md5.New() + h.Write([]byte(strings.Join(s, ""))) + return strings.ToUpper(fmt.Sprintf("%x", h.Sum(nil))) +} + +//随机生成字符串 +func GetRandomString(l int) string { + str := "0123456789abcdefghijklmnopqrstuvwxyz" + bytes := []byte(str) + result := []byte{} + r := rand.New(rand.NewSource(time.Now().UnixNano())) + for i := 0; i < l; i++ { + result = append(result, bytes[r.Intn(len(bytes))]) + } + return string(result) +} diff --git a/query.go b/query.go new file mode 100644 index 0000000..6174584 --- /dev/null +++ b/query.go @@ -0,0 +1,28 @@ +package burgeonsdk + +func (this *BurgeonConnection) NewQuery() PostData { + return PostData{Id: 1, Command: "Query", Params: make(map[string]interface{})} +} + +//设置查询的表 +func (this *PostData) QuerySetTable(t string) { + this.Params["table"] = t +} + +//设置返回结果 +func (this *PostData) QuerySetResult(columns ...string) { + this.Params["columns"] = columns +} + +//设置查询调节 k 条件 v 值 +func (this *PostData) QuerySetCondition(k string, v interface{}) { + pps := make(map[string]interface{}) + pps["column"] = k + pps["condition"] = v + this.Params["params"] = pps +} + +func (this *PostData) QuerySetStartRange(start, rg int) { + this.Params["start"] = start + this.Params["range"] = rg +}