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
@RequestMapping(value = "/objects/", method = RequestMethod.POST) | |
@ResponseStatus(value = HttpStatus.CREATED) | |
@ResponseBody | |
public SomeObj createObject(@RequestBody SomeObj obj) { | |
//Do your things | |
return obj; | |
} | |
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
//Turn off visibility for all fields when serializing (forces @JsonProperty annotations on entities) | |
setVisibilityChecker(getSerializationConfig().getDefaultVisibilityChecker() | |
.withCreatorVisibility(JsonAutoDetect.Visibility.NONE) | |
.withFieldVisibility(JsonAutoDetect.Visibility.NONE) | |
.withGetterVisibility(JsonAutoDetect.Visibility.NONE) | |
.withIsGetterVisibility(JsonAutoDetect.Visibility.NONE) | |
.withSetterVisibility(JsonAutoDetect.Visibility.NONE)); | |
//Turn off visibility for all fields when deserializing (forces @JsonProperty annotations on entities) |
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
public class ContentPatternConverter implements Converter<String, ContentPattern> { | |
private PatternService patternService; | |
@Autowired | |
public ContentPatternConverter(PatternService patternService) { | |
this.patternService = patternService; | |
} | |
@Override |
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
//Import saplo4j: https://github.com/saplo/saplo4j | |
SaploClient client = new SaploClient.Builder("apikey", | |
"secretkey").endpoint("https://api.saplo.com/rpc/json").build(); | |
JSONObject params = new JSONObject(); | |
params.put("html", "<html><h1>Headline</h1><p>text</p></html>"); //will clean html and extract article text. Important to leave html structure since it is used when we are trying to extract the relevant article text. | |
//params.put("url", "http://saplo.com"); will fetch html and clean and extract article text |
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
<?php | |
include "saplo4php-2.0.php"; //downloaded from https://github.com/saplo/saplo4php-2.0 | |
//When creating the SaploAPI object ($client) you will automatically be authenticated. | |
$client = new SaploAPI("APIKEY", "SECRETKEY"); | |
//You can also get your Access Token | |
echo $client->getAccessToken(); |
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
@Parameterized.Parameters | |
public static Collection<Object[]> generateData() | |
{ | |
List<Object[]> data = new LinkedList<>(); | |
//check limit and offset | |
data.add(new Object[]{generateParameters("league=55581"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,ga,gf,gd,pts")}); | |
data.add(new Object[]{generateParameters("league=55581;size=small"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,pts")}); | |
data.add(new Object[]{generateParameters("league=54275;size=medium"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,gd,pts")}); | |
data.add(new Object[]{generateParameters("league=57973;size=large;round=3"), generateExpectedValues("positionStatuses=true;labels.type=group;stats.name=gp,w,d,l,gf,ga,gd,pts;stats.name.gp=3")}); | |
data.add(new Object[]{generateParameters("league=55581;sort=team.name"), generateExpectedValues("positionStatuses=true;labels.type=group;sta |
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
@UseStringTemplate3StatementLocator | |
public interface ModelDao { | |
@RegisterMapper(ModelPropertyMapper.class) | |
@SqlQuery("select * from model_property where model_id in ( <modelIds> )") | |
public List<ModelProperty> findModelPropertiesByModelIds(@BindIn("modelIds") Collection<Long> modelIds); | |
} |