...
|
...
|
@@ -18,10 +18,12 @@ func (service *UserService) ReferrerFrom(companyId int64, orgId int64, userId in |
|
|
if referrer, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Referrer"); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
if referrer != nil {
|
|
|
err := json.Unmarshal(referrer.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -33,13 +35,15 @@ func (service *UserService) UndertakerFrom(companyId int64, orgId int64, userId |
|
|
if userAdaptor, err := adaptor.NewUserAdaptor(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
if referrer, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Undertaker"); err != nil {
|
|
|
if undertaker, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Undertaker"); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
err := json.Unmarshal(referrer.([]byte), returnData)
|
|
|
if undertaker != nil {
|
|
|
err := json.Unmarshal(undertaker.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -51,13 +55,15 @@ func (service *UserService) RelevantFrom(companyId int64, orgId int64, userId in |
|
|
if userAdaptor, err := adaptor.NewUserAdaptor(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
if referrer, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Relevant"); err != nil {
|
|
|
if relevant, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Relevant"); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
err := json.Unmarshal(referrer.([]byte), returnData)
|
|
|
if relevant != nil {
|
|
|
err := json.Unmarshal(relevant.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -69,13 +75,15 @@ func (service *UserService) SalesmanFrom(companyId int64, orgId int64, userId in |
|
|
if userAdaptor, err := adaptor.NewUserAdaptor(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
if referrer, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Salesman"); err != nil {
|
|
|
if salesman, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Salesman"); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
err := json.Unmarshal(referrer.([]byte), returnData)
|
|
|
if salesman != nil {
|
|
|
err := json.Unmarshal(salesman.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -87,26 +95,20 @@ func (service *UserService) OperatorFrom(companyId int64, orgId int64, userId in |
|
|
if userAdaptor, err := adaptor.NewUserAdaptor(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
if referrer, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Operator"); err != nil {
|
|
|
if operator, err := userAdaptor.ToParticipator(companyId, orgId, userId, "Operator"); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
err := json.Unmarshal(referrer.([]byte), returnData)
|
|
|
if operator != nil {
|
|
|
err := json.Unmarshal(operator.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (service *UserService) UserInMenu(companyId int64, orgId int64, userId int64, code string) (bool, error) {
|
|
|
return false, nil
|
|
|
}
|
|
|
|
|
|
func (service *UserService) UserInOrganization(companyId int64, orgId int64, userId int64) (bool, error) {
|
|
|
return false, nil
|
|
|
}
|
|
|
|
|
|
func NewUserService() (*UserService, error) {
|
|
|
return &UserService{}, nil
|
|
|
} |
...
|
...
|
|