Changeset 721cb87 for src/main/java/it/finki/tinki/service/impl
- Timestamp:
- 01/06/21 20:48:58 (4 years ago)
- Branches:
- master
- Children:
- 4a15c9c
- Parents:
- 504c3ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/service/impl/AccountServiceImpl.java
r504c3ef r721cb87 80 80 return this.teamRepository.save(t); 81 81 } 82 83 public Account registerCompany(String email, String password, String name, String country, String city, String street){ 84 if(email==null || email.isEmpty() || password==null || password.isEmpty() || name==null || name.isEmpty() 85 || country==null || country.isEmpty() || city==null || city.isEmpty() || street==null || street.isEmpty()){ 86 throw new InvalidArgumentsException(); 87 } 88 89 if(this.companyRepository.findByEmail(email).isPresent()){ 90 throw new UserExistsException(); 91 } 92 93 Address a = new Address(country, city, street); 94 this.addressRepository.save(a); 95 Company c = new Company(email, password, name, AccountType.COMPANY, a); 96 return this.companyRepository.save(c); 97 } 82 98 }
Note:
See TracChangeset
for help on using the changeset viewer.