- 添加常量定义文件,包含部门、员工、工厂和联系人相关操作类型 - 实现联系人保存与删除接口,支持联系人信息的完整字段 - 实现工厂信息保存接口,包含工厂基本信息及联系人列表 - 定义工厂联系人结构体,支持多个联系人关联工厂信息 - 集成客户端调用逻辑,通过RPC方式与外部服务通信
50 lines
1.1 KiB
Go
50 lines
1.1 KiB
Go
package ik3cloud
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.kumo.work/shama/service/client"
|
|
"git.kumo.work/shama/service/ik3cloud/constant"
|
|
)
|
|
|
|
type contact struct {
|
|
}
|
|
|
|
type ArgsContactSave struct {
|
|
CompanyType constant.Action
|
|
Contacts []ContactItem
|
|
}
|
|
type ContactItem struct {
|
|
ContactId int64 // 部门id
|
|
Number string // 部门编码
|
|
Name string // 部门名称
|
|
Sex string // 性别
|
|
Job string // 职位
|
|
Tel string // 电话
|
|
Phone string // 手机
|
|
Fax string // 传真
|
|
Email string // 邮箱
|
|
IsDefault bool // 是否默认/主联系人
|
|
CompanyNumber string // 关联订单编码
|
|
}
|
|
|
|
// Save @TITLE 保存联系人
|
|
func (c *contact) Save(ctx context.Context, args ArgsContactSave) (entities []Entity, err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "Save", args, &entities)
|
|
return
|
|
}
|
|
|
|
// Delete @TITLE 删除联系人
|
|
func (c *contact) Delete(ctx context.Context, args Unique) (err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
var reply int
|
|
return xClient.Call(ctx, "Delete", args, &reply)
|
|
}
|