Skip to content
yeominsoo edited this page Feb 2, 2023 · 3 revisions

Local 세팅 가이드

1. application.properties 설정

  • login시 사용자 정보 및 db정보를 조회할 수 있는 db를 세팅해야한다.
  • 현재 postgreSQL로 설정되어있음.

2. POSTMAN collection

  • postman collection 정보 아래 json import
  • 요청 정보는 양식만 참조.
{
	"info": {
		"_postman_id": "fd8f1436-2531-43f2-b048-ef4d6716f77f",
		"name": "TO API",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "login",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "msyeo",
					"options": {
						"raw": {
							"language": "text"
						}
					}
				},
				"url": {
					"raw": "http://localhost:8081/warevalley/torange/api/selectUserDatabaseInfo",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8081",
					"path": [
						"warevalley",
						"torange",
						"api",
						"selectUserDatabaseInfo"
					]
				}
			},
			"response": []
		},
		{
			"name": "createUserConnectionPool mariadb",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"userId\": \"[user id]\",\r\n    \"dbUrl\": \"[db url]\",\r\n    \"dbUser\": \"[db username]\",\r\n    \"dbPw\": \"[db password]\",\r\n    \"dbDriverName\": \"[db driverClassPath]\",\r\n    \"dbType\": \"[db type]\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://localhost:8081/warevalley/torange/api/createUserConnectionPool",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8081",
					"path": [
						"warevalley",
						"torange",
						"api",
						"createUserConnectionPool"
					]
				}
			},
			"response": []
		},
		{
			"name": "createUserConnectionPool Postgresql",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"userId\": \"[user id]\",\r\n    \"dbUrl\": \"[db url]\",\r\n    \"dbUser\": \"[db username]\",\r\n    \"dbPw\": \"[db password]\",\r\n    \"dbDriverName\": \"[db driverClassPath]\",\r\n    \"dbType\": \"[db type]\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://localhost:8081/warevalley/torange/api/createUserConnectionPool",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8081",
					"path": [
						"warevalley",
						"torange",
						"api",
						"createUserConnectionPool"
					]
				}
			},
			"response": []
		},
		{
			"name": "selectConnectionTest MariaDB",
			"protocolProfileBehavior": {
				"disabledSystemHeaders": {}
			},
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"dbPoolName\": \"[Login user id]@@[db type]\",\r\n    \"sql\": \"[sql query]\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://localhost:8081/warevalley/torange/api/selectConnectionTest",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8081",
					"path": [
						"warevalley",
						"torange",
						"api",
						"selectConnectionTest"
					]
				}
			},
			"response": []
		},
		{
			"name": "selectConnectionTest PostgreSQL",
			"protocolProfileBehavior": {
				"disabledSystemHeaders": {}
			},
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"dbPoolName\": \"[Login user id]@@[db type]\",\r\n    \"sql\": \"[sql query]\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://localhost:8081/warevalley/torange/api/selectConnectionTest",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8081",
					"path": [
						"warevalley",
						"torange",
						"api",
						"selectConnectionTest"
					]
				}
			},
			"response": []
		},
		{
			"name": "releaseConnection MariaDB",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"dbPoolName\": \"[Login user id]@@[db type]\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://localhost:8081/warevalley/torange/api/poolShutdown",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8081",
					"path": [
						"warevalley",
						"torange",
						"api",
						"poolShutdown"
					]
				}
			},
			"response": []
		},
		{
			"name": "releaseConnection PostgreSQL",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"dbPoolName\": \"[Login user id]@@[db type]\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://localhost:8081/warevalley/torange/api/poolShutdown",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8081",
					"path": [
						"warevalley",
						"torange",
						"api",
						"poolShutdown"
					]
				}
			},
			"response": []
		}
	]
}

3. build.gradle 설정

  1. dependencies 설정 "2023-02-02 기준"
  • db driver dependencies 추가
 <!-- 2023-02-02 추가된 driver -->
    runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
    runtimeOnly 'org.postgresql:postgresql'
  • 차 후 resources를 통해 driver를 관리할 예정

Clone this wiki locally