From da6bd17f84c0f774aabd8b1e38b942a39ce86458 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 3 Jun 2026 10:47:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(erp):=20=E6=B7=BB=E5=8A=A0=20ik3cloud=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=B9=B6=E5=AE=9E=E7=8E=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B1=87=E7=8E=87=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 erp 服务中注册 ik3cloud 服务 - 创建 ik3cloud 结构体和服务接口 - 实现 GetCurrencyRate 方法用于获取指定货币的汇率 - 添加 ArgsGetCurrencyRate 参数结构体定义 - 集成客户端调用逻辑以支持远程服务调用 --- erp/erp.go | 1 + erp/ik3cloud.go | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 erp/ik3cloud.go diff --git a/erp/erp.go b/erp/erp.go index 66070be..627def8 100644 --- a/erp/erp.go +++ b/erp/erp.go @@ -19,4 +19,5 @@ type Erp struct { Expense expense Request request Dict dict + Ik3cloud ik3cloud } diff --git a/erp/ik3cloud.go b/erp/ik3cloud.go new file mode 100644 index 0000000..f123142 --- /dev/null +++ b/erp/ik3cloud.go @@ -0,0 +1,27 @@ +package erp + +import ( + "context" + "time" + + client2 "git.kumo.work/shama/service/client" + "github.com/shopspring/decimal" +) + +type ik3cloud struct { +} + +type ArgsGetCurrencyRate struct { + Currency string + Date time.Time +} + +// GetCurrencyRate @TITLE 获取汇率 +func (i *ik3cloud) GetCurrencyRate(ctx context.Context, args ArgsGetCurrencyRate) (rate decimal.Decimal, err error) { + xClient, err := client2.GetClient(i) + if err != nil { + return + } + err = xClient.Call(ctx, "GetCurrencyRate", args, &rate) + return +}