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
{ | |
"id": "17cdd3c6-8c8e-4d96-921f-674bbc098bb3", | |
"nome": "Welcome To The Jungle", | |
"artistaId": "8061e332-c443-4d0f-9ee1-1306030feb1f", | |
"artista": { | |
"id": "8061e332-c443-4d0f-9ee1-1306030feb1f", | |
"nome": "Guns 'n' Roses" | |
} | |
} |
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.dojo.musicas.dao; | |
import java.util.List; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
import com.dojo.musicas.entity.Musica; | |
public interface MusicaDao extends JpaRepository<Musica, String> { |
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.dojo.musicas.service.impl; | |
import java.util.List; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Component; | |
import com.dojo.musicas.dao.MusicaDao; | |
import com.dojo.musicas.entity.Musica; | |
import com.dojo.musicas.service.CacheService; |
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.dojo.springboot.rest.template.controllers; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.CrossOrigin; |
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.dojo.musicas.dao; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
import com.dojo.musicas.entity.Playlist; | |
public interface PlaylistDao extends JpaRepository<Playlist, String> { | |
Playlist findPlaylistByUsuarioNome(String nome); | |
} |
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
Method in controller: | |
@RequestMapping("/hi") | |
public String sayHi(@Size(max = 10, message = "name should at most 10 characters long") @RequestParam("name") String name) { | |
return "Hi " + name; | |
Controller Advice: | |
@ExceptionHandler(value = {ConstraintViolationException.class}) | |
@ResponseStatus(value = HttpStatus.BAD_REQUEST) | |
public String handleValidationFailure(ConstraintViolationException ex) { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<include | |
resource="org/springframework/boot/logging/logback/base.xml" /> | |
<include | |
resource="org/springframework/boot/logging/logback/defaults.xml" /> | |
| |
<springProperty scope="context" name="springAppName" | |
source="spring.application.name" /> |
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.splunk.dev.logging.examples; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import com.dtdsoftware.splunk.logging.SplunkLogEvent; | |
import com.dtdsoftware.splunk.logging.SplunkLogEventFactory; | |
/** | |
* Simple examples to demonstrate using the SplunkJavaLogging framework |
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
@constructorproperties |
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
const Buffer = require('safe-buffer').Buffer; | |
const Compute = require('@google-cloud/compute'); | |
const compute = new Compute(); | |
const zone = 'us-central1-a'; | |
// We are going to add our vm configuration in the next step | |
// const vmConfig = ... | |
exports.createInstance = (event, context) => { |
OlderNewer