service.go
482 字节
package service
import "errors"
//PlatformAction 企业平台数据同步服务 接口设定
type PlatformAction interface {
DoAction(string, []byte) error
}
var actionmap = map[string]PlatformAction{
// "department":
// "position":
"employee": SyncEmployeeService{},
"company": SyncCompanyService{},
}
func NewPlatformAction(module string) (PlatformAction, error) {
if v, ok := actionmap[module]; ok {
return v, nil
}
return nil, errors.New("module cannot found")
}