해당 게시글은 개인 프로젝트인 "광고 관리 플랫폼 대행사 센터 제작" 중
#60 "삭제 기능 수정" 이슈를 다루고 있습니다.
@Modifying
@Transactional
@Query("UPDATE Agent a SET a.deleted = true where a.userId = :agentId and a.agency.agencyId = :agencyId")
void setAgentDeletedTrue(@Param("agentId") String agentId,
@Param("agencyId") String agencyId);
public static CampaignWithCreativesDto from(Campaign entity) {
return new CampaignWithCreativesDto(
ClientUserDto.from(entity.getClientUser()),
entity.getId(),
entity.getName(),
entity.getBudget(),
entity.getCreatedAt(),
entity.getCreatedBy(),
entity.getModifiedAt(),
entity.getModifiedBy(),
entity.getCreatives().stream()
.filter(c -> !c.isDeleted())
.map(CreativeDto::from)
.collect(Collectors.toCollection(LinkedHashSet::new)),
entity.getStatus()
);