作者 yangfu

init

正在显示 104 个修改的文件 包含 3893 行增加0 行删除
  1 +# Compiled Object codefiles, Static and Dynamic libs (Shared Objects)
  2 +*.o
  3 +*.a
  4 +*.so
  5 +
  6 +# Folders
  7 +_obj
  8 +_test
  9 +
  10 +# Architecture specific extensions/prefixes
  11 +*.[568vq]
  12 +[568vq].out
  13 +
  14 +*.cgo1.go
  15 +*.cgo2.c
  16 +_cgo_defun.c
  17 +_cgo_gotypes.go
  18 +_cgo_export.*
  19 +
  20 +_testmain.go
  21 +
  22 +*.exe
  23 +*.test
  24 +.log
  25 +.idea
  26 +*.tmp
  1 +FROM golang:latest
  2 +MAINTAINER <>
  3 +ENV APP_DIR $GOPATH/src/project
  4 +RUN mkdir -p $APP_DIR
  5 +WORKDIR $APP_DIR/
  6 +COPY ./pkg pkg
  7 +COPY ./conf conf
  8 +COPY ./go.mod go.mod
  9 +COPY ./go.sum go.sum
  10 +COPY ./main.go main.go
  11 +RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
  12 +ENV GO111MODULE on
  13 +ENV GOPROXY https://goproxy.io
  14 +RUN ["go","mod","tidy"]
  15 +RUN ["ls"]
  16 +RUN ["go","build"]
  17 +ENTRYPOINT ["./project"]
  1 +#project
  1 +#!/bin/bash
  2 +export PATH=/root/local/bin:$PATH
  3 +kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
  4 +if [ "$?" == "1" ];then
  5 + kubectl create -f /tmp/dev/project/project.yaml --record
  6 + kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
  7 + if [ "$?" == "0" ];then
  8 + echo "project service install success!"
  9 + else
  10 + echo "project service install fail!"
  11 + fi
  12 + kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
  13 + if [ "$?" == "0" ];then
  14 + echo "project deployment install success!"
  15 + else
  16 + echo "project deployment install fail!"
  17 + fi
  18 +else
  19 + kubectl delete -f /tmp/dev/project/project.yaml
  20 + kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
  21 + while [ "$?" == "0" ]
  22 + do
  23 + kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
  24 + done
  25 + kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
  26 + while [ "$?" == "0" ]
  27 + do
  28 + kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
  29 + done
  30 + kubectl create -f /tmp/dev/project/project.yaml --record
  31 + kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
  32 + if [ "$?" == "0" ];then
  33 + echo "project service update success!"
  34 + else
  35 + echo "project service update fail!"
  36 + fi
  37 + kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
  38 + if [ "$?" == "0" ];then
  39 + echo "project deployment update success!"
  40 + else
  41 + echo "project deployment update fail!"
  42 + fi
  43 +fi
  1 +apiVersion: v1
  2 +kind: Service
  3 +metadata:
  4 + name: project
  5 + namespace: <replace-your-k8s-namespace>
  6 + labels:
  7 + k8s-app: project
  8 +spec:
  9 + ports:
  10 + - name: "http"
  11 + port: 80
  12 + targetPort: 8082
  13 + selector:
  14 + k8s-app: project
  15 +---
  16 +apiVersion: extensions/v1beta1
  17 +kind: Deployment
  18 +metadata:
  19 + name: project
  20 + namespace: <replace-your-k8s-namespace>
  21 + labels:
  22 + k8s-app: project
  23 +spec:
  24 + replicas: 1
  25 + template:
  26 + metadata:
  27 + labels:
  28 + k8s-app: project
  29 + spec:
  30 + affinity:
  31 + nodeAffinity:
  32 + preferredDuringSchedulingIgnoredDuringExecution:
  33 + - preference: {}
  34 + weight: 100
  35 + requiredDuringSchedulingIgnoredDuringExecution:
  36 + nodeSelectorTerms:
  37 + - matchExpressions:
  38 + - key: kubernetes.io/hostname
  39 + operator: In
  40 + values:
  41 + - cn-hangzhou.i-bp1djh1xn7taumbue1ze
  42 + - cn-hangzhou.i-bp1djh1xn7taumbue1zd
  43 + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
  44 + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
  45 + containers:
  46 + - name: project
  47 + image: 192.168.0.243:5000/mmm/project:dev
  48 + imagePullPolicy: Always
  49 + ports:
  50 + - containerPort: 8082
  51 + volumeMounts:
  52 + - mountPath: /opt/logs
  53 + name: accesslogs
  54 + env:
  55 + - name: LOG_LEVEL
  56 + value: "debug"
  57 + - name: ERROR_BASE_CODE
  58 + value: "1"
  59 + - name: ERROR_BASE_CODE_MULTIPLE
  60 + value: "1000"
  61 + volumes:
  62 + - name: accesslogs
  63 + emptyDir: {}
  1 +version: v1
  2 +kind: HttpApi
  3 +metadata:
  4 + service: menu
  5 + path: /menus
  6 + endpoints:
  7 + - method: createMenu
  8 + route:
  9 + post: /
  10 + - method: updateMenu
  11 + route:
  12 + put: /{menuId}
  13 + - method: getMenu
  14 + route:
  15 + get: /{menuId}
  16 + - method: removeMenu
  17 + route:
  18 + delete: /{menuId}
  19 + - method: listMenu
  20 + route:
  21 + get: /
  22 + params:
  23 + - name: offset
  24 + - name: limit
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: count
  5 + description: 匹配数目
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: createAt
  5 + description: 创建时间
  6 + type:
  7 + primitive: datetime
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: deleteAt
  5 + description: 删除时间
  6 + type:
  7 + primitive: datetime
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: limit
  5 + description: 查询限制
  6 + type:
  7 + primitive: int
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: offset
  5 + description: 查询偏离量
  6 + type:
  7 + primitive: int
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: remark
  5 + description: 备注
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: updateAt
  5 + description: 更新时间
  6 + type:
  7 + primitive: datetime
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: companyId
  5 + description: 企业id
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: companyName
  5 + description: 企业名称
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: configCode
  5 + description: 参数编码
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: configId
  5 + description: 系统配置id
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: configLevel
  5 + description: 参数管控层级 (1.平台级 2.系统级 3.功能级)
  6 + type:
  7 + primitive: int
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: configName
  5 + description: 参数名称
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: desc
  5 + description: 参数描述
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: value
  5 + description: 管控值
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: valueType
  5 + description: 参数管控层级 (1.字符 2.数值 3.时间)
  6 + type:
  7 + primitive: int
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: menuId
  5 + description: 菜单编号
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: orgCode
  5 + description: 组织编码
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: orgId
  5 + description: 组织ID
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: orgName
  5 + description: 组织名称
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: roleId
  5 + description: 角色ID
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: roleName
  5 + description: 角色名称
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: status
  5 + description: 用户状态
  6 + type:
  7 + primitive: int
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: usersCode
  5 + description: 用户编号
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: usersCompanyId
  5 + description: 用户公司编号
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: usersId
  5 + description: 用户编号
  6 + type:
  7 + primitive: int64
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: usersName
  5 + description: 用户姓名
  6 + type:
  7 + primitive: string
  1 +version: v1
  2 +kind: Attribute
  3 +metadata:
  4 + name: usersType
  5 + description: 用户类型 : 1:普通用户 2:共创用户 1024:超级管理员
  6 + type:
  7 + primitive: int
  1 +version: v1
  2 +kind: Project
  3 +metadata:
  4 + name: project
  5 + description: 天联企业管理系统
  6 + version: 0.0.1
  7 + repository: gitlab.fjmaimaimai.com/allied-creation/allied-creation-user
  8 + contact:
  9 + name:
  10 + email:
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: app
  5 + description: app项目管理
  6 + attributes:
  7 + - name: appId
  8 + description: appId
  9 + type:
  10 + primitive: int64
  11 + - name: project
  12 + description: 项目标识 ability
  13 + type:
  14 + primitive: string
  15 + - name: app
  16 + description: 应用标识 ability.boss.pad
  17 + type:
  18 + primitive: string
  19 + - name: icon
  20 + description: 图标地址
  21 + type:
  22 + primitive: string
  23 + - name: remark
  24 + description: 备注信息
  25 + type:
  26 + primitive: string
  27 + - ref: createAt
  28 + required: true
  29 + - ref: updateAt
  30 + required: true
  31 + - ref: deleteAt
  32 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: appVersion
  5 + description: App版本管理
  6 + attributes:
  7 + - name: appVersionId
  8 + description: app版本id
  9 + type:
  10 + primitive: int64
  11 + - name: app
  12 + description: 应用
  13 + type:
  14 + schema: app
  15 + - name: os
  16 + description: 设备类型 0:IOS 1:安卓
  17 + type:
  18 + primitive: int
  19 + - name: version
  20 + description: 版本信息
  21 + type:
  22 + schema: appVersionInfo
  23 + - name: remark
  24 + description: 备注信息
  25 + type:
  26 + primitive: string
  27 + - ref: createAt
  28 + required: true
  29 + - ref: updateAt
  30 + required: true
  31 + - ref: deleteAt
  32 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: appVersionInfo
  5 + description: app 版本信息
  6 + attributes:
  7 + - name: versionNo
  8 + description: 版本号
  9 + type:
  10 + primitive: string
  11 + - name: versionName
  12 + description: 版本名称
  13 + type:
  14 + primitive: string
  15 + - name: title
  16 + description: 标题
  17 + type:
  18 + primitive: string
  19 + - name: summary
  20 + description: 版本概要
  21 + type:
  22 + primitive: string
  23 + - name: content
  24 + description: 版本内容
  25 + type:
  26 + primitive: string
  27 + - name: deviceType
  28 + description: 设备类型 0:ios , 1:android
  29 + type:
  30 + primitive: int
  31 + - name: downloadPage
  32 + description: 下载页面
  33 + type:
  34 + primitive: string
  35 + - name: downloadFile
  36 + description: 文件下载地址
  37 + type:
  38 + primitive: string
  39 + - name: updateType
  40 + description: 更新类型 0不需要更新 1是引导更新 2是强制更新
  41 + type:
  42 + primitive: int
  43 + - name: channel
  44 + description: 更新的渠道 当前渠道 0_AppStore、1_fir平台、2_华为、3_小米、4_魅族、5_oppo、6_vivo、7_360、8_百度、9_应用宝、10_其他(使用应用宝地址)
  45 + type:
  46 + array: int
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: company
  5 + description: 企业信息 (base)
  6 + attributes:
  7 + - ref: companyId
  8 + required: true
  9 + - name: companyConfig
  10 + description: 企业配置信息
  11 + type:
  12 + schema: companyConfig
  13 + - name: companyInfo
  14 + description: 企业基本信息
  15 + type:
  16 + schema: companyInfo
  17 + - name: status
  18 + description: 公司状态
  19 + type:
  20 + primitive: int
  21 + - ref: createAt
  22 + required: false
  23 + - ref: updateAt
  24 + required: false
  25 +
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: companyConfig
  5 + description: 公司配置信息
  6 + attributes:
  7 + - name: systemName
  8 + description: 系统名称
  9 + type:
  10 + primitive: string
  11 + - name: theme
  12 + description: 主题
  13 + type:
  14 + primitive: string
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: companyInfo
  5 + description: 公司信息
  6 + attributes:
  7 + - name: companyName
  8 + description: 公司名称
  9 + type:
  10 + primitive: string
  11 + - name: scale
  12 + description: 规模
  13 + type:
  14 + primitive: string
  15 + - name: logo
  16 + description: 公司Logo地址
  17 + type:
  18 + primitive: string
  19 + - name: address
  20 + description: 公司地址
  21 + type:
  22 + primitive: string
  23 + - name: taxpayerCode
  24 + description: 纳税人识别号
  25 + type:
  26 + primitive: string
  27 + - name: businessLicense
  28 + description: 营业执照
  29 + type:
  30 + primitive: string
  31 + - name: industryCategory
  32 + description: 所属行业
  33 + type:
  34 + primitive: string
  35 + - name: contacts
  36 + description: 联系人
  37 + type:
  38 + primitive: string
  39 + - name: registTime
  40 + description: 注册时间
  41 + type:
  42 + primitive: datetime
  43 + - name: registStatus
  44 + description: 注册状态
  45 + type:
  46 + primitive: int
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: config
  5 + description: 系统参数配置
  6 + attributes:
  7 + - ref: configId
  8 + required: true
  9 + - ref: companyId
  10 + required: true
  11 + - ref: configCode
  12 + required: true
  13 + - ref: configName
  14 + required: true
  15 + - ref: configLevel
  16 + required: true
  17 + - ref: valueType
  18 + required: true
  19 + - ref: value
  20 + required: true
  21 + - ref: desc
  22 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: cooperationInfo
  5 + description: 共创信息
  6 + attributes:
  7 + - name: cooperationCompany
  8 + description: 共创公司
  9 + type:
  10 + primitive: string
  11 + - name: cooperationDeadline
  12 + description: 共创到期时间 (yyyy-MM-dd)
  13 + type:
  14 + primitive: datetime
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: credentialAuth
  5 + description: 凭证认证 (base) (停用)
  6 + attributes:
  7 + - name: credential
  8 + description: 凭证
  9 + type:
  10 + primitive: string
  11 + - name: deviceType
  12 + description: 设备类型
  13 + type:
  14 + primitive: string
  15 + - name: expire
  16 + description: 过期时间蹉(unix)
  17 + type:
  18 + primitive: int64
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: customizeMenus
  5 + description: 自定义菜单 (base)(菜单维护)
  6 + attributes:
  7 + - name: customizeMenusId
  8 + description: 自定义菜单id
  9 + type:
  10 + primitive: int64
  11 + - ref: companyId
  12 + required: true
  13 + - name: menuId
  14 + description: 菜单id
  15 + type:
  16 + primitive: int64
  17 + - name: menuName
  18 + description: 菜单名称
  19 + type:
  20 + primitive: string
  21 + - name: menuAlias
  22 + description: 菜单别名
  23 + type:
  24 + primitive: string
  25 + - name: sort
  26 + description: 排序
  27 + type:
  28 + primitive: int
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: dataColumn
  5 + description: 数据列
  6 + attributes:
  7 + - name: dataIndex
  8 + description: 数据列字段代码名称
  9 + type:
  10 + primitive: string
  11 + - name: title
  12 + description: 数据列字段中文描述
  13 + type:
  14 + primitive: string
  15 + - name: sortBy
  16 + description: 默认的排序
  17 + type:
  18 + primitive: int64
  19 + - name: isDefault
  20 + description: 是否是默认配置字段
  21 + type:
  22 + primitive: int
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: dataColumnPerson
  5 + description: 列表设置个人:页面列表数据的输出列的个人配置
  6 + attributes:
  7 + - name: dataColumnPersonId
  8 + description: 数据id
  9 + type:
  10 + primitive: int64
  11 + - name: resource
  12 + description: 资源 (列如表单 user)
  13 + type:
  14 + primitive: string
  15 + - name: columns
  16 + description: 配置的用户显示的字段,例 `["c1","c2"]``
  17 + type:
  18 + array: string
  19 + - name: usersId
  20 + description: 归属的用户id
  21 + type:
  22 + primitive: int64
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: dataColumnSys
  5 + description: 列表设置系统:页面列表数据的输出列的系统全局配置
  6 + attributes:
  7 + - name: dataColumnSysId
  8 + description: 数据id
  9 + type:
  10 + primitive: int64
  11 + - name: resource
  12 + description: 资源 (列如表单 user)
  13 + type:
  14 + primitive: string
  15 + - name: columns
  16 + description: 数据列字段代码名称
  17 + type:
  18 + array: dataColumn
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: dictionary
  5 + description: 字典
  6 + attributes:
  7 + - name: dictionaryId
  8 + description: 字典编号 主键
  9 + type:
  10 + primitive: int
  11 + - name: dictCode
  12 + description: 字典编码
  13 + type:
  14 + primitive: string
  15 + - name: dictName
  16 + description: 字典名称
  17 + type:
  18 + primitive: string
  19 + - name: enableStatus
  20 + description: 启用状态(启用:1 禁用:2)
  21 + type:
  22 + primitive: int
  23 + - name: desc
  24 + description: 备注信息
  25 + type:
  26 + primitive: string
  27 + - name: dictItems
  28 + description: 字典值列表
  29 + type:
  30 + array: dictionaryItem
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: dictionaryItem
  5 + description: 字典明细项
  6 + attributes:
  7 + - name: itemCode
  8 + description: 项编码
  9 + type:
  10 + primitive: string
  11 + - name: itemLabel
  12 + description: 项标签
  13 + type:
  14 + primitive: string
  15 + - name: itemValue
  16 + description:
  17 + type:
  18 + primitive: string
  19 + - name: enableStatus
  20 + description: 启用状态(启用:1 禁用:2)
  21 + type:
  22 + primitive: string
  23 + - name: sort
  24 + description: 显示序号
  25 + type:
  26 + primitive: int
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: ext
  5 + description: 冗余附加数据
  6 + attributes:
  7 + - ref: usersName
  8 + required: true
  9 + - ref: orgName
  10 + required: true
  11 + - name: phone
  12 + description: 手机号
  13 + type:
  14 + primitive: string
  15 + - name: depName
  16 + description: 部门名称
  17 + type:
  18 + primitive: string
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: im
  5 + description: 冗余附加数据
  6 + attributes:
  7 + - name: accid
  8 + description: 网易云信ID
  9 + type:
  10 + primitive: string
  11 + - name: imToken
  12 + description: 网易云信Token
  13 + type:
  14 + primitive: string
  15 + - name: csAccountId
  16 + description: 系统分配客服ID
  17 + type:
  18 + primitive: string
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: menu
  5 + description: 系统菜单
  6 + attributes:
  7 + - ref: menuId
  8 + required: true
  9 + - name: parentId
  10 + description: 父级id
  11 + type:
  12 + primitive: int64
  13 + - name: menuName
  14 + description: 菜单名称
  15 + type:
  16 + primitive: string
  17 + - name: code
  18 + description: 菜单编码 SYSTEM_USER_EDIT / 100101 (字符编码)
  19 + type:
  20 + primitive: string
  21 + - name: accessCode
  22 + description: 权限编码 users:edit
  23 + type:
  24 + primitive: string
  25 + - name: menuType
  26 + description: 菜单类型 (目录catalog、菜单menu、按钮button)
  27 + type:
  28 + primitive: string
  29 + - name: icon
  30 + description: 菜单图标
  31 + type:
  32 + primitive: string
  33 + - name: sort
  34 + description: 排序
  35 + type:
  36 + primitive: int
  37 + - name: remark
  38 + description: 菜单说明
  39 + type:
  40 + primitive: string
  41 + - name: category
  42 + description: 菜单类别 (web:1、app:2)
  43 + type:
  44 + primitive: string
  45 + - name: parentPath
  46 + description: 父级节点路径("0,11,12,")
  47 + type:
  48 + primitive: string
  49 + - name: isPublish
  50 + description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
  51 + type:
  52 + primitive: int
  53 + - name: isSystem
  54 + description: 菜单是否是系统级,[0:否],[1:是],默认否
  55 + type:
  56 + primitive: int
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: org
  5 + description: 组织 organization
  6 + attributes:
  7 + - ref: orgId
  8 + required: true
  9 + - ref: companyId
  10 + required: true
  11 + - ref: createAt
  12 + required: true
  13 + - ref: updateAt
  14 + required: true
  15 + - ref: deleteAt
  16 + required: true
  17 + - ref: orgCode
  18 + required: true
  19 + - ref: orgName
  20 + required: true
  21 + - name: isOrg
  22 + description: 是否是组织
  23 + type:
  24 + primitive: int
  25 + - name: parentId
  26 + description: 父级ID
  27 + type:
  28 + primitive: int64
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: phoneAuth
  5 + description: 手机认证 (base)
  6 + attributes:
  7 + - name: phone
  8 + description: 手机号
  9 + type:
  10 + primitive: string
  11 + - name: password
  12 + description: 密码
  13 + type:
  14 + primitive: string
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: role
  5 + description: 角色 (base)
  6 + attributes:
  7 + - ref: roleId
  8 + required: true
  9 + - ref: companyId
  10 + required: true
  11 + - ref: orgId
  12 + required: true
  13 + - ref: roleName
  14 + required: true
  15 + - name: menuAccess
  16 + description: 菜单权限列表
  17 + type:
  18 + array: int64
  19 + - name: desc
  20 + description: 角色描述
  21 + type:
  22 + primitive: string
  23 + - name: ext
  24 + description: 扩展数据
  25 + type:
  26 + schema: ext
  27 + - ref: createAt
  28 + required: true
  29 + - ref: updateAt
  30 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: users
  5 + description: 用户(base)
  6 + attributes:
  7 + - ref: usersId
  8 + required: true
  9 + - name: usersInfo
  10 + description: 用户信息
  11 + type:
  12 + schema: usersInfo
  13 + - name: phoneAuth
  14 + description: 手机认证
  15 + type:
  16 + schemal: phoneAuth
  17 + - name: im
  18 + description: IM信息
  19 + type:
  20 + schemal: im
  21 + - ref: createAt
  22 + required: true
  23 + - ref: updateAt
  24 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: usersCompany
  5 + description: 用户 (base)
  6 + attributes:
  7 + - ref: usersCompanyId
  8 + required: true
  9 + - ref: companyId
  10 + required: true
  11 + - ref: usersId
  12 + required: true
  13 + - ref: usersType
  14 + required: true
  15 + - ref: usersCode
  16 + required: true
  17 + - name: organization
  18 + description: 组织机构
  19 + type:
  20 + primitive: int64
  21 + - name: department
  22 + description: 所属部门
  23 + type:
  24 + primitive: int64
  25 + - name: usersOrg
  26 + description: 用户关联的组织
  27 + type:
  28 + array: int64
  29 + - name: usersRole
  30 + description: 用户关联的角色
  31 + type:
  32 + array: int64
  33 + - name: collectedMenus
  34 + description: 收藏的菜单(工作台)(菜单编码列表)
  35 + type:
  36 + array: string
  37 + - name: cooperationInfo
  38 + description: 共创信息 (共创用户有效)
  39 + type:
  40 + schema: cooperationInfo
  41 + - name: enableStatus
  42 + description: 启用状态(启用:1 禁用:2)
  43 + type:
  44 + primitive: int
  45 + - name: ext
  46 + description: 扩展数据
  47 + type:
  48 + schema: ext
  49 + - ref: createAt
  50 + required: true
  51 + - ref: updateAt
  52 + required: true
  1 +version: v1
  2 +kind: Schema
  3 +metadata:
  4 + name: usersInfo
  5 + description: 用户信息 (base)
  6 + attributes:
  7 + - ref: usersName
  8 + required: true
  9 + - name: phone
  10 + description: 手机号码
  11 + type:
  12 + primitive: string
  13 + - name: avator
  14 + description: 头像
  15 + type:
  16 + primitive: string
  17 + - name: email
  18 + description: 邮箱
  19 + type:
  20 + primitive: string
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: createMenu
  5 + type: command
  6 + description: 创建菜单服务
  7 + payload:
  8 + - name: parentId
  9 + description: 父级id
  10 + type:
  11 + primitive: int64
  12 + - name: menuName
  13 + description: 菜单名称
  14 + type:
  15 + primitive: string
  16 + required: true
  17 + - name: code
  18 + description: 菜单编码 SYSTEM_USER_EDIT / 100101 (字符编码)
  19 + type:
  20 + primitive: string
  21 + required: true
  22 + - name: accessCode
  23 + description: 权限编码 users:edit
  24 + type:
  25 + primitive: string
  26 + required: true
  27 + - name: menuType
  28 + description: 菜单类型 (目录catalog、菜单menu、按钮button)
  29 + type:
  30 + primitive: string
  31 + required: true
  32 + - name: icon
  33 + description: 菜单图标
  34 + type:
  35 + primitive: string
  36 + - name: sort
  37 + description: 排序
  38 + type:
  39 + primitive: int
  40 + required: true
  41 + - name: remark
  42 + description: 菜单说明
  43 + type:
  44 + primitive: string
  45 + - name: isPublish
  46 + description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
  47 + type:
  48 + primitive: int
  49 + required: true
  50 + result:
  51 + - name: menu
  52 + type:
  53 + schema: menu
  54 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: getMenu
  5 + type: query
  6 + description: 返回菜单服务
  7 + payload:
  8 + - ref: menuId
  9 + required: true
  10 + result:
  11 + - name: menu
  12 + type:
  13 + schema: menu
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: listMenu
  5 + type: query
  6 + description: 返回菜单服务列表
  7 + payload:
  8 + - name: menuCategory
  9 + description: 菜单类别 web app
  10 + required: false
  11 + type:
  12 + primitive: string
  13 + - name: parentId
  14 + description: 菜单父级id 0:查询所有 n:父级id为n的菜单列表
  15 + required: false
  16 + type:
  17 + primitive: int64
  18 + - name: menuName
  19 + description: 菜单名称过滤
  20 + required: false
  21 + type:
  22 + primitive: string
  23 + - ref: offset
  24 + required: true
  25 + - ref: limit
  26 + required: true
  27 + result:
  28 + - ref: count
  29 + required: true
  30 + - name: menus
  31 + type:
  32 + array: menu
  33 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: removeMenu
  5 + type: command
  6 + description: 移除菜单服务
  7 + payload:
  8 + - ref: menuId
  9 + required: true
  10 + result:
  11 + - name: menu
  12 + type:
  13 + schema: menu
  14 + required: true
  1 +version: v1
  2 +kind: Method
  3 +metadata:
  4 + name: updateMenu
  5 + type: command
  6 + description: 更新菜单服务
  7 + payload:
  8 + - ref: menuId
  9 + required: true
  10 + - name: menuName
  11 + description: 菜单名称
  12 + type:
  13 + primitive: string
  14 + required: true
  15 + - name: code
  16 + description: 菜单编码 SYSTEM_USER_EDIT / 100101 (字符编码)
  17 + type:
  18 + primitive: string
  19 + required: true
  20 + - name: accessCode
  21 + description: 权限编码 users:edit
  22 + type:
  23 + primitive: string
  24 + - name: menuType
  25 + description: 菜单类型 (目录catalog、菜单menu、按钮button)
  26 + type:
  27 + primitive: string
  28 + required: true
  29 + - name: icon
  30 + description: 菜单图标
  31 + type:
  32 + primitive: string
  33 + - name: sort
  34 + description: 排序
  35 + type:
  36 + primitive: int
  37 + required: true
  38 + - name: remark
  39 + description: 菜单说明
  40 + type:
  41 + primitive: string
  42 + - name: isPublish
  43 + description: 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
  44 + type:
  45 + primitive: int
  46 + result:
  47 + - name: menu
  48 + type:
  49 + schema: menu
  50 + required: true
  1 +version: v1
  2 +kind: Service
  3 +metadata:
  4 + name: menu
  5 + description: 菜单服务
  1 +module gitlab.fjmaimaimai.com/allied-creation/allied-creation-user
  2 +
  3 +go 1.16
  4 +
  5 +require (
  6 + github.com/ajg/form v1.5.1 // indirect
  7 + github.com/beego/beego/v2 v2.0.1
  8 + github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
  9 + github.com/fatih/structs v1.1.0 // indirect
  10 + github.com/gavv/httpexpect v2.0.0+incompatible
  11 + github.com/go-pg/pg/v10 v10.9.0
  12 + github.com/google/go-querystring v1.1.0 // indirect
  13 + github.com/imkira/go-interpol v1.1.0 // indirect
  14 + github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7
  15 + github.com/mattn/go-colorable v0.1.8 // indirect
  16 + github.com/moul/http2curl v1.0.0 // indirect
  17 + github.com/onsi/ginkgo v1.15.2
  18 + github.com/onsi/gomega v1.11.0
  19 + github.com/sergi/go-diff v1.2.0 // indirect
  20 + github.com/smartystreets/goconvey v1.6.4 // indirect
  21 + github.com/valyala/fasthttp v1.23.0 // indirect
  22 + github.com/xeipuuv/gojsonschema v1.2.0 // indirect
  23 + github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
  24 + github.com/yudai/gojsondiff v1.0.0 // indirect
  25 + github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
  26 + github.com/yudai/pp v2.0.1+incompatible // indirect
  27 +)
  28 +
  29 +replace github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7 => github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34
  1 +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
  2 +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
  3 +github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
  4 +github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
  5 +github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
  6 +github.com/Shopify/sarama v1.25.0 h1:ch1ywjRLjfJtU+EaiJ+l0rWffQ6TRpyYmW4DX7Cb2SU=
  7 +github.com/Shopify/sarama v1.25.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+gmdfj8w=
  8 +github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
  9 +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
  10 +github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
  11 +github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
  12 +github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
  13 +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
  14 +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
  15 +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
  16 +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
  17 +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U=
  18 +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
  19 +github.com/alicebob/miniredis v2.5.0+incompatible h1:yBHoLpsyjupjz3NL3MhKMVkR41j82Yjf3KFv7ApYzUI=
  20 +github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
  21 +github.com/andybalholm/brotli v1.0.1 h1:KqhlKozYbRtJvsPrrEeXcO+N2l6NYT5A2QAFmSULpEc=
  22 +github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
  23 +github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
  24 +github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE=
  25 +github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI=
  26 +github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
  27 +github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
  28 +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
  29 +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
  30 +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
  31 +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
  32 +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
  33 +github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
  34 +github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
  35 +github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
  36 +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
  37 +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
  38 +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
  39 +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
  40 +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
  41 +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
  42 +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
  43 +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
  44 +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
  45 +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
  46 +github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
  47 +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
  48 +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
  49 +github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
  50 +github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
  51 +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
  52 +github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
  53 +github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
  54 +github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
  55 +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
  56 +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
  57 +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
  58 +github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
  59 +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  60 +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
  61 +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  62 +github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4=
  63 +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
  64 +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
  65 +github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU=
  66 +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
  67 +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=
  68 +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
  69 +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
  70 +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
  71 +github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
  72 +github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
  73 +github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
  74 +github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
  75 +github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
  76 +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
  77 +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
  78 +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
  79 +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
  80 +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=
  81 +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
  82 +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
  83 +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
  84 +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
  85 +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
  86 +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
  87 +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
  88 +github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
  89 +github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk=
  90 +github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
  91 +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
  92 +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
  93 +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
  94 +github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=
  95 +github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
  96 +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
  97 +github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
  98 +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
  99 +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
  100 +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
  101 +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
  102 +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
  103 +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
  104 +github.com/go-pg/pg/v10 v10.7.7/go.mod h1:d0w17Xw5x2DtbD/UgB9rnZg3FAck3eDHXff0Srrzuuk=
  105 +github.com/go-pg/pg/v10 v10.9.0 h1:mNIxE7H7/5fHOniVrLgUXNoIgHiJXXvhiNY+PxqtV6k=
  106 +github.com/go-pg/pg/v10 v10.9.0/go.mod h1:rgmTPgHgl5EN2CNKKoMwC7QT62t8BqsdpEkUQuiZMQs=
  107 +github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU=
  108 +github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
  109 +github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
  110 +github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U=
  111 +github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
  112 +github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
  113 +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
  114 +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
  115 +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
  116 +github.com/go-xorm/builder v0.3.4/go.mod h1:KxkQkNN1DpPKTedxXyTQcmH+rXfvk4LZ9SOOBoZBAxw=
  117 +github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
  118 +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
  119 +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
  120 +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
  121 +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
  122 +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
  123 +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
  124 +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
  125 +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
  126 +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
  127 +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  128 +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  129 +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  130 +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
  131 +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
  132 +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
  133 +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
  134 +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
  135 +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
  136 +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
  137 +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
  138 +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
  139 +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
  140 +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  141 +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  142 +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
  143 +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  144 +github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
  145 +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
  146 +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
  147 +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
  148 +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
  149 +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
  150 +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  151 +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  152 +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  153 +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  154 +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
  155 +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  156 +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
  157 +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
  158 +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
  159 +github.com/google/gops v0.3.7/go.mod h1:bj0cwMmX1X4XIJFTjR99R5sCxNssNJ8HebFNvoQlmgY=
  160 +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
  161 +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
  162 +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
  163 +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
  164 +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
  165 +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
  166 +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
  167 +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
  168 +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
  169 +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
  170 +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
  171 +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
  172 +github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0=
  173 +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
  174 +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
  175 +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
  176 +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
  177 +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
  178 +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
  179 +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
  180 +github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
  181 +github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=
  182 +github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
  183 +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
  184 +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM=
  185 +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
  186 +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
  187 +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
  188 +github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
  189 +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
  190 +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
  191 +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
  192 +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
  193 +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
  194 +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
  195 +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
  196 +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
  197 +github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA=
  198 +github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
  199 +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
  200 +github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ=
  201 +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
  202 +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
  203 +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
  204 +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
  205 +github.com/klauspost/compress v1.11.8 h1:difgzQsp5mdAz9v8lm3P/I+EpDKMU/6uTMw1y1FObuo=
  206 +github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
  207 +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
  208 +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
  209 +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
  210 +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
  211 +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
  212 +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
  213 +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
  214 +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
  215 +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
  216 +github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
  217 +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
  218 +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
  219 +github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
  220 +github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
  221 +github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
  222 +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
  223 +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
  224 +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
  225 +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
  226 +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
  227 +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
  228 +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
  229 +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
  230 +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
  231 +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
  232 +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
  233 +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
  234 +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
  235 +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
  236 +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
  237 +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
  238 +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
  239 +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
  240 +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
  241 +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
  242 +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
  243 +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
  244 +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
  245 +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
  246 +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
  247 +github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=
  248 +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
  249 +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
  250 +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
  251 +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
  252 +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
  253 +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
  254 +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
  255 +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
  256 +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
  257 +github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
  258 +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  259 +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  260 +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  261 +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
  262 +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
  263 +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
  264 +github.com/onsi/ginkgo v1.15.2 h1:l77YT15o814C2qVL47NOyjV/6RbaP7kKdrvZnxQ3Org=
  265 +github.com/onsi/ginkgo v1.15.2/go.mod h1:Dd6YFfwBW84ETqqtL0CPyPXillHgY6XhQH3uuCCTr/o=
  266 +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
  267 +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
  268 +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
  269 +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
  270 +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
  271 +github.com/onsi/gomega v1.11.0 h1:+CqWgvj0OZycCaqclBD1pxKHAU+tOkHmQIWvDHq2aug=
  272 +github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg=
  273 +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
  274 +github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
  275 +github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
  276 +github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
  277 +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
  278 +github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
  279 +github.com/pierrec/lz4 v2.5.1+incompatible h1:Yq0up0149Hh5Ekhm/91lgkZuD1ZDnXNM26bycpTzYBM=
  280 +github.com/pierrec/lz4 v2.5.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
  281 +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  282 +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  283 +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
  284 +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  285 +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
  286 +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
  287 +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
  288 +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
  289 +github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
  290 +github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
  291 +github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
  292 +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
  293 +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  294 +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  295 +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
  296 +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  297 +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
  298 +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
  299 +github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
  300 +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
  301 +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
  302 +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
  303 +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
  304 +github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
  305 +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
  306 +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
  307 +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
  308 +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
  309 +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
  310 +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
  311 +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
  312 +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
  313 +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
  314 +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
  315 +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
  316 +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
  317 +github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
  318 +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
  319 +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
  320 +github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
  321 +github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
  322 +github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
  323 +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
  324 +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
  325 +github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
  326 +github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
  327 +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
  328 +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
  329 +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
  330 +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
  331 +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
  332 +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
  333 +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
  334 +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
  335 +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
  336 +github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
  337 +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  338 +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  339 +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
  340 +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
  341 +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
  342 +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
  343 +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
  344 +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
  345 +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
  346 +github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
  347 +github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
  348 +github.com/tal-tech/go-zero v1.0.27 h1:QMIbaTxibMc/OsO5RTAuKZ8ndbl2dGN6pITQEtp2x/A=
  349 +github.com/tal-tech/go-zero v1.0.27/go.mod h1:JtNXlsh/CgeIHyQnt5C5M2IcSevW7V0NAnqO93TQgm8=
  350 +github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34 h1:9iDNyYbfpv5KLWDLpDywD/aIODg+PNnwn+v9on7KGlE=
  351 +github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34/go.mod h1:KT8WFA2LPo5zVKbomCR6HocO4prnIY9DUVGekA3Ifo4=
  352 +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
  353 +github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
  354 +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
  355 +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
  356 +github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
  357 +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
  358 +github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
  359 +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
  360 +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
  361 +github.com/valyala/fasthttp v1.23.0 h1:0ufwSD9BhWa6f8HWdmdq4FHQ23peRo3Ng/Qs8m5NcFs=
  362 +github.com/valyala/fasthttp v1.23.0/go.mod h1:0mw2RjXGOzxf4NL2jni3gUQ7LfjjUSiG5sskOUUSEpU=
  363 +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
  364 +github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
  365 +github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
  366 +github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM=
  367 +github.com/vmihailenco/msgpack/v5 v5.3.0 h1:8G3at/kelmBKeHY6d6cKnGsYO3BLn+uubitdOtOhyNI=
  368 +github.com/vmihailenco/msgpack/v5 v5.3.0/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
  369 +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc=
  370 +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
  371 +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
  372 +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
  373 +github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
  374 +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
  375 +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
  376 +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
  377 +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
  378 +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
  379 +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
  380 +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
  381 +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
  382 +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
  383 +github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
  384 +github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY=
  385 +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=
  386 +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
  387 +github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
  388 +github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
  389 +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
  390 +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
  391 +github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=
  392 +github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
  393 +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
  394 +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
  395 +github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
  396 +github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0=
  397 +github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
  398 +go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
  399 +go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM=
  400 +go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
  401 +go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
  402 +go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng=
  403 +go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg=
  404 +go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
  405 +go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg=
  406 +go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc=
  407 +go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
  408 +go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1rU+ip2v9Q=
  409 +go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA=
  410 +go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
  411 +go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc=
  412 +go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg=
  413 +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
  414 +go.uber.org/automaxprocs v1.3.0 h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0=
  415 +go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA=
  416 +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
  417 +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
  418 +go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
  419 +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
  420 +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  421 +golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  422 +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
  423 +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
  424 +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  425 +golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  426 +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  427 +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
  428 +golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
  429 +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
  430 +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
  431 +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
  432 +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
  433 +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
  434 +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
  435 +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
  436 +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
  437 +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
  438 +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
  439 +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
  440 +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
  441 +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
  442 +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
  443 +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
  444 +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
  445 +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  446 +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  447 +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  448 +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  449 +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  450 +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  451 +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
  452 +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
  453 +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  454 +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  455 +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  456 +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  457 +golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  458 +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  459 +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
  460 +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
  461 +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  462 +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  463 +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  464 +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  465 +golang.org/x/net v0.0.0-20210226101413-39120d07d75e/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
  466 +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
  467 +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
  468 +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
  469 +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  470 +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  471 +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  472 +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  473 +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  474 +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  475 +golang.org/x/sys v0.0.0-20171017063910-8dbc5d05d6ed/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  476 +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  477 +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  478 +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  479 +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  480 +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  481 +golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  482 +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  483 +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  484 +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  485 +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  486 +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  487 +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  488 +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  489 +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  490 +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  491 +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  492 +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  493 +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  494 +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  495 +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  496 +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  497 +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  498 +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  499 +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  500 +golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  501 +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  502 +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  503 +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  504 +golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  505 +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  506 +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc=
  507 +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  508 +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
  509 +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
  510 +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
  511 +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
  512 +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
  513 +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
  514 +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
  515 +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
  516 +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
  517 +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
  518 +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  519 +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  520 +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  521 +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  522 +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
  523 +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
  524 +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
  525 +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
  526 +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
  527 +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
  528 +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  529 +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  530 +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  531 +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  532 +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  533 +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
  534 +golang.org/x/tools v0.0.0-20200410132612-ae9902aceb98/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
  535 +golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
  536 +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE=
  537 +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
  538 +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  539 +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  540 +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  541 +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
  542 +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  543 +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
  544 +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
  545 +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
  546 +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
  547 +google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
  548 +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
  549 +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
  550 +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
  551 +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
  552 +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
  553 +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
  554 +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
  555 +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
  556 +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
  557 +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
  558 +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
  559 +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
  560 +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
  561 +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
  562 +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  563 +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  564 +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  565 +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
  566 +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
  567 +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
  568 +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
  569 +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  570 +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  571 +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  572 +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
  573 +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  574 +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
  575 +gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
  576 +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
  577 +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
  578 +gopkg.in/h2non/gock.v1 v1.0.15 h1:SzLqcIlb/fDfg7UvukMpNcWsu7sI5tWwL+KCATZqks0=
  579 +gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
  580 +gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=
  581 +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
  582 +gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=
  583 +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q=
  584 +gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI=
  585 +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4=
  586 +gopkg.in/jcmturner/gokrb5.v7 v7.2.3 h1:hHMV/yKPwMnJhPuPx7pH2Uw/3Qyf+thJYlisUc44010=
  587 +gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM=
  588 +gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=
  589 +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
  590 +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
  591 +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
  592 +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
  593 +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
  594 +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
  595 +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  596 +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  597 +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  598 +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  599 +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  600 +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  601 +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  602 +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
  603 +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
  604 +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
  605 +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
  606 +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
  607 +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
  608 +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
  609 +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
  610 +honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
  611 +mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w=
  612 +mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ=
  613 +rsc.io/goversion v1.0.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo=
  614 +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
  615 +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
  616 +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
  617 +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
  1 +package main
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  6 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/redis"
  7 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/port/beego"
  8 +)
  9 +
  10 +func main() {
  11 + web.Run()
  12 +}
  1 +package factory
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/transaction/pg"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/repository"
  7 +)
  8 +
  9 +func CreateMenuRepository(options map[string]interface{}) (domain.MenuRepository, error) {
  10 + var transactionContext *pg.TransactionContext
  11 + if value, ok := options["transactionContext"]; ok {
  12 + transactionContext = value.(*pg.TransactionContext)
  13 + }
  14 + return repository.NewMenuRepository(transactionContext)
  15 +}
  1 +package factory
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/core/application"
  5 + pG "github.com/linmadan/egglib-go/transaction/pg"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  7 +)
  8 +
  9 +func CreateTransactionContext(options map[string]interface{}) (application.TransactionContext, error) {
  10 + return pG.NewPGTransactionContext(pg.DB), nil
  11 +}
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 +)
  8 +
  9 +type CreateMenuCommand struct {
  10 + // 父级id
  11 + ParentId int64 `json:"parentId,omitempty"`
  12 + // 菜单名称
  13 + MenuName string `json:"menuName" valid:"Required"`
  14 + // 菜单编码 SYSTEM_USER_EDIT / 100101 (字符编码)
  15 + Code string `json:"code" valid:"Required"`
  16 + // 权限编码 users:edit
  17 + AccessCode string `json:"accessCode"`
  18 + // 菜单类型 (目录catalog、菜单menu、按钮button)
  19 + MenuType string `json:"menuType" valid:"Required"`
  20 + // 菜单图标
  21 + Icon string `json:"icon,omitempty"`
  22 + // 排序
  23 + Sort int `json:"sort" valid:"Required"`
  24 + // 菜单说明
  25 + Desc string `json:"desc,omitempty"`
  26 + // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
  27 + IsPublish int `json:"isPublish"`
  28 +}
  29 +
  30 +func (createMenuCommand *CreateMenuCommand) Valid(validation *validation.Validation) {
  31 +
  32 +}
  33 +
  34 +func (createMenuCommand *CreateMenuCommand) ValidateCommand() error {
  35 + valid := validation.Validation{}
  36 + b, err := valid.Valid(createMenuCommand)
  37 + if err != nil {
  38 + return err
  39 + }
  40 + if !b {
  41 + for _, validErr := range valid.Errors {
  42 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  43 + }
  44 + }
  45 + return nil
  46 +}
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 +)
  8 +
  9 +type RemoveMenuCommand struct {
  10 + // 菜单编号
  11 + MenuId int64 `json:"menuId" valid:"Required"`
  12 +}
  13 +
  14 +func (removeMenuCommand *RemoveMenuCommand) Valid(validation *validation.Validation) {
  15 +
  16 +}
  17 +
  18 +func (removeMenuCommand *RemoveMenuCommand) ValidateCommand() error {
  19 + valid := validation.Validation{}
  20 + b, err := valid.Valid(removeMenuCommand)
  21 + if err != nil {
  22 + return err
  23 + }
  24 + if !b {
  25 + for _, validErr := range valid.Errors {
  26 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  27 + }
  28 + }
  29 + return nil
  30 +}
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 +)
  8 +
  9 +type UpdateMenuCommand struct {
  10 + // 菜单编号
  11 + MenuId int64 `json:"menuId" valid:"Required"`
  12 + // 父级id
  13 + ParentId int64 `json:"parentId,omitempty"`
  14 + // 菜单名称
  15 + MenuName string `json:"menuName" valid:"Required"`
  16 + // 菜单编码 SYSTEM_USER_EDIT / 100101 (字符编码)
  17 + Code string `json:"code" valid:"Required"`
  18 + // 权限编码 users:edit
  19 + AccessCode string `json:"accessCode,omitempty"`
  20 + // 菜单类型 (目录catalog、菜单menu、按钮button)
  21 + MenuType string `json:"menuType" valid:"Required"`
  22 + // 菜单图标
  23 + Icon string `json:"icon,omitempty"`
  24 + // 排序
  25 + Sort int `json:"sort" valid:"Required"`
  26 + // 菜单说明
  27 + Desc string `json:"desc,omitempty"`
  28 + // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
  29 + IsPublish int `json:"isPublish,omitempty"`
  30 +}
  31 +
  32 +func (updateMenuCommand *UpdateMenuCommand) Valid(validation *validation.Validation) {
  33 +
  34 +}
  35 +
  36 +func (updateMenuCommand *UpdateMenuCommand) ValidateCommand() error {
  37 + valid := validation.Validation{}
  38 + b, err := valid.Valid(updateMenuCommand)
  39 + if err != nil {
  40 + return err
  41 + }
  42 + if !b {
  43 + for _, validErr := range valid.Errors {
  44 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  45 + }
  46 + }
  47 + return nil
  48 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 +)
  8 +
  9 +type GetMenuQuery struct {
  10 + // 菜单编号
  11 + MenuId int64 `json:"menuId" valid:"Required"`
  12 +}
  13 +
  14 +func (getMenuQuery *GetMenuQuery) Valid(validation *validation.Validation) {
  15 +
  16 +}
  17 +
  18 +func (getMenuQuery *GetMenuQuery) ValidateQuery() error {
  19 + valid := validation.Validation{}
  20 + b, err := valid.Valid(getMenuQuery)
  21 + if err != nil {
  22 + return err
  23 + }
  24 + if !b {
  25 + for _, validErr := range valid.Errors {
  26 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  27 + }
  28 + }
  29 + return nil
  30 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 +)
  8 +
  9 +type ListMenuQuery struct {
  10 + // 菜单类别 web app
  11 + MenuCategory string `json:"menuCategory,omitempty"`
  12 + // 菜单父级id 0:查询所有 n:parent_id为n的菜单列表
  13 + ParentId int64 `json:"parentId,omitempty"`
  14 + // 菜单名称过滤
  15 + MenuName string `json:"menuName,omitempty"`
  16 + // 结构类型 树型:tree 列表型:list
  17 + StructType string `json:"structType,omitempty"`
  18 + // 查询偏离量
  19 + Offset int `json:"offset"`
  20 + // 查询限制
  21 + Limit int `json:"limit" valid:"Required"`
  22 +}
  23 +
  24 +func (listMenuQuery *ListMenuQuery) Valid(validation *validation.Validation) {
  25 +
  26 +}
  27 +
  28 +func (listMenuQuery *ListMenuQuery) ValidateQuery() error {
  29 + valid := validation.Validation{}
  30 + b, err := valid.Valid(listMenuQuery)
  31 + if err != nil {
  32 + return err
  33 + }
  34 + if !b {
  35 + for _, validErr := range valid.Errors {
  36 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  37 + }
  38 + }
  39 + return nil
  40 +}
  1 +package service
  2 +
  3 +import (
  4 + "fmt"
  5 + "github.com/linmadan/egglib-go/core/application"
  6 + "github.com/linmadan/egglib-go/utils/tool_funs"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/factory"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/menu/command"
  9 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/menu/query"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/common"
  12 + "strconv"
  13 +)
  14 +
  15 +// 菜单服务
  16 +type MenuService struct {
  17 +}
  18 +
  19 +// 创建菜单服务
  20 +func (menuService *MenuService) CreateMenu(createMenuCommand *command.CreateMenuCommand) (interface{}, error) {
  21 + if err := createMenuCommand.ValidateCommand(); err != nil {
  22 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  23 + }
  24 + transactionContext, err := factory.CreateTransactionContext(nil)
  25 + if err != nil {
  26 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  27 + }
  28 + if err := transactionContext.StartTransaction(); err != nil {
  29 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  30 + }
  31 + defer func() {
  32 + transactionContext.RollbackTransaction()
  33 + }()
  34 + newMenu := &domain.Menu{
  35 + ParentId: createMenuCommand.ParentId,
  36 + MenuName: createMenuCommand.MenuName,
  37 + Code: createMenuCommand.Code,
  38 + AccessCode: createMenuCommand.AccessCode,
  39 + MenuType: createMenuCommand.MenuType,
  40 + Icon: createMenuCommand.Icon,
  41 + Sort: createMenuCommand.Sort,
  42 + Remark: createMenuCommand.Desc,
  43 + IsPublish: createMenuCommand.IsPublish,
  44 + }
  45 + var menuRepository domain.MenuRepository
  46 + if value, err := factory.CreateMenuRepository(map[string]interface{}{
  47 + "transactionContext": transactionContext,
  48 + }); err != nil {
  49 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  50 + } else {
  51 + menuRepository = value
  52 + }
  53 + // 1.菜单类型验证
  54 + if newMenu.ValidMenuType() {
  55 + return nil, application.ThrowError(application.ARG_ERROR, domain.ErrorMenuType.Error())
  56 + }
  57 + // 2.菜单编码验证
  58 + if menu, err := menuRepository.FindOne(map[string]interface{}{"code": createMenuCommand.Code}); err == nil && menu != nil {
  59 + return nil, application.ThrowError(application.ARG_ERROR, fmt.Sprintf("菜单编码:%v已重复,请重新输入", createMenuCommand.Code))
  60 + }
  61 + // 3.更新菜单路径
  62 + if newMenu.ParentId > 0 {
  63 + if pMenu, err := menuRepository.FindOne(map[string]interface{}{"menuId": newMenu.ParentId}); err != nil {
  64 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "父级菜单不存在")
  65 + } else {
  66 + newMenu.ParentPath = pMenu.GetParentPath()
  67 + newMenu.Category = pMenu.GetCategory()
  68 + }
  69 + }
  70 + // 4.保存菜单项
  71 + if menu, err := menuRepository.Save(newMenu); err != nil {
  72 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  73 + } else {
  74 + if err := transactionContext.CommitTransaction(); err != nil {
  75 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  76 + }
  77 + return menu, nil
  78 + }
  79 +}
  80 +
  81 +// 返回菜单服务
  82 +func (menuService *MenuService) GetMenu(getMenuQuery *query.GetMenuQuery) (interface{}, error) {
  83 + if err := getMenuQuery.ValidateQuery(); err != nil {
  84 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  85 + }
  86 + transactionContext, err := factory.CreateTransactionContext(nil)
  87 + if err != nil {
  88 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  89 + }
  90 + if err := transactionContext.StartTransaction(); err != nil {
  91 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  92 + }
  93 + defer func() {
  94 + transactionContext.RollbackTransaction()
  95 + }()
  96 + var menuRepository domain.MenuRepository
  97 + if value, err := factory.CreateMenuRepository(map[string]interface{}{
  98 + "transactionContext": transactionContext,
  99 + }); err != nil {
  100 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  101 + } else {
  102 + menuRepository = value
  103 + }
  104 + menu, err := menuRepository.FindOne(map[string]interface{}{"menuId": getMenuQuery.MenuId})
  105 + if err != nil {
  106 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  107 + }
  108 + if menu == nil {
  109 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(getMenuQuery.MenuId)))
  110 + } else {
  111 + if err := transactionContext.CommitTransaction(); err != nil {
  112 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  113 + }
  114 + return menu, nil
  115 + }
  116 +}
  117 +
  118 +// 返回菜单服务列表
  119 +func (menuService *MenuService) ListMenu(listMenuQuery *query.ListMenuQuery) (interface{}, error) {
  120 + if err := listMenuQuery.ValidateQuery(); err != nil {
  121 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  122 + }
  123 + transactionContext, err := factory.CreateTransactionContext(nil)
  124 + if err != nil {
  125 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  126 + }
  127 + if err := transactionContext.StartTransaction(); err != nil {
  128 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  129 + }
  130 + defer func() {
  131 + transactionContext.RollbackTransaction()
  132 + }()
  133 + var menuRepository domain.MenuRepository
  134 + if value, err := factory.CreateMenuRepository(map[string]interface{}{
  135 + "transactionContext": transactionContext,
  136 + }); err != nil {
  137 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  138 + } else {
  139 + menuRepository = value
  140 + }
  141 + queryOptions := common.SimpleStructToMap(listMenuQuery)
  142 + if len(listMenuQuery.MenuCategory) > 0 {
  143 + queryOptions["code"] = ""
  144 + if m, e := menuRepository.FindOne(map[string]interface{}{"code": listMenuQuery.MenuCategory}); e == nil && m != nil {
  145 + queryOptions["category"] = strconv.Itoa(int(m.MenuId))
  146 + }
  147 + }
  148 + if count, menus, err := menuRepository.Find(queryOptions); err != nil {
  149 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  150 + } else {
  151 + if err := transactionContext.CommitTransaction(); err != nil {
  152 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  153 + }
  154 + // 树形返回
  155 + if listMenuQuery.StructType == domain.StructTree {
  156 + var treeNodes = make([]domain.TreeNode, len(menus))
  157 + for i := 0; i < len(menus); i++ {
  158 + treeNodes[i] = menus[i]
  159 + }
  160 + return map[string]interface{}{
  161 + "count": count,
  162 + "menus": domain.NewTrees(treeNodes).Nodes,
  163 + }, nil
  164 + }
  165 + // 列表返回
  166 + return map[string]interface{}{
  167 + "count": count,
  168 + "menus": menus,
  169 + }, nil
  170 + }
  171 +}
  172 +
  173 +// 移除菜单服务
  174 +func (menuService *MenuService) RemoveMenu(removeMenuCommand *command.RemoveMenuCommand) (interface{}, error) {
  175 + if err := removeMenuCommand.ValidateCommand(); err != nil {
  176 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  177 + }
  178 + transactionContext, err := factory.CreateTransactionContext(nil)
  179 + if err != nil {
  180 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  181 + }
  182 + if err := transactionContext.StartTransaction(); err != nil {
  183 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  184 + }
  185 + defer func() {
  186 + transactionContext.RollbackTransaction()
  187 + }()
  188 + var menuRepository domain.MenuRepository
  189 + if value, err := factory.CreateMenuRepository(map[string]interface{}{
  190 + "transactionContext": transactionContext,
  191 + }); err != nil {
  192 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  193 + } else {
  194 + menuRepository = value
  195 + }
  196 + // 1.节点是否存在
  197 + menu, err := menuRepository.FindOne(map[string]interface{}{"menuId": removeMenuCommand.MenuId})
  198 + if err != nil {
  199 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  200 + }
  201 + if menu == nil {
  202 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeMenuCommand.MenuId)))
  203 + }
  204 + // 2. 是否存在子节点
  205 + if m, err := menuRepository.FindOne(map[string]interface{}{"parentId": menu.MenuId}); err == nil && m != nil {
  206 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "下级菜单不为空")
  207 + }
  208 + if menu, err := menuRepository.Remove(menu); err != nil {
  209 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  210 + } else {
  211 + if err := transactionContext.CommitTransaction(); err != nil {
  212 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  213 + }
  214 + return menu, nil
  215 + }
  216 +}
  217 +
  218 +// 更新菜单服务
  219 +func (menuService *MenuService) UpdateMenu(updateMenuCommand *command.UpdateMenuCommand) (interface{}, error) {
  220 + if err := updateMenuCommand.ValidateCommand(); err != nil {
  221 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  222 + }
  223 + transactionContext, err := factory.CreateTransactionContext(nil)
  224 + if err != nil {
  225 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  226 + }
  227 + if err := transactionContext.StartTransaction(); err != nil {
  228 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  229 + }
  230 + defer func() {
  231 + transactionContext.RollbackTransaction()
  232 + }()
  233 + var menuRepository domain.MenuRepository
  234 + if value, err := factory.CreateMenuRepository(map[string]interface{}{
  235 + "transactionContext": transactionContext,
  236 + }); err != nil {
  237 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  238 + } else {
  239 + menuRepository = value
  240 + }
  241 + menu, err := menuRepository.FindOne(map[string]interface{}{"menuId": updateMenuCommand.MenuId})
  242 + if err != nil {
  243 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  244 + }
  245 + if menu == nil {
  246 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateMenuCommand.MenuId)))
  247 + }
  248 + // 1.验证code是否有重复的情况
  249 + if menu.Code != updateMenuCommand.Code {
  250 + if m, e := menuRepository.FindOne(map[string]interface{}{"code": updateMenuCommand.Code}); e == nil && m.MenuId != menu.MenuId {
  251 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  252 + }
  253 + }
  254 + // 2.验证父级节点是否有发生更新
  255 + if updateMenuCommand.ParentId != menu.ParentId && (updateMenuCommand.ParentId != 0 && menu.ParentId != 0) {
  256 + var oldParentFullPath, newParentFullPath = menu.GetFullPath(), menu.GetFullPath()
  257 + var oldParentPath = menu.ParentPath
  258 + if pMenu, err := menuRepository.FindOne(map[string]interface{}{"menuId": updateMenuCommand.ParentId}); err != nil {
  259 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  260 + } else {
  261 + newParentFullPath = pMenu.GetParentPath()
  262 + menu.ParentPath = newParentFullPath
  263 + }
  264 + // 父级目录不一致时,联动更新其他的子节点的父级目录
  265 + if oldParentFullPath != newParentFullPath {
  266 + if _, menus, err := menuRepository.Find(map[string]interface{}{"parentPath": oldParentFullPath}); err != nil {
  267 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  268 + } else {
  269 + for i := range menus {
  270 + if menus[i].ParentPath == oldParentPath {
  271 + continue
  272 + }
  273 + menus[i].UpdateParentPath(oldParentPath, newParentFullPath)
  274 + if _, err := menuRepository.Save(menus[i]); err != nil {
  275 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  276 + }
  277 + }
  278 + }
  279 + }
  280 + }
  281 + if err := menu.Update(tool_funs.SimpleStructToMap(updateMenuCommand)); err != nil {
  282 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  283 + }
  284 + if menu, err := menuRepository.Save(menu); err != nil {
  285 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  286 + } else {
  287 + if err := transactionContext.CommitTransaction(); err != nil {
  288 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  289 + }
  290 + return menu, nil
  291 + }
  292 +}
  293 +
  294 +func NewMenuService(options map[string]interface{}) *MenuService {
  295 + newMenuService := &MenuService{}
  296 + return newMenuService
  297 +}
  1 +package constant
  2 +
  3 +import "os"
  4 +
  5 +const SERVICE_NAME = "terms.base"
  6 +
  7 +var LOG_LEVEL = "debug"
  8 +var EnableCaching = false
  9 +
  10 +func init() {
  11 + if os.Getenv("LOG_LEVEL") != "" {
  12 + LOG_LEVEL = os.Getenv("LOG_LEVEL")
  13 + }
  14 +}
  1 +package constant
  2 +
  3 +import "os"
  4 +
  5 +var POSTGRESQL_DB_NAME = "terms"
  6 +var POSTGRESQL_USER = "postgres"
  7 +var POSTGRESQL_PASSWORD = "123456"
  8 +var POSTGRESQL_HOST = "127.0.0.1"
  9 +var POSTGRESQL_PORT = "5432"
  10 +var DISABLE_CREATE_TABLE = false
  11 +var DISABLE_SQL_GENERATE_PRINT = false
  12 +
  13 +func init() {
  14 + if os.Getenv("POSTGRESQL_DB_NAME") != "" {
  15 + POSTGRESQL_DB_NAME = os.Getenv("POSTGRESQL_DB_NAME")
  16 + }
  17 + if os.Getenv("POSTGRESQL_USER") != "" {
  18 + POSTGRESQL_USER = os.Getenv("POSTGRESQL_USER")
  19 + }
  20 + if os.Getenv("POSTGRESQL_PASSWORD") != "" {
  21 + POSTGRESQL_PASSWORD = os.Getenv("POSTGRESQL_PASSWORD")
  22 + }
  23 + if os.Getenv("POSTGRESQL_HOST") != "" {
  24 + POSTGRESQL_HOST = os.Getenv("POSTGRESQL_HOST")
  25 + }
  26 + if os.Getenv("POSTGRESQL_PORT") != "" {
  27 + POSTGRESQL_PORT = os.Getenv("POSTGRESQL_PORT")
  28 + }
  29 + if os.Getenv("DISABLE_CREATE_TABLE") != "" {
  30 + DISABLE_CREATE_TABLE = true
  31 + }
  32 + if os.Getenv("DISABLE_SQL_GENERATE_PRINT") != "" {
  33 + DISABLE_SQL_GENERATE_PRINT = true
  34 + }
  35 +}
  1 +package constant
  2 +
  3 +import "os"
  4 +
  5 +var REDIS_HOST = "127.0.0.1"
  6 +var REDIS_PORT = "6379"
  7 +var REDIS_AUTH = ""
  8 +
  9 +func init() {
  10 + if os.Getenv("REDIS_HOST") != "" {
  11 + REDIS_HOST = os.Getenv("REDIS_HOST")
  12 + REDIS_AUTH = os.Getenv("REDIS_AUTH")
  13 + }
  14 + if os.Getenv("REDIS_PORT") != "" {
  15 + REDIS_PORT = os.Getenv("REDIS_PORT")
  16 + }
  17 + if _, ok := os.LookupEnv("REDIS_AUTH"); ok {
  18 + REDIS_AUTH = os.Getenv("REDIS_AUTH")
  19 + }
  20 +}
  1 +package domain
  2 +
  3 +// 冗余附加数据
  4 +type Im struct {
  5 + // 网易云信ID
  6 + Accid string `json:"accid"`
  7 + // 网易云信Token
  8 + ImToken string `json:"imToken"`
  9 + // 系统分配客服ID
  10 + CsAccountId string `json:"csAccountId"`
  11 +}
  1 +package domain
  2 +
  3 +import (
  4 + "errors"
  5 + "fmt"
  6 + "strconv"
  7 + "strings"
  8 +)
  9 +
  10 +const PathSegment = ","
  11 +
  12 +var (
  13 + Catalog MenuType = "catalog" // 目录
  14 + Menu_ MenuType = "menu" // 菜单
  15 + Button MenuType = "button" // 按钮
  16 +)
  17 +
  18 +var (
  19 + ErrorMenuType = errors.New(fmt.Sprintf("菜单类型有误 可选值 %v、%v、%v", Catalog, Menu_, Button))
  20 +)
  21 +
  22 +// 菜单类型
  23 +type MenuType string
  24 +
  25 +// 系统菜单
  26 +type Menu struct {
  27 + // 菜单编号
  28 + MenuId int64 `json:"menuId"`
  29 + // 父级id
  30 + ParentId int64 `json:"parentId"`
  31 + // 菜单名称
  32 + MenuName string `json:"menuName"`
  33 + // 菜单编码 SYSTEM_USER_EDIT / 100101 (字符编码)
  34 + Code string `json:"code"`
  35 + // 权限编码 users:edit
  36 + AccessCode string `json:"accessCode"`
  37 + // 菜单类型 (目录catalog、菜单menu、按钮button)
  38 + MenuType string `json:"menuType"`
  39 + // 菜单图标
  40 + Icon string `json:"icon"`
  41 + // 排序
  42 + Sort int `json:"sort"`
  43 + // 菜单说明
  44 + Remark string `json:"remark"`
  45 + // 菜单类别 (web:1、app:2)
  46 + Category string `json:"category"`
  47 + // 路径节点路径("0,11,12,")
  48 + ParentPath string `json:"parentPath"`
  49 + // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
  50 + IsPublish int `json:"isPublish"`
  51 + // 菜单是否是系统级,[0:否],[1:是],默认否
  52 + IsSystem int `json:"isSystem"`
  53 +}
  54 +
  55 +type MenuRepository interface {
  56 + Save(menu *Menu) (*Menu, error)
  57 + Remove(menu *Menu) (*Menu, error)
  58 + FindOne(queryOptions map[string]interface{}) (*Menu, error)
  59 + Find(queryOptions map[string]interface{}) (int64, []*Menu, error)
  60 +}
  61 +
  62 +func (menu *Menu) Identify() interface{} {
  63 + if menu.MenuId == 0 {
  64 + return nil
  65 + }
  66 + return menu.MenuId
  67 +}
  68 +
  69 +func (menu *Menu) Update(data map[string]interface{}) error {
  70 + if parentId, ok := data["parentId"]; ok {
  71 + menu.ParentId = parentId.(int64)
  72 + }
  73 + if menuName, ok := data["menuName"]; ok {
  74 + menu.MenuName = menuName.(string)
  75 + }
  76 + if code, ok := data["code"]; ok {
  77 + menu.Code = code.(string)
  78 + }
  79 + if accessCode, ok := data["accessCode"]; ok {
  80 + menu.AccessCode = accessCode.(string)
  81 + }
  82 + if menuType, ok := data["menuType"]; ok {
  83 + menu.MenuType = menuType.(string)
  84 + }
  85 + if icon, ok := data["icon"]; ok {
  86 + menu.Icon = icon.(string)
  87 + }
  88 + if sort, ok := data["sort"]; ok {
  89 + menu.Sort = sort.(int)
  90 + }
  91 + if desc, ok := data["desc"]; ok {
  92 + menu.Remark = desc.(string)
  93 + }
  94 + //if category, ok := data["category"]; ok {
  95 + // menu.Category = category.(string)
  96 + //}
  97 + //if fullPath, ok := data["fullPath"]; ok {
  98 + // menu.ParentPath = parentPath.(string)
  99 + //}
  100 + if isPublish, ok := data["isPublish"]; ok {
  101 + menu.IsPublish = isPublish.(int)
  102 + }
  103 + if isSystem, ok := data["isSystem"]; ok {
  104 + menu.IsSystem = isSystem.(int)
  105 + }
  106 + return nil
  107 +}
  108 +
  109 +// GetParentPath 获取菜单路径
  110 +func (menu *Menu) GetParentPath() string {
  111 + if menu.ParentId == 0 {
  112 + return ""
  113 + }
  114 + if len(menu.ParentPath) > 0 {
  115 + return fmt.Sprintf("%v%v%v", menu.ParentPath, PathSegment, menu.MenuId)
  116 + }
  117 + return fmt.Sprintf("%v", menu.MenuId)
  118 +}
  119 +
  120 +// GetFullPath 获取菜单全路径
  121 +func (menu *Menu) GetFullPath() string {
  122 + if menu.ParentId == 0 {
  123 + return ""
  124 + }
  125 + if len(menu.ParentPath) > 0 {
  126 + return fmt.Sprintf("%v%v%v", menu.ParentPath, PathSegment, menu.MenuId)
  127 + }
  128 + return fmt.Sprintf("%v", menu.MenuId)
  129 +}
  130 +
  131 +// GetCategory 获取菜单类别 1.web 2.app
  132 +func (menu *Menu) GetCategory() string {
  133 + if menu.Category == "" {
  134 + return strconv.Itoa(int(menu.MenuId))
  135 + }
  136 + return menu.Category
  137 +}
  138 +
  139 +func (menu *Menu) UpdateParentPath(old, new string) {
  140 + if !strings.Contains(menu.ParentPath, old) {
  141 + return
  142 + }
  143 + menu.ParentPath = strings.Replace(menu.ParentPath, old, new, 1)
  144 +}
  145 +
  146 +func (menu *Menu) ValidMenuType() bool {
  147 + mt := MenuType(menu.MenuType)
  148 + if mt == Catalog || mt == Menu_ || mt == Button {
  149 + return true
  150 + }
  151 + return false
  152 +}
  153 +
  154 +// 实现 TreeNode
  155 +func (menu *Menu) PID() string {
  156 + return menu.ParentPath
  157 +}
  158 +func (menu *Menu) ID() string {
  159 + return menu.GetFullPath()
  160 +}
  1 +package domain
  2 +
  3 +const (
  4 + StructTree = "tree"
  5 + StructList = "list"
  6 +)
  7 +
  8 +type TreeNode interface {
  9 + PID() string
  10 + ID() string
  11 +}
  12 +
  13 +type Tree struct {
  14 + Node TreeNode `json:"node"`
  15 + Nodes []*Tree `json:"nodes"`
  16 +}
  17 +
  18 +func traverse(tree *Tree, node TreeNode) bool {
  19 + list := tree.Nodes
  20 + var match bool = false
  21 + for i := range list {
  22 + id, pid := list[i].Node.ID(), node.PID() //list[i].Node.PID() == node.ID()
  23 + if pid == id {
  24 + list[i].Nodes = append(list[i].Nodes, NewTree(node))
  25 + return true
  26 + }
  27 + if match || traverse(list[i], node) {
  28 + match = true
  29 + break
  30 + }
  31 + }
  32 + return match
  33 +}
  34 +
  35 +func NewTrees(nodes []TreeNode) *Tree {
  36 + var tree = &Tree{
  37 + Node: nil,
  38 + Nodes: make([]*Tree, 0),
  39 + }
  40 + for i := range nodes {
  41 + match := traverse(tree, nodes[i])
  42 + if !match {
  43 + tree.Nodes = append(tree.Nodes, NewTree(nodes[i]))
  44 + }
  45 + }
  46 + return tree
  47 +}
  48 +
  49 +func NewTree(node TreeNode) *Tree {
  50 + return &Tree{
  51 + Node: node,
  52 + Nodes: make([]*Tree, 0),
  53 + }
  54 +}
  1 +package common
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/utils/string_convert"
  5 + "reflect"
  6 +)
  7 +
  8 +func SimpleStructToMap(toMapStruct interface{}) map[string]interface{} {
  9 + m := ObjectToMap(toMapStruct)
  10 + if pageNumber, ok := m["pageNumber"]; ok {
  11 + var pageSize int64
  12 + if _, ok := m["pageSize"]; ok {
  13 + pageSize = m["pageSize"].(int64)
  14 + } else {
  15 + pageSize = 20
  16 + }
  17 + m["offset"] = (pageNumber.(int64) - 1) * pageSize
  18 + m["limit"] = pageSize
  19 + }
  20 + return m
  21 +}
  22 +
  23 +func ObjectToMap(o interface{}) map[string]interface{} {
  24 + if o == nil {
  25 + return nil
  26 + }
  27 + value := reflect.ValueOf(o)
  28 + if value.Kind() != reflect.Ptr {
  29 + return nil
  30 + }
  31 + elem := value.Elem()
  32 + relType := elem.Type()
  33 + m := make(map[string]interface{})
  34 + for i := 0; i < relType.NumField(); i++ {
  35 + field := relType.Field(i)
  36 + if elem.Field(i).IsZero() {
  37 + continue
  38 + }
  39 + m[string_convert.CamelCase(field.Name, false, false)] = elem.Field(i).Interface()
  40 + }
  41 + return m
  42 +}
  1 +package domainService
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/im"
  8 +)
  9 +
  10 +type PgImService struct {
  11 + transactionContext *pgTransaction.TransactionContext
  12 +}
  13 +
  14 +func (s *PgImService) InitOrUpdateUserIMInfo(userId int64, name string) (imInfo *domain.Im, err error) {
  15 + var (
  16 + //ImInfoRepository, _ = factory.CreateImInfoRepository(ctx)
  17 + checkImRequest *im.CheckImRequest = &im.CheckImRequest{}
  18 + IsCreated = false
  19 + checkImResponse *im.CheckImResponse
  20 + )
  21 + var errFind error
  22 + //imInfo, errFind = ImInfoRepository.FindOne(map[string]interface{}{"user_id": userId})
  23 + // 异常
  24 + //if errFind != nil && errFind != domain.QueryNoRow {
  25 + // err = errFind
  26 + // return
  27 + //}
  28 + // 不存在
  29 + //if errFind == domain.QueryNoRow {
  30 + // imInfo = &domain.Im{
  31 + // UserId: userId,
  32 + // CreateTime: time.Now(),
  33 + // }
  34 + //}
  35 + // 已存在
  36 + if errFind == nil && imInfo != nil {
  37 + IsCreated = true
  38 + }
  39 +
  40 + if len(imInfo.Accid) == 0 {
  41 + //id, _ := utils.NewSnowflakeId()
  42 + //imInfo.ImId = fmt.Sprintf("%v", id)
  43 + }
  44 + checkImRequest = &im.CheckImRequest{
  45 + UserId: userId,
  46 + ImId: imInfo.Accid,
  47 + Uname: name,
  48 + CustomerImId: fmt.Sprintf("%v", imInfo.CsAccountId),
  49 + IsCreated: IsCreated,
  50 + }
  51 + if checkImResponse, err = CheckIm(checkImRequest); err != nil {
  52 + return
  53 + }
  54 + if len(imInfo.CsAccountId) == 0 {
  55 + imInfo.CsAccountId = getRandomCustomerAccount(userId)
  56 + }
  57 + imInfo.ImToken = checkImResponse.ImToken
  58 + //if _, err = ImInfoRepository.Save(imInfo); err != nil {
  59 + // return
  60 + //}
  61 + return
  62 +}
  63 +
  64 +// 检查ImToken
  65 +func CheckIm(request *im.CheckImRequest) (rsp *im.CheckImResponse, err error) {
  66 + var ()
  67 + rsp = &im.CheckImResponse{}
  68 + if !request.IsCreated {
  69 + if err = imCreate(request, rsp); err != nil {
  70 + return
  71 + }
  72 + } else {
  73 + if err = imUpdate(request, rsp); err != nil {
  74 + return
  75 + }
  76 + }
  77 + if err = imRefreshToken(request, rsp); err != nil {
  78 + return
  79 + }
  80 + return
  81 +}
  82 +
  83 +//create
  84 +func imCreate(request *im.CheckImRequest, rsp *im.CheckImResponse) (err error) {
  85 + var (
  86 + param im.UserCreate = im.UserCreate{
  87 + Accid: request.ImId,
  88 + Name: request.Uname,
  89 + Icon: request.Icon,
  90 + }
  91 + out *im.UserTokenResult
  92 + )
  93 + if out, err = im.CallCreate(param); err != nil {
  94 + return
  95 + }
  96 + if out.Code != 200 || (out.Info.Accid != request.ImId) {
  97 + return im.ErrorFailCall
  98 + }
  99 + rsp.ImToken = out.Info.Token
  100 + return
  101 +}
  102 +
  103 +//update user info
  104 +func imUpdate(request *im.CheckImRequest, rsp *im.CheckImResponse) (err error) {
  105 + var (
  106 + param im.UserUpdate = im.UserUpdate{
  107 + Accid: request.ImId,
  108 + Name: request.Uname,
  109 + Icon: request.Icon,
  110 + }
  111 + out *im.BaseResp
  112 + )
  113 + if out, err = im.CallUpdate(param); err != nil {
  114 + return
  115 + }
  116 + if out.Code != 200 {
  117 + return im.ErrorFailCall
  118 + }
  119 + return
  120 +}
  121 +
  122 +//refresh token
  123 +func imRefreshToken(request *im.CheckImRequest, rsp *im.CheckImResponse) (err error) {
  124 + var (
  125 + param im.UserRefreshToken = im.UserRefreshToken{
  126 + Accid: request.ImId,
  127 + }
  128 + out *im.UserTokenResult
  129 + )
  130 + if out, err = im.CallRefreshToken(param); err != nil {
  131 + return
  132 + }
  133 + if out.Code != 200 || (out.Info.Accid != request.ImId) {
  134 + return im.ErrorFailCall
  135 + }
  136 + rsp.ImToken = out.Info.Token
  137 + return
  138 +}
  139 +
  140 +// 获取客服id
  141 +func getRandomCustomerAccount(userId int64) (acid string) {
  142 + //ImCustomerServiceRepository, _ := factory.CreateImCustomerServiceRepository(ctx)
  143 + //total, customers, err := ImCustomerServiceRepository.Find(map[string]interface{}{"sortById": domain.ASC})
  144 + //if err != nil {
  145 + // log.Error(err)
  146 + // return 0
  147 + //}
  148 + //if total == 0 {
  149 + // return 0
  150 + //}
  151 + //index := userId % total
  152 + //if int(index) < len(customers) {
  153 + // acid, _ = strconv.ParseInt(customers[index].ImId, 10, 64)
  154 + // return
  155 + //}
  156 + //acid, _ = strconv.ParseInt(customers[0].ImId, 10, 64)
  157 + return
  158 +}
  1 +package im
  2 +
  3 +import (
  4 + "encoding/json"
  5 +)
  6 +
  7 +//func init() {
  8 +// InitImClient(constant.IM_SERVICE_ADDRESS, constant.IM_APP_KEY, constant.IM_APP_SECRET)
  9 +//}
  10 +
  11 +type RequestParam interface {
  12 + Format() map[string]string
  13 + GetPath() string
  14 + Valid() error
  15 +}
  16 +
  17 +//接口
  18 +func CallCreate(v UserCreate) (*UserTokenResult, error) {
  19 + var result UserTokenResult
  20 + btData, err := DefaultImClient.Call(v)
  21 + if err != nil {
  22 + return nil, err
  23 + }
  24 + err = json.Unmarshal(btData, &result)
  25 + if err != nil {
  26 + return nil, err
  27 + }
  28 + return &result, nil
  29 +}
  30 +func CallRefreshToken(v UserRefreshToken) (*UserTokenResult, error) {
  31 + var result UserTokenResult
  32 + btData, err := DefaultImClient.Call(v)
  33 + if err != nil {
  34 + return nil, err
  35 + }
  36 + err = json.Unmarshal(btData, &result)
  37 + if err != nil {
  38 + return nil, err
  39 + }
  40 + return &result, nil
  41 +}
  42 +func CallUpdate(v UserUpdate) (*BaseResp, error) {
  43 + var result BaseResp
  44 + btData, err := DefaultImClient.Call(v)
  45 + if err != nil {
  46 + return nil, err
  47 + }
  48 + err = json.Unmarshal(btData, &result)
  49 + if err != nil {
  50 + return nil, err
  51 + }
  52 + return &result, nil
  53 +}
  54 +
  55 +/*CheckIm */
  56 +type CheckImRequest struct {
  57 + UserId int64
  58 + ImId string
  59 + Uname string
  60 + Icon string
  61 + CustomerImId string
  62 + IsCreated bool
  63 +}
  64 +type CheckImResponse struct {
  65 + ImToken string //net im token
  66 + CsAccount int64 //客服id
  67 +}
  1 +package im
  2 +
  3 +import (
  4 + "testing"
  5 +)
  6 +
  7 +const (
  8 + IM_SERVICE_ADDRESS = "https://api.netease.im/nimserver"
  9 + IM_APP_KEY = "be7c0639c10e6a69f86ce3b4fa8dc8ec" //"ebf3ae278ee1b346773b99be5080f6a9"
  10 + IM_APP_SECRET = "9c5b60346613" //"67ea92e1ea45"
  11 +)
  12 +
  13 +var accid = "18860183051"
  14 +
  15 +func TestCallCreate(t *testing.T) {
  16 + InitImClient(IM_SERVICE_ADDRESS, IM_APP_KEY, IM_APP_SECRET)
  17 + token, err := CallCreate(UserCreate{Accid: accid})
  18 + if err != nil {
  19 + t.Fatal(err)
  20 + }
  21 + if token == nil {
  22 + t.Fatal("token is nil")
  23 + }
  24 + t.Log(token.Code, token.Info)
  25 +}
  26 +
  27 +func TestCallRefreshToken(t *testing.T) {
  28 + InitImClient(IM_SERVICE_ADDRESS, IM_APP_KEY, IM_APP_SECRET)
  29 + token, err := CallRefreshToken(UserRefreshToken{Accid: accid})
  30 + if err != nil {
  31 + t.Fatal(err)
  32 + }
  33 + if token == nil {
  34 + t.Fatal("token is nil")
  35 + }
  36 + t.Log(token.Code, token.Info)
  37 +}
  38 +
  39 +func TestCallUpdate(t *testing.T) {
  40 + InitImClient(IM_SERVICE_ADDRESS, IM_APP_KEY, IM_APP_SECRET)
  41 + token, err := CallUpdate(UserUpdate{Accid: accid, Name: "tip tok"})
  42 + if err != nil {
  43 + t.Fatal(err)
  44 + }
  45 + if token == nil {
  46 + t.Fatal("token is nil")
  47 + }
  48 + t.Log(token.Code)
  49 +}
  1 +package im
  2 +
  3 +import (
  4 + "crypto/sha1"
  5 + "encoding/hex"
  6 + "fmt"
  7 + "io/ioutil"
  8 + "math/rand"
  9 + "net/http"
  10 + "net/url"
  11 + "strconv"
  12 + "strings"
  13 + "time"
  14 +)
  15 +
  16 +var DefaultImClient Client
  17 +
  18 +var ErrorFailCall = fmt.Errorf(" imclient call failed")
  19 +
  20 +func InitImClient(baseUrl, appKey, appSecret string) {
  21 + DefaultImClient = Client{
  22 + baseUrl: baseUrl,
  23 + appKey: appKey,
  24 + appSecret: appSecret,
  25 + }
  26 +}
  27 +
  28 +type Client struct {
  29 + baseUrl string
  30 + appKey string
  31 + appSecret string
  32 +}
  33 +
  34 +func (i Client) Call(param RequestParam) ([]byte, error) {
  35 + return i.httpDo(param.GetPath(), param.Format())
  36 +}
  37 +func (i Client) buildHeader() http.Header {
  38 + var h = http.Header{}
  39 + curTime := strconv.FormatInt(time.Now().Unix(), 10)
  40 + nonce := strconv.FormatInt(time.Now().Unix()+rand.Int63n(5000), 10)
  41 + checkSum := buildCheckSum(i.appSecret, nonce, curTime)
  42 + h.Set("Content-Type", "application/x-www-form-urlencoded")
  43 + h.Set("AppKey", i.appKey)
  44 + h.Set("Nonce", nonce)
  45 + h.Set("CurTime", curTime)
  46 + h.Set("CheckSum", checkSum)
  47 + return h
  48 +}
  49 +func (i Client) httpDo(path string, posts map[string]string) ([]byte, error) {
  50 + client := http.Client{
  51 + Timeout: 5 * time.Second, //请求超时时间5秒
  52 + }
  53 + reqURL := i.baseUrl + path
  54 + params := url.Values{}
  55 + for k, v := range posts {
  56 + params.Add(k, v)
  57 + }
  58 + req, err := http.NewRequest("POST", reqURL, strings.NewReader(params.Encode()))
  59 + if err != nil {
  60 + return nil, err
  61 + }
  62 + req.Header = i.buildHeader()
  63 + resp, err := client.Do(req)
  64 + if err != nil {
  65 + return nil, err
  66 + }
  67 + defer resp.Body.Close()
  68 +
  69 + body, err := ioutil.ReadAll(resp.Body)
  70 + if err != nil {
  71 + return nil, err
  72 + }
  73 +
  74 + return body, nil
  75 +}
  76 +
  77 +func buildCheckSum(appSecret string, nonce string, curTime string) string {
  78 + str := []byte(appSecret + nonce + curTime)
  79 + sh := sha1.New()
  80 + sh.Write(str)
  81 + result := hex.EncodeToString(sh.Sum(nil))
  82 + return strings.ToLower(result)
  83 +}
  1 +package im
  2 +
  3 +import (
  4 + "fmt"
  5 +)
  6 +
  7 +var (
  8 + _ RequestParam = UserCreate{}
  9 + _ RequestParam = UserUpdate{}
  10 + _ RequestParam = UserRefreshToken{}
  11 +)
  12 +
  13 +type BaseResp struct {
  14 + Code int `json:"code"`
  15 +}
  16 +
  17 +// TokenInfo 云通信Token
  18 +type TokenInfo struct {
  19 + Token string `json:"token"`
  20 + Accid string `json:"accid"`
  21 + Name string `json:"name"`
  22 +}
  23 +type UserTokenResult struct {
  24 + BaseResp
  25 + Info TokenInfo `json:"info"`
  26 +}
  27 +
  28 +// 创建网易云通信ID
  29 +type UserCreate struct {
  30 + Accid string //网易云通信ID,最大长度32字符
  31 + Name string //ID昵称,最大长度64字符。
  32 + Props string //json属性,开发者可选填,最大长度1024字符
  33 + Icon string //ID头像URL,开发者可选填,最大长度1024字符
  34 + /**
  35 + 云通信ID可以指定登录token值,最大长度128字符,
  36 + 并更新,如果未指定,会自动生成token,并在
  37 + 创建成功后返回
  38 + **/
  39 + Token string
  40 + Sign string //签名
  41 + Email string
  42 + Birth string
  43 + Mobile string
  44 + Gender int //0未知,1男,2女
  45 + Ex string //扩展字段
  46 +}
  47 +
  48 +func (p UserCreate) Format() map[string]string {
  49 + return map[string]string{
  50 + "accid": p.Accid,
  51 + "name": p.Name,
  52 + "props": p.Props,
  53 + "icon": p.Icon,
  54 + "token": p.Token,
  55 + "sign": p.Sign,
  56 + "email": p.Email,
  57 + "birth": p.Birth,
  58 + "mobile": p.Mobile,
  59 + "gender": fmt.Sprintf("%d", p.Gender),
  60 + "ex": p.Ex,
  61 + }
  62 +}
  63 +func (p UserCreate) GetPath() string {
  64 + return "/user/create.action"
  65 +}
  66 +func (p UserCreate) Valid() error {
  67 + return nil
  68 +}
  69 +
  70 +// 重置网易云通信token
  71 +type UserRefreshToken struct {
  72 + Accid string //网易云通信ID,最大长度32字符,必须保证一个 APP内唯一
  73 +}
  74 +
  75 +func (p UserRefreshToken) Format() map[string]string {
  76 + return map[string]string{
  77 + "accid": p.Accid,
  78 + }
  79 +}
  80 +func (p UserRefreshToken) GetPath() string {
  81 + return "/user/refreshToken.action"
  82 +}
  83 +func (p UserRefreshToken) Valid() error {
  84 + return nil
  85 +}
  86 +
  87 +// 更新网易云通信token
  88 +type UserUpdate struct {
  89 + Accid string
  90 + Name string //这边网易云要有昵称以手机号码为昵称
  91 + Icon string //icon默认头像
  92 + Sign string //签名
  93 + Email string
  94 + Birth string
  95 + Mobile string
  96 + Gender int //0未知,1男,2女
  97 + Ex string //扩展字段
  98 +}
  99 +
  100 +func (u UserUpdate) Format() map[string]string {
  101 + return map[string]string{
  102 + "accid": u.Accid,
  103 + "name": u.Name,
  104 + "icon": u.Icon,
  105 + "sign": u.Sign,
  106 + "email": u.Email,
  107 + "birth": u.Birth,
  108 + "mobile": u.Mobile,
  109 + "gender": fmt.Sprintf("%d", u.Gender),
  110 + "ex": u.Ex,
  111 + }
  112 +}
  113 +func (u UserUpdate) GetPath() string {
  114 + return "/user/refreshToken.action"
  115 +}
  116 +func (u UserUpdate) Valid() error {
  117 + return nil
  118 +}
  1 +package pg
  2 +
  3 +import (
  4 + "context"
  5 + "fmt"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg/models"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/log"
  8 +
  9 + "github.com/go-pg/pg/v10"
  10 + "github.com/go-pg/pg/v10/orm"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/constant"
  12 +
  13 + //_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg/models"
  14 + "github.com/linmadan/egglib-go/persistent/pg/hooks"
  15 +)
  16 +
  17 +var DB *pg.DB
  18 +
  19 +func init() {
  20 + DB = pg.Connect(&pg.Options{
  21 + User: constant.POSTGRESQL_USER,
  22 + Password: constant.POSTGRESQL_PASSWORD,
  23 + Database: constant.POSTGRESQL_DB_NAME,
  24 + Addr: fmt.Sprintf("%s:%s", constant.POSTGRESQL_HOST, constant.POSTGRESQL_PORT),
  25 + })
  26 + if !constant.DISABLE_SQL_GENERATE_PRINT {
  27 + DB.AddQueryHook(hooks.SqlGeneratePrintHook{})
  28 + }
  29 + if !constant.DISABLE_CREATE_TABLE {
  30 + for _, model := range []interface{}{
  31 + (*models.Menu)(nil),
  32 + } {
  33 + err := DB.Model(model).CreateTable(&orm.CreateTableOptions{
  34 + Temp: false,
  35 + IfNotExists: true,
  36 + FKConstraints: true,
  37 + })
  38 + if err != nil {
  39 + panic(err)
  40 + }
  41 + }
  42 + }
  43 +}
  44 +
  45 +type SqlGeneratePrintHook struct{}
  46 +
  47 +func (hook SqlGeneratePrintHook) BeforeQuery(c context.Context, q *pg.QueryEvent) (context.Context, error) {
  48 + return c, nil
  49 +}
  50 +
  51 +func (hook SqlGeneratePrintHook) AfterQuery(c context.Context, q *pg.QueryEvent) error {
  52 + sqlStr, err := q.FormattedQuery()
  53 + if err != nil {
  54 + return err
  55 + }
  56 + log.Logger.Debug(string(sqlStr))
  57 + return nil
  58 +}
  1 +package models
  2 +
  3 +type Menu struct {
  4 + tableName string `pg:"base.menu,alias:menu"`
  5 + // 菜单编号
  6 + MenuId int64 `pg:",pk"`
  7 + // 父级id
  8 + ParentId int64
  9 + // 菜单名称
  10 + MenuName string
  11 + // 菜单编码 SYSTEM_USER_EDIT / 100101 (字符编码)
  12 + Code string
  13 + // 权限编码 users:edit
  14 + AccessCode string
  15 + // 菜单类型 (目录catalog、菜单menu、按钮button)
  16 + MenuType string
  17 + // 菜单图标
  18 + Icon string
  19 + // 排序
  20 + Sort int
  21 + // 菜单说明
  22 + Remark string
  23 + // 菜单类别 (web:1、app:2)
  24 + Category string
  25 + // 父级节点路径("0,11,12,")
  26 + ParentPath string
  27 + // 菜单是否公开状态,[0:隐藏],[1:显示],默认显示
  28 + IsPublish int
  29 + // 菜单是否是系统级,[0:否],[1:是],默认否
  30 + IsSystem int
  31 +}
  1 +package transform
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg/models"
  6 +)
  7 +
  8 +func TransformToMenuDomainModelFromPgModels(menuModel *models.Menu) (*domain.Menu, error) {
  9 + return &domain.Menu{
  10 + MenuId: menuModel.MenuId,
  11 + ParentId: menuModel.ParentId,
  12 + MenuName: menuModel.MenuName,
  13 + Code: menuModel.Code,
  14 + AccessCode: menuModel.AccessCode,
  15 + MenuType: menuModel.MenuType,
  16 + Icon: menuModel.Icon,
  17 + Sort: menuModel.Sort,
  18 + Remark: menuModel.Remark,
  19 + Category: menuModel.Category,
  20 + ParentPath: menuModel.ParentPath,
  21 + IsPublish: menuModel.IsPublish,
  22 + IsSystem: menuModel.IsSystem,
  23 + }, nil
  24 +}
  1 +package redis
  2 +
  3 +import (
  4 + ilog "github.com/linmadan/egglib-go/log"
  5 + "github.com/linmadan/egglib-go/persistent/cache"
  6 + "github.com/linmadan/egglib-go/persistent/cache/gzcache"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/constant"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/log"
  9 +)
  10 +
  11 +func init() {
  12 + cache.NewDefaultCache(cache.WithDebugLog(true, func() ilog.Logger { return log.Logger }))
  13 + cache.RegisterCache(gzcache.NewNodeCache(constant.REDIS_HOST+":"+constant.REDIS_PORT, constant.REDIS_AUTH))
  14 +}
  1 +package repository
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/go-pg/pg/v10"
  7 + "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
  8 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  9 + "github.com/linmadan/egglib-go/utils/snowflake"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg/models"
  12 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg/transform"
  13 +)
  14 +
  15 +type MenuRepository struct {
  16 + transactionContext *pgTransaction.TransactionContext
  17 +}
  18 +
  19 +func (repository *MenuRepository) nextIdentify() (int64, error) {
  20 + IdWorker, err := snowflake.NewIdWorker(1)
  21 + if err != nil {
  22 + return 0, err
  23 + }
  24 + id, err := IdWorker.NextId()
  25 + return id, err
  26 +}
  27 +func (repository *MenuRepository) Save(menu *domain.Menu) (*domain.Menu, error) {
  28 + sqlBuildFields := []string{
  29 + "menu_id",
  30 + "parent_id",
  31 + "menu_name",
  32 + "code",
  33 + "access_code",
  34 + "menu_type",
  35 + "icon",
  36 + "sort",
  37 + "remark",
  38 + "category",
  39 + "parent_path",
  40 + "is_publish",
  41 + "is_system",
  42 + }
  43 + insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "menu_id"))
  44 + insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "menu_id"))
  45 + returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  46 + updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "menu_id")
  47 + updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
  48 + tx := repository.transactionContext.PgTx
  49 + if menu.Identify() == nil {
  50 + menuId, err := repository.nextIdentify()
  51 + if err != nil {
  52 + return menu, err
  53 + } else {
  54 + menu.MenuId = menuId
  55 + }
  56 + if _, err := tx.QueryOne(
  57 + pg.Scan(
  58 + &menu.MenuId,
  59 + &menu.ParentId,
  60 + &menu.MenuName,
  61 + &menu.Code,
  62 + &menu.AccessCode,
  63 + &menu.MenuType,
  64 + &menu.Icon,
  65 + &menu.Sort,
  66 + &menu.Remark,
  67 + &menu.Category,
  68 + &menu.ParentPath,
  69 + &menu.IsPublish,
  70 + &menu.IsSystem,
  71 + ),
  72 + fmt.Sprintf("INSERT INTO base.menu (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
  73 + menu.ParentId,
  74 + menu.MenuName,
  75 + menu.Code,
  76 + menu.AccessCode,
  77 + menu.MenuType,
  78 + menu.Icon,
  79 + menu.Sort,
  80 + menu.Remark,
  81 + menu.Category,
  82 + menu.ParentPath,
  83 + menu.IsPublish,
  84 + menu.IsSystem,
  85 + ); err != nil {
  86 + return menu, err
  87 + }
  88 + } else {
  89 + if _, err := tx.QueryOne(
  90 + pg.Scan(
  91 + &menu.MenuId,
  92 + &menu.ParentId,
  93 + &menu.MenuName,
  94 + &menu.Code,
  95 + &menu.AccessCode,
  96 + &menu.MenuType,
  97 + &menu.Icon,
  98 + &menu.Sort,
  99 + &menu.Remark,
  100 + &menu.Category,
  101 + &menu.ParentPath,
  102 + &menu.IsPublish,
  103 + &menu.IsSystem,
  104 + ),
  105 + fmt.Sprintf("UPDATE base.menu SET %s WHERE menu_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
  106 + menu.ParentId,
  107 + menu.MenuName,
  108 + menu.Code,
  109 + menu.AccessCode,
  110 + menu.MenuType,
  111 + menu.Icon,
  112 + menu.Sort,
  113 + menu.Remark,
  114 + menu.Category,
  115 + menu.ParentPath,
  116 + menu.IsPublish,
  117 + menu.IsSystem,
  118 + menu.Identify(),
  119 + ); err != nil {
  120 + return menu, err
  121 + }
  122 + }
  123 + return menu, nil
  124 +}
  125 +func (repository *MenuRepository) Remove(menu *domain.Menu) (*domain.Menu, error) {
  126 + tx := repository.transactionContext.PgTx
  127 + menuModel := new(models.Menu)
  128 + menuModel.MenuId = menu.Identify().(int64)
  129 + if _, err := tx.Model(menuModel).WherePK().Delete(); err != nil {
  130 + return menu, err
  131 + }
  132 + return menu, nil
  133 +}
  134 +func (repository *MenuRepository) FindOne(queryOptions map[string]interface{}) (*domain.Menu, error) {
  135 + tx := repository.transactionContext.PgTx
  136 + menuModel := new(models.Menu)
  137 + query := sqlbuilder.BuildQuery(tx.Model(menuModel), queryOptions)
  138 + query.SetWhereByQueryOption("menu_id = ?", "menuId")
  139 + query.SetWhereByQueryOption("parent_id = ?", "parentId")
  140 + query.SetWhereByQueryOption("code = ?", "code")
  141 + if err := query.First(); err != nil {
  142 + if err.Error() == "pg: no rows in result set" {
  143 + return nil, fmt.Errorf("没有此资源")
  144 + } else {
  145 + return nil, err
  146 + }
  147 + }
  148 + if menuModel.MenuId == 0 {
  149 + return nil, nil
  150 + } else {
  151 + return transform.TransformToMenuDomainModelFromPgModels(menuModel)
  152 + }
  153 +}
  154 +func (repository *MenuRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.Menu, error) {
  155 + tx := repository.transactionContext.PgTx
  156 + var menuModels []*models.Menu
  157 + menus := make([]*domain.Menu, 0)
  158 + query := sqlbuilder.BuildQuery(tx.Model(&menuModels), queryOptions)
  159 + query.SetWhereByQueryOption("category = ?", "category")
  160 + if v, ok := queryOptions["parentPath"]; ok {
  161 + query.Where(fmt.Sprintf("parent_path like '%v%%'", v))
  162 + }
  163 + if v, ok := queryOptions["menuName"]; ok {
  164 + query.Where(fmt.Sprintf("menu_name like '%%%v%%'", v))
  165 + }
  166 + query.SetWhereByQueryOption("parent_id = ?", "parentId")
  167 + query.SetOffsetAndLimit(20)
  168 + query.SetOrderDirect("menu_id", "asc")
  169 + if count, err := query.SelectAndCount(); err != nil {
  170 + return 0, menus, err
  171 + } else {
  172 + for _, menuModel := range menuModels {
  173 + if menu, err := transform.TransformToMenuDomainModelFromPgModels(menuModel); err != nil {
  174 + return 0, menus, err
  175 + } else {
  176 + menus = append(menus, menu)
  177 + }
  178 + }
  179 + return int64(count), menus, nil
  180 + }
  181 +}
  182 +func NewMenuRepository(transactionContext *pgTransaction.TransactionContext) (*MenuRepository, error) {
  183 + if transactionContext == nil {
  184 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  185 + } else {
  186 + return &MenuRepository{
  187 + transactionContext: transactionContext,
  188 + }, nil
  189 + }
  190 +}
  1 +package log
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/log"
  5 + "github.com/linmadan/egglib-go/log/logrus"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/constant"
  7 +)
  8 +
  9 +var Logger log.Logger
  10 +
  11 +func init() {
  12 + Logger = logrus.NewLogrusLogger()
  13 + Logger.SetServiceName(constant.SERVICE_NAME)
  14 + Logger.SetLevel(constant.LOG_LEVEL)
  15 +}
  1 +package beego
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "github.com/linmadan/egglib-go/web/beego/filters"
  6 + "os"
  7 + "strconv"
  8 +
  9 + . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/log"
  10 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/port/beego/routers"
  11 +)
  12 +
  13 +func init() {
  14 + web.BConfig.AppName = "project"
  15 + web.BConfig.CopyRequestBody = true
  16 + web.BConfig.RunMode = "dev"
  17 + web.BConfig.Listen.HTTPPort = 8080
  18 + web.BConfig.Listen.EnableAdmin = false
  19 + web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego/routers"
  20 + if os.Getenv("RUN_MODE") != "" {
  21 + web.BConfig.RunMode = os.Getenv("RUN_MODE")
  22 + }
  23 + if os.Getenv("HTTP_PORT") != "" {
  24 + portStr := os.Getenv("HTTP_PORT")
  25 + if port, err := strconv.Atoi(portStr); err == nil {
  26 + web.BConfig.Listen.HTTPPort = port
  27 + }
  28 + }
  29 + web.InsertFilter("/*", web.BeforeExec, filters.AllowCors())
  30 + web.InsertFilter("/*", web.BeforeExec, filters.CreateRequstLogFilter(Logger))
  31 + web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(Logger), web.WithReturnOnOutput(false))
  32 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/menu/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/menu/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/menu/service"
  8 +)
  9 +
  10 +type MenuController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *MenuController) CreateMenu() {
  15 + menuService := service.NewMenuService(nil)
  16 + createMenuCommand := &command.CreateMenuCommand{}
  17 + controller.Unmarshal(createMenuCommand)
  18 + data, err := menuService.CreateMenu(createMenuCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *MenuController) UpdateMenu() {
  23 + menuService := service.NewMenuService(nil)
  24 + updateMenuCommand := &command.UpdateMenuCommand{}
  25 + controller.Unmarshal(updateMenuCommand)
  26 + Id, _ := controller.GetInt64(":menuId")
  27 + updateMenuCommand.MenuId = Id
  28 + data, err := menuService.UpdateMenu(updateMenuCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *MenuController) GetMenu() {
  33 + menuService := service.NewMenuService(nil)
  34 + getMenuQuery := &query.GetMenuQuery{}
  35 + Id, _ := controller.GetInt64(":menuId")
  36 + getMenuQuery.MenuId = Id
  37 + data, err := menuService.GetMenu(getMenuQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *MenuController) RemoveMenu() {
  42 + menuService := service.NewMenuService(nil)
  43 + removeMenuCommand := &command.RemoveMenuCommand{}
  44 + controller.Unmarshal(removeMenuCommand)
  45 + Id, _ := controller.GetInt64(":menuId")
  46 + removeMenuCommand.MenuId = Id
  47 + data, err := menuService.RemoveMenu(removeMenuCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *MenuController) ListMenu() {
  52 + menuService := service.NewMenuService(nil)
  53 + listMenuQuery := &query.ListMenuQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listMenuQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listMenuQuery.Limit = limit
  58 + listMenuQuery.MenuCategory = controller.GetString("menuCategory")
  59 + listMenuQuery.ParentId, _ = controller.GetInt64("parentId", 0)
  60 + listMenuQuery.MenuName = controller.GetString("menuName")
  61 + listMenuQuery.StructType = controller.GetString("structType")
  62 + data, err := menuService.ListMenu(listMenuQuery)
  63 + controller.Response(data, err)
  64 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/menus/", &controllers.MenuController{}, "Post:CreateMenu")
  10 + web.Router("/menus/:menuId", &controllers.MenuController{}, "Put:UpdateMenu")
  11 + web.Router("/menus/:menuId", &controllers.MenuController{}, "Get:GetMenu")
  12 + web.Router("/menus/:menuId", &controllers.MenuController{}, "Delete:RemoveMenu")
  13 + web.Router("/menus/", &controllers.MenuController{}, "Get:ListMenu")
  14 +}
  1 +package menu
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建菜单服务", func() {
  13 + Describe("提交数据创建菜单服务", func() {
  14 + Context("提交正确的新系统菜单数据", func() {
  15 + It("返回系统菜单数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "parentId": 0,
  19 + "menuName": "string",
  20 + "code": "string",
  21 + "accessCode": "string",
  22 + "menuType": "string",
  23 + "icon": "string",
  24 + "sort": 1,
  25 + "desc": "string",
  26 + "isPublish": 1,
  27 + }
  28 + httpExpect.POST("/menus/").
  29 + WithJSON(body).
  30 + Expect().
  31 + Status(http.StatusOK).
  32 + JSON().
  33 + Object().
  34 + ContainsKey("code").ValueEqual("code", 0).
  35 + ContainsKey("msg").ValueEqual("msg", "ok").
  36 + ContainsKey("data").Value("data").Object().
  37 + ContainsKey("menuId").ValueNotEqual("menuId", BeZero())
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM base.menu WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package menu
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回菜单服务", func() {
  14 + var menuId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&menuId),
  18 + "INSERT INTO base.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
  19 + 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testParentPath", 1, 1)
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据menuId参数返回系统菜单", func() {
  23 + Context("传入有效的menuId", func() {
  24 + It("返回系统菜单数据", func() {
  25 + return
  26 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  27 + httpExpect.GET("/menus/1").
  28 + Expect().
  29 + Status(http.StatusOK).
  30 + JSON().
  31 + Object().
  32 + ContainsKey("code").ValueEqual("code", 0).
  33 + ContainsKey("msg").ValueEqual("msg", "ok").
  34 + ContainsKey("data").Value("data").Object()
  35 + })
  36 + })
  37 + })
  38 + AfterEach(func() {
  39 + _, err := pG.DB.Exec("DELETE FROM base.menu WHERE true")
  40 + Expect(err).NotTo(HaveOccurred())
  41 + })
  42 +})
  1 +package menu
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回菜单服务列表", func() {
  14 + var menuId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&menuId),
  18 + "INSERT INTO base.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
  19 + 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1)
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回系统菜单列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回系统菜单数据列表", func() {
  25 + return
  26 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  27 + httpExpect.GET("/menus/").
  28 + WithQuery("offset", 0).
  29 + WithQuery("limit", 20).
  30 + Expect().
  31 + Status(http.StatusOK).
  32 + JSON().
  33 + Object().
  34 + ContainsKey("code").ValueEqual("code", 0).
  35 + ContainsKey("msg").ValueEqual("msg", "ok").
  36 + ContainsKey("data").Value("data").Object().
  37 + ContainsKey("count").ValueEqual("count", 1).
  38 + ContainsKey("menus").Value("menus").Array()
  39 + })
  40 + })
  41 + })
  42 + AfterEach(func() {
  43 + _, err := pG.DB.Exec("DELETE FROM base.menu WHERE true")
  44 + Expect(err).NotTo(HaveOccurred())
  45 + })
  46 +})
  1 +package menu
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/port/beego"
  13 +)
  14 +
  15 +func TestMenu(t *testing.T) {
  16 + RegisterFailHandler(Fail)
  17 + RunSpecs(t, "Beego Port Menu Correlations Test Case Suite")
  18 +}
  19 +
  20 +var handler http.Handler
  21 +var server *httptest.Server
  22 +
  23 +var _ = BeforeSuite(func() {
  24 + handler = web.BeeApp.Handlers
  25 + server = httptest.NewServer(handler)
  26 +})
  27 +
  28 +var _ = AfterSuite(func() {
  29 + server.Close()
  30 +})
  1 +package menu
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除菜单服务", func() {
  14 + var menuId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&menuId),
  18 + "INSERT INTO base.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
  19 + 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1)
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除菜单服务", func() {
  23 + Context("传入有效的menuId", func() {
  24 + It("返回被移除系统菜单的数据", func() {
  25 +
  26 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  27 + httpExpect.DELETE("/menus/1").
  28 + Expect().
  29 + Status(http.StatusOK).
  30 + JSON().
  31 + Object().
  32 + ContainsKey("code").ValueEqual("code", 0).
  33 + ContainsKey("msg").ValueEqual("msg", "ok").
  34 + ContainsKey("data").Value("data").Object()
  35 + })
  36 + })
  37 + })
  38 + AfterEach(func() {
  39 + _, err := pG.DB.Exec("DELETE FROM base.menu WHERE true")
  40 + Expect(err).NotTo(HaveOccurred())
  41 + })
  42 +})
  1 +package menu
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新菜单服务", func() {
  14 + var menuId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&menuId),
  18 + "INSERT INTO base.menu (menu_id, parent_id, menu_name, code, access_code, menu_type, icon, sort, remark, category, parent_path, is_publish, is_system) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING menu_id",
  19 + 1, 0, "testMenuName", "testCode", "testAccessCode", "testMenuType", "testIcon", 1, "testDesc", "testCategory", "testfullPath", 1, 1)
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新菜单服务", func() {
  23 + Context("提交正确的系统菜单数据", func() {
  24 + It("返回更新后的系统菜单数据", func() {
  25 +
  26 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  27 + body := map[string]interface{}{
  28 + "menuName": "string11",
  29 + "code": "string22",
  30 + "accessCode": "string",
  31 + "menuType": "cate",
  32 + "icon": "string",
  33 + "sort": 1,
  34 + "desc": "string",
  35 + "isPublish": 0,
  36 + }
  37 + httpExpect.PUT("/menus/1").
  38 + WithJSON(body).
  39 + Expect().
  40 + Status(http.StatusOK).
  41 + JSON().
  42 + Object().
  43 + ContainsKey("code").ValueEqual("code", 0).
  44 + ContainsKey("msg").ValueEqual("msg", "ok").
  45 + ContainsKey("data").Value("data").Object().
  46 + ContainsKey("menuId").ValueEqual("menuId", menuId)
  47 + })
  48 + })
  49 + })
  50 + AfterEach(func() {
  51 + _, err := pG.DB.Exec("DELETE FROM base.menu WHERE true")
  52 + Expect(err).NotTo(HaveOccurred())
  53 + })
  54 +})