-
Removida classe
Linkcaseira dos projetos livraria e payfast. -
Na classe
PagamentoResourcedo payfast, foi criado o métodogetTransitionsque retorna um array deLinkdo JAX-RS com as transições possíveis, de acordo com o status do pagamento. -
O array de
Linké utilizado no métodolinksdoResponseBuilderdo JAX-RS:Response.ok().entity(pagamento).links(links).build()
-
Na classe
ClienteRestda livraria, foi modificado o código dos métodoscriarPagamentoeconfirmarPagamentopara utilizar oLinkdo JAX-RS.
This file contains hidden or 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
| public enum Operacao { | |
| SOMA ("+") { | |
| @Override | |
| Integer executa(Integer a, Integer b) { | |
| return a + b; | |
| } | |
| }, | |
| SUBTRACAO ("-") { | |
| @Override | |
| Integer executa(Integer a, Integer b) { |
This file contains hidden or 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 br.com.casadocodigo.loja.infra.spring; | |
| import org.springframework.beans.BeansException; | |
| import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; | |
| import org.springframework.beans.factory.config.BeanDefinition; | |
| import org.springframework.beans.factory.config.BeanFactoryPostProcessor; | |
| import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.core.type.AnnotationMetadata; | |
| import org.springframework.stereotype.Controller; |
This file contains hidden or 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
| public void convertHtmlToPdf(String html, OutputStream out) throws DocumentException { | |
| Document doc = Jsoup.parse(html); | |
| doc.outputSettings().escapeMode(EscapeMode.xhtml); | |
| Element head = doc.head(); | |
| Element style = new Element(Tag.valueOf("style"), doc.baseUri()); | |
| style.text("img { -fs-fit-images-to-width: 100% }"); | |
| head.appendChild(style); | |
| DefaultUserAgent userAgent = new DefaultUserAgent(); | |
| ITextRenderer renderer = new ITextRenderer(userAgent); | |
| renderer.setDocument(DOMBuilder.jsoup2DOM(doc), doc.baseUri()); |
This file contains hidden or 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 cargaHorariaDosServidores; | |
| import java.io.IOException; | |
| import java.nio.charset.StandardCharsets; | |
| import java.nio.file.Files; | |
| import java.nio.file.Path; | |
| import java.nio.file.Paths; | |
| import java.util.TreeMap; | |
| import java.util.function.Function; | |
| import java.util.function.Predicate; |
This file contains hidden or 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
| lala | |
| begin | |
| sddasdas | |
| asdasdasd | |
| asdasd | |
| end | |
| lolo |
This file contains hidden or 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 spring; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.annotation.Qualifier; | |
| import org.springframework.context.annotation.AnnotationConfigApplicationContext; | |
| import org.springframework.context.annotation.ComponentScan; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.stereotype.Component; | |
| import javax.annotation.PostConstruct; |
This file contains hidden or 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 jsr330; | |
| import org.springframework.context.annotation.AnnotationConfigApplicationContext; | |
| import org.springframework.context.annotation.ComponentScan; | |
| import org.springframework.context.annotation.Configuration; | |
| import javax.annotation.PostConstruct; | |
| import javax.inject.Inject; | |
| import javax.inject.Named; | |
| import java.lang.annotation.ElementType; |
This file contains hidden or 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 qualifiers; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.annotation.Qualifier; | |
| import org.springframework.context.annotation.AnnotationConfigApplicationContext; | |
| import org.springframework.context.annotation.ComponentScan; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.stereotype.Component; | |
| import javax.annotation.PostConstruct; |
This file contains hidden or 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 qualifiers; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.annotation.Qualifier; | |
| import org.springframework.context.annotation.AnnotationConfigApplicationContext; | |
| import org.springframework.context.annotation.ComponentScan; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.stereotype.Component; | |
| import javax.annotation.PostConstruct; |