package com.jakduk.repository;

import com.jakduk.model.db.BoardFree;
import com.jakduk.model.simple.BoardFreeOfMinimum;
import com.jakduk.model.simple.BoardFreeOnList;
import com.jakduk.model.web.BoardFreeWrite;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.Optional;

public interface BoardFreeRepository extends MongoRepository<BoardFree, String> {

	Optional<BoardFree> findOneById(String id);
	Optional<BoardFree> findOneBySeq(Integer seq);

	Page<BoardFreeOnList> findByCategoryName(String categoryName, Pageable pageable);
	BoardFree findByWriter(String writer);
	long countByCategoryName(String categoryName);
	long count();
	
	@Query(value="{'status.notice' : 'notice'}")
	Page<BoardFreeOnList> findByNotice(Pageable pageable);
	
	@Query(value="{'seq' : ?0}")
	BoardFreeWrite boardFreeWriteFindOneBySeq(Integer seq);
	
	@Query(value="{'seq' : ?0}")
	BoardFreeOfMinimum findBoardFreeOfMinimumBySeq(Integer seq);
}

@@ -36,182 +36,29 @@
 ort 
-com.jakduk.model.db.BoardFree;%0Aimport com.jakduk.model.simple.BoardFreeOfMinimum;%0Aimport com.jakduk.model.simple.BoardFreeOnList;%0Aimport com.jakduk.model.web.BoardFreeWrite
+java.util.Optional
 ;%0A
+%0A
 impo
@@ -281,34 +281,188 @@
 %0Aimport 
-java.util.Optional
+com.jakduk.model.db.BoardFree;%0Aimport com.jakduk.model.simple.BoardFreeOfMinimum;%0Aimport com.jakduk.model.simple.BoardFreeOnList;%0Aimport com.jakduk.model.web.BoardFreeWrite
 ;%0A%0Apubli
@@ -859,16 +859,12 @@
 ' : 
-'notice'
+true
 %7D%22)%0A

fix notice in list