...
|
...
|
@@ -18,9 +18,11 @@ 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 {
|
|
|
err := json.Unmarshal(referrer.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
if referrer != nil {
|
|
|
err := json.Unmarshal(referrer.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
...
|
...
|
@@ -33,12 +35,14 @@ 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 err != nil {
|
|
|
return nil, err
|
|
|
if undertaker != nil {
|
|
|
err := json.Unmarshal(undertaker.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
...
|
...
|
@@ -51,12 +55,14 @@ 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 err != nil {
|
|
|
return nil, err
|
|
|
if relevant != nil {
|
|
|
err := json.Unmarshal(relevant.([]byte), returnData)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
}
|
...
|
...
|
@@ -69,12 +75,14 @@ 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 err != nil {
|
|
|
return nil, err
|
|
|
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 err != nil {
|
|
|
return nil, err
|
|
|
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
|
|
|
} |
...
|
...
|
|