feat(erp): 添加 ik3cloud 模块并实现获取汇率功能

- 在 erp 服务中注册 ik3cloud 服务
- 创建 ik3cloud 结构体和服务接口
- 实现 GetCurrencyRate 方法用于获取指定货币的汇率
- 添加 ArgsGetCurrencyRate 参数结构体定义
- 集成客户端调用逻辑以支持远程服务调用
This commit is contained in:
2026-06-03 10:47:11 +08:00
parent 084778d51e
commit da6bd17f84
2 changed files with 28 additions and 0 deletions

View File

@@ -19,4 +19,5 @@ type Erp struct {
Expense expense
Request request
Dict dict
Ik3cloud ik3cloud
}

27
erp/ik3cloud.go Normal file
View File

@@ -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
}