refactor(erp): 重构字典服务中的货币功能模块
- 将货币相关结构体和方法独立为单独的currency模块 - 在Dict结构体中添加Currency字段以支持货币功能 - 移除原dict.go中的FunctionalCurrency方法实现 - 新增currency.go文件包含完整的货币字典项定义和本位币查询功能
This commit is contained in:
10
erp/dict.go
10
erp/dict.go
@@ -104,13 +104,3 @@ func (d *dict) Delete(ctx context.Context, dictIds []int64) (err error) {
|
||||
err = xClient.Call(ctx, "Delete", dictIds, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// FunctionalCurrency @TITLE 本位币
|
||||
func (d *dict) FunctionalCurrency(ctx context.Context) (reply DictItem, err error) {
|
||||
xClient, err := client2.GetClient(d)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "FunctionalCurrency", 0, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
38
erp/dict/currency.go
Normal file
38
erp/dict/currency.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package dict
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
client2 "git.kumo.work/shama/service/client"
|
||||
)
|
||||
|
||||
type currency struct {
|
||||
}
|
||||
|
||||
type DictItem struct {
|
||||
Id int64 `json:"id"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
CategoryCode string `json:"categoryCode"`
|
||||
Sort int64 `json:"sort"`
|
||||
Value1 string `json:"value1"`
|
||||
Value2 string `json:"value2"`
|
||||
Value3 string `json:"value3"`
|
||||
Value4 string `json:"value4"`
|
||||
Value5 string `json:"value5"`
|
||||
Value6 string `json:"value6"`
|
||||
Value7 string `json:"value7"`
|
||||
Value8 string `json:"value8"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// FunctionalCurrency @TITLE 本位币
|
||||
func (c *currency) FunctionalCurrency(ctx context.Context) (reply DictItem, err error) {
|
||||
xClient, err := client2.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "FunctionalCurrency", 0, &reply)
|
||||
return
|
||||
}
|
||||
@@ -3,4 +3,5 @@ package dict
|
||||
type Dict struct {
|
||||
Font font
|
||||
Category category
|
||||
Currency currency
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user