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 | |
class AppModel extends Model { | |
function afterFind($results) | |
{ | |
$columnTypes = $this->getColumnTypes(); | |
array_walk_recursive($results, array($this, "iterateRecursion"), $columnTypes); | |
return $results; |
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.navid.webflux.serializer | |
import org.springframework.core.MethodParameter | |
import org.springframework.core.ReactiveAdapterRegistry | |
import org.springframework.data.web.PageableHandlerMethodArgumentResolver | |
import org.springframework.stereotype.Component | |
import org.springframework.util.MultiValueMap | |
import org.springframework.web.context.request.NativeWebRequest | |
import org.springframework.web.reactive.BindingContext | |
import org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport |
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
apply plugin: 'com.android.feature' | |
apply plugin: 'kotlin-android' | |
android { | |
compileSdkVersion 28 | |
baseFeature true | |
defaultConfig { | |
minSdkVersion 19 | |
targetSdkVersion 28 | |
versionCode 1 |
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
class ProblemVM( | |
val url: String, | |
val message: String, | |
val status: Int, | |
val params: MutableMap<String, Any> = HashMap() | |
) { | |
fun with(key: String, value: Any): ProblemVM { | |
params[key] = value | |
return this |
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 com.fasterxml.jackson.databind.ObjectMapper | |
import com.navid.test.creditcard.config.AppConstants.Error.Companion.Url.Companion.INTERNAL_TYPE | |
import com.navid.test.creditcard.config.error.handler.util.ProblemExceptionHandler | |
import com.navid.test.creditcard.web.rest.vm.ProblemVM | |
import org.slf4j.LoggerFactory | |
import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler | |
import org.springframework.context.annotation.Bean | |
import org.springframework.context.annotation.Configuration | |
import org.springframework.core.Ordered | |
import org.springframework.core.annotation.Order |
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
interface ProblemExceptionHandler<T : Throwable> { | |
fun supports(clazz: Throwable): Boolean | |
fun generateProblemVM(e: T): ProblemVM | |
} |
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
@Component | |
class HttpStatusCodeExceptionProblemHandler(private val objectMapper: ObjectMapper) : | |
ProblemExceptionHandler<HttpStatusCodeException> { | |
override fun supports(clazz: Throwable): Boolean { | |
return clazz is HttpStatusCodeException | |
} | |
override fun generateProblemVM(e: HttpStatusCodeException): ProblemVM { | |
val status = e.statusCode |
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
#!/bin/bash | |
set -eo pipefail | |
export KUBE_NAMESPACE=test | |
export REPLICA_COUNT=3 | |
cat <<EOF | kubectl apply -f - | |
apiVersion: apps/v1beta1 | |
kind: StatefulSet |
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
@NoRepositoryBean | |
interface BaseGenericReactiveMongoRepository<T> : ReactiveMongoRepository<T, String> { | |
fun patch(id: String, fields: Map<String, Any>): Mono<T> | |
} |
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
class SimpleBaseGenericReactiveMongoRepository<ENTITY>( | |
private val entityInformation: MappingMongoEntityInformation<ENTITY, String>, | |
private val template: ReactiveMongoTemplate | |
) : SimpleReactiveMongoRepository<ENTITY, String>(entityInformation, template), | |
BaseGenericReactiveMongoRepository<ENTITY> { | |
private val eventPublisher: ApplicationEventPublisher? | |
init { | |
val context = template.converter.mappingContext as MongoMappingContext |
OlderNewer