@NotEmpty
    private String userId;

-->

/* @NotEmpty */
    private String userId;

 

(https://tecoble.techcourse.co.kr/post/2020-09-20-validation-in-spring-boot/)



(https://stackoverflow.com/questions/12711786/convert-command-line-arguments-into-an-array-in-bash/12711837)

#!/bin/bash

echo "Dollar-1 : $1"
echo "Dollar-2 : $2"
echo "Dollar-3 : $3"
echo "Dollar-AT: $@"
echo ""

myArray=( "$@" )

echo "A Val 0: ${myArray[0]}"
echo "A Val 1: ${myArray[1]}"
echo "A Val 2: ${myArray[2]}"
echo "A All Values: ${myArray[@]}"


spring, @Controller @RestController

2021. 9. 24. 17:52

보호되어 있는 글입니다. 내용을 보시려면 비밀번호를 입력하세요.


java, Gson

카테고리 없음 2021. 9. 24. 17:52
$ cat build.gradle
...
dependencies {
....

implementation 'com.google.code.gson:gson'
...
}
...

$ cat GsonTest.java
...
import com.google.gson.GsonBuilder;
...
        String req = new GsonBuilder().create().toJson(obj);
        ...
                Mono<String> result = webClient.mutate()
                .build()
                .post()
                .uri(uri)
                .header("Content-Type", "application/json")
                .header("openapikey", openapikey())
                .bodyValue(req)
                .accept(MediaType.APPLICATION_JSON)
                .retrieve()
                .bodyToMono(String.class);

 


java, Gson

카테고리 없음 2021. 9. 7. 14:58
$ cat build.gradle
...
dependencies {
....

implementation 'com.google.code.gson:gson'
...
}
...

$ cat GsonTest.java
...
import com.google.gson.GsonBuilder;
...
        String req = new GsonBuilder().create().toJson(obj);
        ...
                Mono<String> result = webClient.mutate()
                .build()
                .post()
                .uri(uri)
                .header("Content-Type", "application/json")
                .header("openapikey", openapikey())
                .bodyValue(req)
                .accept(MediaType.APPLICATION_JSON)
                .retrieve()
                .bodyToMono(String.class);

 


 you can create new instances of Foo by writing: Foo.of(5); instead of having to write: new Foo<Integer>(5);.

(https://projectlombok.org/features/Data)


$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py


import requests

def exists(path):
r = requests.head(path)
return r.status_code == requests.codes.ok

url='url='https://static01.nyt.com/images/2021/08/25/us/politics/25dc-lawmakers1/merlin_158041143_78d36ee5-264a-4431-b384-13d19ae386ec-superJumbo.jpg'
if (exists(url)):
print ('OK')
else:
print ('not exists:'+url)


(X) SELECT COLUMN_NAME FROM ....

(O) SELECT COLUMN_NAME as columnName FROM ...