作者 王健

company todo

... ... @@ -102,6 +102,8 @@ func (companyService *CompanyService) CreateCompany(createCompanyCommand *comman
if company, err := companyRepository.Save(newCompany); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
// todo 新增公司管理员
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ... @@ -265,6 +267,8 @@ func (companyService *CompanyService) SetCompanyAdmin(setCompanyAdminCommand *co
if company, err := companyRepository.Save(company); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
// todo 更改公司管理员
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ... @@ -318,6 +322,8 @@ func (companyService *CompanyService) UpdateCompany(updateCompanyCommand *comman
if err := company.SetCompanyAdmin(companyAdmin); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
// todo 更改公司管理员
}
if company, err := companyRepository.Save(company); err != nil {
... ...