测试第三方接口
This commit is contained in:
parent
119e614765
commit
615e81968c
|
@ -2,11 +2,15 @@ package com.chint.domain.aggregates.order;
|
|||
|
||||
import com.chint.domain.aggregates.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
|
||||
import static com.chint.infrastructure.constant.Constant.*;
|
||||
|
||||
@Data
|
||||
@Table("leg_event")
|
||||
public class LegEvent extends BaseEntity {
|
||||
@Id
|
||||
private Long legEventId;
|
||||
|
||||
private Long legId;
|
||||
|
|
|
@ -6,8 +6,11 @@ import com.chint.domain.aggregates.order.RouteOrder;
|
|||
import java.util.List;
|
||||
|
||||
public interface LegRepository {
|
||||
Leg save(Leg bookingItem);
|
||||
Leg save(Leg leg);
|
||||
|
||||
void deleteById(Long id);
|
||||
|
||||
List<Leg> findByOrder(RouteOrder order);
|
||||
void saveAll(List<Leg> bookingItems);
|
||||
|
||||
void saveAll(List<Leg> legs);
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.chint.infrastructure.repository;
|
||||
|
||||
import com.chint.domain.aggregates.order.Leg;
|
||||
import com.chint.domain.aggregates.order.LegEvent;
|
||||
import com.chint.domain.repository.LegEventRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcLegEventRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class LegEventRepositoryImpl implements LegEventRepository {
|
||||
|
||||
@Autowired
|
||||
private JdbcLegEventRepository legEventRepository;
|
||||
|
||||
@Override
|
||||
public void deleteByLegId(Leg leg) {
|
||||
legEventRepository.deleteByLegId(leg.getLegId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LegEvent> findAllByLegId(Long legId) {
|
||||
return legEventRepository.findByLegId(legId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LegEvent save(LegEvent legEvent) {
|
||||
return legEventRepository.save(legEvent);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.order.LegEvent;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface JdbcLegEventRepository extends CrudRepository<LegEvent, Long> {
|
||||
void deleteByLegId(Long legId);
|
||||
|
||||
List<LegEvent> findByLegId(Long legId);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.order.Leg;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface JdbcLegRepository extends CrudRepository<Leg, Long> {
|
||||
|
||||
List<Leg> findByRouteId(Long routeId);
|
||||
}
|
Loading…
Reference in New Issue