- 新增联系人保存与删除逻辑处理 - 新增工厂信息保存逻辑,支持银行、财务等详细信息 - 部门与员工模块接口参数调整,统一使用实体对象返回 - 优化部门与员工的增删改查操作,去除冗余代码 - 统一使用 constant 包管理业务类型常量 - 增加性别转换与整型数组转字符串工具函数 - RPC 注册新增工厂与联系人服务路由 - 调整客户端调用参数结构,增强代码可读性与维护性
This commit is contained in:
22
app/controller/contact.go
Normal file
22
app/controller/contact.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"ik3cloud/app/logic"
|
||||
|
||||
"git.kumo.work/shama/service/ik3cloud"
|
||||
)
|
||||
|
||||
type Contact struct {
|
||||
}
|
||||
|
||||
// Save @TITLE 保存联系人
|
||||
func (f *Contact) Save(ctx context.Context, args ik3cloud.ArgsContactSave, entity *[]ik3cloud.Entity) (err error) {
|
||||
*entity, err = logic.ContactLogic.Save(args.CompanyType, args.Contacts)
|
||||
return err
|
||||
}
|
||||
|
||||
// Delete @TITLE 删除联系人
|
||||
func (f *Contact) Delete(ctx context.Context, args ik3cloud.Unique, reply *int) error {
|
||||
return logic.ContactLogic.Delete(args.Numbers, args.Ids)
|
||||
}
|
||||
@@ -17,8 +17,8 @@ func (d *Department) All(ctx context.Context, args int, reply *[]ik3cloud.Depart
|
||||
}
|
||||
|
||||
// Add @TITLE 添加部门
|
||||
func (d *Department) Add(ctx context.Context, args ik3cloud.ArgsDepartmentAdd, departmentId *int64) (err error) {
|
||||
*departmentId, err = logic.DepartmentLogic.Add(args)
|
||||
func (d *Department) Add(ctx context.Context, args ik3cloud.ArgsDepartmentAdd, entity *ik3cloud.Entity) (err error) {
|
||||
*entity, err = logic.DepartmentLogic.Add(args)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ func (d *Department) Edit(ctx context.Context, args ik3cloud.ArgsDepartmentEdit,
|
||||
}
|
||||
|
||||
// Delete @TITLE 删除部门
|
||||
func (d *Department) Delete(ctx context.Context, numbers []string, reply *int) error {
|
||||
return logic.DepartmentLogic.Delete(numbers)
|
||||
func (d *Department) Delete(ctx context.Context, args ik3cloud.Unique, reply *int) error {
|
||||
return logic.DepartmentLogic.Delete(args.Numbers, args.Ids)
|
||||
}
|
||||
|
||||
17
app/controller/factory.go
Normal file
17
app/controller/factory.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"ik3cloud/app/logic"
|
||||
|
||||
"git.kumo.work/shama/service/ik3cloud"
|
||||
)
|
||||
|
||||
type Factory struct {
|
||||
}
|
||||
|
||||
// Save @TITLE 保存工厂
|
||||
func (f *Factory) Save(ctx context.Context, args ik3cloud.ArgsFactorySave, entity *ik3cloud.Entity) (err error) {
|
||||
*entity, err = logic.FactoryLogic.Save(args)
|
||||
return err
|
||||
}
|
||||
@@ -21,8 +21,8 @@ func (s *Staff) List(ctx context.Context, args ik3cloud.ArgsStaffList, reply *ik
|
||||
}
|
||||
|
||||
// Add @TITLE 添加员工
|
||||
func (s *Staff) Add(ctx context.Context, args ik3cloud.ArgsStaffAdd, staffId *int64) (err error) {
|
||||
*staffId, err = logic.StaffLogic.Add(args)
|
||||
func (s *Staff) Add(ctx context.Context, args ik3cloud.ArgsStaffAdd, entity *ik3cloud.Entity) (err error) {
|
||||
*entity, err = logic.StaffLogic.Add(args)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -32,16 +32,16 @@ func (s *Staff) Edit(ctx context.Context, args ik3cloud.ArgsStaffEdit, reply *in
|
||||
}
|
||||
|
||||
// Disable @TITLE 禁用员工
|
||||
func (s *Staff) Disable(ctx context.Context, numbers []string, reply *int) error {
|
||||
return logic.StaffLogic.Disable(numbers)
|
||||
func (s *Staff) Disable(ctx context.Context, args ik3cloud.Unique, reply *int) error {
|
||||
return logic.StaffLogic.Disable(args.Numbers, args.Ids)
|
||||
}
|
||||
|
||||
// Enable @TITLE 启用员工
|
||||
func (s *Staff) Enable(ctx context.Context, numbers []string, reply *int) error {
|
||||
return logic.StaffLogic.Enable(numbers)
|
||||
func (s *Staff) Enable(ctx context.Context, args ik3cloud.Unique, reply *int) error {
|
||||
return logic.StaffLogic.Enable(args.Numbers, args.Ids)
|
||||
}
|
||||
|
||||
// Delete @TITLE 删除
|
||||
func (s *Staff) Delete(ctx context.Context, numbers []string, reply *int) error {
|
||||
return logic.StaffLogic.Delete(numbers)
|
||||
func (s *Staff) Delete(ctx context.Context, args ik3cloud.Unique, reply *int) error {
|
||||
return logic.StaffLogic.Delete(args.Numbers, args.Ids)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user