From 4e85c1718876ffa76c2047b94e9310bc0932f39d Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 27 Jul 2022 18:10:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96secret?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/user.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/customer/user.go b/customer/user.go index 6d6c80b..df74d3f 100644 --- a/customer/user.go +++ b/customer/user.go @@ -101,3 +101,9 @@ func (u *user) Disable(ctx context.Context, userId uint) error { reply := 0 return client.GetClient(u).Call(ctx, "Disable", userId, &reply) } + +// SecretByAppKey @Title 通过appKey获取Secret +func (u *user) SecretByAppKey(ctx context.Context, appKey string) (appSecret string, err error) { + err = client.GetClient(u).Call(ctx, "Disable", appKey, &appSecret) + return +} From a4de9689858670474dbdd49330ce862cce7cfb9d Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 27 Jul 2022 18:31:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service.go | 7 +++++++ customer/user.go | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 customer/service.go diff --git a/customer/service.go b/customer/service.go new file mode 100644 index 0000000..57cee5f --- /dev/null +++ b/customer/service.go @@ -0,0 +1,7 @@ +package customer + +type serviceId uint + +const ( + ServiceSupply serviceId = 1 // 供应链 +) diff --git a/customer/user.go b/customer/user.go index df74d3f..f0a79e5 100644 --- a/customer/user.go +++ b/customer/user.go @@ -102,8 +102,18 @@ func (u *user) Disable(ctx context.Context, userId uint) error { return client.GetClient(u).Call(ctx, "Disable", userId, &reply) } -// SecretByAppKey @Title 通过appKey获取Secret -func (u *user) SecretByAppKey(ctx context.Context, appKey string) (appSecret string, err error) { - err = client.GetClient(u).Call(ctx, "Disable", appKey, &appSecret) +type ArgsUserServiceInfo struct { + ServiceId uint // 服务id + AppKey string // 渠道appKey +} +type ReplyUserServiceInfo struct { + CustomerId uint `json:"customerId"` + AppSecret string `json:"appSecret"` + ExpirationAt int64 `json:"expirationAt"` +} + +// ServiceInfo @Title 获取服务信息 +func (u *user) ServiceInfo(ctx context.Context, args ArgsUserServiceInfo) (reply ReplyUserServiceInfo, err error) { + err = client.GetClient(u).Call(ctx, "ServiceInfo", args, &reply) return } From 7308e174fe7b19e3e4bf39a623e5bcf57fa3eb0d Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 27 Jul 2022 18:34:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/customer/user.go b/customer/user.go index f0a79e5..d63be1b 100644 --- a/customer/user.go +++ b/customer/user.go @@ -103,8 +103,8 @@ func (u *user) Disable(ctx context.Context, userId uint) error { } type ArgsUserServiceInfo struct { - ServiceId uint // 服务id - AppKey string // 渠道appKey + ServiceId serviceId // 服务id + AppKey string // 渠道appKey } type ReplyUserServiceInfo struct { CustomerId uint `json:"customerId"`