spring:
  application:
    name: guardpay

  profiles:
    active: local   # ?? ?? ????: local

---

spring:
  config:
    activate:
      on-profile: local

  ai:
    openai:
      api-key: dummy   # open ai ??

  datasource:
    url: jdbc:h2:mem:guardpay
    driver-class-name: org.h2.Driver
    username: sa
    password:
  jpa:
    hibernate:
      ddl-auto: create-drop   # ??? ??? ??? ?? ??
    show-sql: true
    properties:
      hibernate:
        format_sql: true
  h2:
    console:
      enabled: true
      path: /h2-console

server:
  port: 8080
  address: 0.0.0.0

---

spring:
  config:
    activate:
      on-profile: dev

  datasource:
    url: jdbc:mysql://localhost:3306/guardpay?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: root
    password: yourpassword
  jpa:
    hibernate:
      ddl-auto: update   # ?? DB?? update ?? ??
    show-sql: true
    properties:
      hibernate:
        format_sql: true

server:
  port: 8080

---

spring:
  config:
    activate:
      on-profile: prod

  datasource:
    url: jdbc:mysql://prod-db-server:3306/guardpay?useSSL=true&serverTimezone=Asia/Seoul&characterEncoding=UTF-8
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: prod_user
    password: prod_password
  jpa:
    hibernate:
      ddl-auto: validate   # ?? DB? ??? ?? ?? ??
    show-sql: false

server:
  port: 8080

spring:
  datasource:
    # 1. URL의 'mysql'을 'mariadb'로 변경
    url: jdbc:mariadb://localhost:3306/guardpay?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8
    # 2. MariaDB 드라이버 클래스 이름으로 변경
    driver-class-name: org.mariadb.jdbc.Driver
    username: root
    password: 1234 # 여기에 실제 비밀번호를 입력하세요

  jpa:
    hibernate:
      ddl-auto: create
    show-sql: true
    properties:
      hibernate:
        format_sql: true
    # 3. Hibernate Dialect(방언)를 MariaDB에 맞게 변경
    database-platform: org.hibernate.dialect.MariaDBDialect
plugins {
	id 'java'
	id 'org.springframework.boot' version '3.5.5'
	id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
description = 'Demo project for Spring Boot'

java {
	toolchain {
		languageVersion = JavaLanguageVersion.of(21)
	}
}

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

ext {
    set('springAiVersion', "1.0.1")
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.ai:spring-ai-starter-model-openai'
    compileOnly 'org.projectlombok:lombok'
    runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.security:spring-security-test'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.ai:spring-ai-bom:${springAiVersion}"
    }
}

tasks.named('test') {
    useJUnitPlatform()
}

JDK 21