This file contains hidden or 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 config | |
import ( | |
"fmt" | |
"github.com/spf13/viper" | |
"reflect" | |
"strings" | |
) | |
var readFromEnv = func(v *viper.Viper) *viper.Viper { |
This file contains hidden or 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 main | |
import ( | |
"go.uber.org/zap" | |
"helloWorld/pkg/api" | |
"helloWorld/pkg/config/config" | |
"helloWorld/pkg/config/migrate" | |
"helloWorld/pkg/config/postgre" | |
"helloWorld/pkg/logging" | |
"helloWorld/pkg/router" |
This file contains hidden or 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.cem.springnativeexample.configuration.security; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | |
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; |
This file contains hidden or 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.cem.springnativeexample.controller; | |
import com.cem.springnativeexample.controller.model.User; | |
import com.cem.springnativeexample.service.UserService; | |
import com.sun.istack.NotNull; | |
import org.springframework.security.access.prepost.PreAuthorize; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.Collection; | |
import java.util.Optional; |
This file contains hidden or 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.cem.springnativeexample.repository.entity; | |
import com.cem.springnativeexample.controller.model.User; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; | |
import lombok.NoArgsConstructor; | |
import javax.persistence.*; | |
This file contains hidden or 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.cem.springnativeexample.service; | |
import com.cem.springnativeexample.controller.model.User; | |
import com.cem.springnativeexample.repository.UserRepository; | |
import com.cem.springnativeexample.repository.entity.UserEntity; | |
import org.springframework.stereotype.Service; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.stream.Collectors; |
This file contains hidden or 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.cem.springnativeexample.controller; | |
import com.cem.springnativeexample.controller.model.User; | |
import com.cem.springnativeexample.service.UserService; | |
import com.sun.istack.NotNull; | |
import org.springframework.security.access.prepost.PreAuthorize; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.Collection; | |
import java.util.Optional; |
This file contains hidden or 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.cem.springnativeexample.configuration.security; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | |
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; |
This file contains hidden or 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"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-parent</artifactId> | |
<version>2.4.4</version> | |
<relativePath/> <!-- lookup parent from repository --> | |
</parent> |
This file contains hidden or 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 Main { | |
public static void main(String[] args) { | |
ProxyFactory factory = new ProxyFactory(new SimplePojo()); | |
factory.addInterface(Pojo.class); | |
factory.addAdvice(new RetryAdvice()); | |
Pojo pojo = (Pojo) factory.getProxy(); | |