diff --git a/src/main/java/zerobibim/flory/global/config/SwaggerConfig.java b/src/main/java/zerobibim/flory/global/config/SwaggerConfig.java index b3b5dbb..e1f73d6 100644 --- a/src/main/java/zerobibim/flory/global/config/SwaggerConfig.java +++ b/src/main/java/zerobibim/flory/global/config/SwaggerConfig.java @@ -1,24 +1,24 @@ -//package zerobibim.flory.global.config; -// -//import io.swagger.v3.oas.models.Components; -//import io.swagger.v3.oas.models.OpenAPI; -//import io.swagger.v3.oas.models.info.Info; -//import org.springframework.context.annotation.Bean; -//import org.springframework.context.annotation.Configuration; -// -//@Configuration -//public class SwaggerConfig { -// @Bean -// public OpenAPI openAPI() { -// return new OpenAPI() -// .components(new Components()) -// .info(apiInfo()); -// } -// -// private Info apiInfo() { -// return new Info() -// .title("Swagger for flory") -// .description("Springdoc을 사용한 Swagger UI for flory") -// .version("1.0.0"); -// } -//} \ No newline at end of file +package zerobibim.flory.global.config; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class SwaggerConfig { + @Bean + public OpenAPI openAPI() { + return new OpenAPI() + .components(new Components()) + .info(apiInfo()); + } + + private Info apiInfo() { + return new Info() + .title("Swagger for flory") + .description("Springdoc을 사용한 Swagger UI for flory") + .version("1.0.0"); + } +} \ No newline at end of file diff --git a/src/main/java/zerobibim/flory/global/config/Web3jConfig.java b/src/main/java/zerobibim/flory/global/config/Web3jConfig.java index c107af1..8434063 100644 --- a/src/main/java/zerobibim/flory/global/config/Web3jConfig.java +++ b/src/main/java/zerobibim/flory/global/config/Web3jConfig.java @@ -1,47 +1,47 @@ -package zerobibim.flory.global.config; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.web3j.crypto.Credentials; -import org.web3j.crypto.ECKeyPair; -import org.web3j.protocol.Web3j; -import org.web3j.protocol.http.HttpService; -import org.web3j.tx.Contract; -import org.web3j.tx.gas.StaticGasProvider; -import zerobibim.flory.domain.contract.NFT; - -import java.math.BigInteger; - -@Configuration -public class Web3jConfig { - - @Value("${infura.API_URL}") - private String INFURA_API_URL; - - @Value("${metamask.PRIVATE_KEY}") - private String PRIVATE_KEY; - - @Value("${metamask.CONTRACT_ADDRESS}") - private String CONTRACT_ADDRESS; - - @Bean - public Web3j web3j() { - return Web3j.build(new HttpService(INFURA_API_URL)); - } - - @Bean - public Credentials credentials() { - BigInteger privateKeyInBT = new BigInteger(PRIVATE_KEY, 16); - return Credentials.create(ECKeyPair.create(privateKeyInBT)); - } - - @Bean - public NFT nft() { - BigInteger gasPrice = Contract.GAS_PRICE; - BigInteger gasLimit = Contract.GAS_LIMIT; - //StaticGasProvider gasProvider = new StaticGasProvider(gasPrice, gasLimit); - - return NFT.load(CONTRACT_ADDRESS, web3j(), credentials(), gasPrice, gasLimit); - } -} \ No newline at end of file +//package zerobibim.flory.global.config; +// +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.web3j.crypto.Credentials; +//import org.web3j.crypto.ECKeyPair; +//import org.web3j.protocol.Web3j; +//import org.web3j.protocol.http.HttpService; +//import org.web3j.tx.Contract; +//import org.web3j.tx.gas.StaticGasProvider; +//import zerobibim.flory.domain.contract.NFT; +// +//import java.math.BigInteger; +// +//@Configuration +//public class Web3jConfig { +// +// @Value("${infura.API_URL}") +// private String INFURA_API_URL; +// +// @Value("${metamask.PRIVATE_KEY}") +// private String PRIVATE_KEY; +// +// @Value("${metamask.CONTRACT_ADDRESS}") +// private String CONTRACT_ADDRESS; +// +// @Bean +// public Web3j web3j() { +// return Web3j.build(new HttpService(INFURA_API_URL)); +// } +// +// @Bean +// public Credentials credentials() { +// BigInteger privateKeyInBT = new BigInteger(PRIVATE_KEY, 16); +// return Credentials.create(ECKeyPair.create(privateKeyInBT)); +// } +// +// @Bean +// public NFT nft() { +// BigInteger gasPrice = Contract.GAS_PRICE; +// BigInteger gasLimit = Contract.GAS_LIMIT; +// //StaticGasProvider gasProvider = new StaticGasProvider(gasPrice, gasLimit); +// +// return NFT.load(CONTRACT_ADDRESS, web3j(), credentials(), gasPrice, gasLimit); +// } +//} \ No newline at end of file