From 02fcd437e512619164175ab87f7fd92b26469c60 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 19 Nov 2025 13:47:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(ik3cloud):=20=E6=B7=BB=E5=8A=A0=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E5=92=8C=E5=91=98=E5=B7=A5=E6=9C=8D=E5=8A=A1=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增部门服务,支持获取所有部门信息 - 新增员工服务,支持分页查询员工列表 - 定义部门和员工相关的数据结构 - 实现与远程客户端的调用逻辑 - 集成到主服务入口文件中便于调用 - 添加手机号、状态等员工搜索条件支持 --- ik3cloud/department.go | 27 +++++++++++++++++++++++++++ ik3cloud/ik3cloud.go | 6 ++++++ ik3cloud/staff.go | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 ik3cloud/department.go create mode 100644 ik3cloud/ik3cloud.go create mode 100644 ik3cloud/staff.go diff --git a/ik3cloud/department.go b/ik3cloud/department.go new file mode 100644 index 0000000..902a8cf --- /dev/null +++ b/ik3cloud/department.go @@ -0,0 +1,27 @@ +package ik3cloud + +import ( + "context" + + "git.kumo.work/shama/service/client" +) + +type department struct { +} +type DepartmentItem struct { + Number *string `json:"number"` + Name *string `json:"name"` + ParentNumber *string `json:"parentNumber"` + ParentName *string `json:"parentName"` + Children []*DepartmentItem `json:"children"` +} + +// All @TITLE 获取部门 +func (d *department) All(ctx context.Context) (reply []DepartmentItem, err error) { + xClient, err := client.GetClient(d) + if err != nil { + return + } + err = xClient.Call(ctx, "All", 0, &reply) + return +} diff --git a/ik3cloud/ik3cloud.go b/ik3cloud/ik3cloud.go new file mode 100644 index 0000000..47e6237 --- /dev/null +++ b/ik3cloud/ik3cloud.go @@ -0,0 +1,6 @@ +package ik3cloud + +type Ik3cloud struct { + Department department // 部门 + Staff staff // 员工 +} diff --git a/ik3cloud/staff.go b/ik3cloud/staff.go new file mode 100644 index 0000000..910517c --- /dev/null +++ b/ik3cloud/staff.go @@ -0,0 +1,42 @@ +package ik3cloud + +import ( + "context" + + "git.kumo.work/shama/service/client" + "git.kumo.work/shama/service/lib/bean" +) + +type staff struct { +} +type ArgsStaffList struct { + Page bean.Page + Search StaffSearch +} +type StaffSearch struct { + Status int64 // 状态 1=启用 2=停用 + Name string // 姓名 + Phone string // 手机号 +} +type ReplyStaffList struct { + List []StaffItem `json:"list"` // 员工列表 + Total int64 `json:"total"` // 总数 +} +type StaffItem struct { + Number *string `json:"number"` // 工号 + Name *string `json:"name"` // 姓名 + Position *string `json:"position"` // 职位 + Phone *string `json:"phone"` // 账号 + Mobile *string `json:"mobile"` // 手机号 + Status *string `json:"status"` // 状态 +} + +// List @TITLE 员工列表 +func (s *staff) List(ctx context.Context, args ArgsStaffList) (reply ReplyStaffList, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "List", args, &reply) + return +}