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 com.testes.spring.mongodb.models; | |
public class JogoModel { | |
public String id; | |
public String nome; | |
public String desenvolvedora; | |
public String genero; | |
public String informacoesAdicionais; | |
public JogoModel() { |
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 com.testes.spring.mongodb.models; | |
import org.springframework.data.annotation.Id; | |
import org.springframework.data.mongodb.core.index.Indexed; | |
import org.springframework.data.mongodb.core.mapping.Document; | |
@Document(collection = "jogos") | |
public class JogoModel { | |
@Id | |
public String id; |
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 com.testes.spring.mongodb.repositories; | |
import org.springframework.data.mongodb.repository.MongoRepository; | |
import org.springframework.stereotype.Repository; | |
import com.testes.spring.mongodb.models.JogoModel; | |
@Repository | |
public interface JogoRepository extends MongoRepository<JogoModel, String>{ |
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 com.testes.spring.mongodb.config; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.mongodb.config.AbstractMongoClientConfiguration; | |
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; | |
import com.mongodb.client.MongoClient; | |
import com.mongodb.client.MongoClients; | |
import com.testes.spring.mongodb.repositories.JogoRepository; |
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 com.testes.spring.mongodb.rest; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.PostMapping; | |
import org.springframework.web.bind.annotation.RequestBody; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import com.testes.spring.mongodb.models.JogoModel; |
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
{ | |
"atividade_principal": [ | |
], | |
"data_situacao": "", | |
"complemento": "", | |
"nome": "", | |
"uf": "SP", | |
"telefone": "", | |
"email": "", | |
"atividades_secundarias": [], |
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
{ | |
"cnpj": "99450169000100", | |
"cep": "04476230", | |
"municipio": "Sao Paulo", | |
"bairro": "Bairro Aleatorio", | |
"logradouro": "Av Faria Aleatoria", | |
"numero": 115, | |
"jsonApi":{ | |
} | |
} |
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 com.testes.spring.exemplo.empresas.models; | |
import org.apache.commons.text.WordUtils; | |
import org.springframework.data.annotation.Id; | |
import org.springframework.data.mongodb.core.mapping.Document; | |
import com.mongodb.BasicDBObject; | |
import com.mongodb.DBObject; | |
@Document(collection = "empresas") |
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 com.testes.spring.exemplo.empresas.repositories; | |
import org.springframework.data.mongodb.repository.MongoRepository; | |
import org.springframework.stereotype.Repository; | |
import com.testes.spring.exemplo.empresas.models.EmpresaEnvelope; | |
@Repository | |
public interface EmpresaEnvelopeRepository extends MongoRepository<EmpresaEnvelope, String> { |
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 com.testes.spring.exemplo.empresas.config; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.mongodb.config.AbstractMongoClientConfiguration; | |
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; | |
import com.mongodb.client.MongoClient; | |
import com.mongodb.client.MongoClients; | |
import com.testes.spring.exemplo.empresas.repositories.EmpresaEnvelopeRepository; |