测试第三方接口

This commit is contained in:
lulz1 2024-02-01 17:20:31 +08:00
parent 119e614765
commit 615e81968c
5 changed files with 68 additions and 2 deletions

View File

@ -2,11 +2,15 @@ package com.chint.domain.aggregates.order;
import com.chint.domain.aggregates.base.BaseEntity; import com.chint.domain.aggregates.base.BaseEntity;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import static com.chint.infrastructure.constant.Constant.*; import static com.chint.infrastructure.constant.Constant.*;
@Data @Data
@Table("leg_event")
public class LegEvent extends BaseEntity { public class LegEvent extends BaseEntity {
@Id
private Long legEventId; private Long legEventId;
private Long legId; private Long legId;

View File

@ -6,8 +6,11 @@ import com.chint.domain.aggregates.order.RouteOrder;
import java.util.List; import java.util.List;
public interface LegRepository { public interface LegRepository {
Leg save(Leg bookingItem); Leg save(Leg leg);
void deleteById(Long id); void deleteById(Long id);
List<Leg> findByOrder(RouteOrder order); List<Leg> findByOrder(RouteOrder order);
void saveAll(List<Leg> bookingItems);
void saveAll(List<Leg> legs);
} }

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}