package ik3cloud import ( "github.com/deep-project/kingdee" "github.com/deep-project/kingdee/adapters" client2 "github.com/deep-project/kingdee/pkg/client" ) var Client = &client{} type client struct { config *Config *client2.Client } type Config struct { Host string // 接口地址 AccountId string // 账套ID Username string // 用户名 AppId string // 应用ID AppSecret string // 应用秘钥 LanguageId string // 语言ID } func InitClient(config *Config) (*client, error) { var err error Client.Client, err = kingdee.New(config.Host, &adapters.LoginBySign{ AccountID: config.AccountId, Username: config.Username, AppID: config.AppId, AppSecret: config.AppSecret, LanguageID: config.LanguageId, }) if err != nil { return nil, err } Client.config = config return Client, nil }