From a2abdd3b114f70118c7ee65980e7dc60ea45f73a Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 20 Nov 2025 16:47:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(ik3cloud):=20=E6=89=A9=E5=B1=95Ik3cloud?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=BB=93=E6=9E=84=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在Ik3cloud结构体中新增Contact和Factory字段 - 定义Entity结构体用于统一返回格式 - 定义Unique结构体用于批量操作参数 - 修改员工添加接口返回值为Entity结构体 - 修改员工禁用、启用和删除接口参数为Unique结构体 --- ik3cloud/ik3cloud.go | 12 ++++++++++++ ik3cloud/staff.go | 16 ++++++++-------- oa/department.go | 2 ++ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ik3cloud/ik3cloud.go b/ik3cloud/ik3cloud.go index 47e6237..0cffa8f 100644 --- a/ik3cloud/ik3cloud.go +++ b/ik3cloud/ik3cloud.go @@ -3,4 +3,16 @@ package ik3cloud type Ik3cloud struct { Department department // 部门 Staff staff // 员工 + Contact contact // 联系人 + Factory factory // 工厂 +} +type Entity struct { + Id int64 `json:"Id"` + Number string `json:"Number"` + DIndex int `json:"DIndex"` +} + +type Unique struct { + Numbers []string // 编码 + Ids []int64 // id } diff --git a/ik3cloud/staff.go b/ik3cloud/staff.go index f8fc9b8..4c7f034 100644 --- a/ik3cloud/staff.go +++ b/ik3cloud/staff.go @@ -51,12 +51,12 @@ type ArgsStaffAdd struct { } // Add @TITLE 添加员工 -func (s *staff) Add(ctx context.Context, args ArgsStaffAdd) (staffId int64, err error) { +func (s *staff) Add(ctx context.Context, args ArgsStaffAdd) (entity Entity, err error) { xClient, err := client.GetClient(s) if err != nil { return } - err = xClient.Call(ctx, "Add", args, &staffId) + err = xClient.Call(ctx, "Add", args, &entity) return } @@ -76,31 +76,31 @@ func (s *staff) Edit(ctx context.Context, args ArgsStaffEdit) (err error) { } // Disable @TITLE 禁用员工 -func (s *staff) Disable(ctx context.Context, numbers []string) (err error) { +func (s *staff) Disable(ctx context.Context, args Unique) (err error) { xClient, err := client.GetClient(s) if err != nil { return } var reply int - return xClient.Call(ctx, "Disable", numbers, &reply) + return xClient.Call(ctx, "Disable", args, &reply) } // Enable @TITLE 启用员工 -func (s *staff) Enable(ctx context.Context, numbers []string) (err error) { +func (s *staff) Enable(ctx context.Context, args Unique) (err error) { xClient, err := client.GetClient(s) if err != nil { return } var reply int - return xClient.Call(ctx, "Enable", numbers, &reply) + return xClient.Call(ctx, "Enable", args, &reply) } // Delete @TITLE 删除员工 -func (s *staff) Delete(ctx context.Context, numbers []string) (err error) { +func (s *staff) Delete(ctx context.Context, args Unique) (err error) { xClient, err := client.GetClient(s) if err != nil { return } var reply int - return xClient.Call(ctx, "Delete", numbers, &reply) + return xClient.Call(ctx, "Delete", args, &reply) } diff --git a/oa/department.go b/oa/department.go index 4890e43..5eaf10e 100644 --- a/oa/department.go +++ b/oa/department.go @@ -12,6 +12,7 @@ type department struct { type DepartmentItem struct { Id int64 `json:"id"` Name string `json:"name"` + Code string `json:"code"` ParentId int64 `json:"parentId"` ManageStaffId int64 `json:"manageStaffId"` CreatedAt time.Time `json:"createdAt"` @@ -30,6 +31,7 @@ func (d *department) All(ctx context.Context) (reply []DepartmentItem, err error type ArgsDepartmentAdd struct { Name string // 部门名称 + Code string // 部门编号 ParentId int64 // 上级部门id ManageStaffId int64 // 部门负责人 }