| 1 | package org.sanmibuh.tedee.lock.application; | |
| 2 | ||
| 3 | import lombok.RequiredArgsConstructor; | |
| 4 | import org.sanmibuh.ddd.port.CommandHandler; | |
| 5 | import org.sanmibuh.tedee.lock.domain.Lock; | |
| 6 | import org.sanmibuh.tedee.lock.domain.LockRepository; | |
| 7 | import org.sanmibuh.tedee.lock.domain.vo.LockId; | |
| 8 | import org.sanmibuh.tedee.lock.domain.vo.LockJamStatus; | |
| 9 | import org.sanmibuh.tedee.lock.domain.vo.LockState; | |
| 10 | ||
| 11 | @RequiredArgsConstructor | |
| 12 | public final class ReportLockStatusHandler extends CommandHandler<ReportLockStatusCommand, Lock> { | |
| 13 | ||
| 14 | private final LockRepository repository; | |
| 15 | ||
| 16 | @Override | |
| 17 | protected Lock execute(final ReportLockStatusCommand command) { | |
| 18 | final var lock = repository.get(new LockId(command.deviceId())); | |
| 19 |
1
1. execute : removed call to org/sanmibuh/tedee/lock/domain/Lock::reportStatus → KILLED |
lock.reportStatus( |
| 20 | LockState.fromBridgeCode(command.state()), LockJamStatus.fromBridgeCode(command.jammed())); | |
| 21 |
1
1. execute : removed call to org/sanmibuh/tedee/lock/domain/LockRepository::save → KILLED |
repository.save(lock); |
| 22 | ||
| 23 |
1
1. execute : replaced return value with null for org/sanmibuh/tedee/lock/application/ReportLockStatusHandler::execute → KILLED |
return lock; |
| 24 | } | |
| 25 | } | |
Mutations | ||
| 19 |
1.1 |
|
| 21 |
1.1 |
|
| 23 |
1.1 |