feat(k3cloud): 更新客户和产品数据结构以支持联系人信息
- 在自定义结构体中新增联系人字段,用于存储多个联系人信息 - 将FactoryCustomItem重命名为CustomItem,统一命名规范 - 修改产品保存参数类型ArgsProductSave为ProductSaveItem - 调整产品保存接口实现,支持批量保存产品数据 - 更新产品保存方法签名,返回实体列表而非单个实体
This commit is contained in:
@@ -18,9 +18,10 @@ type ArgsCustomSave struct {
|
|||||||
Website string // 网站
|
Website string // 网站
|
||||||
Tel string // 电话
|
Tel string // 电话
|
||||||
Fax string // 传真
|
Fax string // 传真
|
||||||
|
Contacts []CustomItem
|
||||||
}
|
}
|
||||||
|
|
||||||
type FactoryCustomItem struct {
|
type CustomItem struct {
|
||||||
ContactNumber string // 联系人编号
|
ContactNumber string // 联系人编号
|
||||||
Name string // 部门名称
|
Name string // 部门名称
|
||||||
Sex string // 性别
|
Sex string // 性别
|
||||||
|
|||||||
@@ -8,18 +8,18 @@ import (
|
|||||||
|
|
||||||
type product struct {
|
type product struct {
|
||||||
}
|
}
|
||||||
type ArgsProductSave struct {
|
type ProductSaveItem struct {
|
||||||
ProductId int64 // 付款单id
|
ProductId int64 // 付款单id
|
||||||
Number string // 编码
|
Number string // 编码
|
||||||
Name string // 名称
|
Name string // 名称
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save @TITLE 保存客户
|
// Save @TITLE 保存客户
|
||||||
func (p *product) Save(ctx context.Context, args ArgsProductSave) (entity Entity, err error) {
|
func (p *product) Save(ctx context.Context, args []ProductSaveItem) (entities []Entity, err error) {
|
||||||
xClient, err := client.GetClient(p)
|
xClient, err := client.GetClient(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = xClient.Call(ctx, "Save", args, &entity)
|
err = xClient.Call(ctx, "Save", args, &entities)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user