This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package swimpee | |
import grails.util.TypeConvertingMap | |
import grails.web.mapping.UrlMapping | |
import org.grails.taglib.TagOutput | |
import org.grails.taglib.encoder.OutputContextLookupHelper | |
import org.springframework.web.servlet.support.RequestContextUtils | |
class PaginationTagLib { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package es.pablocloud.accidentswatcher | |
import org.springframework.boot.SpringApplication | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.scheduling.annotation.EnableScheduling | |
@SpringBootApplication | |
@EnableScheduling | |
class AccidentswatcherApplication { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besuricata.rest.domain; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.Id; | |
import java.io.Serializable; | |
@Entity | |
public class Suricata implements Serializable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besuricata.rest.repositories; | |
import com.besuricata.rest.domain.Suricata; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
import org.springframework.stereotype.Repository; | |
import java.util.Collection; | |
@Repository | |
public interface SuricataRepository extends JpaRepository<Suricata, Long> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besuricata.rest.services; | |
import java.util.Collection; | |
public interface BasicService<T, ID> { | |
T getById(ID identifier); | |
Collection<T> findAll(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besuricata.rest.services; | |
import org.springframework.dao.EmptyResultDataAccessException; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
import java.util.Collection; | |
public abstract class BasicServiceAbstract<T, ID> implements BasicService<T, ID> { | |
protected JpaRepository<T, ID> repository; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besuricata.rest.controllers; | |
import java.util.Collection; | |
interface BasicController<T, ID> { | |
T getById(ID identifier); | |
Collection<T> get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besuricata.rest.controllers; | |
import com.besuricata.rest.services.BasicService; | |
import org.springframework.http.MediaType; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestMethod; | |
import java.util.Collection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besuricata.rest.controllers.impl; | |
import com.besuricata.rest.controllers.BasicControllerAbstract; | |
import com.besuricata.rest.domain.Suricata; | |
import com.besuricata.rest.services.impl.SuricataService; | |
import org.springframework.http.MediaType; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestMethod; | |
import org.springframework.web.bind.annotation.RestController; |