Compare commits
2 Commits
e2da0185b8
...
9c2d9e2f3f
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c2d9e2f3f | |||
| a2abdd3b11 |
@@ -3,4 +3,16 @@ package ik3cloud
|
|||||||
type Ik3cloud struct {
|
type Ik3cloud struct {
|
||||||
Department department // 部门
|
Department department // 部门
|
||||||
Staff staff // 员工
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,12 +51,12 @@ type ArgsStaffAdd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add @TITLE 添加员工
|
// 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)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = xClient.Call(ctx, "Add", args, &staffId)
|
err = xClient.Call(ctx, "Add", args, &entity)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,31 +76,31 @@ func (s *staff) Edit(ctx context.Context, args ArgsStaffEdit) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Disable @TITLE 禁用员工
|
// 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)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Disable", numbers, &reply)
|
return xClient.Call(ctx, "Disable", args, &reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable @TITLE 启用员工
|
// 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)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Enable", numbers, &reply)
|
return xClient.Call(ctx, "Enable", args, &reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete @TITLE 删除员工
|
// 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)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Delete", numbers, &reply)
|
return xClient.Call(ctx, "Delete", args, &reply)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user