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 ru; | |
import lombok.Data; | |
/** | |
* Created by Dmitry Tkachenko on 4/7/18 | |
*/ | |
@Data | |
public class Child { |
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
/.gradle/ | |
/.idea/ | |
/build/ | |
**/*.iml | |
**/target/ | |
**/out | |
**/log |
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
dependencies { | |
compile 'org.springframework.boot:spring-boot-starter-mail:1.5.7.RELEASE' | |
} |
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 ru.mailer.service | |
import com.icegreen.greenmail.util.GreenMail | |
import com.icegreen.greenmail.util.ServerSetup | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.boot.test.context.SpringBootTest | |
import ru.mailer.mq.model.MessageDto | |
import spock.lang.Shared | |
import spock.lang.Specification |
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
version: "2" | |
services: | |
redis: | |
image: redis:latest | |
ports: | |
- 6379:6379 | |
restart: always | |
volumes: | |
- /etc/localtime:/etc/localtime:ro | |
redisCli: |
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 ru.rtln.mailer.config; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import lombok.RequiredArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
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
@Data | |
@ToString(exclude = {"password"}) | |
public class MyRequest { | |
@NotEmpty | |
@Size(min = 1, max = 64) | |
private String password; | |
private Set<String> emails; |
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
@RestController | |
@Slf4j | |
@RequiredArgsConstructor | |
@RequestMapping("channel") | |
public class MyController { | |
// Если бы мы в UserPrincipal добавили public final static String ROLE_ADMIN_NAME = ROLE_PREFIX + Role.ADMIN; | |
// или Role.ADMIN.name(), | |
// то при использовании @Secured(UserPrincipal.ROLE_ADMIN_NAME) мы бы получили: Attribute value must be constant. | |
// Т.к. здесь используется вызов функции Role. или Role.ADMIN., а это уже не константа |
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
def testMapToJson() { | |
def obj = new DictionaryRow() | |
obj.id = 1L | |
obj.values = [ | |
(new DictionaryField().setId(1)) : 1, | |
(new DictionaryField().setId(2)) : 2] as Map | |
println new JsonBuilder(obj).toPrettyString() | |
} |
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
# current file location: src/main/liquibase/v-1.0/2018_12_14--01-dictionary.groovy | |
databaseChangeLog() { | |
changeSet(id: '1547828693315-1', author: 'dmitry_tkachenko (generated)') { | |
createSequence(cacheSize: 0, cycle: false, incrementBy: 1, maxValue: 9999999999999999999999999999, minValue: 1, ordered: false, sequenceName: 'CHANNEL_SEQ', startValue: 3) | |
} | |
changeSet(id: '1547828693315-41', author: 'dmitry_tkachenko (generated)') { | |
createTable(tableName: 'TEMPLATE_CHANNEL_TAB') { | |
column(name: 'TEMPLATE_ID', type: 'NUMBER(19, 0)') { | |
constraints(nullable: false) |