[KC-108] ai api 실행
This commit is contained in:
@@ -216,4 +216,14 @@ public class InferenceResultCoreService {
|
||||
.map(MapInkx5kEntity::toEntity)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public void update(UUID uuid, Long batchId, String status) {
|
||||
MapSheetLearnEntity entity =
|
||||
mapSheetLearnRepository
|
||||
.getInferenceResultByUuid(uuid)
|
||||
.orElseThrow(() -> new EntityNotFoundException(uuid.toString()));
|
||||
|
||||
entity.setBatchId(batchId);
|
||||
entity.setStatus(status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class MapSheetLearnEntity {
|
||||
@Column(name = "title", nullable = false, length = 200)
|
||||
private String title;
|
||||
|
||||
@Size(max = 10)
|
||||
@Size(max = 20)
|
||||
@Column(name = "status", length = 10)
|
||||
private String status;
|
||||
|
||||
@@ -103,6 +103,9 @@ public class MapSheetLearnEntity {
|
||||
@Column(name = "updated_uid")
|
||||
private Long updatedUid;
|
||||
|
||||
@Column(name = "batch_id")
|
||||
private Long batchId;
|
||||
|
||||
public InferenceResultDto.ResultList toDto() {
|
||||
return new InferenceResultDto.ResultList(
|
||||
this.uuid,
|
||||
|
||||
@@ -2,9 +2,13 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
public interface MapSheetLearnRepositoryCustom {
|
||||
|
||||
Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
||||
|
||||
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.querydsl.core.types.dsl.CaseBuilder;
|
||||
import com.querydsl.core.types.dsl.NumberExpression;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -73,4 +75,13 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
|
||||
return new PageImpl<>(content, pageable, total == null ? 0L : total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid) {
|
||||
return Optional.ofNullable(
|
||||
queryFactory
|
||||
.selectFrom(mapSheetLearnEntity)
|
||||
.where(mapSheetLearnEntity.uuid.eq(uuid))
|
||||
.fetchOne());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user