Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 07fbe1ba54 | |||
| 4916bdf4af | |||
| 35621b5174 | |||
| b97b0fcf7b | |||
| 6cb98d36bb | |||
| fd229fca43 | |||
| 5e8d08f1af | |||
| e7945233fe | |||
| 815e2bdd04 | |||
| 0629e842a3 | |||
| 6fa2167378 | |||
| 84e873a08b | |||
| 6c231c4189 | |||
| e3b5a44270 | |||
| 829630ae5c | |||
| 2a9694cd85 | |||
| 456b635a32 | |||
| faaf9e8cd6 | |||
| 4749613947 | |||
| 5125dab897 | |||
| 4181d114c1 | |||
| daff07c006 | |||
| 1f51c9b21e |
@@ -80,6 +80,21 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SBOM(CycloneDX) -> xlsx. 산출물 eapim-portal-sbom.xlsx 를 아티팩트로 보관.
|
||||
// 실패해도 배포는 진행하도록 UNSTABLE 로만 표시한다.
|
||||
stage('SBOM') {
|
||||
steps {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh 'gradle sbomXlsx --no-daemon -Pprofile=weblogic'
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/sbom/*.xlsx', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,5 +101,20 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SBOM(CycloneDX) -> xlsx. 산출물 eapim-portal-sbom.xlsx 를 아티팩트로 보관.
|
||||
// 실패해도 빌드는 진행하도록 UNSTABLE 로만 표시한다.
|
||||
stage('SBOM') {
|
||||
steps {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh 'gradle sbomXlsx --no-daemon'
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/sbom/*.xlsx', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-3
@@ -80,9 +80,10 @@ dependencies {
|
||||
// exclude group: 'commons-collections', module: 'commons-collections'
|
||||
}
|
||||
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.3'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.3'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
|
||||
// WS-2026-0003 (jackson-core async parser DoS, CVSS 7.5) — 2.18.6 에서 수정. JDK8 호환.
|
||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.18.6'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.18.6'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.6'
|
||||
|
||||
implementation group: 'org.apache.velocity', name: 'velocity-engine-core', version: '2.3'
|
||||
|
||||
@@ -203,3 +204,5 @@ task printSourceSets {
|
||||
}
|
||||
}
|
||||
}
|
||||
// CycloneDX SBOM -> xlsx 변환 (gradle sbomXlsx)
|
||||
apply from: "$projectDir/gradle/sbom-xlsx.gradle"
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
/*
|
||||
* CycloneDX SBOM(bom.json) -> Excel(xlsx) 변환 태스크.
|
||||
*
|
||||
* gradle sbomXlsx # cyclonedxBom 실행 후 변환
|
||||
* gradle sbomXlsx -PsbomJson=path.json # 기존 bom.json 사용(cyclonedxBom 생략)
|
||||
* gradle sbomXlsx -PsbomOut=out.xlsx # 출력 경로 지정
|
||||
*
|
||||
* buildscript 블록이 이 스크립트에만 적용되므로 POI 의존성이 메인 빌드
|
||||
* classpath 나 WAR 산출물에는 포함되지 않는다.
|
||||
*
|
||||
* 시트: 요약 / WAR 기준
|
||||
* 산출 기준은 war 태스크의 classpath(= runtimeClasspath) 이므로
|
||||
* test·annotationProcessor·developmentOnly·compileOnly 의존은 모두 제외된다.
|
||||
* bom.json 은 라이선스/해시/설명/직접-전이 판별을 위한 메타 소스로만 쓴다.
|
||||
*/
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url "https://nexus.eactive.synology.me:8090/repository/maven-public/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.apache.poi:poi-ooxml:3.17'
|
||||
}
|
||||
}
|
||||
|
||||
import groovy.json.JsonSlurper
|
||||
import org.apache.poi.ss.usermodel.BorderStyle
|
||||
import org.apache.poi.ss.usermodel.FillPatternType
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment
|
||||
import org.apache.poi.ss.usermodel.IndexedColors
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment
|
||||
import org.apache.poi.ss.util.CellRangeAddress
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook
|
||||
|
||||
// 엑셀 셀 문자열 상한(32767)보다 여유를 둔 절단 길이
|
||||
ext.SBOM_CELL_LIMIT = 32000
|
||||
|
||||
task sbomXlsx {
|
||||
group = 'sbom'
|
||||
description = 'CycloneDX bom.json 을 WAR 수록 기준 xlsx 로 변환한다'
|
||||
|
||||
// -PsbomJson 으로 기존 산출물을 지정하면 재생성하지 않는다
|
||||
if (!project.hasProperty('sbomJson')) {
|
||||
dependsOn 'cyclonedxBom'
|
||||
}
|
||||
|
||||
doLast {
|
||||
File src = resolveBomJson(project)
|
||||
File out = project.hasProperty('sbomOut')
|
||||
? project.file(project.property('sbomOut'))
|
||||
: new File(project.buildDir, "reports/sbom/${sbomFileName(project)}")
|
||||
out.parentFile.mkdirs()
|
||||
|
||||
def bom = new JsonSlurper().parse(src, 'UTF-8')
|
||||
def deploy = collectDeployJars(project)
|
||||
def warRows = joinWarRows(deploy.jars, indexComponents(bom))
|
||||
|
||||
def wb = new XSSFWorkbook()
|
||||
def st = createStyles(wb)
|
||||
writeSummarySheet(wb, st, bom, warRows, src, deploy.label)
|
||||
writeWarSheet(wb, st, warRows)
|
||||
|
||||
out.withOutputStream { os -> wb.write(os) }
|
||||
wb.close()
|
||||
|
||||
int unmatched = warRows.count { it.matched == 'N' }
|
||||
logger.lifecycle("SBOM xlsx 생성: ${out.absolutePath} " +
|
||||
"(배포 수록 ${warRows.size()}개, SBOM 미매칭 ${unmatched}개, 원본 ${src.name})")
|
||||
}
|
||||
}
|
||||
|
||||
/** 산출 파일명: 배포 패키지명 기준 (war 있으면 war 파일명, 없으면 project 이름[-버전]) */
|
||||
String sbomFileName(Project p) {
|
||||
def warTask = p.tasks.findByName('war')
|
||||
if (warTask != null) {
|
||||
String archive = warTask.archiveFileName.get()
|
||||
return archive.replaceAll(/\.(war|jar|ear)$/, '') + '-sbom.xlsx'
|
||||
}
|
||||
String ver = (p.version == null || p.version.toString() in ['', 'unspecified']) ? '' : "-${p.version}"
|
||||
return "${p.name}${ver}-sbom.xlsx"
|
||||
}
|
||||
|
||||
/** bom.json 위치 결정: -PsbomJson > cyclonedxBom 산출 경로 후보 */
|
||||
File resolveBomJson(Project p) {
|
||||
if (p.hasProperty('sbomJson')) {
|
||||
File f = p.file(p.property('sbomJson'))
|
||||
if (!f.exists()) {
|
||||
throw new GradleException("bom.json 없음: ${f.absolutePath}")
|
||||
}
|
||||
return f
|
||||
}
|
||||
def candidates = [
|
||||
new File(p.buildDir, 'reports/cyclonedx/bom.json'),
|
||||
new File(p.buildDir, 'reports/bom.json'),
|
||||
]
|
||||
File found = candidates.find { it.exists() }
|
||||
if (found == null) {
|
||||
throw new GradleException(
|
||||
"bom.json 을 찾지 못했다. 확인한 경로: " + candidates*.absolutePath.join(', ') +
|
||||
"\n'gradle cyclonedxBom' 실행 후 재시도하거나 -PsbomJson=<경로> 로 지정한다.")
|
||||
}
|
||||
return found
|
||||
}
|
||||
|
||||
/**
|
||||
* 실제 배포물에 packaging 되는 jar 목록.
|
||||
* war 프로젝트는 war 태스크 classpath(= runtimeClasspath), 그 외는 runtimeClasspath 를
|
||||
* 기준으로 하므로 test/annotationProcessor/developmentOnly/compileOnly 는 자동으로 빠진다.
|
||||
*
|
||||
* @return [label: 기준 설명, jars: 행 목록]
|
||||
*/
|
||||
Map collectDeployJars(Project p) {
|
||||
def cfg = p.configurations.findByName('runtimeClasspath')
|
||||
if (cfg == null) {
|
||||
p.logger.warn("[${p.name}] runtimeClasspath 가 없어 배포 기준 시트를 비운다")
|
||||
return [label: '(없음)', jars: []]
|
||||
}
|
||||
|
||||
def warTask = p.tasks.findByName('war')
|
||||
def files
|
||||
String label
|
||||
if (warTask != null) {
|
||||
files = warTask.classpath.files
|
||||
label = 'WAR WEB-INF/lib (war 태스크 classpath)'
|
||||
} else {
|
||||
files = cfg.files
|
||||
label = 'runtimeClasspath (war 태스크 없음)'
|
||||
}
|
||||
|
||||
def coordByFile = [:]
|
||||
cfg.resolvedConfiguration.resolvedArtifacts.each { a ->
|
||||
def id = a.moduleVersion.id
|
||||
coordByFile[a.file] = [group: id.group, name: id.name, version: id.version]
|
||||
}
|
||||
def jars = files.findAll { it.name.endsWith('.jar') }.collect { f ->
|
||||
def c = coordByFile[f]
|
||||
[
|
||||
file : f.name,
|
||||
group : c?.group ?: '',
|
||||
name : c?.name ?: f.name.replaceAll(/\.jar$/, ''),
|
||||
version: c?.version ?: '',
|
||||
coord : c ? "${c.group}:${c.name}:${c.version}".toString() : '',
|
||||
]
|
||||
}.sort { it.file }
|
||||
|
||||
return [label: label, jars: jars]
|
||||
}
|
||||
|
||||
/** bom.json 컴포넌트를 'group:name:version' 키로 색인 (라이선스/해시/설명/직접-전이) */
|
||||
Map indexComponents(bom) {
|
||||
String rootRef = bom.metadata?.component?.'bom-ref'
|
||||
Set directRefs = (bom.dependencies?.find { it.ref == rootRef }?.dependsOn ?: []) as Set
|
||||
|
||||
def index = [:]
|
||||
bom.components?.each { c ->
|
||||
def hashes = [:]
|
||||
c.hashes?.each { h -> hashes[h.alg] = h.content }
|
||||
|
||||
def licenses = (c.licenses ?: []).collect { l ->
|
||||
l.license?.id ?: l.license?.name ?: l.expression ?: ''
|
||||
}.findAll { it }
|
||||
|
||||
index["${c.group ?: ''}:${c.name ?: ''}:${c.version ?: ''}".toString()] = [
|
||||
direct : directRefs.contains(c.'bom-ref') ? '직접' : '전이',
|
||||
licenses : licenses.join('; '),
|
||||
licenseList: licenses.isEmpty() ? ['(미상)'] : licenses,
|
||||
purl : c.purl ?: '',
|
||||
sha256 : hashes['SHA-256'] ?: '',
|
||||
sha1 : hashes['SHA-1'] ?: '',
|
||||
description: c.description ?: '',
|
||||
]
|
||||
}
|
||||
return index
|
||||
}
|
||||
|
||||
/** WAR jar 목록에 SBOM 메타를 좌표로 결합 */
|
||||
List joinWarRows(List warJars, Map index) {
|
||||
def result = []
|
||||
warJars.eachWithIndex { j, i ->
|
||||
def m = j.coord ? index[j.coord] : null
|
||||
result << [
|
||||
no : i + 1,
|
||||
file : j.file,
|
||||
group : j.group,
|
||||
name : j.name,
|
||||
version : j.version,
|
||||
direct : m?.direct ?: '',
|
||||
licenses : m?.licenses ?: '',
|
||||
licenseList: m?.licenseList ?: ['(미상)'],
|
||||
purl : m?.purl ?: '',
|
||||
sha256 : m?.sha256 ?: '',
|
||||
sha1 : m?.sha1 ?: '',
|
||||
matched : (m != null) ? 'Y' : 'N',
|
||||
description: m?.description ?: '',
|
||||
]
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Map createStyles(wb) {
|
||||
def headFont = wb.createFont()
|
||||
headFont.setBold(true)
|
||||
headFont.setColor(IndexedColors.WHITE.getIndex())
|
||||
|
||||
def head = wb.createCellStyle()
|
||||
head.setFont(headFont)
|
||||
head.setFillForegroundColor(IndexedColors.DARK_BLUE.getIndex())
|
||||
head.setFillPattern(FillPatternType.SOLID_FOREGROUND)
|
||||
head.setAlignment(HorizontalAlignment.CENTER)
|
||||
head.setVerticalAlignment(VerticalAlignment.CENTER)
|
||||
head.setBorderBottom(BorderStyle.THIN)
|
||||
|
||||
def body = wb.createCellStyle()
|
||||
body.setVerticalAlignment(VerticalAlignment.TOP)
|
||||
|
||||
def wrap = wb.createCellStyle()
|
||||
wrap.setVerticalAlignment(VerticalAlignment.TOP)
|
||||
wrap.setWrapText(true)
|
||||
|
||||
def labelFont = wb.createFont()
|
||||
labelFont.setBold(true)
|
||||
def label = wb.createCellStyle()
|
||||
label.setFont(labelFont)
|
||||
|
||||
return [head: head, body: body, wrap: wrap, label: label]
|
||||
}
|
||||
|
||||
/** 헤더 행 생성 + 폭 지정 + 틀고정 */
|
||||
def writeHeader(sheet, style, List<String> headers, List<Integer> widths) {
|
||||
def row = sheet.createRow(0)
|
||||
row.setHeightInPoints(20f)
|
||||
headers.eachWithIndex { h, i ->
|
||||
def cell = row.createCell(i)
|
||||
cell.setCellValue(h)
|
||||
cell.setCellStyle(style)
|
||||
sheet.setColumnWidth(i, widths[i] * 256)
|
||||
}
|
||||
sheet.createFreezePane(0, 1)
|
||||
}
|
||||
|
||||
def cellOf(row, int idx, value, style) {
|
||||
def cell = row.createCell(idx)
|
||||
String s = (value == null) ? '' : value.toString()
|
||||
if (s.length() > SBOM_CELL_LIMIT) {
|
||||
s = s.substring(0, SBOM_CELL_LIMIT) + '…(생략)'
|
||||
}
|
||||
cell.setCellValue(s)
|
||||
cell.setCellStyle(style)
|
||||
return cell
|
||||
}
|
||||
|
||||
def writeSummarySheet(wb, st, bom, List warRows, File src, String basisLabel) {
|
||||
def sheet = wb.createSheet('요약')
|
||||
def comp = bom.metadata?.component ?: [:]
|
||||
def tool = bom.metadata?.tools?.components?.getAt(0)
|
||||
Set licenseKinds = warRows.collectMany { it.licenseList } as Set
|
||||
|
||||
def items = [
|
||||
['대상 프로젝트', "${comp.group ?: ''}:${comp.name ?: ''}:${comp.version ?: ''}"],
|
||||
['산출 기준', "${basisLabel} — test/annotationProcessor/compileOnly 제외"],
|
||||
['BOM 포맷', "${bom.bomFormat ?: ''} ${bom.specVersion ?: ''}"],
|
||||
['serialNumber', bom.serialNumber ?: ''],
|
||||
['생성 시각', bom.metadata?.timestamp ?: ''],
|
||||
['생성 도구', tool ? "${tool.name} ${tool.version}" : ''],
|
||||
['원본 파일', src.absolutePath],
|
||||
['배포 수록 jar', warRows.size()],
|
||||
[' └ 직접 의존', warRows.count { it.direct == '직접' }],
|
||||
[' └ 전이 의존', warRows.count { it.direct == '전이' }],
|
||||
[' └ SBOM 미매칭', warRows.count { it.matched == 'N' }],
|
||||
['라이선스 종류', licenseKinds.size()],
|
||||
['라이선스 미상', warRows.count { it.licenses.isEmpty() }],
|
||||
]
|
||||
|
||||
writeHeader(sheet, st.head, ['항목', '값'], [30, 90])
|
||||
items.eachWithIndex { item, i ->
|
||||
def row = sheet.createRow(i + 1)
|
||||
cellOf(row, 0, item[0], st.label)
|
||||
cellOf(row, 1, item[1], st.body)
|
||||
}
|
||||
|
||||
// 라이선스 분포 (요약 하단)
|
||||
def byLicense = [:].withDefault { 0 }
|
||||
warRows.each { r -> r.licenseList.each { lic -> byLicense[lic] = byLicense[lic] + 1 } }
|
||||
def sorted = byLicense.entrySet().sort { a, b -> (b.value <=> a.value) ?: (a.key <=> b.key) }
|
||||
|
||||
int base = items.size() + 2
|
||||
def hdr = sheet.createRow(base)
|
||||
cellOf(hdr, 0, '라이선스', st.head)
|
||||
cellOf(hdr, 1, 'jar 수', st.head)
|
||||
sorted.eachWithIndex { e, i ->
|
||||
def row = sheet.createRow(base + 1 + i)
|
||||
cellOf(row, 0, e.key, st.body)
|
||||
cellOf(row, 1, e.value, st.body)
|
||||
}
|
||||
}
|
||||
|
||||
/** 실제 배포물(WAR WEB-INF/lib) 기준 시트 */
|
||||
def writeWarSheet(wb, st, List warRows) {
|
||||
def sheet = wb.createSheet('WAR 기준')
|
||||
def headers = ['No', 'jar 파일명', 'Group', 'Name', 'Version', '구분',
|
||||
'License', 'purl', 'SHA-256', 'SHA-1', 'SBOM매칭', 'Description']
|
||||
def widths = [6, 46, 32, 34, 16, 7, 30, 60, 40, 30, 10, 60]
|
||||
writeHeader(sheet, st.head, headers, widths)
|
||||
|
||||
warRows.eachWithIndex { r, i ->
|
||||
def row = sheet.createRow(i + 1)
|
||||
cellOf(row, 0, r.no, st.body)
|
||||
cellOf(row, 1, r.file, st.body)
|
||||
cellOf(row, 2, r.group, st.body)
|
||||
cellOf(row, 3, r.name, st.body)
|
||||
cellOf(row, 4, r.version, st.body)
|
||||
cellOf(row, 5, r.direct, st.body)
|
||||
cellOf(row, 6, r.licenses, st.body)
|
||||
cellOf(row, 7, r.purl, st.body)
|
||||
cellOf(row, 8, r.sha256, st.body)
|
||||
cellOf(row, 9, r.sha1, st.body)
|
||||
cellOf(row, 10, r.matched, st.body)
|
||||
cellOf(row, 11, r.description, st.wrap)
|
||||
}
|
||||
if (!warRows.isEmpty()) {
|
||||
sheet.setAutoFilter(new CellRangeAddress(0, warRows.size(), 0, headers.size() - 1))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.eactive.apim.gateway.data.statistics.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* API 상태 모니터링 결과 (AGWAPP.API_STATUS).
|
||||
*
|
||||
* <p>eapim-admin 의 {@code ApiStatusMonitorJob} 이 상태 변화가 있을 때만 upsert 한다.
|
||||
* 포털은 읽기 전용으로 "마지막 상태 변경 시각" 표시에 사용한다.</p>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "API_STATUS")
|
||||
@Data
|
||||
public class GwApiStatus {
|
||||
|
||||
/** EAI 서비스명 */
|
||||
@Id
|
||||
@Column(name = "EAISVCNAME", length = 30)
|
||||
private String eaisvcname;
|
||||
|
||||
/** N 정상 / C 점검 / D 지연 / E 장애 */
|
||||
@Column(name = "STATUS_CODE", length = 1)
|
||||
private String statusCode;
|
||||
|
||||
@Column(name = "MODIFIED_BY", length = 20)
|
||||
private String modifiedBy;
|
||||
|
||||
@Column(name = "MODIFIED_DATE")
|
||||
private LocalDateTime modifiedDate;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.eactive.apim.gateway.data.statistics.repository;
|
||||
|
||||
import com.eactive.apim.gateway.data.statistics.entity.GwApiStatus;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GwApiStatusRepository extends Repository<GwApiStatus, String> {
|
||||
|
||||
/**
|
||||
* API 상태가 마지막으로 변경된 시각. 데이터가 없으면 empty.
|
||||
*/
|
||||
@Query("SELECT MAX(s.modifiedDate) FROM GwApiStatus s")
|
||||
Optional<LocalDateTime> findLastModifiedDate();
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.eactive.apim.portal.apps.apiservice.dto.ApiServiceDTO;
|
||||
import com.eactive.apim.portal.apps.apiservice.service.ApiServiceService;
|
||||
import com.eactive.apim.portal.common.exception.NotFoundException;
|
||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.ApiStatusCatalogService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,6 +32,7 @@ public class ApiController {
|
||||
private final ApiService apiService;
|
||||
private final ApiServiceService apiServiceService;
|
||||
private final ApiSearchFacade apiSearchFacade;
|
||||
private final ApiStatusCatalogService apiStatusCatalogService;
|
||||
private static final String DEFAULT_TOKEN_API_ID = "default-token-api-spec";
|
||||
private static final String DEFAULT_TOKEN_API_NAME = "인증";
|
||||
|
||||
@@ -86,6 +88,8 @@ public class ApiController {
|
||||
model.addAttribute("totalApiCount", searchResult.get("totalApiCount"));
|
||||
model.addAttribute("selectedApiCount", searchResult.get("selectedApiCount"));
|
||||
model.addAttribute("selected", search.getGroupIds().size() > 0 ? search.getGroupIds().get(0) : "-1");
|
||||
// 카드의 현재 상태 태그 노출 여부 (PTL_PROPERTY djb.apistatus.api-list-status-badge)
|
||||
model.addAttribute("apiStatusBadgeEnabled", apiStatusCatalogService.isApiListStatusBadgeEnabled());
|
||||
|
||||
return "apps/apis/mainApiList";
|
||||
}
|
||||
|
||||
@@ -203,6 +203,14 @@ public class ApiTesterFilter implements Filter {
|
||||
}
|
||||
|
||||
proxyTarget = targetUri;
|
||||
if (logger.isDebugEnabled()) {
|
||||
// GW SERVICE_NOT_FOUND(어댑터 URI 미등록)·AUTH_FAIL 진단용:
|
||||
// 스펙 식별/응답유형, 실제 forward 대상, 전달 헤더(민감값 마스킹), 본문 길이를 남긴다.
|
||||
logger.debug("{} forward - auditId={}, apiId={}, apiUrl={}, apiMethod={}, responseType={}, originalUrl={}, target={}, bodyLen={}, headers={}",
|
||||
auditType, auditId, apiSpecInfoDto.getApiId(), apiSpecInfoDto.getApiUrl(),
|
||||
apiSpecInfoDto.getApiMethod(), responseType, url, targetUri,
|
||||
requestBody == null ? 0 : requestBody.length(), maskHeaders(headers));
|
||||
}
|
||||
APISender apiSender = ApplicationContextUtil.getContext().getBean(APISender.class);
|
||||
String responseStr;
|
||||
if ("post".equalsIgnoreCase(apiSpecInfoDto.getApiMethod())) {
|
||||
@@ -210,6 +218,11 @@ public class ApiTesterFilter implements Filter {
|
||||
} else {
|
||||
responseStr = apiSender.requestGet(targetUri, headers, paramMap);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("{} response - auditId={}, target={}, respLen={}, preview={}",
|
||||
auditType, auditId, targetUri,
|
||||
responseStr == null ? 0 : responseStr.length(), previewOf(responseStr));
|
||||
}
|
||||
response.setContentType("application/json");
|
||||
response.getWriter().println(responseStr);
|
||||
}
|
||||
@@ -308,6 +321,27 @@ public class ApiTesterFilter implements Filter {
|
||||
}
|
||||
|
||||
/** 상태코드 + JSON 본문 응답. */
|
||||
/** forward 헤더 debug 출력용 — 민감 헤더(토큰/쿠키 등)는 StringMaskingUtil 로 마스킹. */
|
||||
private String maskHeaders(Map<String, String> headers) {
|
||||
StringBuilder sb = new StringBuilder("{");
|
||||
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||
if (sb.length() > 1) {
|
||||
sb.append(", ");
|
||||
}
|
||||
sb.append(e.getKey()).append(':').append(StringMaskingUtil.maskHeaderValue(e.getKey(), e.getValue()));
|
||||
}
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
|
||||
/** 응답 body debug 프리뷰 — 앞 300자까지만 (개행 제거). */
|
||||
private String previewOf(String body) {
|
||||
if (body == null) {
|
||||
return "null";
|
||||
}
|
||||
String flat = body.replaceAll("\\s+", " ").trim();
|
||||
return flat.length() > 300 ? flat.substring(0, 300) + "…" : flat;
|
||||
}
|
||||
|
||||
private void writeJson(ServletResponse response, int status, String json) throws IOException {
|
||||
((HttpServletResponse) response).setStatus(status);
|
||||
response.setContentType("application/json");
|
||||
|
||||
@@ -11,11 +11,11 @@ import com.eactive.apim.portal.apps.apiservice.service.ApiServiceService;
|
||||
import com.eactive.apim.portal.apps.app.dto.ApiKeyRegistrationDTO;
|
||||
import com.eactive.apim.portal.apps.app.dto.AppRequestDTO;
|
||||
import com.eactive.apim.portal.apps.app.dto.ClientDTO;
|
||||
import com.eactive.apim.portal.apps.app.service.AdminGatewayClient;
|
||||
import com.eactive.apim.portal.apps.app.service.AppServiceFacade;
|
||||
import com.eactive.apim.portal.apps.auth.twofactor.StepUpProtectedPaths;
|
||||
import com.eactive.apim.portal.apps.auth.twofactor.TwoFactorProperties;
|
||||
import com.eactive.apim.portal.apps.auth.twofactor.TwoFactorService;
|
||||
import com.eactive.apim.portal.common.exception.UserErrorMessageResolver;
|
||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||
import com.eactive.apim.portal.common.util.ApiServiceHelper;
|
||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||
@@ -84,7 +84,6 @@ public class MyAppController {
|
||||
private final ApiService apiService;
|
||||
private final ApiServiceHelper apiServiceHelper;
|
||||
private final FileTypeDetector fileTypeDetector;
|
||||
private final AdminGatewayClient adminGatewayClient;
|
||||
private final TwoFactorService twoFactorService;
|
||||
private final TwoFactorProperties twoFactorProperties;
|
||||
|
||||
@@ -184,6 +183,7 @@ public class MyAppController {
|
||||
|
||||
model.addAttribute("apiKey", apiKey);
|
||||
model.addAttribute("secretAvailable", secretAvailable);
|
||||
model.addAttribute("pendingDeleteRequest", appServiceFacade.hasPendingDeleteRequest(id));
|
||||
|
||||
return new ModelAndView(CREDENTIAL_DETAIL);
|
||||
}
|
||||
@@ -239,10 +239,12 @@ public class MyAppController {
|
||||
}
|
||||
|
||||
/**
|
||||
* API Key를 삭제합니다.
|
||||
* AJAX 요청을 지원하기 위해 @ResponseBody를 사용하여 JSON 응답 반환
|
||||
* API 이용 해지를 신청합니다. (AppRequestType.DELETE 결재 신청 생성)
|
||||
* 즉시 차단/삭제하지 않으며, eapim-admin 관리자 승인 시점에 GW 차단/삭제와
|
||||
* PTL_CREDENTIAL 삭제가 실행됩니다. 승인 전까지 API는 정상 동작합니다.
|
||||
* 본인 확인은 step-up 2FA({@link StepUpProtectedPaths#APP_KEY_DELETE} 인터셉터 가드)가 담당합니다.
|
||||
*
|
||||
* @param requestData 요청 데이터 (clientId와 type 포함)
|
||||
* @param requestData 요청 데이터 (clientId, reason)
|
||||
* @return 성공/실패 결과를 담은 Map
|
||||
*/
|
||||
@PostMapping("/api_key_delete")
|
||||
@@ -258,38 +260,44 @@ public class MyAppController {
|
||||
return result;
|
||||
}
|
||||
|
||||
String reason = requestData.get("reason");
|
||||
if (reason == null || reason.trim().isEmpty()) {
|
||||
result.put("success", false);
|
||||
result.put("msg", "해지 사유를 입력해 주세요.");
|
||||
return result;
|
||||
}
|
||||
if (reason.length() > 1000) {
|
||||
result.put("success", false);
|
||||
result.put("msg", "해지 사유는 1000자 이내로 입력해 주세요.");
|
||||
return result;
|
||||
}
|
||||
|
||||
PortalAuthenticatedUser user = SecurityUtil.getPortalAuthenticatedUser();
|
||||
String orgId = user.getPortalOrg().getId();
|
||||
|
||||
// 1. 소유권 확인 (다른 조직의 인증키 차단/삭제 방지)
|
||||
// 1. 소유권 확인 (다른 조직의 인증키 해지 방지)
|
||||
if (appServiceFacade.getApiKey(orgId, clientId) == null) {
|
||||
result.put("success", false);
|
||||
result.put("msg", "해당 인증키를 찾을 수 없습니다.");
|
||||
return result;
|
||||
}
|
||||
|
||||
// 2. GW 차단(appstatus=0)+리로드를 admin 에 위임. 실패하면 포털 레코드를 삭제하지 않는다.
|
||||
// 2. 해지 신청 생성 + 결재 개시 (GW/credential 은 승인 시점에 admin 이 처리)
|
||||
try {
|
||||
adminGatewayClient.blockClient(clientId);
|
||||
} catch (Exception e) {
|
||||
log.error("GW 차단/리로드 실패로 인증키 삭제 중단 - clientId={}", clientId, e);
|
||||
appServiceFacade.createDeleteRequest(clientId, reason.trim(), user.getPortalOrg());
|
||||
} catch (IllegalStateException e) {
|
||||
result.put("success", false);
|
||||
result.put("msg", "게이트웨이 차단 처리에 실패하여 삭제를 중단했습니다. 잠시 후 다시 시도해 주세요.");
|
||||
result.put("msg", e.getMessage());
|
||||
return result;
|
||||
}
|
||||
|
||||
// 3. GW 차단 성공 시에만 포털 credential 삭제
|
||||
try {
|
||||
appServiceFacade.deleteApp(orgId, clientId);
|
||||
} catch (Exception e) {
|
||||
log.error("포털 credential 삭제 실패 - clientId={}", clientId, e);
|
||||
log.error("API 이용 해지 신청 실패 - clientId={}", clientId, e);
|
||||
result.put("success", false);
|
||||
result.put("msg", "삭제 요청 중 오류가 발생했습니다: " + e.getMessage());
|
||||
result.put("msg", UserErrorMessageResolver.resolveAsHtml(e));
|
||||
return result;
|
||||
}
|
||||
|
||||
result.put("success", true);
|
||||
result.put("msg", "API Key가 삭제되었습니다.");
|
||||
result.put("msg", "해지 신청이 접수되었습니다. 관리자 승인 후 인증키가 삭제됩니다.");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.eactive.apim.portal.portalorg.entity.PortalOrg;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@@ -64,7 +65,11 @@ public class AppServiceFacade {
|
||||
public List<ClientDTO> getApikeyList(PortalOrg portalOrg) {
|
||||
|
||||
List<Credential> clients = credentialRepository.findAllByOrgid(portalOrg.getId());
|
||||
return clients.stream().map(credentialMapper::toVo).collect(Collectors.toList());
|
||||
// 최근 수정(발급/변경) 순으로 정렬. 수정일 없는 건은 뒤로.
|
||||
return clients.stream()
|
||||
.sorted(Comparator.comparing(Credential::getModifiedon,
|
||||
Comparator.nullsLast(Comparator.reverseOrder())))
|
||||
.map(credentialMapper::toVo).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
@@ -73,12 +78,29 @@ public class AppServiceFacade {
|
||||
List<AppRequest> appRequests = appRequestRepository.findAllByOrgAndTypeIsInAndApproval_ApprovalStatusIn(portalOrg, types,
|
||||
Arrays.asList(new ProcessingState(), new RequestedState()));
|
||||
|
||||
// 승인정보(approval) 없는 신청도 목록에 노출한다. (사용자가 직접 삭제 가능)
|
||||
// 승인정보(approval) 없는 신청도 목록에 노출`한다. (사용자가 직접 삭제 가능)
|
||||
appRequests.addAll(appRequestRepository .findAllByOrgAndTypeIsInAndApprovalIsNull(portalOrg, types));
|
||||
|
||||
// 진행중(PROCESSING) → 요청됨(REQUESTED) → 승인정보 없음 순, 같은 상태끼리는 최근 신청 순
|
||||
appRequests.sort(Comparator.comparingInt(this::pendingStatusRank)
|
||||
.thenComparing(AppRequest::getCreatedDate, Comparator.nullsLast(Comparator.reverseOrder())));
|
||||
|
||||
return appRequests;
|
||||
}
|
||||
|
||||
private int pendingStatusRank(AppRequest request) {
|
||||
if (request.getApproval() == null) {
|
||||
return 3;
|
||||
}
|
||||
if (request.getApproval().getApprovalStatus() instanceof ProcessingState) {
|
||||
return 1;
|
||||
}
|
||||
if (request.getApproval().getApprovalStatus() instanceof RequestedState) {
|
||||
return 2;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
public ClientDTO getApiKey(String orgid, String clientId) {
|
||||
return credentialRepository.findByClientidAndOrgid(clientId, orgid).map(credentialMapper::toVo).orElse(null);
|
||||
}
|
||||
@@ -138,13 +160,70 @@ public class AppServiceFacade {
|
||||
approvalService.beginApproval(approvalId);
|
||||
}
|
||||
|
||||
/**
|
||||
* API 이용 해지(DELETE) 결재 신청을 생성하고 결재를 개시합니다.
|
||||
* GW 차단/삭제와 PTL_CREDENTIAL 삭제는 여기서 하지 않으며,
|
||||
* eapim-admin 승인 시점에 PortalAppApprovalListener 가 수행합니다.
|
||||
*
|
||||
* @throws IllegalStateException 중복 신청, 변경 신청 진행 중, 승인라인 미등록 등 사용자에게 안내할 상황
|
||||
*/
|
||||
public void createDeleteRequest(String clientId, String reason, PortalOrg portalOrg) {
|
||||
// 1. 진행 중(REQUESTED/PROCESSING)인 해지·변경 신청 중복 가드
|
||||
List<AppRequest> related = appRequestRepository.findAllByClientIdsContainsAndTypeIsIn(
|
||||
clientId, Arrays.asList(AppRequestType.MODIFY, AppRequestType.DELETE));
|
||||
for (AppRequest r : related) {
|
||||
if (r.getApproval() == null) {
|
||||
continue;
|
||||
}
|
||||
boolean inProgress = r.getApproval().getApprovalStatus() instanceof RequestedState
|
||||
|| r.getApproval().getApprovalStatus() instanceof ProcessingState;
|
||||
if (!inProgress) {
|
||||
continue;
|
||||
}
|
||||
if (AppRequestType.DELETE.equals(r.getType())) {
|
||||
throw new IllegalStateException("이미 해지 신청이 진행 중입니다. 결재 완료 후 다시 확인해 주세요.");
|
||||
}
|
||||
throw new IllegalStateException("해당 인증키의 변경 신청이 진행 중이라 해지를 신청할 수 없습니다. 변경 결재 완료 또는 취소 후 다시 시도해 주세요.");
|
||||
}
|
||||
|
||||
// 2. DELETE 신청 생성 (createAppRequest 의 DELETE 분기가 clientName/prevApiList/apiList 를 채운다)
|
||||
AppRequestDTO dto = new AppRequestDTO();
|
||||
dto.setType(AppRequestType.DELETE);
|
||||
dto.setClientId(clientId);
|
||||
dto.setReason(reason);
|
||||
dto.setOrg(portalOrgMapper.toVo(portalOrg));
|
||||
|
||||
AppRequestDTO saved = createAppRequest(dto);
|
||||
|
||||
// 3. 승인라인 미등록이면 approval 이 null — 결재 없는 해지 신청은 만들지 않는다(트랜잭션 롤백)
|
||||
if (saved.getApproval() == null || saved.getApproval().getId() == null) {
|
||||
throw new IllegalStateException("APP 승인라인이 등록되어 있지 않아 해지를 신청할 수 없습니다. 관리자에게 문의해 주세요.");
|
||||
}
|
||||
|
||||
beginApproval(saved.getApproval().getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 해당 클라이언트의 해지 신청이 결재 진행 중(REQUESTED/PROCESSING)인지 확인합니다.
|
||||
* 상세 화면의 해지 버튼 비활성화에 사용됩니다.
|
||||
*/
|
||||
public boolean hasPendingDeleteRequest(String clientId) {
|
||||
return appRequestRepository.findAllByClientIdsContainsAndTypeIsIn(
|
||||
clientId, Arrays.asList(AppRequestType.DELETE)).stream()
|
||||
.anyMatch(r -> r.getApproval() != null
|
||||
&& (r.getApproval().getApprovalStatus() instanceof RequestedState
|
||||
|| r.getApproval().getApprovalStatus() instanceof ProcessingState));
|
||||
}
|
||||
|
||||
public void cancelApiRequest(String id, PortalOrg portalOrg) {
|
||||
appRequestRepository.findByIdAndOrg(id, portalOrg).ifPresent(request -> {
|
||||
if (request.getApproval() == null) {
|
||||
// 승인정보 없는 신청은 결재 워크플로우가 없으므로 즉시 삭제.
|
||||
// 단, GW에 클라이언트가 존재할 수 있으므로 차단(appstatus=0)+리로드를 먼저 수행하고
|
||||
// 실패 시 삭제를 중단한다. (/api_key_delete 와 동일한 순서)
|
||||
if (StringUtils.isNotBlank(request.getClientId())) {
|
||||
// DELETE(해지) 신청은 살아있는 클라이언트가 대상이므로 취소 시 GW 를 건드리면 안 된다.
|
||||
if (StringUtils.isNotBlank(request.getClientId())
|
||||
&& !AppRequestType.DELETE.equals(request.getType())) {
|
||||
try {
|
||||
adminGatewayClient.blockClient(request.getClientId());
|
||||
} catch (Exception e) {
|
||||
@@ -343,18 +422,4 @@ public class AppServiceFacade {
|
||||
return secret;
|
||||
}
|
||||
|
||||
/**
|
||||
* API Key(Credential)를 즉시 삭제합니다.
|
||||
* 승인 프로세스 없이 바로 삭제 처리됩니다.
|
||||
*
|
||||
* @param orgId 조직 ID
|
||||
* @param clientId 삭제할 클라이언트 ID
|
||||
* @throws NotFoundException 클라이언트를 찾을 수 없는 경우
|
||||
*/
|
||||
public void deleteApp(String orgId, String clientId) {
|
||||
Credential credential = credentialRepository.findByClientidAndOrgid(clientId, orgId)
|
||||
.orElseThrow(() -> new NotFoundException("Client not found: " + clientId));
|
||||
|
||||
credentialRepository.delete(credential);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@ import com.eactive.apim.portal.apps.community.partnership.mapper.PartnershipAppl
|
||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||
import com.eactive.apim.portal.common.util.UserTypeUtil;
|
||||
import com.eactive.apim.portal.djb.community.qna.comment.service.CommunityAdminNotifier;
|
||||
import com.eactive.apim.portal.djb.swing.SwingNotifier;
|
||||
import com.eactive.apim.portal.file.entity.FileInfo;
|
||||
import com.eactive.apim.portal.file.service.FileService;
|
||||
import com.eactive.apim.portal.file.service.FileTypeContext;
|
||||
@@ -29,7 +29,7 @@ public class PartnershipApplicationFacadeImpl implements PartnershipApplicationF
|
||||
private final PartnershipApplicationMapper partnershipApplicationMapper;
|
||||
private final FileService fileService;
|
||||
// portal-admin 알림 발행기(범용). Q&A 등록 알림과 동일 컴포넌트를 재사용한다.
|
||||
private final CommunityAdminNotifier portalAdminNotifier;
|
||||
private final SwingNotifier swingNotifier;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -61,7 +61,7 @@ public class PartnershipApplicationFacadeImpl implements PartnershipApplicationF
|
||||
if (writer != null) {
|
||||
params.put("writerName", writer.getUserName());
|
||||
}
|
||||
portalAdminNotifier.notifyPortalAdmins(MessageCode.PARTNERSHIP_CREATED, params);
|
||||
swingNotifier.notifyPortalAdmins(MessageCode.PARTNERSHIP_CREATED, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@ import com.eactive.apim.portal.apps.community.qna.mapper.InquiryMapper;
|
||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||
import com.eactive.apim.portal.common.util.StringMaskingUtil;
|
||||
import com.eactive.apim.portal.djb.community.qna.comment.service.CommunityAdminNotifier;
|
||||
import com.eactive.apim.portal.djb.swing.SwingNotifier;
|
||||
import com.eactive.apim.portal.file.entity.FileInfo;
|
||||
import com.eactive.apim.portal.file.exception.InvalidFileException;
|
||||
import com.eactive.apim.portal.file.service.FileService;
|
||||
@@ -40,7 +40,7 @@ public class InquiryFacadeImpl implements InquiryFacade {
|
||||
|
||||
private final InquiryService inquiryService;
|
||||
private final InquiryMapper inquiryMapper;
|
||||
private final CommunityAdminNotifier inquiryAdminNotifier;
|
||||
private final SwingNotifier swingNotifier;
|
||||
private final FileService fileService;
|
||||
|
||||
@Override
|
||||
@@ -142,7 +142,7 @@ public class InquiryFacadeImpl implements InquiryFacade {
|
||||
params.put("inquiryId", inquiry.getId());
|
||||
params.put("inquirySubject", inquiry.getInquirySubject());
|
||||
params.put("writerName", current.getUserName());
|
||||
inquiryAdminNotifier.notifyPortalAdmins(MessageCode.INQUIRY_CREATED, params);
|
||||
swingNotifier.notifyPortalAdmins(MessageCode.INQUIRY_CREATED, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,6 +57,13 @@ public class AccountController {
|
||||
private final TwoFactorProperties twoFactorProperties;
|
||||
|
||||
|
||||
/** 비밀번호 변경 화면 라이브 체크: 입력 중인 비밀번호에 아이디/휴대전화가 포함되는지 (민감정보는 응답에 미포함) */
|
||||
@PostMapping("/password/content-check")
|
||||
public ResponseEntity<Map<String, Boolean>> checkPasswordContent(@RequestParam String password) {
|
||||
String currentLoginId = SecurityUtil.getCurrentLoginId();
|
||||
return ResponseEntity.ok(userFacade.checkPasswordContent(currentLoginId, password));
|
||||
}
|
||||
|
||||
@PostMapping("/password/confirm")
|
||||
public ResponseEntity<ValidationResponse> confirmPassword(@RequestParam String inputPassword) {
|
||||
String currentLoginId = SecurityUtil.getCurrentLoginId();
|
||||
|
||||
@@ -54,6 +54,7 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
||||
private final FileService fileService;
|
||||
private final BasicValidationService validationService;
|
||||
private final UserRegistrationValidationService userRegistrationValidationService;
|
||||
private final com.eactive.apim.portal.apps.user.validator.PasswordValidator passwordValidator;
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
private final AgreementValidator agreementValidator;
|
||||
private final ApprovalService approvalService;
|
||||
@@ -75,14 +76,29 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
||||
return new ValidationResponse(false, "입력 정보가 올바르지 않습니다.");
|
||||
}
|
||||
|
||||
// 2025.10.20 - 휴대폰 번호 중복 무시
|
||||
// PortalUser existingUser = portalUserRepository.findByUserNameAndMobileNumber(orgDTO.getUserName(), orgDTO.getMobileNumber());
|
||||
// 개인 가입(@Valid @PasswordRule)과 달리 법인 가입은 컨트롤러 바인딩 검증이 없어
|
||||
// 여기서 서버 측 비밀번호 규칙을 직접 검증한다 (retain/change 시나리오는 기존 비밀번호 유지라 제외)
|
||||
if (!passwordValidator.isValidPassword(orgDTO.getPassword(), orgDTO.getLoginId(), orgDTO.getMobileNumber())) {
|
||||
return new ValidationResponse(false,
|
||||
"비밀번호는 영문/숫자/특수문자 포함 8~50자이며, 아이디·휴대전화 번호, 3자리 이상 연속·반복 문자는 사용할 수 없습니다.");
|
||||
}
|
||||
|
||||
if (orgDTO.getConfirmPassword() == null || !orgDTO.getConfirmPassword().equals(orgDTO.getPassword())) {
|
||||
return new ValidationResponse(false, "비밀번호와 비밀번호 확인이 일치하지 않습니다.");
|
||||
}
|
||||
|
||||
Optional<PortalUser> existingUser = portalUserRepository.findByLoginId(orgDTO.getLoginId());
|
||||
|
||||
if(existingUser.isPresent()) {
|
||||
return new ValidationResponse(false, "가입된 계정이 이미 존재합니다.");
|
||||
}
|
||||
|
||||
// 휴대폰 번호 중복 검증 (Portal/user.mobile.duplicate.allow 프로퍼티에 따라 차단)
|
||||
if (portalUserService.isMobileDuplicateCheckEnabled()
|
||||
&& portalUserService.existsByMobileNumber(orgDTO.getMobileNumber())) {
|
||||
return new ValidationResponse(false, "이미 가입된 휴대폰 번호입니다.");
|
||||
}
|
||||
|
||||
try {
|
||||
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
||||
if (uploadedFile == null) {
|
||||
|
||||
@@ -10,6 +10,9 @@ public interface UserFacade {
|
||||
|
||||
void updatePassword(String loginId, String newPassword, String confirmPassword);
|
||||
|
||||
/** 비밀번호에 아이디/휴대전화 번호가 포함되는지 라이브 체크용 판정 (키: idIncluded, mobileIncluded) */
|
||||
java.util.Map<String, Boolean> checkPasswordContent(String loginId, String password);
|
||||
|
||||
void updateUser(PortalUserDTO portalUserDTO);
|
||||
|
||||
void updateCorporateManager(PortalUserDTO portalUserDTO);
|
||||
|
||||
@@ -60,6 +60,12 @@ public class UserFacadeImpl implements UserFacade {
|
||||
messageHandlerService.publishEvent(UserPasswordChangedEvent.KEY, recipient, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public HashMap<String, Boolean> checkPasswordContent(String loginId, String password) {
|
||||
return passwordService.checkPasswordContent(loginId, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateUser(PortalUserDTO portalUserDTO) {
|
||||
|
||||
@@ -187,7 +187,8 @@ public class UserRegisterFacadeImpl implements UserRegisterFacade {
|
||||
return new ValidationResponse(false, "이미 가입된 휴대폰 번호입니다.");
|
||||
}
|
||||
|
||||
PortalUser existingUser = portalUserRepository.findByUserNameAndMobileNumber(registrationDTO.getUserName(), registrationDTO.getMobileNumber());
|
||||
PortalUser existingUser = portalUserRepository.findByUserNameAndMobileNumber(registrationDTO.getUserName(),
|
||||
com.eactive.apim.portal.common.util.PhoneNumberUtil.normalize(registrationDTO.getMobileNumber()));
|
||||
|
||||
if(existingUser != null) {
|
||||
return new ValidationResponse(false, "가입된 계정이 이미 존재합니다.");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.eactive.apim.portal.apps.user.service;
|
||||
|
||||
import com.eactive.apim.portal.common.dto.PasswordValidationDTO;
|
||||
import com.eactive.apim.portal.common.validator.PasswordRuleValidator;
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||
import com.eactive.apim.portal.portaluser.entity.UserPasswordHistory;
|
||||
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||
@@ -71,6 +72,19 @@ public class PasswordService {
|
||||
}
|
||||
}
|
||||
|
||||
/** 비밀번호에 본인 아이디(local part)/휴대전화 세그먼트가 포함되는지 판정 — 변경 화면 라이브 체크용 */
|
||||
@Transactional(readOnly = true)
|
||||
public java.util.HashMap<String, Boolean> checkPasswordContent(String loginId, String password) {
|
||||
PortalUser user = portalUserRepository.findByLoginId(loginId)
|
||||
.orElseThrow(() -> new IllegalArgumentException("해당 사용자를 찾을 수 없습니다."));
|
||||
java.util.HashMap<String, Boolean> result = new java.util.HashMap<>();
|
||||
result.put("idIncluded",
|
||||
PasswordRuleValidator.containsLoginIdLocalPart(password, user.getLoginId()));
|
||||
result.put("mobileIncluded",
|
||||
PasswordRuleValidator.containsMobileSegment(password, user.getMobileNumber()));
|
||||
return result;
|
||||
}
|
||||
|
||||
private void checkPasswordHistory(String userId, String newPassword) {
|
||||
List<UserPasswordHistory> passwordHistories = passwordHistoryRepository.findRecentPasswordsByUserId(userId);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.eactive.apim.portal.apps.login.service.LoginFinalizer;
|
||||
import com.eactive.apim.portal.apps.user.dto.PortalUserDTO;
|
||||
import com.eactive.apim.portal.apps.user.mapper.PortalUserMapper;
|
||||
import com.eactive.apim.portal.common.exception.SystemException;
|
||||
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
||||
import com.eactive.apim.portal.common.exception.UserNotFoundException;
|
||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||
import com.eactive.apim.portal.common.util.EncryptionUtil;
|
||||
@@ -151,6 +152,8 @@ public class PortalUserAuthService implements UserDetailsService {
|
||||
}
|
||||
|
||||
public void resetPassword(String loginId, String userName, String mobileNumber) {
|
||||
// 입력 그룹핑이 저장 정규형과 달라도 매칭되도록 조회 전 정규화 (암호화 컬럼 등가 비교)
|
||||
mobileNumber = PhoneNumberUtil.normalize(mobileNumber);
|
||||
if (mobileNumber == null || !mobileNumber.matches("^\\d{2,3}-\\d{3,4}-\\d{4}$")) {
|
||||
throw new UserNotFoundException("유효하지 않은 휴대폰 번호 형식입니다.");
|
||||
}
|
||||
@@ -185,7 +188,7 @@ public class PortalUserAuthService implements UserDetailsService {
|
||||
@Transactional
|
||||
public void reactivateDormantAccount(String loginId, String password, String mobileNumber) {
|
||||
try {
|
||||
PortalUser portalUser = portalUserRepository.findByLoginIdAndMobileNumber(loginId, mobileNumber)
|
||||
PortalUser portalUser = portalUserRepository.findByLoginIdAndMobileNumber(loginId, PhoneNumberUtil.normalize(mobileNumber))
|
||||
.orElseThrow(() -> new UserNotFoundException("입력하신 사용자 정보가 올바르지 않습니다. 다시 확인해 주세요."));
|
||||
|
||||
if (!passwordEncoder.matches(password, portalUser.getPasswordHash())) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.eactive.apim.portal.portaluser.repository.UserRoleHistoryRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -35,7 +36,7 @@ public class UserRoleHistoryService {
|
||||
* 역할 변경 이력을 기록한다. 감사 목적이므로 실패해도 본 트랜잭션을 롤백시키지 않도록
|
||||
* 호출부에서 예외를 전파하지 않는다(내부에서 로깅만).
|
||||
*/
|
||||
@Transactional
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void record(String targetLoginId, RoleCode before, RoleCode after, ChangeType changeType) {
|
||||
try {
|
||||
String actor = SecurityUtil.getCurrentLoginId();
|
||||
|
||||
+28
-22
@@ -2,8 +2,6 @@ package com.eactive.apim.portal.common.exception;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -13,11 +11,12 @@ import com.eactive.apim.portal.common.util.StringMaskingUtil;
|
||||
import com.eactive.apim.portal.config.PortalProperties;
|
||||
import com.eactive.apim.portal.file.exception.InvalidFileException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.env.Profiles;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.HttpMediaTypeNotSupportedException;
|
||||
@@ -39,6 +38,7 @@ public class PortalGlobalExceptionHandler {
|
||||
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
private final PortalProperties portalProperties;
|
||||
private final Environment environment;
|
||||
|
||||
@ExceptionHandler(value = NotFoundException.class)
|
||||
public ModelAndView handleINotFoundException(HttpServletRequest request, NotFoundException ex) {
|
||||
@@ -129,10 +129,10 @@ public class PortalGlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(value = {IllegalArgumentException.class})
|
||||
public ModelAndView handleIllegalArgumentException(HttpServletRequest request, IllegalArgumentException ex) {
|
||||
log.error(ex.getMessage());
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.addObject("errorMessage", ex.getMessage());
|
||||
modelAndView.setViewName("error");
|
||||
log.error("잘못된 요청 - uri={}, message={}", request.getRequestURI(), ex.getMessage());
|
||||
ModelAndView modelAndView = new ModelAndView("error");
|
||||
modelAndView.addObject("errorTitle", "요청을 처리할 수 없습니다.");
|
||||
modelAndView.addObject("errorDescription", UserErrorMessageResolver.resolve(ex));
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@@ -146,34 +146,40 @@ public class PortalGlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(value = HttpMediaTypeNotSupportedException.class)
|
||||
public ModelAndView handleHttpMediaTypeNotSupportedException(HttpServletRequest request, HttpMediaTypeNotSupportedException ex) {
|
||||
log.error(ex.getMessage());
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.addObject("errorMessage", ex.getMessage());
|
||||
modelAndView.setViewName("error");
|
||||
log.error("지원하지 않는 요청 형식 - uri={}, message={}", request.getRequestURI(), ex.getMessage());
|
||||
ModelAndView modelAndView = new ModelAndView("error");
|
||||
modelAndView.addObject("errorTitle", "요청을 처리할 수 없습니다.");
|
||||
modelAndView.addObject("errorDescription", "지원하지 않는 요청 형식입니다.\n잠시 후 다시 시도해 주세요.");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 처리되지 않은 예외. 예외 원문은 로그에만 남기고 화면에는 사용자 안내 문구를 표시한다.
|
||||
* 원문(클래스명/메시지)은 운영(prod) 이외 환경의 상세 영역에만 노출한다.
|
||||
*/
|
||||
@ExceptionHandler(value = Exception.class)
|
||||
public ModelAndView handleException(HttpServletRequest request, Exception ex) {
|
||||
Map<String, Object> params = new HashMap<>(2);
|
||||
params.put("errorMessage", ex.getLocalizedMessage());
|
||||
params.put("stackTrace", ExceptionUtils.getStackTrace(ex)); // Apache Commons Lang
|
||||
params.put("requestURL", request.getRequestURL().toString());
|
||||
|
||||
String mapAsString = request.getParameterMap().entrySet()
|
||||
String requestParams = request.getParameterMap().entrySet()
|
||||
.stream()
|
||||
.map(entry -> entry.getKey() + "=" + Arrays.toString(entry.getValue()))
|
||||
.collect(Collectors.joining(", "));
|
||||
|
||||
params.put("requestParams", mapAsString);
|
||||
log.error("Exception occurred - url={}, params={}", request.getRequestURL(), requestParams, ex);
|
||||
|
||||
log.error("Exception occurred: ", ex);
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.addObject("errorMessage", ex.getMessage());
|
||||
modelAndView.setViewName("error");
|
||||
ModelAndView modelAndView = new ModelAndView("error");
|
||||
modelAndView.addObject("errorTitle", "서비스 처리 중 오류가 발생했습니다.");
|
||||
modelAndView.addObject("errorDescription", UserErrorMessageResolver.resolve(ex));
|
||||
if (!isProd()) {
|
||||
modelAndView.addObject("errorMessage", ex.getClass().getName() + ": " + ex.getMessage());
|
||||
modelAndView.addObject("activeProfile", String.join(", ", environment.getActiveProfiles()));
|
||||
}
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
private boolean isProd() {
|
||||
return environment.acceptsProfiles(Profiles.of("prod"));
|
||||
}
|
||||
|
||||
@ExceptionHandler(value = InvalidFileException.class)
|
||||
public ModelAndView handleInvalidFileException(HttpServletRequest request, RedirectAttributes redirectAttributes, InvalidFileException ex) {
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
+6
-2
@@ -53,10 +53,14 @@ public class PortalRestExceptionHandler {
|
||||
return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
/**
|
||||
* 처리되지 않은 예외. 원문 메시지는 로그에만 남기고, 화면에는 사용자 안내 문구를 내려준다.
|
||||
* (JTA 롤백/DB 락 같은 인프라 예외의 영문 원문이 팝업에 그대로 노출되지 않도록)
|
||||
*/
|
||||
@ExceptionHandler(value = Exception.class)
|
||||
public ResponseEntity<ResponseDTO> handleUnknownxception(HttpServletRequest request, Exception ex) {
|
||||
ex.printStackTrace();
|
||||
ResponseDTO response = new ResponseDTO(500, "500", ex.getMessage());
|
||||
log.error("처리되지 않은 예외 - uri={}", request.getRequestURI(), ex);
|
||||
ResponseDTO response = new ResponseDTO(500, "500", UserErrorMessageResolver.resolveAsHtml(ex));
|
||||
return new ResponseEntity<>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
package com.eactive.apim.portal.common.exception;
|
||||
|
||||
import org.springframework.dao.CannotAcquireLockException;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.dao.OptimisticLockingFailureException;
|
||||
import org.springframework.dao.PessimisticLockingFailureException;
|
||||
import org.springframework.dao.QueryTimeoutException;
|
||||
import org.springframework.transaction.CannotCreateTransactionException;
|
||||
import org.springframework.transaction.TransactionException;
|
||||
|
||||
/**
|
||||
* 예외를 사용자에게 보여줄 안내 문구로 변환한다.
|
||||
*
|
||||
* <p>JTA 롤백/DB 락/타임아웃 같은 인프라 예외는 원문(예: {@code "JTA transaction unexpectedly rolled back
|
||||
* (maybe due to a timeout); nested exception is javax.transaction.RollbackException"})이 그대로
|
||||
* 팝업·에러 화면에 노출되면 사용자가 이해할 수 없고 내부 구조까지 드러난다. 이 클래스가 정해진 한글 문구로 치환한다.
|
||||
*
|
||||
* <p>서비스 코드가 의도적으로 던진 한글 안내문(예: {@code IllegalStateException("이미 초대가 진행 중입니다.")})은
|
||||
* 그대로 유지한다. 판단은 {@link #looksUserFacing(String)} 의 휴리스틱(한글 포함 + 기술 토큰 없음)을 따른다.
|
||||
*
|
||||
* <p>반환 문구는 평문이며 줄바꿈은 {@code \n} 이다. HTML 팝업으로 내려줄 때는 {@link #toHtml(String)} 을 쓴다.
|
||||
*/
|
||||
public final class UserErrorMessageResolver {
|
||||
|
||||
/** 원인을 특정할 수 없을 때의 기본 문구. */
|
||||
public static final String DEFAULT_MESSAGE =
|
||||
"요청을 처리하는 중 오류가 발생했습니다.\n잠시 후 다시 시도해 주세요.";
|
||||
|
||||
private static final String ROLLBACK_MESSAGE =
|
||||
"요청 처리가 정상적으로 끝나지 않아 변경 내용이 저장되지 않았습니다.\n잠시 후 다시 시도해 주세요. 같은 문제가 반복되면 관리자에게 문의해 주세요.";
|
||||
|
||||
private static final String TIMEOUT_MESSAGE =
|
||||
"처리 시간이 초과되어 요청이 취소되었습니다.\n잠시 후 다시 시도해 주세요.";
|
||||
|
||||
private static final String CONFLICT_MESSAGE =
|
||||
"이미 등록된 정보이거나 다른 정보와 충돌하여 저장할 수 없습니다.\n입력 내용을 확인해 주세요.";
|
||||
|
||||
private static final String LOCK_MESSAGE =
|
||||
"다른 사용자가 동일한 정보를 변경하고 있습니다.\n잠시 후 다시 시도해 주세요.";
|
||||
|
||||
private static final String STALE_MESSAGE =
|
||||
"다른 사용자가 먼저 정보를 변경했습니다.\n화면을 새로 고친 뒤 다시 시도해 주세요.";
|
||||
|
||||
private static final String CONNECTION_MESSAGE =
|
||||
"시스템 연결이 원활하지 않아 요청을 처리하지 못했습니다.\n잠시 후 다시 시도해 주세요.";
|
||||
|
||||
/** 원문 노출을 막아야 하는 기술 토큰. 메시지에 하나라도 있으면 사용자 안내문으로 보지 않는다. */
|
||||
private static final String[] TECHNICAL_TOKENS = {
|
||||
"exception", "Exception", "rollback", "Rollback", "transaction", "Transaction",
|
||||
"SQL", "ORA-", "JTA", "JDBC", "Hibernate", "hibernate", "com.eactive", "org.springframework",
|
||||
"javax.", "java.", "oracle.", "at com.", "Caused by", "null pointer", "NullPointer",
|
||||
"constraint", "Constraint", "statement", "Statement", "SocketTimeout", "Connection"
|
||||
};
|
||||
|
||||
private UserErrorMessageResolver() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 예외에서 사용자 안내 문구를 만든다.
|
||||
*
|
||||
* @param ex 발생한 예외 (null 허용)
|
||||
* @return 사용자에게 보여줄 평문 문구. 줄바꿈은 {@code \n}
|
||||
*/
|
||||
public static String resolve(Throwable ex) {
|
||||
if (ex == null) {
|
||||
return DEFAULT_MESSAGE;
|
||||
}
|
||||
|
||||
String infraMessage = resolveInfrastructureMessage(ex);
|
||||
if (infraMessage != null) {
|
||||
return infraMessage;
|
||||
}
|
||||
|
||||
// 서비스가 의도적으로 던진 한글 안내문은 그대로 전달
|
||||
String original = ex.getMessage();
|
||||
if (looksUserFacing(original)) {
|
||||
return original;
|
||||
}
|
||||
|
||||
return DEFAULT_MESSAGE;
|
||||
}
|
||||
|
||||
/** {@link #resolve(Throwable)} 결과를 팝업(HTML)용으로 변환한다. */
|
||||
public static String resolveAsHtml(Throwable ex) {
|
||||
return toHtml(resolve(ex));
|
||||
}
|
||||
|
||||
/** 평문 줄바꿈을 {@code <br>} 로 바꾼다. */
|
||||
public static String toHtml(String plainMessage) {
|
||||
if (plainMessage == null) {
|
||||
return null;
|
||||
}
|
||||
return plainMessage.replace("\n", "<br>");
|
||||
}
|
||||
|
||||
/**
|
||||
* 트랜잭션/DB/연결 계열 인프라 예외인지 원인 체인을 따라가며 판별한다.
|
||||
*
|
||||
* @return 해당 문구, 인프라 예외가 아니면 null
|
||||
*/
|
||||
private static String resolveInfrastructureMessage(Throwable ex) {
|
||||
String chainText = causeChainText(ex);
|
||||
|
||||
// 1. 데이터 충돌(유니크/FK/NOT NULL) — 롤백 판정보다 먼저: 롤백 예외가 이를 감싸고 있어도 원인이 더 구체적이다.
|
||||
if (hasType(ex, DataIntegrityViolationException.class)
|
||||
|| containsAny(chainText, "org.hibernate.exception.ConstraintViolationException",
|
||||
"SQLIntegrityConstraintViolationException",
|
||||
"ORA-00001", "ORA-01400", "ORA-02291", "ORA-02292", "ORA-12899")) {
|
||||
return CONFLICT_MESSAGE;
|
||||
}
|
||||
|
||||
// 2. 낙관적 락 충돌
|
||||
if (hasType(ex, OptimisticLockingFailureException.class)
|
||||
|| containsAny(chainText, "OptimisticLockException", "StaleObjectStateException", "StaleStateException")) {
|
||||
return STALE_MESSAGE;
|
||||
}
|
||||
|
||||
// 3. 비관적 락 / 데드락
|
||||
if (hasType(ex, PessimisticLockingFailureException.class)
|
||||
|| hasType(ex, CannotAcquireLockException.class)
|
||||
|| containsAny(chainText, "ORA-00060", "ORA-02049", "ORA-00054", "deadlock")) {
|
||||
return LOCK_MESSAGE;
|
||||
}
|
||||
|
||||
// 4. 타임아웃 (쿼리/소켓/사용자 취소)
|
||||
if (hasType(ex, QueryTimeoutException.class)
|
||||
|| containsAny(chainText, "SocketTimeoutException", "QueryTimeoutException", "ORA-01013")) {
|
||||
return TIMEOUT_MESSAGE;
|
||||
}
|
||||
|
||||
// 5. 연결 실패
|
||||
if (hasType(ex, DataAccessResourceFailureException.class)
|
||||
|| hasType(ex, CannotCreateTransactionException.class)
|
||||
|| containsAny(chainText, "SQLRecoverableException", "ConnectException", "UnknownHostException",
|
||||
"ORA-03113", "ORA-03114", "ORA-12541", "ORA-12170")) {
|
||||
return CONNECTION_MESSAGE;
|
||||
}
|
||||
|
||||
// 6. JTA 롤백 계열 — 원인을 특정하지 못한 트랜잭션 실패
|
||||
if (hasType(ex, TransactionException.class)
|
||||
|| containsAny(chainText, "RollbackException", "HeuristicMixedException", "HeuristicRollbackException",
|
||||
"rolled back", "rollback only")) {
|
||||
// "Transaction set to rollback only" 은 내부 예외가 삼켜진 경우다. Spring 원문에 "maybe due to a
|
||||
// timeout" 이 붙어 있어도 실제 타임아웃이 아니므로 타임아웃 문구를 쓰지 않는다.
|
||||
if (!containsAny(chainText, "rollback only")
|
||||
&& containsAny(chainText, "timeout", "timed out")) {
|
||||
return TIMEOUT_MESSAGE;
|
||||
}
|
||||
return ROLLBACK_MESSAGE;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 원문을 그대로 사용자에게 보여줘도 되는 안내문인지 판단한다.
|
||||
* 한글이 포함되고 기술 토큰이 없어야 한다.
|
||||
*/
|
||||
private static boolean looksUserFacing(String message) {
|
||||
if (message == null) {
|
||||
return false;
|
||||
}
|
||||
String trimmed = message.trim();
|
||||
if (trimmed.isEmpty() || trimmed.length() > 200) {
|
||||
return false;
|
||||
}
|
||||
if (!containsHangul(trimmed)) {
|
||||
return false;
|
||||
}
|
||||
for (String token : TECHNICAL_TOKENS) {
|
||||
if (trimmed.contains(token)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean containsHangul(String text) {
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
char c = text.charAt(i);
|
||||
if (c >= 0xAC00 && c <= 0xD7A3) { // 한글 음절
|
||||
return true;
|
||||
}
|
||||
if (c >= 0x1100 && c <= 0x11FF) { // 한글 자모
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 원인 체인의 클래스명 + 메시지를 한 문자열로 모은다(순환 참조 방지). */
|
||||
private static String causeChainText(Throwable ex) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Throwable current = ex;
|
||||
int depth = 0;
|
||||
while (current != null && depth < 10) {
|
||||
sb.append(current.getClass().getName());
|
||||
if (current.getMessage() != null) {
|
||||
sb.append(' ').append(current.getMessage());
|
||||
}
|
||||
sb.append('\n');
|
||||
Throwable cause = current.getCause();
|
||||
if (cause == current) {
|
||||
break;
|
||||
}
|
||||
current = cause;
|
||||
depth++;
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private static boolean hasType(Throwable ex, Class<? extends Throwable> type) {
|
||||
Throwable current = ex;
|
||||
int depth = 0;
|
||||
while (current != null && depth < 10) {
|
||||
if (type.isInstance(current)) {
|
||||
return true;
|
||||
}
|
||||
Throwable cause = current.getCause();
|
||||
if (cause == current) {
|
||||
return false;
|
||||
}
|
||||
current = cause;
|
||||
depth++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean containsAny(String text, String... keywords) {
|
||||
for (String keyword : keywords) {
|
||||
if (text.contains(keyword)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.eactive.apim.portal.common.security;
|
||||
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 로그인 실패 계정 잠금 임계 횟수를 DB(PortalProperty)에서 조회한다.
|
||||
*
|
||||
* <p>PTL_PROPERTY (group={@code Portal}, name={@code login.failure.lock.count}) 값으로 제어한다.
|
||||
* 값이 없으면 기본값 {@value #DEFAULT_LOCK_COUNT}로 자동 생성되고, 숫자가 아니거나
|
||||
* 0 이하이면 기본값으로 동작한다.</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LoginLockPolicy {
|
||||
|
||||
private static final String GROUP = "Portal";
|
||||
private static final String NAME = "login.failure.lock.count";
|
||||
|
||||
/** 기본 잠금 임계 횟수 (프로퍼티 미존재/파싱 실패 시) */
|
||||
public static final int DEFAULT_LOCK_COUNT = 5;
|
||||
|
||||
private final PortalPropertyService portalPropertyService;
|
||||
|
||||
/** 연속 로그인 실패가 이 값 이상이면 계정을 잠근다. */
|
||||
public int lockCount() {
|
||||
String raw = portalPropertyService.getOrCreateProperty(
|
||||
GROUP, NAME, String.valueOf(DEFAULT_LOCK_COUNT),
|
||||
"로그인 연속 실패 계정 잠금 임계 횟수 (이 값 이상 실패 시 잠금)");
|
||||
try {
|
||||
int parsed = Integer.parseInt(raw.trim());
|
||||
if (parsed > 0) {
|
||||
return parsed;
|
||||
}
|
||||
log.warn("login.failure.lock.count 값이 0 이하({}) - 기본값 {} 사용", parsed, DEFAULT_LOCK_COUNT);
|
||||
} catch (NumberFormatException e) {
|
||||
log.warn("login.failure.lock.count 값이 숫자가 아님('{}') - 기본값 {} 사용", raw, DEFAULT_LOCK_COUNT);
|
||||
}
|
||||
return DEFAULT_LOCK_COUNT;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.eactive.apim.portal.common.validator;
|
||||
|
||||
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
@@ -72,25 +73,13 @@ public class PasswordRuleValidator implements ConstraintValidator<PasswordRule,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (loginId != null && !loginId.isEmpty()) {
|
||||
String[] loginParts = loginId.split("@");
|
||||
if (loginParts.length > 0) {
|
||||
String username = loginParts[0].toUpperCase();
|
||||
if (tmpPw.contains(username)) {
|
||||
if (containsLoginIdLocalPart(password, loginId)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Mobile number validation
|
||||
if (mobileNumber != null && !mobileNumber.isEmpty()) {
|
||||
String[] mobileParts = mobileNumber.split("-");
|
||||
for (String part : mobileParts) {
|
||||
if (!part.isEmpty() && tmpPw.contains(part)) {
|
||||
if (containsMobileSegment(password, mobileNumber)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 공백 체크
|
||||
matcher = Pattern.compile(BLANKPT).matcher(tmpPw);
|
||||
@@ -129,6 +118,33 @@ public class PasswordRuleValidator implements ConstraintValidator<PasswordRule,
|
||||
return true;
|
||||
}
|
||||
|
||||
/** 아이디(이메일)의 @ 앞 local part 가 비밀번호에 포함되는지 (대소문자 무시) */
|
||||
public static boolean containsLoginIdLocalPart(String password, String loginId) {
|
||||
if (password == null || loginId == null || loginId.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
String username = loginId.split("@")[0].toUpperCase();
|
||||
return !username.isEmpty() && password.toUpperCase().contains(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴대전화 번호의 하이픈 세그먼트(010/1234/5678)가 비밀번호에 포함되는지.
|
||||
* DB 에 하이픈 없이 저장된 legacy 값도 잡도록 정규형으로 변환 후 분리한다.
|
||||
*/
|
||||
public static boolean containsMobileSegment(String password, String mobileNumber) {
|
||||
if (password == null || mobileNumber == null || mobileNumber.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
String tmpPw = password.toUpperCase();
|
||||
String[] mobileParts = PhoneNumberUtil.normalize(mobileNumber).split("-");
|
||||
for (String part : mobileParts) {
|
||||
if (!part.isEmpty() && tmpPw.contains(part)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean isContinuous(int first, int third) {
|
||||
// 첫 글자 A-Z / 0-9
|
||||
return (first > 47 && third < 58) || (first > 64 && third < 91);
|
||||
|
||||
+8
-3
@@ -4,6 +4,7 @@ import com.eactive.apim.portal.apps.login.constants.LoginConstants;
|
||||
import com.eactive.apim.portal.apps.login.constants.LoginFailureReason;
|
||||
import com.eactive.apim.portal.apps.user.service.PortalUserLogService;
|
||||
import com.eactive.apim.portal.common.exception.UserNotFoundException;
|
||||
import com.eactive.apim.portal.common.security.LoginLockPolicy;
|
||||
import com.eactive.apim.portal.common.util.HttpRequestUtil;
|
||||
import com.eactive.apim.portal.common.util.StringMaskingUtil;
|
||||
import com.eactive.apim.portal.common.util.StringRepeatUtil;
|
||||
@@ -47,14 +48,17 @@ public class PortalAuthenticationFailureHandler implements AuthenticationFailure
|
||||
private final PortalUserRepository portalUserRepository;
|
||||
private final PortalUserLogService userLogService;
|
||||
private final MessageHandlerService messageHandlerService;
|
||||
private final LoginLockPolicy loginLockPolicy;
|
||||
|
||||
|
||||
public PortalAuthenticationFailureHandler(PortalUserRepository portalUserRepository,
|
||||
PortalUserLogService userLogService,
|
||||
MessageHandlerService messageHandlerService) {
|
||||
MessageHandlerService messageHandlerService,
|
||||
LoginLockPolicy loginLockPolicy) {
|
||||
this.portalUserRepository = portalUserRepository;
|
||||
this.userLogService = userLogService;
|
||||
this.messageHandlerService = messageHandlerService;
|
||||
this.loginLockPolicy = loginLockPolicy;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,15 +77,16 @@ public class PortalAuthenticationFailureHandler implements AuthenticationFailure
|
||||
PortalUser user = portalUserRepository.findPortalUserByEmailAddr(normalizedUsername)
|
||||
.orElseThrow(() -> new UserNotFoundException(normalizedUsername));
|
||||
|
||||
int lockCount = loginLockPolicy.lockCount();
|
||||
user.setLoginFailureCount(user.getLoginFailureCount() + 1);
|
||||
if (user.getLoginFailureCount() >= 5) {
|
||||
if (user.getLoginFailureCount() >= lockCount) {
|
||||
user.setAccountLockYn("Y");
|
||||
|
||||
// 계정 잠금 알림
|
||||
messageHandlerService.publishEvent(
|
||||
MessageCode.USER_ACCOUNT_LOCKED,
|
||||
MessageRecipient.of(user),
|
||||
Maps.of("reason", "5회 이상 로그인 실패로 인한 계정 잠금")) ;;
|
||||
Maps.of("reason", lockCount + "회 이상 로그인 실패로 인한 계정 잠금"));
|
||||
}
|
||||
portalUserRepository.save(user);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.eactive.apim.portal.config;
|
||||
|
||||
|
||||
import com.eactive.apim.portal.apps.user.service.PortalUserAuthService;
|
||||
import com.eactive.apim.portal.common.security.LoginLockPolicy;
|
||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||
import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums;
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
||||
@@ -28,6 +29,7 @@ public class PortalAuthenticationManager implements AuthenticationManager {
|
||||
private final PortalUserAuthService portalUserAuthService;
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
private final MessageHandlerService messageHandlerService;
|
||||
private final LoginLockPolicy loginLockPolicy;
|
||||
|
||||
@Override
|
||||
@Transactional(noRollbackFor = {AuthenticationException.class})
|
||||
@@ -40,7 +42,7 @@ public class PortalAuthenticationManager implements AuthenticationManager {
|
||||
|
||||
|
||||
if (!user.isAccountNonLocked()) {
|
||||
if (user.getLoginFailureCount() >= 5) {
|
||||
if (user.getLoginFailureCount() >= loginLockPolicy.lockCount()) {
|
||||
throw new LockedException("계정이 잠겼습니다. 비밀번호 초기화 또는 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.eactive.apim.portal.custom.config;
|
||||
|
||||
//import com.eactive.ext.djb.safedb.DjbSafedbWrapper;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
@@ -17,8 +16,5 @@ public class DjbPasswordEncoder implements PasswordEncoder {
|
||||
@Override
|
||||
public boolean matches(CharSequence rawPassword, String encodedPassword) {
|
||||
return bcryptEncoder.matches(rawPassword, encodedPassword);
|
||||
// DjbSafedbWrapper safedb = DjbSafedbWrapper.getInstance();
|
||||
// String bcryptHash = safedb.decryptNotRnno(encodedPassword);
|
||||
// return bcryptEncoder.matches(rawPassword, bcryptHash);
|
||||
}
|
||||
}
|
||||
|
||||
+211
@@ -0,0 +1,211 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.controller;
|
||||
|
||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ActiveIncidentDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ApiCurrentStatusDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ApiOptionDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.DailyStatDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.IssueDateEntryDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.MaintenanceCardDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.MyApiStatusDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.PastIssueCardDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.ApiCurrentStatusService;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.ApiStatusCatalogService;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.ApiStatusIssueHistoryService;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.ApiStatusQueryService;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.ApiStatusSupport;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.ApiStatusUptimeService;
|
||||
import com.eactive.apim.portal.djb.apistatus.service.MyApiStatusQueryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 개발자포탈 API Status 화면.
|
||||
*
|
||||
* <p>장애/점검 데이터는 관리자 공지사항(PTL_NOTICE + DJB_APISTATUS_INCIDENT)과
|
||||
* 자동 탐지(eapim-admin ApiStatusDetectionService)가 채운다. 본 컨트롤러는 읽기 전용이다.</p>
|
||||
*
|
||||
* <p>비로그인 사용자도 모두 조회 가능하며, "내 API 현황"만 로그인을 요구한다.</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping("/apistatus")
|
||||
@RequiredArgsConstructor
|
||||
public class ApiStatusController {
|
||||
|
||||
private static final int DEFAULT_RECENT_ISSUE_SIZE = 5;
|
||||
private static final int MAX_PAGE_SIZE = 50;
|
||||
/** 현재 상태 일괄 조회 시 한 번에 물어볼 수 있는 API 수 */
|
||||
private static final int MAX_STATUS_BATCH = 100;
|
||||
|
||||
private final ApiStatusQueryService apiStatusQueryService;
|
||||
private final ApiStatusUptimeService uptimeService;
|
||||
private final ApiStatusIssueHistoryService issueHistoryService;
|
||||
private final MyApiStatusQueryService myApiStatusQueryService;
|
||||
private final ApiStatusCatalogService catalogService;
|
||||
private final ApiCurrentStatusService apiCurrentStatusService;
|
||||
|
||||
/** P1 - API Status 메인 */
|
||||
@GetMapping
|
||||
public ModelAndView index() {
|
||||
ModelAndView mav = new ModelAndView("djb/apistatus/index");
|
||||
mav.addObject("windowDays", catalogService.getWindowDays());
|
||||
mav.addObject("authenticated", SecurityUtil.isAuthenticated());
|
||||
LocalDateTime lastFireAt = catalogService.getLastMonitorFireAt();
|
||||
mav.addObject("lastFireAt", lastFireAt);
|
||||
mav.addObject("lastFireRelative",
|
||||
ApiStatusSupport.relativeTime(lastFireAt, ApiStatusSupport.now()));
|
||||
mav.addObject("lastStatusChangedAt", catalogService.getLastStatusChangedAt());
|
||||
return mav;
|
||||
}
|
||||
|
||||
/**
|
||||
* P8 - 전체 이슈 이력. 날짜를 지정하지 않으면 조회 기간(90일) 전체를 본다.
|
||||
* 날짜 선택 가능 범위는 서버 기준 일자로 내려 클라이언트 timezone 차이를 없앤다.
|
||||
*/
|
||||
@GetMapping("/issues")
|
||||
public ModelAndView issues(
|
||||
@RequestParam(value = "date", required = false)
|
||||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
|
||||
@RequestParam(value = "apiId", required = false) String apiId,
|
||||
@RequestParam(value = "kind", required = false) String kind) {
|
||||
|
||||
LocalDate today = ApiStatusSupport.now().toLocalDate();
|
||||
int windowDays = catalogService.getWindowDays();
|
||||
|
||||
ModelAndView mav = new ModelAndView("djb/apistatus/issues");
|
||||
mav.addObject("windowDays", windowDays);
|
||||
mav.addObject("today", today);
|
||||
mav.addObject("minDate", today.minusDays(windowDays - 1L));
|
||||
mav.addObject("selectedDate", date);
|
||||
mav.addObject("selectedApiId", apiId);
|
||||
mav.addObject("selectedKind", kind);
|
||||
return mav;
|
||||
}
|
||||
|
||||
/** 이슈 이력 API 필터 - 현재 사용자가 조회 가능한 API 목록 */
|
||||
@GetMapping("/apis.json")
|
||||
@ResponseBody
|
||||
public List<ApiOptionDTO> selectableApis() {
|
||||
return catalogService.getSelectableApis();
|
||||
}
|
||||
|
||||
/** P2 - 90일 가동률 */
|
||||
@GetMapping("/uptime.json")
|
||||
@ResponseBody
|
||||
public List<DailyStatDTO> uptime(
|
||||
@RequestParam(value = "days", defaultValue = "0") int days) {
|
||||
return uptimeService.getDailyStats(days > 0 ? days : catalogService.getWindowDays());
|
||||
}
|
||||
|
||||
/** P3 - 진행 중 장애 */
|
||||
@GetMapping("/active.json")
|
||||
@ResponseBody
|
||||
public List<ActiveIncidentDTO> active() {
|
||||
return apiStatusQueryService.getActiveIncidents();
|
||||
}
|
||||
|
||||
/** P4 - 내 API 현황 (로그인 필수) */
|
||||
@GetMapping("/my-apis.json")
|
||||
@ResponseBody
|
||||
public ResponseEntity<List<MyApiStatusDTO>> myApis() {
|
||||
if (!SecurityUtil.isAuthenticated()) {
|
||||
return new ResponseEntity<>(Collections.emptyList(), HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
return ResponseEntity.ok(myApiStatusQueryService.getMyApiStatuses());
|
||||
}
|
||||
|
||||
/** P5 - 예정/진행 중 점검 */
|
||||
@GetMapping("/maintenance.json")
|
||||
@ResponseBody
|
||||
public List<MaintenanceCardDTO> maintenance() {
|
||||
return apiStatusQueryService.getOngoingMaintenance();
|
||||
}
|
||||
|
||||
/** P6 - 지난 이슈 (종결) */
|
||||
@GetMapping("/recent-issues.json")
|
||||
@ResponseBody
|
||||
public List<PastIssueCardDTO> recentIssues(
|
||||
@RequestParam(value = "size", defaultValue = "" + DEFAULT_RECENT_ISSUE_SIZE) int size) {
|
||||
return apiStatusQueryService.getRecentClosedIssues(size);
|
||||
}
|
||||
|
||||
/** P7 - 이슈 상세 */
|
||||
@GetMapping("/incident/{incidentId}")
|
||||
@ResponseBody
|
||||
public ResponseEntity<PastIssueCardDTO> incidentDetail(@PathVariable Long incidentId) {
|
||||
return apiStatusQueryService.getIssueDetail(incidentId)
|
||||
.map(ResponseEntity::ok)
|
||||
.orElseGet(() -> ResponseEntity.notFound().build());
|
||||
}
|
||||
|
||||
/** P9 - 90일 이슈 일자 인덱스 */
|
||||
@GetMapping("/issues/dates.json")
|
||||
@ResponseBody
|
||||
public List<IssueDateEntryDTO> issueDates(
|
||||
@RequestParam(value = "days", defaultValue = "0") int days,
|
||||
@RequestParam(value = "apiId", required = false) String apiId,
|
||||
@RequestParam(value = "kind", required = false) String kind) {
|
||||
return issueHistoryService.getIssueDates(days > 0 ? days : catalogService.getWindowDays(), apiId, kind);
|
||||
}
|
||||
|
||||
/** P10 - 이슈 목록 (날짜/API/유형 필터) */
|
||||
@GetMapping("/issues/list.json")
|
||||
@ResponseBody
|
||||
public Page<PastIssueCardDTO> issueList(
|
||||
@RequestParam(value = "date", required = false)
|
||||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
|
||||
@RequestParam(value = "apiId", required = false) String apiId,
|
||||
@RequestParam(value = "kind", required = false) String kind,
|
||||
@RequestParam(value = "page", defaultValue = "0") int page,
|
||||
@RequestParam(value = "size", defaultValue = "20") int size) {
|
||||
|
||||
int safePage = Math.max(page, 0);
|
||||
int safeSize = size <= 0 ? 20 : Math.min(size, MAX_PAGE_SIZE);
|
||||
return issueHistoryService.getIssues(date, apiId, kind, PageRequest.of(safePage, safeSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* P11 - API 한 건의 현재 상태 (정상/점검/지연/장애). API 상세 화면이 사용한다.
|
||||
*
|
||||
* <p>게시된 장애·점검만 반영하므로 비로그인도 조회 가능하다.</p>
|
||||
*/
|
||||
@GetMapping("/current.json")
|
||||
@ResponseBody
|
||||
public ResponseEntity<ApiCurrentStatusDTO> currentStatus(@RequestParam("apiId") String apiId) {
|
||||
return apiCurrentStatusService.getStatus(apiId)
|
||||
.map(ResponseEntity::ok)
|
||||
.orElseGet(() -> ResponseEntity.badRequest().build());
|
||||
}
|
||||
|
||||
/**
|
||||
* P11 - 여러 API 의 현재 상태. {@code ?apiId=A&apiId=B} 로 반복 지정한다.
|
||||
*/
|
||||
@GetMapping("/current-list.json")
|
||||
@ResponseBody
|
||||
public ResponseEntity<List<ApiCurrentStatusDTO>> currentStatuses(
|
||||
@RequestParam(value = "apiId", required = false) List<String> apiIds) {
|
||||
|
||||
if (apiIds != null && apiIds.size() > MAX_STATUS_BATCH) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
}
|
||||
return ResponseEntity.ok(apiCurrentStatusService.getStatuses(apiIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 진행 중 장애 카드 (P3)
|
||||
*/
|
||||
@Data
|
||||
public class ActiveIncidentDTO {
|
||||
|
||||
private Long incidentId;
|
||||
private String noticeId;
|
||||
private String kind;
|
||||
private String state;
|
||||
private String stateLabel;
|
||||
private String title;
|
||||
private String summary;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startedAt;
|
||||
private long elapsedMinutes;
|
||||
private List<AffectedApiDTO> apis = new ArrayList<>();
|
||||
private List<TimelineEntryDTO> recentTimeline = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 이슈 영향 API
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AffectedApiDTO {
|
||||
|
||||
private String apiId;
|
||||
private String apiName;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime recoveredAt;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* API 한 건의 현재 상태 (정상/점검/지연/장애).
|
||||
*
|
||||
* <p>게시된 장애·점검 공지(PTL_NOTICE + DJB_APISTATUS_INCIDENT)만 근거로 한다.
|
||||
* 미게시(초안/USE_YN='N') 건은 다른 API Status 화면과 동일하게 보이지 않는다.</p>
|
||||
*/
|
||||
@Data
|
||||
public class ApiCurrentStatusDTO {
|
||||
|
||||
private String apiId;
|
||||
|
||||
/** 공개 API 목록(PTL_API_SPEC_INFO, DISPLAY_YN='Y')에 없으면 null */
|
||||
private String apiName;
|
||||
|
||||
/** NORMAL / DEGRADED / OUTAGE / MAINTENANCE */
|
||||
private String currentStatus;
|
||||
|
||||
/** 정상 / 지연 / 장애 / 점검 */
|
||||
private String currentStatusLabel;
|
||||
|
||||
/** 현재 상태의 근거가 된 이슈. 정상이면 null */
|
||||
private Long activeIncidentId;
|
||||
|
||||
/** INCIDENT / MAINTENANCE */
|
||||
private String activeIncidentKind;
|
||||
|
||||
private String activeIncidentTitle;
|
||||
|
||||
/** 현재 상태가 시작된 시각 (근거 이슈의 시작 시각) */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime statusSince;
|
||||
|
||||
/** 점검 종료 예정 시각. 장애이거나 미정이면 null */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime expectedEndAt;
|
||||
|
||||
/** 조회 기간 내 마지막 장애 발생 시각 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastIncidentAt;
|
||||
|
||||
/** 조회 기간 가동률 (0.0 ~ 1.0). 상태만 계산하는 경로에서는 채우지 않는다 */
|
||||
private Double uptimeRatio;
|
||||
|
||||
/** 가동률·최근 장애 집계 기간(일) */
|
||||
private int windowDays;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 이슈 이력 API 필터 옵션. 화면에는 API 명만 노출하고 apiId 는 조회 파라미터로만 쓴다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ApiOptionDTO {
|
||||
|
||||
private String apiId;
|
||||
private String apiName;
|
||||
|
||||
/** 소속 API 그룹명 (오픈 API 목록과 동일 기준) */
|
||||
private String groupName;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 90일 가동률 일별 집계 (P2)
|
||||
*/
|
||||
@Data
|
||||
public class DailyStatDTO {
|
||||
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private LocalDate statDate;
|
||||
|
||||
/** 0.0000 ~ 1.0000 */
|
||||
private double uptimeRatio;
|
||||
|
||||
/** 장애 + 지연 합계 (가동률 차감분). 지연도 서비스 저하이므로 계속 차감한다 */
|
||||
private long incidentMinutes;
|
||||
|
||||
/** 그 중 지연(자동 탐지) 분 */
|
||||
private long delayMinutes;
|
||||
|
||||
private long maintenanceMinutes;
|
||||
|
||||
/** 막대 색상 구분: NORMAL / DEGRADED / OUTAGE / MAINTENANCE */
|
||||
private String status;
|
||||
|
||||
private List<IssueRefDTO> issues = new ArrayList<>();
|
||||
|
||||
@Data
|
||||
public static class IssueRefDTO {
|
||||
private Long incidentId;
|
||||
private String kind;
|
||||
private String title;
|
||||
|
||||
public IssueRefDTO() {
|
||||
}
|
||||
|
||||
public IssueRefDTO(Long incidentId, String kind, String title) {
|
||||
this.incidentId = incidentId;
|
||||
this.kind = kind;
|
||||
this.title = title;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 이슈 이력 페이지의 90일 인덱스바 1칸 (P9)
|
||||
*/
|
||||
@Data
|
||||
public class IssueDateEntryDTO {
|
||||
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private LocalDate date;
|
||||
|
||||
/** INCIDENT / DELAY / MAINTENANCE - 유형 필터와 같은 값 */
|
||||
private List<String> kinds = new ArrayList<>();
|
||||
|
||||
/** 장애 건수 (자동 탐지 지연 제외) */
|
||||
private int incCount;
|
||||
|
||||
/** 지연 건수 (자동 탐지 지연 - INCIDENT 중 INTERFACE_ID 가 DELAY_START: 인 건) */
|
||||
private int dlyCount;
|
||||
|
||||
private int mntCount;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 점검 사항 카드 (P5). 상태 관리를 하지 않으므로(ADR-F15) 진행 단계는 화면이 현재 시각과 비교해 부여한다.
|
||||
*/
|
||||
@Data
|
||||
public class MaintenanceCardDTO {
|
||||
|
||||
private Long incidentId;
|
||||
private String noticeId;
|
||||
private String title;
|
||||
private String summary;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startedAt;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endAt;
|
||||
private Long durationMinutes;
|
||||
private List<AffectedApiDTO> impactedApis = new ArrayList<>();
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime registeredAt;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastModifiedAt;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 내가 이용 중인 API 의 현재 상태 (P4)
|
||||
*/
|
||||
@Data
|
||||
public class MyApiStatusDTO {
|
||||
|
||||
private String apiId;
|
||||
private String apiName;
|
||||
|
||||
/** NORMAL / DEGRADED / OUTAGE / MAINTENANCE */
|
||||
private String currentStatus;
|
||||
|
||||
private String currentStatusLabel;
|
||||
private Long activeIncidentId;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastIncidentAt;
|
||||
private double uptime90d;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 지난 이슈 카드 (P6, P10). 장애는 타임라인 전체, 점검은 요약만 담는다.
|
||||
*/
|
||||
@Data
|
||||
public class PastIssueCardDTO {
|
||||
|
||||
private Long incidentId;
|
||||
private String noticeId;
|
||||
private String kind;
|
||||
private String state;
|
||||
private String stateLabel;
|
||||
private String title;
|
||||
private String summary;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startedAt;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endAt;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private LocalDate dateGroup;
|
||||
private Long durationMinutes;
|
||||
private List<AffectedApiDTO> impactedApis = new ArrayList<>();
|
||||
private List<TimelineEntryDTO> timeline = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 장애 처리 타임라인 1건
|
||||
*/
|
||||
@Data
|
||||
public class TimelineEntryDTO {
|
||||
|
||||
private Long timelineId;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime eventAt;
|
||||
private String stateAfter;
|
||||
private String labelKo;
|
||||
private String body;
|
||||
private String authorType;
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.repository;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentState;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 개발자포탈 API Status 화면 전용 조회. 읽기 전용이며 공개 조건을 항상 적용한다.
|
||||
*
|
||||
* <p>공개 조건({@link #VISIBLE})은 두 갈래다.
|
||||
* <ul>
|
||||
* <li>공지가 붙은 이슈(장애·점검) - 그 공지가 게시(USE_YN='Y')되어 있어야 한다.
|
||||
* 공지가 삭제된 고아 행도 이 조건에서 자연히 빠진다 (물리 FK 없음 - ADR-F10).</li>
|
||||
* <li>공지가 없는 이슈(지연) - 자동 탐지 전용이라 검수할 공지가 없다.
|
||||
* 초안(DRAFT_YN='Y')만 아니면 노출한다.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>공지 조건을 EXISTS 로 쓰는 이유: 예전처럼 {@code FROM ... , PortalNotice n} 으로 조인하면
|
||||
* NOTICE_ID 가 없는 지연 이슈가 행 자체에서 사라진다.</p>
|
||||
*/
|
||||
public interface ApiStatusIncidentQueryRepository extends Repository<DjbApistatusIncident, Long> {
|
||||
|
||||
String VISIBLE = " i.draftYn = 'N'"
|
||||
+ " AND (i.noticeId IS NULL"
|
||||
+ " OR EXISTS (SELECT 1 FROM PortalNotice n"
|
||||
+ " WHERE n.id = i.noticeId AND n.useYn = 'Y')) ";
|
||||
|
||||
/** 종결 판정이 STATE 로 이뤄지는 종류 (장애·지연). JPQL 리터럴로 써야 해서 FQCN 을 쓴다 */
|
||||
String KIND_INCIDENT = "com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind.INCIDENT";
|
||||
String KIND_DELAY = "com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind.DELAY";
|
||||
String KIND_MAINTENANCE = "com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind.MAINTENANCE";
|
||||
|
||||
/** 종결 조건 - 장애·지연은 STATE 로, 점검은 종료 시각 경과로 판정한다 */
|
||||
String CLOSED_CONDITION = " ((i.kind IN (" + KIND_INCIDENT + ", " + KIND_DELAY + ")"
|
||||
+ " AND i.state IN :closedStates)"
|
||||
+ " OR (i.kind = " + KIND_MAINTENANCE
|
||||
+ " AND i.endAt IS NOT NULL AND i.endAt < :now)) ";
|
||||
|
||||
/**
|
||||
* 진행 중 이슈 (P3). 장애와 지연을 함께 본다.
|
||||
*/
|
||||
@Query("SELECT i FROM DjbApistatusIncident i"
|
||||
+ " WHERE " + VISIBLE
|
||||
+ " AND i.kind IN :kinds"
|
||||
+ " AND i.state NOT IN :closedStates"
|
||||
+ " ORDER BY i.startedAt DESC")
|
||||
List<DjbApistatusIncident> findVisibleOpenIncidents(@Param("kinds") Collection<IncidentKind> kinds,
|
||||
@Param("closedStates") Collection<IncidentState> closedStates);
|
||||
|
||||
/**
|
||||
* 예정/진행 중 점검 (P5). 종료 시각이 없거나 아직 지나지 않은 점검.
|
||||
*/
|
||||
@Query("SELECT i FROM DjbApistatusIncident i"
|
||||
+ " WHERE " + VISIBLE
|
||||
+ " AND i.kind = :kind"
|
||||
+ " AND (i.endAt IS NULL OR i.endAt >= :now)"
|
||||
+ " ORDER BY i.startedAt ASC")
|
||||
List<DjbApistatusIncident> findVisibleOngoingMaintenance(@Param("kind") IncidentKind kind,
|
||||
@Param("now") LocalDateTime now);
|
||||
|
||||
/**
|
||||
* 종결된 이슈 (P6). 장애·지연은 종결 상태, 점검은 종료 시각 경과.
|
||||
*/
|
||||
@Query(value = "SELECT i FROM DjbApistatusIncident i"
|
||||
+ " WHERE " + VISIBLE
|
||||
+ " AND " + CLOSED_CONDITION
|
||||
+ " ORDER BY i.startedAt DESC",
|
||||
countQuery = "SELECT COUNT(i) FROM DjbApistatusIncident i"
|
||||
+ " WHERE " + VISIBLE
|
||||
+ " AND " + CLOSED_CONDITION)
|
||||
Page<DjbApistatusIncident> findVisibleClosedIssues(@Param("closedStates") Collection<IncidentState> closedStates,
|
||||
@Param("now") LocalDateTime now,
|
||||
Pageable pageable);
|
||||
|
||||
/**
|
||||
* 기간과 겹치는 모든 이슈 (P2 가동률 집계, P9 일자 인덱스, P10 목록).
|
||||
* 진행 중(END_AT IS NULL) 이슈도 포함한다.
|
||||
*/
|
||||
@Query("SELECT i FROM DjbApistatusIncident i"
|
||||
+ " WHERE " + VISIBLE
|
||||
+ " AND i.startedAt < :to"
|
||||
+ " AND (i.endAt IS NULL OR i.endAt >= :from)"
|
||||
+ " ORDER BY i.startedAt DESC")
|
||||
List<DjbApistatusIncident> findVisibleOverlapping(@Param("from") LocalDateTime from,
|
||||
@Param("to") LocalDateTime to);
|
||||
|
||||
/**
|
||||
* 기간과 겹치고 특정 API 에 영향을 준 이슈 (P9/P10 의 apiId 필터).
|
||||
*/
|
||||
@Query("SELECT DISTINCT i FROM DjbApistatusIncident i, DjbApistatusIncidentApi a"
|
||||
+ " WHERE " + VISIBLE
|
||||
+ " AND a.incidentId = i.incidentId"
|
||||
+ " AND a.apiId = :apiId"
|
||||
+ " AND i.startedAt < :to"
|
||||
+ " AND (i.endAt IS NULL OR i.endAt >= :from)"
|
||||
+ " ORDER BY i.startedAt DESC")
|
||||
List<DjbApistatusIncident> findVisibleOverlappingByApi(@Param("from") LocalDateTime from,
|
||||
@Param("to") LocalDateTime to,
|
||||
@Param("apiId") String apiId);
|
||||
|
||||
/**
|
||||
* 공개 상세 (P7)
|
||||
*/
|
||||
@Query("SELECT i FROM DjbApistatusIncident i"
|
||||
+ " WHERE " + VISIBLE
|
||||
+ " AND i.incidentId = :incidentId")
|
||||
Optional<DjbApistatusIncident> findVisibleById(@Param("incidentId") Long incidentId);
|
||||
}
|
||||
+274
@@ -0,0 +1,274 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.portal.apispec.entity.ApiSpecInfo;
|
||||
import com.eactive.apim.portal.apispec.repository.ApiSpecInfoRepository;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ApiCurrentStatusDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncidentApi;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentState;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.repository.DjbApistatusIncidentApiRepository;
|
||||
import com.eactive.apim.portal.djb.apistatus.repository.ApiStatusIncidentQueryRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* API 별 현재 상태(정상/점검/지연/장애) 조회.
|
||||
*
|
||||
* <p>"내 API 현황"(P4)과 API 상세 화면이 이 서비스를 공유해 판정 기준을 하나로 유지한다.
|
||||
* 근거는 <b>게시된</b> 장애·점검 공지뿐이며(PTL_NOTICE.USE_YN='Y' + DRAFT_YN='N'),
|
||||
* 미게시 건은 다른 API Status 화면과 마찬가지로 반영하지 않는다.</p>
|
||||
*
|
||||
* <p>판정 규칙 (심각한 쪽 우선)
|
||||
* <ul>
|
||||
* <li>진행 중 장애 → 장애(OUTAGE). 단 모니터링 상태이거나 자동 탐지 지연 건이면 지연(DEGRADED)</li>
|
||||
* <li>이미 시작된 점검 → 점검(MAINTENANCE)</li>
|
||||
* <li>해당 없음 → 정상(NORMAL)</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class ApiCurrentStatusService {
|
||||
|
||||
private final ApiStatusIncidentQueryRepository incidentQueryRepository;
|
||||
private final DjbApistatusIncidentApiRepository incidentApiRepository;
|
||||
private final ApiSpecInfoRepository apiSpecInfoRepository;
|
||||
private final ApiStatusUptimeService uptimeService;
|
||||
private final ApiStatusCatalogService catalogService;
|
||||
|
||||
/** API 한 건의 현재 상태. apiId 가 비어 있으면 empty */
|
||||
public Optional<ApiCurrentStatusDTO> getStatus(String apiId) {
|
||||
if (StringUtils.isBlank(apiId)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return getStatuses(Collections.singletonList(apiId)).stream().findFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 API 의 현재 상태 (API 명·가동률 포함). 요청 순서를 유지하며 중복 apiId 는 한 번만 반환한다.
|
||||
*/
|
||||
public List<ApiCurrentStatusDTO> getStatuses(Collection<String> apiIds) {
|
||||
Set<String> ids = normalize(apiIds);
|
||||
if (ids.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Map<String, ApiCurrentStatusDTO> statuses = resolveStatuses(ids);
|
||||
Map<String, String> names = resolveApiNames(ids);
|
||||
Map<String, Double> uptimes = uptimeService.getApiUptimeRatios(ids, catalogService.getWindowDays());
|
||||
|
||||
List<ApiCurrentStatusDTO> result = new ArrayList<>(ids.size());
|
||||
for (String apiId : ids) {
|
||||
ApiCurrentStatusDTO dto = statuses.get(apiId);
|
||||
dto.setApiName(names.get(apiId));
|
||||
dto.setUptimeRatio(uptimes.getOrDefault(apiId, 1.0d));
|
||||
result.add(dto);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 상태만 계산한다 (API 명·가동률 제외). 대상 API 를 이미 알고 있고 이름·가동률을
|
||||
* 따로 채우는 호출자(P4 내 API 현황)를 위한 경량 경로다.
|
||||
*/
|
||||
public Map<String, ApiCurrentStatusDTO> resolveStatuses(Set<String> apiIds) {
|
||||
if (apiIds == null || apiIds.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
LocalDateTime now = ApiStatusSupport.now();
|
||||
int windowDays = catalogService.getWindowDays();
|
||||
|
||||
Map<String, DjbApistatusIncident> openByApi = mapOpenIncidents(apiIds);
|
||||
Map<String, DjbApistatusIncident> maintenanceByApi = mapStartedMaintenance(apiIds, now);
|
||||
Map<String, LocalDateTime> lastIncidentAt = collectLastIncidentAt(apiIds, now, windowDays);
|
||||
|
||||
Map<String, ApiCurrentStatusDTO> result = new LinkedHashMap<>();
|
||||
for (String apiId : apiIds) {
|
||||
DjbApistatusIncident open = openByApi.get(apiId);
|
||||
DjbApistatusIncident maintenance = maintenanceByApi.get(apiId);
|
||||
|
||||
ApiCurrentStatusDTO dto = new ApiCurrentStatusDTO();
|
||||
dto.setApiId(apiId);
|
||||
dto.setCurrentStatus(resolveStatus(open, maintenance != null));
|
||||
dto.setCurrentStatusLabel(ApiStatusSupport.statusLabel(dto.getCurrentStatus()));
|
||||
dto.setLastIncidentAt(lastIncidentAt.get(apiId));
|
||||
dto.setWindowDays(windowDays);
|
||||
|
||||
// 장애가 점검보다 심각하므로 근거 이슈도 장애를 우선한다
|
||||
DjbApistatusIncident active = open != null ? open : maintenance;
|
||||
if (active != null) {
|
||||
dto.setActiveIncidentId(active.getIncidentId());
|
||||
dto.setActiveIncidentKind(active.getKind() == null ? null : active.getKind().name());
|
||||
dto.setActiveIncidentTitle(active.getTitle());
|
||||
dto.setStatusSince(active.getStartedAt());
|
||||
dto.setExpectedEndAt(active.getEndAt());
|
||||
}
|
||||
result.put(apiId, dto);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 빈 값·중복 제거. 요청 순서는 유지한다 */
|
||||
private Set<String> normalize(Collection<String> apiIds) {
|
||||
if (apiIds == null || apiIds.isEmpty()) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
return apiIds.stream()
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(StringUtils::trim)
|
||||
.collect(Collectors.toCollection(LinkedHashSet::new));
|
||||
}
|
||||
|
||||
/**
|
||||
* API 명은 공개 목록(DISPLAY_YN='Y')에서만 가져온다. 비공개 API 의 이름이 새어나가지 않게 한다.
|
||||
*/
|
||||
private Map<String, String> resolveApiNames(Set<String> apiIds) {
|
||||
List<ApiSpecInfo> specs =
|
||||
apiSpecInfoRepository.findAllByDisplayYnAndApiIdIn("Y", new ArrayList<>(apiIds));
|
||||
Map<String, String> names = new HashMap<>();
|
||||
for (ApiSpecInfo spec : specs) {
|
||||
names.put(spec.getApiId(), StringUtils.defaultIfBlank(spec.getApiName(), spec.getApiId()));
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
/** 진행 중(미종결) 장애·지연 중 API 별로 가장 심각한 한 건 */
|
||||
private Map<String, DjbApistatusIncident> mapOpenIncidents(Set<String> apiIds) {
|
||||
List<DjbApistatusIncident> openIncidents = incidentQueryRepository
|
||||
.findVisibleOpenIncidents(IncidentKind.DEGRADING, ApiStatusSupport.CLOSED_STATES);
|
||||
if (openIncidents.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<Long, DjbApistatusIncident> byId = openIncidents.stream()
|
||||
.collect(Collectors.toMap(DjbApistatusIncident::getIncidentId, incident -> incident));
|
||||
|
||||
Map<String, DjbApistatusIncident> byApi = new HashMap<>();
|
||||
for (DjbApistatusIncidentApi api :
|
||||
incidentApiRepository.findByIncidentIdInOrderByIncidentIdAscApiIdAsc(byId.keySet())) {
|
||||
if (!apiIds.contains(api.getApiId()) || api.getRecoveredAt() != null) {
|
||||
continue;
|
||||
}
|
||||
DjbApistatusIncident incident = byId.get(api.getIncidentId());
|
||||
DjbApistatusIncident previous = byApi.get(api.getApiId());
|
||||
// 같은 API 에 여러 장애가 열려 있으면 더 심각한(장애 > 지연, 조사중 > 모니터링) 쪽을 우선한다
|
||||
if (previous == null || severity(incident) < severity(previous)) {
|
||||
byApi.put(api.getApiId(), incident);
|
||||
}
|
||||
}
|
||||
return byApi;
|
||||
}
|
||||
|
||||
/** 이미 시작된 점검 중 API 별로 가장 먼저 시작된 한 건 (예정 점검은 현재 상태가 아니므로 제외) */
|
||||
private Map<String, DjbApistatusIncident> mapStartedMaintenance(Set<String> apiIds, LocalDateTime now) {
|
||||
List<DjbApistatusIncident> maintenances = incidentQueryRepository
|
||||
.findVisibleOngoingMaintenance(IncidentKind.MAINTENANCE, now).stream()
|
||||
.filter(incident -> incident.getStartedAt() != null && !incident.getStartedAt().isAfter(now))
|
||||
.collect(Collectors.toList());
|
||||
if (maintenances.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<Long, DjbApistatusIncident> byId = maintenances.stream()
|
||||
.collect(Collectors.toMap(DjbApistatusIncident::getIncidentId, incident -> incident));
|
||||
|
||||
Map<String, DjbApistatusIncident> byApi = new HashMap<>();
|
||||
for (DjbApistatusIncidentApi api :
|
||||
incidentApiRepository.findByIncidentIdInOrderByIncidentIdAscApiIdAsc(byId.keySet())) {
|
||||
if (!apiIds.contains(api.getApiId())) {
|
||||
continue;
|
||||
}
|
||||
DjbApistatusIncident incident = byId.get(api.getIncidentId());
|
||||
DjbApistatusIncident previous = byApi.get(api.getApiId());
|
||||
if (previous == null
|
||||
|| (incident.getStartedAt() != null && previous.getStartedAt() != null
|
||||
&& incident.getStartedAt().isBefore(previous.getStartedAt()))) {
|
||||
byApi.put(api.getApiId(), incident);
|
||||
}
|
||||
}
|
||||
return byApi;
|
||||
}
|
||||
|
||||
/** 조회 기간 내 마지막 장애·지연 발생 시각 */
|
||||
private Map<String, LocalDateTime> collectLastIncidentAt(Set<String> apiIds, LocalDateTime now, int windowDays) {
|
||||
LocalDateTime windowStart = now.toLocalDate().minusDays(windowDays - 1L).atStartOfDay();
|
||||
List<DjbApistatusIncident> incidents = incidentQueryRepository
|
||||
.findVisibleOverlapping(windowStart, now.toLocalDate().plusDays(1).atStartOfDay()).stream()
|
||||
.filter(incident -> incident.getKind() != null && incident.getKind().isDegrading())
|
||||
.collect(Collectors.toList());
|
||||
if (incidents.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<Long, DjbApistatusIncident> byId = incidents.stream()
|
||||
.collect(Collectors.toMap(DjbApistatusIncident::getIncidentId, incident -> incident));
|
||||
|
||||
Map<String, LocalDateTime> result = new HashMap<>();
|
||||
for (DjbApistatusIncidentApi api :
|
||||
incidentApiRepository.findByIncidentIdInOrderByIncidentIdAscApiIdAsc(byId.keySet())) {
|
||||
if (!apiIds.contains(api.getApiId())) {
|
||||
continue;
|
||||
}
|
||||
LocalDateTime startedAt = byId.get(api.getIncidentId()).getStartedAt();
|
||||
LocalDateTime previous = result.get(api.getApiId());
|
||||
if (startedAt != null && (previous == null || startedAt.isAfter(previous))) {
|
||||
result.put(api.getApiId(), startedAt);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 진행 중 장애·지연 + 점검 여부로 현재 상태를 정한다.
|
||||
*
|
||||
* <p>KIND 가 DELAY 면 지연이다. 장애(INCIDENT)라도 모니터링 단계면 이미 완화된 상태라
|
||||
* 지연으로 표기한다 - 이슈 이력의 유형 필터(KIND 기준)와는 이 지점만 다르다.</p>
|
||||
*/
|
||||
private String resolveStatus(DjbApistatusIncident open, boolean underMaintenance) {
|
||||
if (open != null) {
|
||||
boolean degraded = open.getKind() == IncidentKind.DELAY
|
||||
|| open.getState() == IncidentState.MONITORING;
|
||||
return degraded ? ApiStatusSupport.STATUS_DEGRADED : ApiStatusSupport.STATUS_OUTAGE;
|
||||
}
|
||||
if (underMaintenance) {
|
||||
return ApiStatusSupport.STATUS_MAINTENANCE;
|
||||
}
|
||||
return ApiStatusSupport.STATUS_NORMAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 같은 API 에 열린 이슈가 여럿일 때의 우선순위 (낮을수록 심각).
|
||||
* 지연은 장애보다 뒤로 민다.
|
||||
*/
|
||||
private int severity(DjbApistatusIncident incident) {
|
||||
if (incident == null) {
|
||||
return 99;
|
||||
}
|
||||
int base = incident.getKind() == IncidentKind.DELAY ? 10 : 0;
|
||||
IncidentState state = incident.getState();
|
||||
if (state == null) {
|
||||
return base + 9;
|
||||
}
|
||||
switch (state) {
|
||||
case INVESTIGATING: return base;
|
||||
case IDENTIFIED: return base + 1;
|
||||
// 모니터링 단계는 지연으로 표기되므로 같은 장애라도 뒤로 민다
|
||||
case MONITORING: return base + 12;
|
||||
default: return base + 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ActiveIncidentDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.AffectedApiDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.MaintenanceCardDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.PastIssueCardDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.TimelineEntryDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncidentApi;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncidentTimeline;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.repository.DjbApistatusIncidentApiRepository;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.repository.DjbApistatusIncidentTimelineRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 장애/점검 엔티티 → 화면 DTO 변환. 영향 API·타임라인은 한 번에 모아 읽어 1+N 조회를 피한다.
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class ApiStatusAssembler {
|
||||
|
||||
private static final int RECENT_TIMELINE_SIZE = 3;
|
||||
|
||||
private final DjbApistatusIncidentApiRepository incidentApiRepository;
|
||||
private final DjbApistatusIncidentTimelineRepository timelineRepository;
|
||||
|
||||
public Map<Long, List<AffectedApiDTO>> loadApis(Collection<Long> incidentIds) {
|
||||
if (incidentIds == null || incidentIds.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<Long, List<AffectedApiDTO>> result = new HashMap<>();
|
||||
for (DjbApistatusIncidentApi api :
|
||||
incidentApiRepository.findByIncidentIdInOrderByIncidentIdAscApiIdAsc(incidentIds)) {
|
||||
result.computeIfAbsent(api.getIncidentId(), key -> new ArrayList<>())
|
||||
.add(new AffectedApiDTO(api.getApiId(),
|
||||
StringUtils.defaultIfBlank(api.getApiName(), api.getApiId()),
|
||||
api.getRecoveredAt()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 공개 타임라인. 최신순으로 담는다.
|
||||
*/
|
||||
public Map<Long, List<TimelineEntryDTO>> loadTimelines(Collection<Long> incidentIds) {
|
||||
if (incidentIds == null || incidentIds.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<Long, List<TimelineEntryDTO>> result = new HashMap<>();
|
||||
for (DjbApistatusIncidentTimeline timeline :
|
||||
timelineRepository.findByIncidentIdInAndVisibleYnOrderByEventAtDesc(incidentIds, "Y")) {
|
||||
result.computeIfAbsent(timeline.getIncidentId(), key -> new ArrayList<>())
|
||||
.add(toTimelineEntry(timeline));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<ActiveIncidentDTO> toActiveIncidents(List<DjbApistatusIncident> incidents, LocalDateTime now) {
|
||||
if (incidents.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> ids = incidentIds(incidents);
|
||||
Map<Long, List<AffectedApiDTO>> apis = loadApis(ids);
|
||||
Map<Long, List<TimelineEntryDTO>> timelines = loadTimelines(ids);
|
||||
|
||||
List<ActiveIncidentDTO> result = new ArrayList<>();
|
||||
for (DjbApistatusIncident incident : incidents) {
|
||||
ActiveIncidentDTO dto = new ActiveIncidentDTO();
|
||||
dto.setIncidentId(incident.getIncidentId());
|
||||
dto.setNoticeId(incident.getNoticeId());
|
||||
dto.setKind(incident.getKind() == null ? null : incident.getKind().name());
|
||||
dto.setState(incident.getState() == null ? null : incident.getState().name());
|
||||
dto.setStateLabel(ApiStatusSupport.stateLabel(incident.getState()));
|
||||
dto.setTitle(incident.getTitle());
|
||||
dto.setSummary(incident.getSummary());
|
||||
dto.setStartedAt(incident.getStartedAt());
|
||||
dto.setElapsedMinutes(ApiStatusSupport.minutesBetween(incident.getStartedAt(), now));
|
||||
dto.setApis(apis.getOrDefault(incident.getIncidentId(), Collections.emptyList()));
|
||||
|
||||
List<TimelineEntryDTO> all = timelines.getOrDefault(incident.getIncidentId(), Collections.emptyList());
|
||||
dto.setRecentTimeline(all.size() > RECENT_TIMELINE_SIZE
|
||||
? new ArrayList<>(all.subList(0, RECENT_TIMELINE_SIZE)) : all);
|
||||
result.add(dto);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<MaintenanceCardDTO> toMaintenanceCards(List<DjbApistatusIncident> incidents) {
|
||||
if (incidents.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Map<Long, List<AffectedApiDTO>> apis = loadApis(incidentIds(incidents));
|
||||
|
||||
List<MaintenanceCardDTO> result = new ArrayList<>();
|
||||
for (DjbApistatusIncident incident : incidents) {
|
||||
MaintenanceCardDTO dto = new MaintenanceCardDTO();
|
||||
dto.setIncidentId(incident.getIncidentId());
|
||||
dto.setNoticeId(incident.getNoticeId());
|
||||
dto.setTitle(incident.getTitle());
|
||||
dto.setSummary(incident.getSummary());
|
||||
dto.setStartedAt(incident.getStartedAt());
|
||||
dto.setEndAt(incident.getEndAt());
|
||||
dto.setDurationMinutes(incident.getEndAt() == null ? null
|
||||
: ApiStatusSupport.minutesBetween(incident.getStartedAt(), incident.getEndAt()));
|
||||
dto.setImpactedApis(apis.getOrDefault(incident.getIncidentId(), Collections.emptyList()));
|
||||
dto.setRegisteredAt(incident.getCreatedDate());
|
||||
dto.setLastModifiedAt(incident.getLastModifiedDate());
|
||||
result.add(dto);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 지난 이슈 카드. 장애·지연은 타임라인 전체를 붙이고 점검은 붙이지 않는다 (ADR-F15).
|
||||
*/
|
||||
public List<PastIssueCardDTO> toPastIssueCards(List<DjbApistatusIncident> incidents) {
|
||||
if (incidents.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> ids = incidentIds(incidents);
|
||||
Map<Long, List<AffectedApiDTO>> apis = loadApis(ids);
|
||||
|
||||
List<Long> incidentKindIds = incidents.stream()
|
||||
.filter(incident -> incident.getKind() != null && incident.getKind().isDegrading())
|
||||
.map(DjbApistatusIncident::getIncidentId)
|
||||
.collect(Collectors.toList());
|
||||
Map<Long, List<TimelineEntryDTO>> timelines = loadTimelines(incidentKindIds);
|
||||
|
||||
List<PastIssueCardDTO> result = new ArrayList<>();
|
||||
for (DjbApistatusIncident incident : incidents) {
|
||||
PastIssueCardDTO dto = new PastIssueCardDTO();
|
||||
dto.setIncidentId(incident.getIncidentId());
|
||||
dto.setNoticeId(incident.getNoticeId());
|
||||
dto.setKind(incident.getKind() == null ? null : incident.getKind().name());
|
||||
dto.setState(incident.getState() == null ? null : incident.getState().name());
|
||||
dto.setStateLabel(ApiStatusSupport.stateLabel(incident.getState()));
|
||||
dto.setTitle(incident.getTitle());
|
||||
dto.setSummary(incident.getSummary());
|
||||
dto.setStartedAt(incident.getStartedAt());
|
||||
dto.setEndAt(incident.getEndAt());
|
||||
dto.setDateGroup(incident.getStartedAt() == null ? null : incident.getStartedAt().toLocalDate());
|
||||
dto.setDurationMinutes(incident.getEndAt() == null ? null
|
||||
: ApiStatusSupport.minutesBetween(incident.getStartedAt(), incident.getEndAt()));
|
||||
dto.setImpactedApis(apis.getOrDefault(incident.getIncidentId(), Collections.emptyList()));
|
||||
dto.setTimeline(timelines.getOrDefault(incident.getIncidentId(), Collections.emptyList()));
|
||||
result.add(dto);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private TimelineEntryDTO toTimelineEntry(DjbApistatusIncidentTimeline timeline) {
|
||||
TimelineEntryDTO dto = new TimelineEntryDTO();
|
||||
dto.setTimelineId(timeline.getTimelineId());
|
||||
dto.setEventAt(timeline.getEventAt());
|
||||
dto.setStateAfter(timeline.getStateAfter() == null ? null : timeline.getStateAfter().name());
|
||||
dto.setLabelKo(ApiStatusSupport.stateLabel(timeline.getStateAfter()));
|
||||
dto.setBody(timeline.getBody());
|
||||
dto.setAuthorType(timeline.getAuthorType());
|
||||
return dto;
|
||||
}
|
||||
|
||||
private List<Long> incidentIds(List<DjbApistatusIncident> incidents) {
|
||||
return incidents.stream().map(DjbApistatusIncident::getIncidentId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.gateway.data.statistics.repository.GwApiStatusRepository;
|
||||
import com.eactive.apim.portal.apps.apis.dto.ApiSpecInfoDto;
|
||||
import com.eactive.apim.portal.apps.apis.service.ApiSearchFacade;
|
||||
import com.eactive.apim.portal.apps.apiservice.dto.ApiGroupSearch;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ApiOptionDTO;
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* API Status 화면의 부가 조회 - 필터용 API 목록, 상태 모니터링 최근 실행 시각.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class ApiStatusCatalogService {
|
||||
|
||||
public static final String PROPERTY_GROUP = "Portal";
|
||||
|
||||
/** API 상태 모니터링 Quartz Job 이름 (eapim-admin QRTZ_JOB_DETAILS.JOB_NAME) */
|
||||
public static final String KEY_MONITOR_JOB_NAME = "djb.apistatus.monitor.job-name";
|
||||
|
||||
/** 실서버(DAPM) QRTZ_JOB_DETAILS 실사값 (2026-07-31) */
|
||||
private static final String DEFAULT_MONITOR_JOB_NAME = "ApiStatusMonitorJob";
|
||||
|
||||
/** 상태/이력 조회 기간(일). 가동률 바·이슈 인덱스·date picker 범위가 모두 이 값을 따른다 */
|
||||
public static final String KEY_WINDOW_DAYS = "djb.apistatus.window-days";
|
||||
|
||||
/** OPEN API 목록 카드의 현재 상태 태그 노출 여부 (true/false) */
|
||||
public static final String KEY_API_LIST_STATUS_BADGE = "djb.apistatus.api-list-status-badge";
|
||||
|
||||
private static final boolean DEFAULT_API_LIST_STATUS_BADGE = true;
|
||||
|
||||
private static final int MIN_WINDOW_DAYS = 1;
|
||||
private static final int MAX_WINDOW_DAYS = 365;
|
||||
|
||||
private final ApiSearchFacade apiSearchFacade;
|
||||
private final PortalPropertyService portalPropertyService;
|
||||
private final GwApiStatusRepository gwApiStatusRepository;
|
||||
|
||||
@PersistenceContext
|
||||
private EntityManager entityManager;
|
||||
|
||||
/**
|
||||
* 이슈 이력 필터용 API 목록.
|
||||
*
|
||||
* <p>"오픈 API" 목록 화면과 <b>같은 조회 경로</b>({@link ApiSearchFacade#searchApis})를 쓴다.
|
||||
* 즉 API 그룹(AGWAPP.API_GROUP + API_GROUP_API)에 편성된 API 중
|
||||
* PTL_API_SPEC_INFO 에 스펙이 있고 현재 사용자에게 공개된 것만 나온다.</p>
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ApiOptionDTO> getSelectableApis() {
|
||||
Object apis = apiSearchFacade.searchApis(new ApiGroupSearch()).get("apis");
|
||||
if (!(apis instanceof List)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return ((List<ApiSpecInfoDto>) apis).stream()
|
||||
.filter(api -> StringUtils.isNotBlank(api.getApiId()))
|
||||
.map(api -> new ApiOptionDTO(api.getApiId(),
|
||||
StringUtils.defaultIfBlank(api.getApiName(), api.getApiId()),
|
||||
api.getApiGroupName()))
|
||||
.sorted(Comparator.comparing(ApiOptionDTO::getApiName,
|
||||
Comparator.nullsLast(Comparator.naturalOrder())))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* API 상태 모니터링 Job(eapim-admin Quartz)의 마지막 실행 시각.
|
||||
*
|
||||
* <p>Job 이름은 PTL_PROPERTY({@code Portal} / {@code djb.apistatus.monitor.job-name})로
|
||||
* 바꿀 수 있으며, 최초 접근 시 기본값으로 row 가 자동 생성된다.
|
||||
* Quartz 메타(QRTZ_TRIGGERS)는 EMSAPP 스키마라 EMS EntityManager 로 직접 읽는다.</p>
|
||||
*
|
||||
* <p>readOnly 를 풀어야 최초 접근 시 프로퍼티 row 자동 생성(INSERT)이 가능하다.</p>
|
||||
*/
|
||||
@Transactional
|
||||
public LocalDateTime getLastMonitorFireAt() {
|
||||
try {
|
||||
String jobName = portalPropertyService.getOrCreateProperty(
|
||||
PROPERTY_GROUP, KEY_MONITOR_JOB_NAME, DEFAULT_MONITOR_JOB_NAME,
|
||||
"API 상태 모니터링 Quartz Job 이름 (eapim-admin QRTZ_JOB_DETAILS.JOB_NAME)");
|
||||
if (StringUtils.isBlank(jobName)) {
|
||||
jobName = DEFAULT_MONITOR_JOB_NAME;
|
||||
}
|
||||
|
||||
Object fireTime = entityManager.createNativeQuery(
|
||||
"SELECT MAX(PREV_FIRE_TIME) FROM QRTZ_TRIGGERS WHERE JOB_NAME = :jobName")
|
||||
.setParameter("jobName", jobName)
|
||||
.getSingleResult();
|
||||
if (!(fireTime instanceof Number)) {
|
||||
return null;
|
||||
}
|
||||
long epochMillis = ((Number) fireTime).longValue();
|
||||
if (epochMillis <= 0) {
|
||||
return null;
|
||||
}
|
||||
return LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMillis), ApiStatusSupport.ZONE);
|
||||
} catch (Exception e) {
|
||||
// 스케줄 메타 조회 실패가 화면 전체를 막지 않도록 한다
|
||||
log.warn("API 상태 모니터링 실행 시각 조회 실패", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 상태/이력 조회 기간(일). PTL_PROPERTY({@code Portal} / {@code djb.apistatus.window-days})로
|
||||
* 조절하며 1~365 로 clamp 한다. 값이 이상하면 기본 90일.
|
||||
*/
|
||||
@Transactional
|
||||
public int getWindowDays() {
|
||||
try {
|
||||
String value = portalPropertyService.getOrCreateProperty(
|
||||
PROPERTY_GROUP, KEY_WINDOW_DAYS,
|
||||
String.valueOf(ApiStatusSupport.DEFAULT_WINDOW_DAYS),
|
||||
"API Status 조회 기간(일). 가동률 바·이슈 인덱스·날짜 선택 범위에 적용 (1~365)");
|
||||
int days = Integer.parseInt(StringUtils.trimToEmpty(value));
|
||||
return Math.max(MIN_WINDOW_DAYS, Math.min(MAX_WINDOW_DAYS, days));
|
||||
} catch (Exception e) {
|
||||
log.warn("조회 기간 프로퍼티 해석 실패 - 기본값 {}일 사용", ApiStatusSupport.DEFAULT_WINDOW_DAYS, e);
|
||||
return ApiStatusSupport.DEFAULT_WINDOW_DAYS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* OPEN API 목록(/apis) 카드에 현재 상태 태그를 노출할지 여부.
|
||||
* PTL_PROPERTY({@code Portal} / {@code djb.apistatus.api-list-status-badge}) 로 켜고 끈다.
|
||||
*
|
||||
* <p>{@code true/Y/1} 이면 노출, {@code false/N/0} 이면 숨김. 값이 비었거나 이상하면 기본 노출.</p>
|
||||
*/
|
||||
@Transactional
|
||||
public boolean isApiListStatusBadgeEnabled() {
|
||||
try {
|
||||
String value = portalPropertyService.getOrCreateProperty(
|
||||
PROPERTY_GROUP, KEY_API_LIST_STATUS_BADGE,
|
||||
String.valueOf(DEFAULT_API_LIST_STATUS_BADGE),
|
||||
"OPEN API 목록 카드에 현재 상태(정상/점검/지연/장애) 태그 노출 여부 (true/false)");
|
||||
String normalized = StringUtils.trimToEmpty(value);
|
||||
if (StringUtils.equalsAnyIgnoreCase(normalized, "false", "n", "0")) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.equalsAnyIgnoreCase(normalized, "true", "y", "1")) {
|
||||
return true;
|
||||
}
|
||||
return DEFAULT_API_LIST_STATUS_BADGE;
|
||||
} catch (Exception e) {
|
||||
log.warn("API 목록 상태 태그 노출 프로퍼티 조회 실패 - 기본값 {} 사용", DEFAULT_API_LIST_STATUS_BADGE, e);
|
||||
return DEFAULT_API_LIST_STATUS_BADGE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* API 상태가 마지막으로 <b>변경</b>된 시각 (AGWAPP.API_STATUS 최근 upsert).
|
||||
* 실행 시각(fire)과 달리 상태 변화가 있을 때만 갱신된다.
|
||||
*/
|
||||
public LocalDateTime getLastStatusChangedAt() {
|
||||
try {
|
||||
return gwApiStatusRepository.findLastModifiedDate().orElse(null);
|
||||
} catch (Exception e) {
|
||||
log.warn("API 상태 변경 시각 조회 실패", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.IssueDateEntryDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.PastIssueCardDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind;
|
||||
import com.eactive.apim.portal.djb.apistatus.repository.ApiStatusIncidentQueryRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 전체 이슈 이력 페이지 조회 (ADR-F16/F17). 필터는 날짜와 API 두 축만 지원한다.
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class ApiStatusIssueHistoryService {
|
||||
|
||||
private final ApiStatusIncidentQueryRepository incidentQueryRepository;
|
||||
private final ApiStatusAssembler assembler;
|
||||
private final ApiStatusCatalogService catalogService;
|
||||
|
||||
/**
|
||||
* P9 - 90일 인덱스바용 일자별 이슈 집계. 이슈가 여러 날에 걸치면 걸친 날짜 모두에 집계한다.
|
||||
*/
|
||||
public List<IssueDateEntryDTO> getIssueDates(int days, String apiId, String kind) {
|
||||
int windowDays = days <= 0 ? ApiStatusSupport.DEFAULT_WINDOW_DAYS : Math.min(days, 365);
|
||||
LocalDateTime now = ApiStatusSupport.now();
|
||||
LocalDate today = now.toLocalDate();
|
||||
LocalDate from = today.minusDays(windowDays - 1L);
|
||||
LocalDateTime windowStart = from.atStartOfDay();
|
||||
LocalDateTime windowEnd = today.plusDays(1).atStartOfDay();
|
||||
|
||||
List<DjbApistatusIncident> incidents = findOverlapping(windowStart, windowEnd, apiId, kind);
|
||||
|
||||
Map<LocalDate, IssueDateEntryDTO> byDate = new LinkedHashMap<>();
|
||||
for (int offset = 0; offset < windowDays; offset++) {
|
||||
LocalDate date = from.plusDays(offset);
|
||||
IssueDateEntryDTO entry = new IssueDateEntryDTO();
|
||||
entry.setDate(date);
|
||||
byDate.put(date, entry);
|
||||
}
|
||||
|
||||
for (DjbApistatusIncident incident : incidents) {
|
||||
if (incident.getStartedAt() == null) {
|
||||
continue;
|
||||
}
|
||||
LocalDate start = incident.getStartedAt().toLocalDate();
|
||||
LocalDateTime effectiveEnd = incident.getEndAt() == null ? now : incident.getEndAt();
|
||||
LocalDate end = effectiveEnd.toLocalDate();
|
||||
|
||||
LocalDate cursor = start.isBefore(from) ? from : start;
|
||||
LocalDate last = end.isAfter(today) ? today : end;
|
||||
|
||||
while (!cursor.isAfter(last)) {
|
||||
IssueDateEntryDTO entry = byDate.get(cursor);
|
||||
if (entry != null) {
|
||||
tally(entry, incident);
|
||||
}
|
||||
cursor = cursor.plusDays(1);
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayList<>(byDate.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* 인덱스바 1칸에 이슈 1건을 집계한다. 유형은 이슈 목록 필터와 같은 세 축(장애/지연/점검)으로 가른다.
|
||||
*/
|
||||
private void tally(IssueDateEntryDTO entry, DjbApistatusIncident incident) {
|
||||
IncidentKind kind = incident.getKind();
|
||||
if (kind == null) {
|
||||
return;
|
||||
}
|
||||
switch (kind) {
|
||||
case MAINTENANCE: entry.setMntCount(entry.getMntCount() + 1); break;
|
||||
case DELAY: entry.setDlyCount(entry.getDlyCount() + 1); break;
|
||||
default: entry.setIncCount(entry.getIncCount() + 1); break;
|
||||
}
|
||||
if (!entry.getKinds().contains(kind.name())) {
|
||||
entry.getKinds().add(kind.name());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* P10 - 날짜/API/유형 필터 이슈 목록. 날짜 미지정 시 90일 전체.
|
||||
*/
|
||||
public Page<PastIssueCardDTO> getIssues(LocalDate date, String apiId, String kind, Pageable pageable) {
|
||||
LocalDateTime now = ApiStatusSupport.now();
|
||||
LocalDateTime from;
|
||||
LocalDateTime to;
|
||||
|
||||
if (date == null) {
|
||||
LocalDate today = now.toLocalDate();
|
||||
from = today.minusDays(catalogService.getWindowDays() - 1L).atStartOfDay();
|
||||
to = today.plusDays(1).atStartOfDay();
|
||||
} else {
|
||||
from = date.atStartOfDay();
|
||||
to = date.plusDays(1).atStartOfDay();
|
||||
}
|
||||
|
||||
List<DjbApistatusIncident> incidents = findOverlapping(from, to, apiId, kind);
|
||||
if (incidents.isEmpty()) {
|
||||
return new PageImpl<>(Collections.emptyList(), pageable, 0);
|
||||
}
|
||||
|
||||
int offset = (int) pageable.getOffset();
|
||||
if (offset >= incidents.size()) {
|
||||
return new PageImpl<>(Collections.emptyList(), pageable, incidents.size());
|
||||
}
|
||||
int end = Math.min(offset + pageable.getPageSize(), incidents.size());
|
||||
|
||||
List<PastIssueCardDTO> content = assembler.toPastIssueCards(incidents.subList(offset, end));
|
||||
return new PageImpl<>(content, pageable, incidents.size());
|
||||
}
|
||||
|
||||
private List<DjbApistatusIncident> findOverlapping(LocalDateTime from, LocalDateTime to,
|
||||
String apiId, String kind) {
|
||||
List<DjbApistatusIncident> incidents = StringUtils.isBlank(apiId)
|
||||
? incidentQueryRepository.findVisibleOverlapping(from, to)
|
||||
: incidentQueryRepository.findVisibleOverlappingByApi(from, to, apiId);
|
||||
|
||||
java.util.function.Predicate<DjbApistatusIncident> filter = kindFilter(kind);
|
||||
if (filter == null) {
|
||||
return incidents;
|
||||
}
|
||||
return incidents.stream().filter(filter).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 유형 필터. 미지정/ALL/알 수 없는 값은 전체(null)로 본다.
|
||||
* 필터 값은 {@link IncidentKind} 이름 그대로다 (INCIDENT / DELAY / MAINTENANCE).
|
||||
*/
|
||||
private java.util.function.Predicate<DjbApistatusIncident> kindFilter(String kind) {
|
||||
if (StringUtils.isBlank(kind) || "ALL".equalsIgnoreCase(kind)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
IncidentKind selected = IncidentKind.valueOf(kind.trim().toUpperCase());
|
||||
return incident -> incident.getKind() == selected;
|
||||
} catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ActiveIncidentDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.MaintenanceCardDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.PastIssueCardDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind;
|
||||
import com.eactive.apim.portal.djb.apistatus.repository.ApiStatusIncidentQueryRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* API Status 메인 화면 조회 (진행 중 장애 / 점검 사항 / 지난 이슈 / 이슈 상세).
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class ApiStatusQueryService {
|
||||
|
||||
private final ApiStatusIncidentQueryRepository incidentQueryRepository;
|
||||
private final ApiStatusAssembler assembler;
|
||||
|
||||
/** P3 - 진행 중 장애·지연 */
|
||||
public List<ActiveIncidentDTO> getActiveIncidents() {
|
||||
LocalDateTime now = ApiStatusSupport.now();
|
||||
List<DjbApistatusIncident> incidents = incidentQueryRepository
|
||||
.findVisibleOpenIncidents(IncidentKind.DEGRADING, ApiStatusSupport.CLOSED_STATES);
|
||||
return assembler.toActiveIncidents(incidents, now);
|
||||
}
|
||||
|
||||
/** P5 - 예정/진행 중 점검 */
|
||||
public List<MaintenanceCardDTO> getOngoingMaintenance() {
|
||||
List<DjbApistatusIncident> incidents = incidentQueryRepository
|
||||
.findVisibleOngoingMaintenance(IncidentKind.MAINTENANCE, ApiStatusSupport.now());
|
||||
return assembler.toMaintenanceCards(incidents);
|
||||
}
|
||||
|
||||
/** P6 - 종결된 이슈 최근 N건 */
|
||||
public List<PastIssueCardDTO> getRecentClosedIssues(int size) {
|
||||
int limit = size <= 0 ? 5 : Math.min(size, 50);
|
||||
List<DjbApistatusIncident> incidents = incidentQueryRepository
|
||||
.findVisibleClosedIssues(ApiStatusSupport.CLOSED_STATES, ApiStatusSupport.now(),
|
||||
PageRequest.of(0, limit))
|
||||
.getContent();
|
||||
return assembler.toPastIssueCards(incidents);
|
||||
}
|
||||
|
||||
/** P7 - 이슈 공개 상세 */
|
||||
public Optional<PastIssueCardDTO> getIssueDetail(Long incidentId) {
|
||||
return incidentQueryRepository.findVisibleById(incidentId)
|
||||
.map(incident -> assembler.toPastIssueCards(java.util.Collections.singletonList(incident)).get(0));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentState;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* API Status 조회 서비스 공통 상수/헬퍼.
|
||||
*/
|
||||
public final class ApiStatusSupport {
|
||||
|
||||
/** 일자 경계 기준 timezone (OQ-10) */
|
||||
public static final ZoneId ZONE = ZoneId.of("Asia/Seoul");
|
||||
|
||||
/** 90일 가동률/이력 인덱스 기본 조회 일수 */
|
||||
public static final int DEFAULT_WINDOW_DAYS = 90;
|
||||
|
||||
/** 장애 종결 상태 */
|
||||
public static final List<IncidentState> CLOSED_STATES =
|
||||
Collections.unmodifiableList(Arrays.asList(IncidentState.RESOLVED, IncidentState.CANCELED));
|
||||
|
||||
public static final String STATUS_NORMAL = "NORMAL";
|
||||
public static final String STATUS_DEGRADED = "DEGRADED";
|
||||
public static final String STATUS_OUTAGE = "OUTAGE";
|
||||
public static final String STATUS_MAINTENANCE = "MAINTENANCE";
|
||||
|
||||
private ApiStatusSupport() {
|
||||
}
|
||||
|
||||
public static LocalDateTime now() {
|
||||
return LocalDateTime.now(ZONE);
|
||||
}
|
||||
|
||||
/** 지연 건인지 여부 (장애와 구분) */
|
||||
public static boolean isDelay(DjbApistatusIncident incident) {
|
||||
return incident != null && incident.getKind() == IncidentKind.DELAY;
|
||||
}
|
||||
|
||||
/** 이슈 종류에 대응하는 현재 상태 코드 */
|
||||
public static String statusOf(IncidentKind kind) {
|
||||
if (kind == null) {
|
||||
return STATUS_NORMAL;
|
||||
}
|
||||
switch (kind) {
|
||||
case INCIDENT: return STATUS_OUTAGE;
|
||||
case DELAY: return STATUS_DEGRADED;
|
||||
case MAINTENANCE: return STATUS_MAINTENANCE;
|
||||
default: return STATUS_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 상태 심각도 순위 (낮을수록 심각). 정렬·상태 병합에 함께 쓴다.
|
||||
*/
|
||||
public static int statusRank(String status) {
|
||||
if (status == null) {
|
||||
return 9;
|
||||
}
|
||||
switch (status) {
|
||||
case STATUS_OUTAGE: return 0;
|
||||
case STATUS_MAINTENANCE: return 1;
|
||||
case STATUS_DEGRADED: return 2;
|
||||
default: return 3;
|
||||
}
|
||||
}
|
||||
|
||||
public static String stateLabel(IncidentState state) {
|
||||
if (state == null) {
|
||||
return null;
|
||||
}
|
||||
switch (state) {
|
||||
case INVESTIGATING: return "발생";
|
||||
case IDENTIFIED: return "원인 확인";
|
||||
case MONITORING: return "모니터링";
|
||||
case RESOLVED: return "해소";
|
||||
case CANCELED: return "취소";
|
||||
default: return state.name();
|
||||
}
|
||||
}
|
||||
|
||||
public static String statusLabel(String status) {
|
||||
if (status == null) {
|
||||
return null;
|
||||
}
|
||||
switch (status) {
|
||||
case STATUS_NORMAL: return "정상";
|
||||
case STATUS_DEGRADED: return "지연";
|
||||
case STATUS_OUTAGE: return "장애";
|
||||
case STATUS_MAINTENANCE: return "점검";
|
||||
default: return status;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 두 시각 사이의 분. 종료가 없거나 역순이면 0.
|
||||
*/
|
||||
public static long minutesBetween(LocalDateTime from, LocalDateTime to) {
|
||||
if (from == null || to == null || !to.isAfter(from)) {
|
||||
return 0L;
|
||||
}
|
||||
return Duration.between(from, to).toMinutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* "N분 전" 형태의 상대 시간 표기.
|
||||
*/
|
||||
public static String relativeTime(LocalDateTime past, LocalDateTime now) {
|
||||
if (past == null || now == null) {
|
||||
return null;
|
||||
}
|
||||
long minutes = Duration.between(past, now).toMinutes();
|
||||
if (minutes < 1) {
|
||||
return "방금 전";
|
||||
}
|
||||
if (minutes < 60) {
|
||||
return minutes + "분 전";
|
||||
}
|
||||
long hours = minutes / 60;
|
||||
if (hours < 24) {
|
||||
long restMinutes = minutes % 60;
|
||||
return restMinutes == 0 ? hours + "시간 전" : hours + "시간 " + restMinutes + "분 전";
|
||||
}
|
||||
return (hours / 24) + "일 전";
|
||||
}
|
||||
}
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.DailyStatDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncidentApi;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.IncidentKind;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.repository.DjbApistatusIncidentApiRepository;
|
||||
import com.eactive.apim.portal.djb.apistatus.repository.ApiStatusIncidentQueryRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 90일 가동률 집계. 일별 캐시 테이블(DJB_APISTATUS_DAILY_STAT) 없이 이슈 구간을 그때그때 합산한다.
|
||||
*
|
||||
* <p>이슈 건수가 연 1천 건 미만이므로 90일 구간을 메모리에서 합산해도 부담이 없다.
|
||||
* 같은 시간대에 겹치는 이슈는 구간 합집합으로 계산해 중복 차감을 막는다.</p>
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class ApiStatusUptimeService {
|
||||
|
||||
private final ApiStatusIncidentQueryRepository incidentQueryRepository;
|
||||
private final DjbApistatusIncidentApiRepository incidentApiRepository;
|
||||
|
||||
/** P2 - 90일 가동률 */
|
||||
public List<DailyStatDTO> getDailyStats(int days) {
|
||||
int windowDays = days <= 0 ? ApiStatusSupport.DEFAULT_WINDOW_DAYS : Math.min(days, 365);
|
||||
LocalDateTime now = ApiStatusSupport.now();
|
||||
LocalDate today = now.toLocalDate();
|
||||
LocalDate from = today.minusDays(windowDays - 1L);
|
||||
|
||||
List<DjbApistatusIncident> incidents = incidentQueryRepository
|
||||
.findVisibleOverlapping(from.atStartOfDay(), today.plusDays(1).atStartOfDay());
|
||||
|
||||
List<DailyStatDTO> result = new ArrayList<>();
|
||||
for (int offset = 0; offset < windowDays; offset++) {
|
||||
LocalDate date = from.plusDays(offset);
|
||||
result.add(buildDailyStat(date, incidents, now));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* API 별 90일 가동률. 장애(INCIDENT) 구간만 차감한다.
|
||||
*/
|
||||
public Map<String, Double> getApiUptimeRatios(Set<String> apiIds, int days) {
|
||||
if (apiIds == null || apiIds.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
int windowDays = days <= 0 ? ApiStatusSupport.DEFAULT_WINDOW_DAYS : Math.min(days, 365);
|
||||
LocalDateTime now = ApiStatusSupport.now();
|
||||
LocalDateTime windowStart = now.toLocalDate().minusDays(windowDays - 1L).atStartOfDay();
|
||||
|
||||
// 장애와 지연 모두 서비스 저하이므로 가동률에서 차감한다. 점검은 계획된 작업이라 제외.
|
||||
List<DjbApistatusIncident> incidents = incidentQueryRepository
|
||||
.findVisibleOverlapping(windowStart, now.toLocalDate().plusDays(1).atStartOfDay()).stream()
|
||||
.filter(incident -> incident.getKind() != null && incident.getKind().isDegrading())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Map<String, List<long[]>> intervalsByApi = new HashMap<>();
|
||||
if (!incidents.isEmpty()) {
|
||||
Map<Long, DjbApistatusIncident> byId = incidents.stream()
|
||||
.collect(Collectors.toMap(DjbApistatusIncident::getIncidentId, incident -> incident));
|
||||
|
||||
for (DjbApistatusIncidentApi api :
|
||||
incidentApiRepository.findByIncidentIdInOrderByIncidentIdAscApiIdAsc(byId.keySet())) {
|
||||
if (!apiIds.contains(api.getApiId())) {
|
||||
continue;
|
||||
}
|
||||
DjbApistatusIncident incident = byId.get(api.getIncidentId());
|
||||
LocalDateTime start = max(incident.getStartedAt(), windowStart);
|
||||
// 개별 API 복구 시각이 있으면 그 시점까지만 장애로 본다
|
||||
LocalDateTime end = min(firstNonNull(api.getRecoveredAt(), incident.getEndAt(), now), now);
|
||||
long minutes = ApiStatusSupport.minutesBetween(start, end);
|
||||
if (minutes <= 0) {
|
||||
continue;
|
||||
}
|
||||
intervalsByApi.computeIfAbsent(api.getApiId(), key -> new ArrayList<>())
|
||||
.add(new long[]{toEpochMinute(start), toEpochMinute(end)});
|
||||
}
|
||||
}
|
||||
|
||||
long totalMinutes = Math.max(1L, ApiStatusSupport.minutesBetween(windowStart, now));
|
||||
Map<String, Double> ratios = new HashMap<>();
|
||||
for (String apiId : apiIds) {
|
||||
long down = unionMinutes(intervalsByApi.get(apiId));
|
||||
double ratio = (double) (totalMinutes - Math.min(down, totalMinutes)) / totalMinutes;
|
||||
ratios.put(apiId, round4(ratio));
|
||||
}
|
||||
return ratios;
|
||||
}
|
||||
|
||||
private DailyStatDTO buildDailyStat(LocalDate date, List<DjbApistatusIncident> incidents, LocalDateTime now) {
|
||||
LocalDateTime dayStart = date.atStartOfDay();
|
||||
LocalDateTime dayEnd = min(date.plusDays(1).atStartOfDay(), now);
|
||||
|
||||
DailyStatDTO dto = new DailyStatDTO();
|
||||
dto.setStatDate(date);
|
||||
|
||||
if (!dayEnd.isAfter(dayStart)) {
|
||||
// 아직 시작되지 않은 날짜 (오늘 자정 직후 등)
|
||||
dto.setUptimeRatio(1.0d);
|
||||
dto.setStatus(ApiStatusSupport.STATUS_NORMAL);
|
||||
return dto;
|
||||
}
|
||||
|
||||
// 가동률은 장애+지연을 합쳐 차감하므로 합집합 계산용 리스트를 따로 둔다.
|
||||
// (장애와 지연을 나눠 union 한 뒤 더하면 겹치는 구간이 이중 차감된다)
|
||||
List<long[]> incidentIntervals = new ArrayList<>();
|
||||
List<long[]> outageIntervals = new ArrayList<>();
|
||||
List<long[]> delayIntervals = new ArrayList<>();
|
||||
List<long[]> maintenanceIntervals = new ArrayList<>();
|
||||
Set<Long> seen = new HashSet<>();
|
||||
|
||||
for (DjbApistatusIncident incident : incidents) {
|
||||
LocalDateTime start = max(incident.getStartedAt(), dayStart);
|
||||
LocalDateTime end = min(firstNonNull(incident.getEndAt(), now), dayEnd);
|
||||
if (!end.isAfter(start)) {
|
||||
continue;
|
||||
}
|
||||
long[] interval = new long[]{toEpochMinute(start), toEpochMinute(end)};
|
||||
if (incident.getKind() == IncidentKind.MAINTENANCE) {
|
||||
maintenanceIntervals.add(interval);
|
||||
} else {
|
||||
incidentIntervals.add(interval);
|
||||
if (incident.getKind() == IncidentKind.DELAY) {
|
||||
delayIntervals.add(interval);
|
||||
} else {
|
||||
outageIntervals.add(interval);
|
||||
}
|
||||
}
|
||||
if (seen.add(incident.getIncidentId())) {
|
||||
dto.getIssues().add(new DailyStatDTO.IssueRefDTO(incident.getIncidentId(),
|
||||
incident.getKind() == null ? null : incident.getKind().name(),
|
||||
incident.getTitle()));
|
||||
}
|
||||
}
|
||||
|
||||
long dayMinutes = Math.max(1L, ApiStatusSupport.minutesBetween(dayStart, dayEnd));
|
||||
long incidentMinutes = unionMinutes(incidentIntervals);
|
||||
long outageMinutes = unionMinutes(outageIntervals);
|
||||
long delayMinutes = unionMinutes(delayIntervals);
|
||||
long maintenanceMinutes = unionMinutes(maintenanceIntervals);
|
||||
|
||||
dto.setIncidentMinutes(incidentMinutes);
|
||||
dto.setDelayMinutes(delayMinutes);
|
||||
dto.setMaintenanceMinutes(maintenanceMinutes);
|
||||
|
||||
long downMinutes = Math.min(dayMinutes, incidentMinutes + maintenanceMinutes);
|
||||
dto.setUptimeRatio(round4((double) (dayMinutes - downMinutes) / dayMinutes));
|
||||
|
||||
// 색상은 심각한 순으로 하나만 고른다 (장애 > 점검 > 지연)
|
||||
if (outageMinutes > 0) {
|
||||
dto.setStatus(ApiStatusSupport.STATUS_OUTAGE);
|
||||
} else if (maintenanceMinutes > 0) {
|
||||
dto.setStatus(ApiStatusSupport.STATUS_MAINTENANCE);
|
||||
} else if (delayMinutes > 0) {
|
||||
dto.setStatus(ApiStatusSupport.STATUS_DEGRADED);
|
||||
} else {
|
||||
dto.setStatus(ApiStatusSupport.STATUS_NORMAL);
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 겹치는 구간을 합쳐 총 분을 구한다.
|
||||
*/
|
||||
private long unionMinutes(List<long[]> intervals) {
|
||||
if (intervals == null || intervals.isEmpty()) {
|
||||
return 0L;
|
||||
}
|
||||
intervals.sort((left, right) -> Long.compare(left[0], right[0]));
|
||||
|
||||
long total = 0L;
|
||||
long currentStart = intervals.get(0)[0];
|
||||
long currentEnd = intervals.get(0)[1];
|
||||
|
||||
for (int index = 1; index < intervals.size(); index++) {
|
||||
long[] interval = intervals.get(index);
|
||||
if (interval[0] > currentEnd) {
|
||||
total += currentEnd - currentStart;
|
||||
currentStart = interval[0];
|
||||
currentEnd = interval[1];
|
||||
} else if (interval[1] > currentEnd) {
|
||||
currentEnd = interval[1];
|
||||
}
|
||||
}
|
||||
total += currentEnd - currentStart;
|
||||
return total;
|
||||
}
|
||||
|
||||
private long toEpochMinute(LocalDateTime dateTime) {
|
||||
return dateTime.atZone(ApiStatusSupport.ZONE).toEpochSecond() / 60L;
|
||||
}
|
||||
|
||||
private LocalDateTime max(LocalDateTime left, LocalDateTime right) {
|
||||
if (left == null) {
|
||||
return right;
|
||||
}
|
||||
return left.isAfter(right) ? left : right;
|
||||
}
|
||||
|
||||
private LocalDateTime min(LocalDateTime left, LocalDateTime right) {
|
||||
if (left == null) {
|
||||
return right;
|
||||
}
|
||||
return left.isBefore(right) ? left : right;
|
||||
}
|
||||
|
||||
private LocalDateTime firstNonNull(LocalDateTime... candidates) {
|
||||
for (LocalDateTime candidate : candidates) {
|
||||
if (candidate != null) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private double round4(double value) {
|
||||
double clamped = Math.max(0.0d, Math.min(1.0d, value));
|
||||
return Math.round(clamped * 10000.0d) / 10000.0d;
|
||||
}
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.service;
|
||||
|
||||
import com.eactive.apim.portal.app.entity.Credential;
|
||||
import com.eactive.apim.portal.app.repository.CredentialRepository;
|
||||
import com.eactive.apim.portal.apispec.entity.ApiSpecInfo;
|
||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.ApiCurrentStatusDTO;
|
||||
import com.eactive.apim.portal.djb.apistatus.dto.MyApiStatusDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* 로그인 사용자가 이용 중인 API 의 현재 상태 (P4).
|
||||
*
|
||||
* <p>대상 API 는 소속 기관이 발급받은 앱(Credential)의 API 목록(ptl_credential_api)이다.
|
||||
* 상태 판정은 {@link ApiCurrentStatusService} 에 위임해 API 상세 화면과 기준을 맞춘다.</p>
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class MyApiStatusQueryService {
|
||||
|
||||
private final CredentialRepository credentialRepository;
|
||||
private final ApiCurrentStatusService apiCurrentStatusService;
|
||||
private final ApiStatusUptimeService uptimeService;
|
||||
private final ApiStatusCatalogService catalogService;
|
||||
|
||||
public List<MyApiStatusDTO> getMyApiStatuses() {
|
||||
PortalAuthenticatedUser user = SecurityUtil.getPortalAuthenticatedUser();
|
||||
if (user == null || user.getPortalOrg() == null || StringUtils.isBlank(user.getPortalOrg().getId())) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Map<String, String> myApis = collectMyApis(user.getPortalOrg().getId());
|
||||
if (myApis.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Map<String, ApiCurrentStatusDTO> statuses = apiCurrentStatusService.resolveStatuses(myApis.keySet());
|
||||
Map<String, Double> uptimes =
|
||||
uptimeService.getApiUptimeRatios(myApis.keySet(), catalogService.getWindowDays());
|
||||
|
||||
List<MyApiStatusDTO> result = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : myApis.entrySet()) {
|
||||
String apiId = entry.getKey();
|
||||
ApiCurrentStatusDTO status = statuses.get(apiId);
|
||||
|
||||
MyApiStatusDTO dto = new MyApiStatusDTO();
|
||||
dto.setApiId(apiId);
|
||||
// 기관이 발급받은 앱 기준 목록이므로 API 명은 credential 쪽 값을 그대로 쓴다
|
||||
dto.setApiName(entry.getValue());
|
||||
dto.setCurrentStatus(status == null ? ApiStatusSupport.STATUS_NORMAL : status.getCurrentStatus());
|
||||
dto.setCurrentStatusLabel(ApiStatusSupport.statusLabel(dto.getCurrentStatus()));
|
||||
dto.setActiveIncidentId(status == null ? null : status.getActiveIncidentId());
|
||||
dto.setLastIncidentAt(status == null ? null : status.getLastIncidentAt());
|
||||
dto.setUptime90d(uptimes.getOrDefault(apiId, 1.0d));
|
||||
result.add(dto);
|
||||
}
|
||||
|
||||
result.sort(Comparator
|
||||
.comparingInt((MyApiStatusDTO dto) -> ApiStatusSupport.statusRank(dto.getCurrentStatus()))
|
||||
.thenComparing(MyApiStatusDTO::getApiName, Comparator.nullsLast(Comparator.naturalOrder())));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 기관이 보유한 앱들의 API 목록 (중복 제거, API 명 기준 정렬)
|
||||
*/
|
||||
private Map<String, String> collectMyApis(String orgId) {
|
||||
Map<String, String> myApis = new TreeMap<>();
|
||||
for (Credential credential : credentialRepository.findAllByOrgid(orgId)) {
|
||||
if (credential.getApiList() == null) {
|
||||
continue;
|
||||
}
|
||||
for (ApiSpecInfo api : credential.getApiList()) {
|
||||
if (StringUtils.isBlank(api.getApiId())) {
|
||||
continue;
|
||||
}
|
||||
myApis.put(api.getApiId(), StringUtils.defaultIfBlank(api.getApiName(), api.getApiId()));
|
||||
}
|
||||
}
|
||||
return myApis;
|
||||
}
|
||||
}
|
||||
+6
-13
@@ -3,20 +3,13 @@ package com.eactive.apim.portal.djb.community.qna.comment.repository;
|
||||
import com.eactive.apim.portal.user.entity.UserInfo;
|
||||
import com.eactive.eai.data.jpa.BaseRepository;
|
||||
import com.eactive.eai.rms.data.EMSDataSource;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EMSDataSource
|
||||
public interface UserInfoRepository extends BaseRepository<UserInfo, String> {
|
||||
|
||||
/**
|
||||
* TSEAIRM02.roleidnfiname 컬럼은 콤마로 구분된 복수 역할을 저장한다.
|
||||
* (예: {@code "admin,portal-admin"}). Oracle native query로 콤마 토큰 매치.
|
||||
* 댓글 작성자(내부 직원) 표시용 TSEAIRM02 조회.
|
||||
*
|
||||
* <p>역할 기반 알림 대상 조회는
|
||||
* {@code com.eactive.apim.portal.djb.swing.repository.SwingStaffRepository} 로 분리했다.</p>
|
||||
*/
|
||||
@Query(value = "SELECT * FROM TSEAIRM02 t"
|
||||
+ " WHERE ',' || t.ROLEIDNFINAME || ',' LIKE '%,' || :role || ',%'",
|
||||
nativeQuery = true)
|
||||
List<UserInfo> findByRoleContaining(@Param("role") String role);
|
||||
@EMSDataSource
|
||||
public interface UserInfoRepository extends BaseRepository<UserInfo, String> {
|
||||
}
|
||||
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
package com.eactive.apim.portal.djb.community.qna.comment.service;
|
||||
|
||||
import com.eactive.apim.portal.djb.community.qna.comment.repository.UserInfoRepository;
|
||||
import com.eactive.apim.portal.djb.community.qna.constant.DjbAdminRole;
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.service.MessageHandlerService;
|
||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
||||
import com.eactive.apim.portal.user.entity.UserInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Q&A 등록/댓글 등록 시 portal-admin 역할(TSEAIRM02)을 가진 관리자 전원에게
|
||||
* 알림 메시지를 발행한다. 발송 실패는 트랜잭션 롤백을 유발하지 않는다.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CommunityAdminNotifier {
|
||||
|
||||
private final UserInfoRepository userInfoRepository;
|
||||
private final MessageHandlerService messageHandlerService;
|
||||
|
||||
public void notifyPortalAdmins(MessageCode code, Map<String, Object> params) {
|
||||
try {
|
||||
List<UserInfo> admins = userInfoRepository.findByRoleContaining(DjbAdminRole.PORTAL_ADMIN);
|
||||
if (admins == null || admins.isEmpty()) {
|
||||
log.warn("portal-admin 역할 관리자가 없습니다 — 알림 미발송 code={}", code.name());
|
||||
return;
|
||||
}
|
||||
for (UserInfo admin : admins) {
|
||||
try {
|
||||
MessageRecipient recipient = toRecipient(admin);
|
||||
messageHandlerService.publishEvent(code, recipient, params);
|
||||
} catch (Exception e) {
|
||||
log.warn("portal-admin 개별 알림 발행 실패 — userid={}, code={}",
|
||||
admin.getUserid(), code.name(), e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("portal-admin 알림 발행 실패 — code={}", code.name(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private MessageRecipient toRecipient(UserInfo admin) {
|
||||
MessageRecipient r = new MessageRecipient();
|
||||
r.setUsername(admin.getUsername());
|
||||
r.setUserId(admin.getEmad());
|
||||
r.setPhone(admin.getCphnno());
|
||||
r.setMessengerId(admin.getUserid());
|
||||
return r;
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -8,6 +8,7 @@ import com.eactive.apim.portal.djb.community.qna.comment.dto.InquiryCommentDTO;
|
||||
import com.eactive.apim.portal.djb.community.qna.comment.repository.InquiryCommentRepository;
|
||||
import com.eactive.apim.portal.djb.community.qna.comment.repository.UserInfoRepository;
|
||||
import com.eactive.apim.portal.djb.community.qna.constant.DjbInquiryStatus;
|
||||
import com.eactive.apim.portal.djb.swing.SwingNotifier;
|
||||
import com.eactive.apim.portal.djb.community.qna.support.InquiryCommentPermissionChecker;
|
||||
import com.eactive.apim.portal.portalorg.entity.PortalOrg;
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||
@@ -47,7 +48,7 @@ public class InquiryCommentFacadeImpl implements InquiryCommentFacade {
|
||||
private final InquiryCommentService commentService;
|
||||
private final InquiryCommentRepository commentRepository;
|
||||
private final InquiryCommentPermissionChecker permissionChecker;
|
||||
private final CommunityAdminNotifier adminNotifier;
|
||||
private final SwingNotifier swingNotifier;
|
||||
private final PortalUserRepository portalUserRepository;
|
||||
private final UserInfoRepository userInfoRepository;
|
||||
|
||||
@@ -107,7 +108,7 @@ public class InquiryCommentFacadeImpl implements InquiryCommentFacade {
|
||||
params.put("inquirySubject", inquiry.getInquirySubject());
|
||||
params.put("commentContent", comment.getCommentDetail());
|
||||
params.put("writerName", current.getUserName());
|
||||
adminNotifier.notifyPortalAdmins(MessageCode.INQUIRY_COMMENT_CREATED, params);
|
||||
swingNotifier.notifyPortalAdmins(MessageCode.INQUIRY_COMMENT_CREATED, params);
|
||||
}
|
||||
|
||||
private Map<String, Writer> resolveWriters(List<InquiryComment> comments) {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.eactive.apim.portal.djb.community.qna.constant;
|
||||
|
||||
public final class DjbAdminRole {
|
||||
|
||||
/** TSEAIRM02.roleidnfiname 컬럼에서 포털 관리자를 식별하는 값. */
|
||||
public static final String PORTAL_ADMIN = "portal-admin";
|
||||
|
||||
private DjbAdminRole() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.eactive.apim.portal.djb.swing;
|
||||
|
||||
/**
|
||||
* Swing 메신저 수신자 ID 가 행번(직원번호)이 아닐 때의 처리 정책.
|
||||
*
|
||||
* <p>Swing 메신저는 {@code TSEAIRM02.USERID} 를 수신자 코드로 사용하며 운영 직원은 숫자 행번을 쓴다.
|
||||
* portal-admin 역할이 부여된 개발용 계정(영문 ID 등)은 Swing 에 존재하지 않아 발송이 무의미하므로
|
||||
* 이 정책으로 처리 방식을 선택한다. PTL_PROPERTY
|
||||
* {@code Portal / djb.swing.notify.non-employee.policy} 로 지정한다.</p>
|
||||
*/
|
||||
public enum EmployeeIdPolicy {
|
||||
|
||||
/** 정상 발송 (PTL_MESSAGE_REQUEST 에 PENDING 적재) */
|
||||
SEND,
|
||||
|
||||
/** 발송 + WARN 로그 */
|
||||
SEND_WARN,
|
||||
|
||||
/** 무시 처리 — REQUEST_STATUS='SKIPPED' 로 적재해 이력만 남기고 배치는 수집하지 않음 */
|
||||
SKIP,
|
||||
|
||||
/** 거부 — PTL_MESSAGE_REQUEST 에 적재하지 않음 + INFO 로그 */
|
||||
REJECT_LOG,
|
||||
|
||||
/** 완전 거부 — 적재하지 않고 로그도 남기지 않음 */
|
||||
REJECT;
|
||||
|
||||
/** 프로퍼티 문자열 → enum. 값이 없거나 알 수 없으면 기본값 {@link #SKIP}. */
|
||||
public static EmployeeIdPolicy from(String value) {
|
||||
if (value != null) {
|
||||
String trimmed = value.trim();
|
||||
for (EmployeeIdPolicy policy : values()) {
|
||||
if (policy.name().equalsIgnoreCase(trimmed)) {
|
||||
return policy;
|
||||
}
|
||||
}
|
||||
}
|
||||
return SKIP;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.eactive.apim.portal.djb.swing;
|
||||
|
||||
import com.eactive.apim.portal.djb.swing.repository.SwingStaffRepository;
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||
import com.eactive.apim.portal.template.entity.MessageTemplate;
|
||||
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
||||
import com.eactive.apim.portal.template.repository.MessageTemplateRepository;
|
||||
import com.eactive.apim.portal.user.entity.UserInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Swing 메신저 발송 요청을 PTL_MESSAGE_REQUEST 에 직접 적재한다.
|
||||
*
|
||||
* <p>TSEAIRM02(직원) → PTL_MESSAGE_TEMPLATE(본문) → PTL_MESSAGE_REQUEST(발송 요청) 순으로
|
||||
* 처리하며, 실제 발송은 기존과 동일하게 eapim-admin 의 {@code UmsDispatchJob}(5초 주기)이
|
||||
* {@code REQUEST_STATUS='PENDING'} 행을 수집해 수행한다.</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SwingMessageWriter {
|
||||
|
||||
private static final String MESSAGE_TYPE_MESSENGER = "MESSENGER";
|
||||
private static final String STATUS_PENDING = "PENDING";
|
||||
/** 행번 아닌 ID 를 무시 처리할 때 쓰는 신설 상태값. 배치(PENDING 수집)가 건드리지 않는다. */
|
||||
private static final String STATUS_SKIPPED = "SKIPPED";
|
||||
private static final String ENABLED = "Y";
|
||||
|
||||
private final SwingStaffRepository swingStaffRepository;
|
||||
private final MessageTemplateRepository messageTemplateRepository;
|
||||
private final MessageRequestRepository messageRequestRepository;
|
||||
private final SwingNotifyProperties properties;
|
||||
|
||||
@Transactional
|
||||
public void write(MessageCode code, Map<String, Object> params) {
|
||||
String role = properties.getTargetRole();
|
||||
List<UserInfo> staffs = swingStaffRepository.findByRole(role);
|
||||
if (staffs == null || staffs.isEmpty()) {
|
||||
log.warn("Swing 알림 대상 직원이 없습니다 — role={}, code={}", role, code.name());
|
||||
return;
|
||||
}
|
||||
|
||||
MessageTemplate template = messageTemplateRepository.findById(code.name()).orElse(null);
|
||||
if (template == null) {
|
||||
log.warn("메세지 템플릿이 존재하지 않습니다 — code={}", code.name());
|
||||
return;
|
||||
}
|
||||
if (!ENABLED.equalsIgnoreCase(template.getEnableMessenger())) {
|
||||
log.warn("메신저 발송이 비활성화된 템플릿입니다 — code={}, enableMessenger={}",
|
||||
code.name(), template.getEnableMessenger());
|
||||
return;
|
||||
}
|
||||
|
||||
SwingNotifyProperties.UmsMessengerIds umsIds = properties.getUmsMessengerIds();
|
||||
EmployeeIdPolicy policy = properties.getNonEmployeePolicy();
|
||||
|
||||
for (UserInfo staff : staffs) {
|
||||
try {
|
||||
writeOne(code, template, params, staff, umsIds, policy);
|
||||
} catch (Exception e) {
|
||||
log.warn("Swing 알림 적재 실패 — userid={}, code={}", staff.getUserid(), code.name(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void writeOne(MessageCode code, MessageTemplate template, Map<String, Object> params,
|
||||
UserInfo staff, SwingNotifyProperties.UmsMessengerIds umsIds,
|
||||
EmployeeIdPolicy policy) {
|
||||
|
||||
String messengerId = staff.getUserid();
|
||||
String requestStatus = STATUS_PENDING;
|
||||
|
||||
if (!properties.isEmployeeId(messengerId)) {
|
||||
switch (policy) {
|
||||
case REJECT:
|
||||
return;
|
||||
case REJECT_LOG:
|
||||
log.info("행번이 아닌 ID — 발송 거부(미적재). userid={}, code={}", messengerId, code.name());
|
||||
return;
|
||||
case SKIP:
|
||||
log.info("행번이 아닌 ID — 무시 처리({}). userid={}, code={}",
|
||||
STATUS_SKIPPED, messengerId, code.name());
|
||||
requestStatus = STATUS_SKIPPED;
|
||||
break;
|
||||
case SEND_WARN:
|
||||
log.warn("행번이 아닌 ID — 발송 진행. Swing 미등록 계정이면 발송 실패한다. userid={}, code={}",
|
||||
messengerId, code.name());
|
||||
break;
|
||||
case SEND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> messageParams = toStringParams(params);
|
||||
messageParams.put("userId", messengerId);
|
||||
messageParams.putIfAbsent("USER_ID", messengerId);
|
||||
if (StringUtils.hasText(staff.getUsername())) {
|
||||
messageParams.put("userName", staff.getUsername());
|
||||
messageParams.putIfAbsent("USER_NAME", staff.getUsername());
|
||||
}
|
||||
|
||||
MessageRequest request = new MessageRequest();
|
||||
request.setMessageCode(code);
|
||||
request.setMessageType(MESSAGE_TYPE_MESSENGER);
|
||||
request.setSubject(buildMessage(template.getSubjectTemplate(), messageParams));
|
||||
request.setMessage(buildMessage(template.getMessengerTemplate(), messageParams));
|
||||
request.setUsername(staff.getUsername());
|
||||
request.setUserId(messengerId);
|
||||
request.setMessengerId(messengerId);
|
||||
request.setEaiInterfaceId(umsIds.getInterfaceId());
|
||||
request.setServiceId(umsIds.getServiceId());
|
||||
request.setRequestDate(LocalDateTime.now());
|
||||
request.setRequestStatus(requestStatus);
|
||||
// email/phone 은 설정하지 않는다 — 메신저 전용 경로라 개인정보를 적재할 이유가 없다.
|
||||
|
||||
messageRequestRepository.save(request);
|
||||
log.debug("Swing 알림 적재 — code={}, userid={}, status={}", code.name(), messengerId, requestStatus);
|
||||
}
|
||||
|
||||
/** 수신자별로 파라미터를 복사한다(공유 맵을 오염시키지 않기 위함). */
|
||||
private static Map<String, String> toStringParams(Map<String, Object> params) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
if (params != null) {
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
if (entry.getKey() == null || entry.getValue() == null) {
|
||||
continue;
|
||||
}
|
||||
result.put(entry.getKey(), String.valueOf(entry.getValue()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 템플릿 본문의 {@code %KEY%} 플레이스홀더를 치환한다(정규식 아닌 리터럴 치환). */
|
||||
private static String buildMessage(String contents, Map<String, String> params) {
|
||||
if (!StringUtils.hasText(contents)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String result = contents;
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
if (entry.getKey() == null || entry.getValue() == null) {
|
||||
continue;
|
||||
}
|
||||
result = result.replace("%" + entry.getKey() + "%", entry.getValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.eactive.apim.portal.djb.swing;
|
||||
|
||||
import com.eactive.apim.portal.djb.swing.config.SwingAsyncConfig;
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DjBankSwing(사내 메신저) 전용 알림 발행자.
|
||||
*
|
||||
* <p>포털 사용자용 범용 발송 경로({@code MessageHandlerService} → {@code MessageSendService})를
|
||||
* 타지 않고 TSEAIRM02 / PTL_MESSAGE_TEMPLATE / PTL_MESSAGE_REQUEST 를 직접 다룬다.
|
||||
* 내부 직원은 수신자 ID 체계(행번)와 채널(메신저 단일)이 포털 사용자와 완전히 달라 분리했다.</p>
|
||||
*
|
||||
* <p>비동기 실행이므로 게시물 등록 트랜잭션과 분리된다. 발송 적재 실패가 등록을 되돌리지 않는 대신,
|
||||
* 등록이 롤백돼도 알림은 남을 수 있다.</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SwingNotifier {
|
||||
|
||||
private final SwingMessageWriter swingMessageWriter;
|
||||
|
||||
/**
|
||||
* 대상 역할(PTL_PROPERTY {@code djb.swing.notify.role}) 직원 전원에게 메신저 알림을 적재한다.
|
||||
*
|
||||
* @param code 메세지 코드 (PTL_MESSAGE_TEMPLATE.MESSAGE_CODE 와 동일)
|
||||
* @param params 템플릿 {@code %KEY%} 치환 파라미터
|
||||
*/
|
||||
@Async(SwingAsyncConfig.EXECUTOR)
|
||||
public void notifyPortalAdmins(MessageCode code, Map<String, Object> params) {
|
||||
try {
|
||||
swingMessageWriter.write(code, params);
|
||||
} catch (Exception e) {
|
||||
log.warn("Swing 알림 발행 실패 — code={}", code == null ? null : code.name(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.eactive.apim.portal.djb.swing;
|
||||
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Swing 알림 관련 PTL_PROPERTY 접근 래퍼.
|
||||
*
|
||||
* <p>그룹 {@code Portal}, 점 구분 소문자 키 관례를 따른다.
|
||||
* {@link PortalPropertyService#getOrCreateProperty} 는 최초 접근 시 기본값으로 DB row 를
|
||||
* 생성하므로 별도 초기 데이터 없이도 동작한다.</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SwingNotifyProperties {
|
||||
|
||||
public static final String GROUP = "Portal";
|
||||
|
||||
public static final String KEY_TARGET_ROLE = "djb.swing.notify.role";
|
||||
public static final String KEY_EMPLOYEE_ID_PATTERN = "djb.swing.notify.employee-id.pattern";
|
||||
public static final String KEY_NON_EMPLOYEE_POLICY = "djb.swing.notify.non-employee.policy";
|
||||
|
||||
/** UMS 메신저 연계 식별자. 기존 발송 경로(MessageSendService)와 같은 키를 그대로 읽는다. */
|
||||
public static final String KEY_MESSENGER_IF_ID = "djb.ums.messenger.if_id";
|
||||
public static final String KEY_MESSENGER_TX_ID = "djb.ums.messenger.tx_id";
|
||||
|
||||
private static final String DEFAULT_TARGET_ROLE = "portal-admin";
|
||||
private static final String DEFAULT_EMPLOYEE_ID_PATTERN = "^[0-9]+$";
|
||||
|
||||
private final PortalPropertyService portalPropertyService;
|
||||
|
||||
/** 컴파일된 행번 정규식 캐시. 프로퍼티 값이 바뀌면 다시 컴파일한다. */
|
||||
private volatile String cachedPatternValue;
|
||||
private volatile Pattern cachedPattern;
|
||||
|
||||
/** 알림 대상 직원을 식별하는 TSEAIRM02.ROLEIDNFINAME 역할명 */
|
||||
public String getTargetRole() {
|
||||
return resolve(KEY_TARGET_ROLE, DEFAULT_TARGET_ROLE,
|
||||
"Swing 알림 대상 직원 역할명 (TSEAIRM02.ROLEIDNFINAME 의 콤마 구분 토큰)");
|
||||
}
|
||||
|
||||
/** 행번 아닌 ID 처리 정책 */
|
||||
public EmployeeIdPolicy getNonEmployeePolicy() {
|
||||
return EmployeeIdPolicy.from(resolve(KEY_NON_EMPLOYEE_POLICY, EmployeeIdPolicy.SKIP.name(),
|
||||
"행번 아닌 ID 처리 정책 (SEND/SEND_WARN/SKIP/REJECT_LOG/REJECT)"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 행번(직원번호) 형식인지 여부. 정규식이 잘못 지정된 경우 기본 정규식으로 폴백한다.
|
||||
*
|
||||
* @param userId TSEAIRM02.USERID
|
||||
*/
|
||||
public boolean isEmployeeId(String userId) {
|
||||
if (userId == null || userId.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return employeeIdPattern().matcher(userId.trim()).matches();
|
||||
}
|
||||
|
||||
/** UMS 메신저 연계 식별자(EAI 인터페이스 ID / 서비스 ID) */
|
||||
public UmsMessengerIds getUmsMessengerIds() {
|
||||
// 환경별 실제 연계값이라 임의 기본값을 만들면 위험 — getOrCreateProperty 대신 조회만 한다.
|
||||
Map<String, String> portalProperties = portalPropertyService.getPortalPropertiesAsMap(GROUP);
|
||||
return new UmsMessengerIds(
|
||||
portalProperties.get(KEY_MESSENGER_IF_ID),
|
||||
portalProperties.get(KEY_MESSENGER_TX_ID));
|
||||
}
|
||||
|
||||
private Pattern employeeIdPattern() {
|
||||
String value = resolve(KEY_EMPLOYEE_ID_PATTERN, DEFAULT_EMPLOYEE_ID_PATTERN,
|
||||
"행번(직원번호) 판별 정규식. 미매치 시 개발용 ID 로 간주");
|
||||
|
||||
Pattern cached = this.cachedPattern;
|
||||
if (cached != null && value != null && value.equals(this.cachedPatternValue)) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
Pattern compiled;
|
||||
try {
|
||||
compiled = Pattern.compile(value);
|
||||
} catch (Exception e) {
|
||||
log.warn("행번 판별 정규식이 잘못되어 기본값으로 대체합니다 — pattern={}", value, e);
|
||||
compiled = Pattern.compile(DEFAULT_EMPLOYEE_ID_PATTERN);
|
||||
}
|
||||
this.cachedPatternValue = value;
|
||||
this.cachedPattern = compiled;
|
||||
return compiled;
|
||||
}
|
||||
|
||||
private String resolve(String key, String defaultValue, String description) {
|
||||
return portalPropertyService.getOrCreateProperty(GROUP, key, defaultValue, description);
|
||||
}
|
||||
|
||||
/** UMS 메신저 연계 식별자 묶음 */
|
||||
@Getter
|
||||
public static class UmsMessengerIds {
|
||||
private final String interfaceId;
|
||||
private final String serviceId;
|
||||
|
||||
public UmsMessengerIds(String interfaceId, String serviceId) {
|
||||
this.interfaceId = interfaceId;
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.eactive.apim.portal.djb.swing.config;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
/**
|
||||
* Swing 알림 전용 비동기 실행기.
|
||||
*
|
||||
* <p>게시물 등록 트랜잭션이 메신저 알림 적재를 기다리지 않도록 분리한다.
|
||||
* eapim-admin 의 {@code WebhookAsyncConfig} 와 동일한 구성.</p>
|
||||
*/
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class SwingAsyncConfig {
|
||||
|
||||
public static final String EXECUTOR = "swingNotifyExecutor";
|
||||
|
||||
@Bean(name = EXECUTOR)
|
||||
public Executor swingNotifyExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(2);
|
||||
executor.setMaxPoolSize(10);
|
||||
executor.setQueueCapacity(100);
|
||||
executor.setThreadNamePrefix("swing-notify-");
|
||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
executor.setAwaitTerminationSeconds(30);
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.eactive.apim.portal.djb.swing.repository;
|
||||
|
||||
import com.eactive.apim.portal.user.entity.UserInfo;
|
||||
import com.eactive.eai.rms.data.EMSDataSource;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Swing 알림 대상 직원(TSEAIRM02) 조회 전용 리포지토리.
|
||||
*/
|
||||
@Repository
|
||||
@EMSDataSource
|
||||
public interface SwingStaffRepository extends JpaRepository<UserInfo, String> {
|
||||
|
||||
/**
|
||||
* TSEAIRM02.roleidnfiname 컬럼은 콤마로 구분된 복수 역할을 저장한다.
|
||||
* (예: {@code "admin,portal-admin"}). Oracle native query로 콤마 토큰 매치.
|
||||
*/
|
||||
@Query(value = "SELECT * FROM TSEAIRM02 t"
|
||||
+ " WHERE ',' || t.ROLEIDNFINAME || ',' LIKE '%,' || :role || ',%'",
|
||||
nativeQuery = true)
|
||||
List<UserInfo> findByRole(@Param("role") String role);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.eactive.apim.portal.djb.webhook.controller;
|
||||
import com.eactive.apim.portal.apps.apiservice.dto.ApiGroupSearch;
|
||||
import com.eactive.apim.portal.apps.app.service.AppServiceFacade;
|
||||
import com.eactive.apim.portal.apps.apiservice.service.ApiServiceService;
|
||||
import com.eactive.apim.portal.common.exception.UserErrorMessageResolver;
|
||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||
import com.eactive.apim.portal.djb.webhook.dto.WebhookDTO;
|
||||
@@ -163,8 +164,8 @@ public class WebhookController {
|
||||
redirectAttributes.addFlashAttribute("registrationSuccess", true);
|
||||
return new ModelAndView("redirect:/webhook/register/step3");
|
||||
} catch (RuntimeException e) {
|
||||
log.warn("Webhook 신청 실패 orgId={} : {}", currentOrgId(), e.getMessage());
|
||||
redirectAttributes.addFlashAttribute("error", e.getMessage());
|
||||
log.warn("Webhook 신청 실패 orgId={}", currentOrgId(), e);
|
||||
redirectAttributes.addFlashAttribute("error", UserErrorMessageResolver.resolve(e));
|
||||
return new ModelAndView("redirect:/webhook/register/step2");
|
||||
}
|
||||
}
|
||||
@@ -270,8 +271,8 @@ public class WebhookController {
|
||||
redirectAttributes.addFlashAttribute("modifySuccess", true);
|
||||
return new ModelAndView("redirect:/webhook/modify/step3");
|
||||
} catch (RuntimeException e) {
|
||||
log.warn("Webhook 수정 실패 orgId={} : {}", currentOrgId(), e.getMessage());
|
||||
redirectAttributes.addFlashAttribute("error", e.getMessage());
|
||||
log.warn("Webhook 수정 실패 orgId={}", currentOrgId(), e);
|
||||
redirectAttributes.addFlashAttribute("error", UserErrorMessageResolver.resolve(e));
|
||||
return new ModelAndView("redirect:/webhook/modify/step2");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ server:
|
||||
servlet:
|
||||
context-path: /
|
||||
session:
|
||||
# 세션 타임아웃 10분 고정 (DB property 관리 폐지).
|
||||
# 세션 타임아웃 10분 고정
|
||||
# WebLogic 배포 시에는 weblogic.xml <timeout-secs>600 이 동일 값을 적용한다.
|
||||
# CSRF 토큰은 세션에 저장(HttpSessionCsrfTokenRepository)되므로 수명도 이 값과 동일하다.
|
||||
timeout: 10m
|
||||
@@ -318,6 +318,13 @@ page:
|
||||
api_testbed:
|
||||
name: "테스트베드"
|
||||
path: "/apis/detail/testbed"
|
||||
apistatus:
|
||||
name: "API Status"
|
||||
path: "/apistatus"
|
||||
children:
|
||||
issues:
|
||||
name: "전체 이슈 이력"
|
||||
path: "/apistatus/issues"
|
||||
community:
|
||||
name: 고객지원
|
||||
path: "#"
|
||||
|
||||
+1605
-484
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,457 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const page = document.getElementById('issueHistoryPage');
|
||||
if (!page) return;
|
||||
|
||||
const windowDays = parseInt(page.getAttribute('data-window-days'), 10) || 90;
|
||||
const base = page.getAttribute('data-base') || '/apistatus';
|
||||
const apiDetailBase = page.getAttribute('data-api-detail-base') || '/apis/detail';
|
||||
|
||||
/** 오픈 API 목록에 노출되는 API (링크 가능 대상) */
|
||||
const linkableApiIds = new Set();
|
||||
|
||||
const KIND_LABEL = { INCIDENT: '장애', DELAY: '지연', MAINTENANCE: '점검' };
|
||||
const KIND_CLASS = { INCIDENT: 'is-incident', DELAY: 'is-degraded', MAINTENANCE: 'is-maintenance' };
|
||||
const PAGE_SIZE = 10;
|
||||
const API_LIST_LIMIT = 50; // 라이브서치 결과 표시 상한
|
||||
|
||||
const today = page.getAttribute('data-today') || '';
|
||||
// My APIs 등에서 넘어올 때 표시용 API 명 (필터 자체는 apiId 로 동작)
|
||||
const urlApiName = new URLSearchParams(window.location.search).get('apiName') || '';
|
||||
const minDate = page.getAttribute('data-min-date') || '';
|
||||
|
||||
// 진입 시 날짜 미지정 = 조회 기간 전체
|
||||
const state = {
|
||||
date: page.getAttribute('data-selected-date') || '',
|
||||
apiId: page.getAttribute('data-selected-api') || '',
|
||||
kind: page.getAttribute('data-selected-kind') || '',
|
||||
page: 0
|
||||
};
|
||||
|
||||
const indexBar = document.getElementById('issueIndexBar');
|
||||
const listEl = document.getElementById('issueList');
|
||||
const pagerEl = document.getElementById('issuePager');
|
||||
const totalCountEl = document.getElementById('issueTotalCount');
|
||||
const selectedDateLabel = document.getElementById('selectedDateLabel');
|
||||
const dateField = document.getElementById('dateField');
|
||||
const dateInput = document.getElementById('filterDateInput');
|
||||
const dateClearBtn = document.getElementById('filterDateClear');
|
||||
const kindSelect = document.getElementById('filterKindSelect');
|
||||
const apiCombo = document.getElementById('apiCombo');
|
||||
const apiInput = document.getElementById('filterApiInput');
|
||||
const apiClearBtn = document.getElementById('filterApiClear');
|
||||
const apiListEl = document.getElementById('filterApiList');
|
||||
const unlistedBanner = document.getElementById('unlistedApiBanner');
|
||||
const unlistedName = document.getElementById('unlistedApiName');
|
||||
|
||||
let apiOptions = [];
|
||||
|
||||
function escapeHtml(text) {
|
||||
if (text == null) return '';
|
||||
return String(text)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function fetchJson(url) {
|
||||
return fetch(url, { credentials: 'same-origin', headers: { Accept: 'application/json' } })
|
||||
.then(function (response) {
|
||||
if (!response.ok) throw new Error('HTTP ' + response.status);
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function parseDateTime(value) {
|
||||
if (!value) return null;
|
||||
const parsed = new Date(String(value).replace(' ', 'T'));
|
||||
return isNaN(parsed.getTime()) ? null : parsed;
|
||||
}
|
||||
|
||||
function pad(value) {
|
||||
return value < 10 ? '0' + value : String(value);
|
||||
}
|
||||
|
||||
function formatDate(value) {
|
||||
const date = parseDateTime(value);
|
||||
if (!date) return '-';
|
||||
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate());
|
||||
}
|
||||
|
||||
function formatDateTime(value) {
|
||||
const date = parseDateTime(value);
|
||||
if (!date) return '-';
|
||||
return formatDate(value) + ' ' + pad(date.getHours()) + ':' + pad(date.getMinutes());
|
||||
}
|
||||
|
||||
function formatDuration(minutes) {
|
||||
if (minutes == null) return '';
|
||||
if (minutes < 60) return minutes + '분';
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const rest = minutes % 60;
|
||||
return rest === 0 ? hours + '시간' : hours + '시간 ' + rest + '분';
|
||||
}
|
||||
|
||||
function buildQuery(params) {
|
||||
const query = [];
|
||||
Object.keys(params).forEach(function (key) {
|
||||
if (params[key] !== '' && params[key] != null) {
|
||||
query.push(key + '=' + encodeURIComponent(params[key]));
|
||||
}
|
||||
});
|
||||
return query.length ? '?' + query.join('&') : '';
|
||||
}
|
||||
|
||||
function syncBrowserUrl() {
|
||||
if (!window.history || !window.history.replaceState) return;
|
||||
window.history.replaceState(null, '',
|
||||
base + '/issues' + buildQuery({ date: state.date, apiId: state.apiId, kind: state.kind }));
|
||||
}
|
||||
|
||||
/** 필터 변경 후 목록/인덱스 재조회 */
|
||||
function applyFilters(reloadIndex) {
|
||||
state.page = 0;
|
||||
syncBrowserUrl();
|
||||
renderIndexBarSelection();
|
||||
if (reloadIndex) loadIndexBar();
|
||||
loadIssues();
|
||||
}
|
||||
|
||||
// ---------------- 90일 인덱스바 ----------------
|
||||
function renderIndexBar(entries) {
|
||||
if (!entries || !entries.length) {
|
||||
indexBar.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
indexBar.innerHTML = entries.map(function (entry) {
|
||||
const hasIncident = entry.incCount > 0;
|
||||
const hasDelay = entry.dlyCount > 0;
|
||||
const hasMaintenance = entry.mntCount > 0;
|
||||
|
||||
// 유형이 2종 이상 섞인 날은 개별 색 대신 복합 색으로 표시한다
|
||||
const kindCount = (hasIncident ? 1 : 0) + (hasDelay ? 1 : 0) + (hasMaintenance ? 1 : 0);
|
||||
let cls = '';
|
||||
if (kindCount > 1) cls = ' has-mixed';
|
||||
else if (hasIncident) cls = ' has-incident';
|
||||
else if (hasDelay) cls = ' has-degraded';
|
||||
else if (hasMaintenance) cls = ' has-maintenance';
|
||||
if (state.date && state.date === entry.date) cls += ' is-selected';
|
||||
|
||||
const parts = [];
|
||||
if (hasIncident) parts.push('장애 ' + entry.incCount + '건');
|
||||
if (hasDelay) parts.push('지연 ' + entry.dlyCount + '건');
|
||||
if (hasMaintenance) parts.push('점검 ' + entry.mntCount + '건');
|
||||
const tooltip = entry.date + (parts.length ? ' · ' + parts.join(' · ') : ' · 이슈 없음');
|
||||
|
||||
return '<button type="button" class="as-index-cell' + cls + '"'
|
||||
+ ' data-date="' + escapeHtml(entry.date) + '"'
|
||||
+ ' title="' + escapeHtml(tooltip) + '"></button>';
|
||||
}).join('');
|
||||
|
||||
indexBar.querySelectorAll('.as-index-cell').forEach(function (cell) {
|
||||
cell.addEventListener('click', function () {
|
||||
const clicked = cell.getAttribute('data-date');
|
||||
state.date = state.date === clicked ? '' : clicked;
|
||||
applyFilters(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function renderIndexBarSelection() {
|
||||
indexBar.querySelectorAll('.as-index-cell').forEach(function (cell) {
|
||||
cell.classList.toggle('is-selected', state.date === cell.getAttribute('data-date'));
|
||||
});
|
||||
selectedDateLabel.textContent = state.date || '전체 기간';
|
||||
if (dateInput.value !== state.date) {
|
||||
dateInput.value = state.date;
|
||||
}
|
||||
dateField.classList.toggle('has-value', !!state.date);
|
||||
}
|
||||
|
||||
// ---------------- 이슈 카드 ----------------
|
||||
/**
|
||||
* 영향 API 태그. 오픈 API 목록에 있는 API 만 상세 화면으로 링크하고,
|
||||
* 목록에 없는 API(비공개·미편성)는 링크 없이 흐리게 표시한다.
|
||||
*/
|
||||
function apiPillsHtml(apis) {
|
||||
if (!apis || !apis.length) return '';
|
||||
const pills = apis.map(function (api) {
|
||||
const text = escapeHtml(api.apiName || api.apiId);
|
||||
if (!linkableApiIds.has(api.apiId)) {
|
||||
return '<span class="as-api-pill is-unlinked" title="공개된 API 목록에 없는 API 입니다">'
|
||||
+ text + '</span>';
|
||||
}
|
||||
return '<a class="as-api-pill" href="' + apiDetailBase + '?id=' + encodeURIComponent(api.apiId) + '">'
|
||||
+ text + '</a>';
|
||||
}).join('');
|
||||
return '<div class="as-api-pills"><span>영향 API:</span>' + pills + '</div>';
|
||||
}
|
||||
|
||||
function issueCardHtml(issue) {
|
||||
const kindClass = KIND_CLASS[issue.kind] || 'is-incident';
|
||||
|
||||
let inner;
|
||||
if (issue.kind === 'MAINTENANCE') {
|
||||
inner = '<p class="as-tl-body">' + escapeHtml(issue.summary || '점검 안내') + '</p>';
|
||||
} else {
|
||||
const items = (issue.timeline || []).map(function (entry) {
|
||||
return '<div class="as-tl-item state-' + escapeHtml(entry.stateAfter || 'NONE') + '">'
|
||||
+ '<span class="as-dot"></span>'
|
||||
+ '<p class="as-tl-label">' + escapeHtml(entry.labelKo || '진행 상황') + '</p>'
|
||||
+ '<p class="as-tl-body">' + escapeHtml(entry.body) + '</p>'
|
||||
+ '<p class="as-tl-ts">' + escapeHtml(formatDateTime(entry.eventAt)) + '</p>'
|
||||
+ '</div>';
|
||||
}).join('');
|
||||
inner = items
|
||||
? '<div class="as-tl-block">' + items + '</div>'
|
||||
: '<p class="as-tl-body">' + escapeHtml(issue.summary || '상세 진행 내역이 등록되지 않았습니다.') + '</p>';
|
||||
}
|
||||
|
||||
const period = formatDateTime(issue.startedAt)
|
||||
+ (issue.endAt ? ' ~ ' + formatDateTime(issue.endAt) : ' ~ 진행 중')
|
||||
+ (issue.durationMinutes != null ? ' (' + formatDuration(issue.durationMinutes) + ')' : '');
|
||||
|
||||
return '<article class="as-issue-card ' + kindClass + '">'
|
||||
+ '<div class="as-issue-meta-row">'
|
||||
+ ' <span class="as-badge ' + kindClass + '">' + escapeHtml(KIND_LABEL[issue.kind] || '') + '</span>'
|
||||
+ ' <span>' + escapeHtml(period) + '</span>'
|
||||
+ (issue.stateLabel ? '<span>' + escapeHtml(issue.stateLabel) + '</span>' : '')
|
||||
+ '</div>'
|
||||
+ '<h3 class="as-issue-title">' + escapeHtml(issue.title) + '</h3>'
|
||||
+ inner
|
||||
+ apiPillsHtml(issue.impactedApis)
|
||||
+ '</article>';
|
||||
}
|
||||
|
||||
function renderPager(pageData) {
|
||||
const totalPages = pageData.totalPages || 0;
|
||||
if (totalPages <= 1) {
|
||||
pagerEl.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
let html = '';
|
||||
for (let index = 0; index < totalPages; index++) {
|
||||
const current = index === pageData.number;
|
||||
html += '<button type="button" class="as-btn' + (current ? ' is-current' : '') + '"'
|
||||
+ ' data-page="' + index + '"' + (current ? ' disabled' : '') + '>' + (index + 1) + '</button>';
|
||||
}
|
||||
pagerEl.innerHTML = html;
|
||||
pagerEl.querySelectorAll('button[data-page]').forEach(function (button) {
|
||||
button.addEventListener('click', function () {
|
||||
state.page = parseInt(button.getAttribute('data-page'), 10) || 0;
|
||||
loadIssues();
|
||||
window.scrollTo({ top: listEl.offsetTop - 80, behavior: 'smooth' });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadIssues() {
|
||||
const query = buildQuery({
|
||||
date: state.date,
|
||||
apiId: state.apiId,
|
||||
kind: state.kind,
|
||||
page: state.page,
|
||||
size: PAGE_SIZE
|
||||
});
|
||||
|
||||
fetchJson(base + '/issues/list.json' + query)
|
||||
.then(function (pageData) {
|
||||
const content = pageData.content || [];
|
||||
totalCountEl.textContent = pageData.totalElements != null ? pageData.totalElements : content.length;
|
||||
|
||||
listEl.innerHTML = content.length
|
||||
? content.map(issueCardHtml).join('')
|
||||
: '<div class="as-empty">조건에 해당하는 이슈가 없습니다.</div>';
|
||||
renderPager(pageData);
|
||||
})
|
||||
.catch(function () {
|
||||
listEl.innerHTML = '<div class="as-empty">이슈 목록을 불러올 수 없습니다.</div>';
|
||||
pagerEl.innerHTML = '';
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------- API 필터 (라이브서치 콤보박스) ----------------
|
||||
|
||||
/** 옵션 = 오픈 API 목록과 동일 기준(그룹 편성 + 사용자 공개). 표시는 API 명만. */
|
||||
function loadApiOptions() {
|
||||
return fetchJson(base + '/apis.json')
|
||||
.then(function (apis) {
|
||||
apiOptions = (apis || []).filter(function (api) { return api.apiId; });
|
||||
apiOptions.forEach(function (api) { linkableApiIds.add(api.apiId); });
|
||||
// URL 로 들어온 apiId 는 옵션(오픈 API 목록)에 없어도 필터를 유지한다.
|
||||
// My APIs(기관 계약 API)처럼 오픈 API 목록 밖의 API 로도 진입하기 때문.
|
||||
renderApiInput();
|
||||
})
|
||||
.catch(function () { /* 옵션 조회 실패 시 전체 API 기준으로 동작 */ });
|
||||
}
|
||||
|
||||
function findApiOption(apiId) {
|
||||
if (!apiId) return null;
|
||||
for (let index = 0; index < apiOptions.length; index++) {
|
||||
if (apiOptions[index].apiId === apiId) return apiOptions[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** 표시 형태: "[그룹명] API명" (그룹 없으면 API명만) */
|
||||
function optionLabel(api) {
|
||||
if (!api) return '';
|
||||
return api.groupName ? '[' + api.groupName + '] ' + api.apiName : api.apiName;
|
||||
}
|
||||
|
||||
function renderApiInput() {
|
||||
const selected = findApiOption(state.apiId);
|
||||
// 옵션에 없는 API(오픈 API 목록 밖)는 전달받은 API 명 또는 ID 로 표시해 필터 상태를 보이게 한다
|
||||
apiInput.value = selected ? optionLabel(selected) : (state.apiId ? (urlApiName || state.apiId) : '');
|
||||
apiCombo.classList.toggle('has-value', !!state.apiId);
|
||||
|
||||
// 포탈 미게시 API 필터 안내 배너 (옵션 목록을 받은 뒤에만 판단)
|
||||
const unlisted = !!state.apiId && apiOptions.length > 0 && !selected;
|
||||
if (unlisted) {
|
||||
unlistedName.textContent = urlApiName || state.apiId;
|
||||
}
|
||||
unlistedBanner.style.display = unlisted ? '' : 'none';
|
||||
}
|
||||
|
||||
function closeApiList() {
|
||||
apiListEl.hidden = true;
|
||||
apiInput.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
|
||||
function openApiList(keyword) {
|
||||
const query = (keyword || '').trim().toLowerCase();
|
||||
const matched = apiOptions.filter(function (api) {
|
||||
if (!query) return true;
|
||||
return optionLabel(api).toLowerCase().indexOf(query) >= 0;
|
||||
});
|
||||
|
||||
if (!matched.length) {
|
||||
apiListEl.innerHTML = '<li class="as-combo-empty">검색 결과가 없습니다</li>';
|
||||
} else {
|
||||
const items = matched.slice(0, API_LIST_LIMIT).map(function (api) {
|
||||
return '<li role="option" class="as-combo-item" data-api-id="' + escapeHtml(api.apiId) + '">'
|
||||
+ escapeHtml(optionLabel(api)) + '</li>';
|
||||
});
|
||||
if (matched.length > API_LIST_LIMIT) {
|
||||
items.push('<li class="as-combo-empty">이하 '
|
||||
+ (matched.length - API_LIST_LIMIT) + '건은 검색어를 입력해 좁혀주세요</li>');
|
||||
}
|
||||
apiListEl.innerHTML = '<li role="option" class="as-combo-item" data-api-id="">전체 API</li>'
|
||||
+ items.join('');
|
||||
}
|
||||
|
||||
apiListEl.hidden = false;
|
||||
apiInput.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
|
||||
function selectApi(apiId) {
|
||||
state.apiId = apiId || '';
|
||||
renderApiInput();
|
||||
closeApiList();
|
||||
applyFilters(true);
|
||||
}
|
||||
|
||||
function loadIndexBar() {
|
||||
fetchJson(base + '/issues/dates.json'
|
||||
+ buildQuery({ days: windowDays, apiId: state.apiId, kind: state.kind }))
|
||||
.then(function (entries) {
|
||||
renderIndexBar(entries);
|
||||
renderIndexBarSelection();
|
||||
})
|
||||
.catch(function () { indexBar.innerHTML = ''; });
|
||||
}
|
||||
|
||||
// ---------------- 필터 이벤트 ----------------
|
||||
|
||||
dateInput.addEventListener('change', function () {
|
||||
const value = dateInput.value;
|
||||
// 조회 기간(90일) 밖 날짜는 되돌린다
|
||||
if (value && ((minDate && value < minDate) || (today && value > today))) {
|
||||
dateInput.value = state.date;
|
||||
return;
|
||||
}
|
||||
state.date = value;
|
||||
applyFilters(false);
|
||||
});
|
||||
|
||||
dateClearBtn.addEventListener('click', function () {
|
||||
state.date = '';
|
||||
dateInput.value = '';
|
||||
applyFilters(false);
|
||||
});
|
||||
|
||||
kindSelect.addEventListener('change', function () {
|
||||
state.kind = kindSelect.value;
|
||||
applyFilters(true);
|
||||
});
|
||||
|
||||
// readonly 자동완성 차단 트릭: 브라우저 autofill 은 readonly 입력을 후보에서 제외한다.
|
||||
// 사용자가 실제로 만지는 순간에만 readonly 를 풀어 입력을 허용한다 (모바일은 touchstart 가 먼저 온다).
|
||||
function unlockApiInput() {
|
||||
if (apiInput.hasAttribute('readonly')) {
|
||||
apiInput.removeAttribute('readonly');
|
||||
}
|
||||
}
|
||||
apiInput.addEventListener('touchstart', unlockApiInput, { passive: true });
|
||||
apiInput.addEventListener('mousedown', unlockApiInput);
|
||||
|
||||
apiInput.addEventListener('focus', function () {
|
||||
unlockApiInput();
|
||||
openApiList('');
|
||||
});
|
||||
|
||||
apiInput.addEventListener('input', function () { openApiList(apiInput.value); });
|
||||
|
||||
apiInput.addEventListener('keydown', function (event) {
|
||||
if (event.key === 'Escape') {
|
||||
renderApiInput();
|
||||
closeApiList();
|
||||
} else if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
const first = apiListEl.querySelector('.as-combo-item');
|
||||
if (first) selectApi(first.getAttribute('data-api-id'));
|
||||
}
|
||||
});
|
||||
|
||||
apiListEl.addEventListener('mousedown', function (event) {
|
||||
const item = event.target.closest('.as-combo-item');
|
||||
if (!item) return;
|
||||
event.preventDefault();
|
||||
selectApi(item.getAttribute('data-api-id'));
|
||||
});
|
||||
|
||||
apiClearBtn.addEventListener('click', function () {
|
||||
apiInput.value = '';
|
||||
selectApi('');
|
||||
});
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
if (!apiCombo.contains(event.target)) {
|
||||
renderApiInput();
|
||||
closeApiList();
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('filterResetBtn').addEventListener('click', function () {
|
||||
state.date = '';
|
||||
state.apiId = '';
|
||||
state.kind = '';
|
||||
dateInput.value = '';
|
||||
kindSelect.value = '';
|
||||
renderApiInput();
|
||||
closeApiList();
|
||||
applyFilters(true);
|
||||
});
|
||||
|
||||
// ---------------- 초기 로딩 ----------------
|
||||
dateInput.value = state.date;
|
||||
kindSelect.value = state.kind;
|
||||
renderIndexBarSelection();
|
||||
loadIndexBar();
|
||||
// 영향 API 태그의 링크 여부 판단에 오픈 API 목록이 필요하므로 옵션을 먼저 받는다
|
||||
loadApiOptions().then(loadIssues);
|
||||
})();
|
||||
@@ -0,0 +1,357 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const page = document.getElementById('apiStatusPage');
|
||||
if (!page) return;
|
||||
|
||||
const windowDays = parseInt(page.getAttribute('data-window-days'), 10) || 90;
|
||||
const authenticated = page.classList.contains('is-authenticated');
|
||||
const base = page.getAttribute('data-base') || '/apistatus';
|
||||
const apiDetailBase = page.getAttribute('data-api-detail-base') || '/apis/detail';
|
||||
|
||||
/** 오픈 API 목록에 노출되는 API (링크 가능 대상) */
|
||||
const linkableApiIds = new Set();
|
||||
|
||||
const KIND_LABEL = { INCIDENT: '장애', DELAY: '지연', MAINTENANCE: '점검' };
|
||||
const KIND_CLASS = { INCIDENT: 'is-incident', DELAY: 'is-degraded', MAINTENANCE: 'is-maintenance' };
|
||||
|
||||
/** 진행 중 장애 카드 노출 상한. 초과분은 전체 이력 링크로 넘긴다. */
|
||||
const ACTIVE_INCIDENT_LIMIT = 1;
|
||||
|
||||
function escapeHtml(text) {
|
||||
if (text == null) return '';
|
||||
return String(text)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function fetchJson(url) {
|
||||
return fetch(url, { credentials: 'same-origin', headers: { Accept: 'application/json' } })
|
||||
.then(function (response) {
|
||||
if (!response.ok) throw new Error('HTTP ' + response.status);
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
/** "2026-07-30T09:15:00" → Date. 서버는 서버 timezone(KST) 기준 LocalDateTime 을 보낸다. */
|
||||
function parseDateTime(value) {
|
||||
if (!value) return null;
|
||||
const parsed = new Date(String(value).replace(' ', 'T'));
|
||||
return isNaN(parsed.getTime()) ? null : parsed;
|
||||
}
|
||||
|
||||
function pad(value) {
|
||||
return value < 10 ? '0' + value : String(value);
|
||||
}
|
||||
|
||||
function formatDate(value) {
|
||||
const date = parseDateTime(value);
|
||||
if (!date) return '-';
|
||||
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate());
|
||||
}
|
||||
|
||||
function formatDateTime(value) {
|
||||
const date = parseDateTime(value);
|
||||
if (!date) return '-';
|
||||
return formatDate(value) + ' ' + pad(date.getHours()) + ':' + pad(date.getMinutes());
|
||||
}
|
||||
|
||||
function formatTime(value) {
|
||||
const date = parseDateTime(value);
|
||||
if (!date) return '-';
|
||||
return pad(date.getHours()) + ':' + pad(date.getMinutes());
|
||||
}
|
||||
|
||||
function formatDuration(minutes) {
|
||||
if (minutes == null) return '';
|
||||
if (minutes < 60) return minutes + '분';
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const rest = minutes % 60;
|
||||
return rest === 0 ? hours + '시간' : hours + '시간 ' + rest + '분';
|
||||
}
|
||||
|
||||
function formatPercent(ratio) {
|
||||
if (ratio == null) return '-';
|
||||
return (ratio * 100).toFixed(2);
|
||||
}
|
||||
|
||||
function issuesHref(params) {
|
||||
const query = [];
|
||||
if (params.date) query.push('date=' + encodeURIComponent(params.date));
|
||||
if (params.apiId) query.push('apiId=' + encodeURIComponent(params.apiId));
|
||||
if (params.apiName) query.push('apiName=' + encodeURIComponent(params.apiName));
|
||||
return base + '/issues' + (query.length ? '?' + query.join('&') : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 영향 API 태그. 오픈 API 목록에 있는 API 만 상세 화면으로 링크하고,
|
||||
* 목록에 없는 API(비공개·미편성)는 링크 없이 흐리게 표시한다.
|
||||
*/
|
||||
function apiPillsHtml(apis, label) {
|
||||
if (!apis || !apis.length) return '';
|
||||
const pills = apis.map(function (api) {
|
||||
const text = escapeHtml(api.apiName || api.apiId);
|
||||
if (!linkableApiIds.has(api.apiId)) {
|
||||
return '<span class="as-api-pill is-unlinked" title="공개된 API 목록에 없는 API 입니다">'
|
||||
+ text + '</span>';
|
||||
}
|
||||
return '<a class="as-api-pill" href="' + apiDetailBase + '?id=' + encodeURIComponent(api.apiId) + '">'
|
||||
+ text + '</a>';
|
||||
}).join('');
|
||||
return '<div class="as-api-pills"><span>' + escapeHtml(label) + '</span>' + pills + '</div>';
|
||||
}
|
||||
|
||||
// ---------------- ❶ 진행 중 장애 ----------------
|
||||
function renderActiveIncidents(incidents) {
|
||||
const container = document.getElementById('activeIncidents');
|
||||
if (!incidents || !incidents.length) {
|
||||
container.innerHTML = '<section class="as-card">'
|
||||
+ '<div class="as-card-head"><div><h2>현재 진행 중인 장애가 없습니다</h2>'
|
||||
+ '<p class="as-desc">모든 API 가 정상 동작 중입니다.</p></div>'
|
||||
+ '<span class="as-badge is-normal">정상</span></div></section>';
|
||||
return;
|
||||
}
|
||||
|
||||
const visible = incidents.slice(0, ACTIVE_INCIDENT_LIMIT);
|
||||
const hidden = incidents.length - visible.length;
|
||||
|
||||
const cards = visible.map(function (incident) {
|
||||
const timeline = (incident.recentTimeline || []).map(function (entry) {
|
||||
const who = entry.authorType === 'SYSTEM' ? 'SYSTEM' : '운영자';
|
||||
const whoClass = entry.authorType === 'SYSTEM' ? ' is-system' : '';
|
||||
return '<div class="as-tl-row">'
|
||||
+ '<span class="as-tl-time">' + escapeHtml(formatTime(entry.eventAt)) + '</span>'
|
||||
+ '<span class="as-tl-who' + whoClass + '">' + escapeHtml(who) + '</span>'
|
||||
+ '<span>' + escapeHtml(entry.body) + '</span>'
|
||||
+ '</div>';
|
||||
}).join('');
|
||||
|
||||
return '<section class="as-card as-alert-card">'
|
||||
+ '<div class="as-alert-head">'
|
||||
+ ' <div><span class="as-badge is-incident">장애</span>'
|
||||
+ (incident.stateLabel ? ' <span class="as-badge is-muted">' + escapeHtml(incident.stateLabel) + '</span>' : '')
|
||||
+ ' </div>'
|
||||
+ ' <div class="as-meta">시작 <strong>' + escapeHtml(formatDateTime(incident.startedAt)) + '</strong>'
|
||||
+ ' · 경과 <strong>' + escapeHtml(formatDuration(incident.elapsedMinutes)) + '</strong></div>'
|
||||
+ '</div>'
|
||||
+ '<h2 class="as-alert-title">' + escapeHtml(incident.title) + '</h2>'
|
||||
+ (incident.summary ? '<p class="as-meta">' + escapeHtml(incident.summary) + '</p>' : '')
|
||||
+ apiPillsHtml(incident.apis, '영향 API:')
|
||||
+ (timeline ? '<div class="as-alert-timeline">' + timeline + '</div>' : '')
|
||||
+ '</section>';
|
||||
}).join('');
|
||||
|
||||
const overflow = hidden > 0
|
||||
? '<div class="as-alert-overflow">'
|
||||
+ '<span>진행 중인 장애가 ' + escapeHtml(String(hidden)) + '건 더 있습니다.</span>'
|
||||
+ '<a href="' + issuesHref({}) + '">전체 이슈 이력에서 보기 →</a>'
|
||||
+ '</div>'
|
||||
: '';
|
||||
|
||||
container.innerHTML = cards + overflow;
|
||||
}
|
||||
|
||||
// ---------------- ❷ 90일 서비스 상태 ----------------
|
||||
function renderUptime(stats) {
|
||||
const chart = document.getElementById('uptimeChart');
|
||||
const fromLabel = document.getElementById('uptimeFromLabel');
|
||||
|
||||
if (!stats || !stats.length) {
|
||||
chart.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
const STATUS_LABEL = { OUTAGE: '장애', MAINTENANCE: '점검', DEGRADED: '지연' };
|
||||
|
||||
chart.innerHTML = stats.map(function (stat) {
|
||||
const statusClass = stat.status === 'OUTAGE' ? ' is-outage'
|
||||
: stat.status === 'MAINTENANCE' ? ' is-maintenance'
|
||||
: stat.status === 'DEGRADED' ? ' is-degraded' : '';
|
||||
const titles = (stat.issues || []).map(function (issue) {
|
||||
return (KIND_LABEL[issue.kind] || '') + ' ' + issue.title;
|
||||
});
|
||||
const tooltip = stat.statDate + ' · ' + (STATUS_LABEL[stat.status] || '정상')
|
||||
+ (titles.length ? '\n' + titles.join('\n') : '');
|
||||
return '<button type="button" class="as-bar' + statusClass + '"'
|
||||
+ ' data-date="' + escapeHtml(stat.statDate) + '"'
|
||||
+ ' title="' + escapeHtml(tooltip) + '"></button>';
|
||||
}).join('');
|
||||
|
||||
if (fromLabel) fromLabel.textContent = stats[0].statDate;
|
||||
|
||||
chart.querySelectorAll('.as-bar').forEach(function (bar) {
|
||||
bar.addEventListener('click', function () {
|
||||
window.location.href = issuesHref({ date: bar.getAttribute('data-date') });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------- ❸ My APIs ----------------
|
||||
function renderMyApis(apis) {
|
||||
const card = document.getElementById('myApisCard');
|
||||
if (!card) return;
|
||||
if (!apis || !apis.length) {
|
||||
card.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
const badgeClass = {
|
||||
OUTAGE: 'is-outage',
|
||||
DEGRADED: 'is-degraded',
|
||||
MAINTENANCE: 'is-maintenance',
|
||||
NORMAL: 'is-normal'
|
||||
};
|
||||
|
||||
document.getElementById('myApisCount').textContent = apis.length + '건';
|
||||
document.getElementById('myApisBody').innerHTML = apis.map(function (api) {
|
||||
const cls = badgeClass[api.currentStatus] || 'is-muted';
|
||||
return '<tr data-api-id="' + escapeHtml(api.apiId) + '" data-api-name="' + escapeHtml(api.apiName) + '">'
|
||||
+ '<td><span class="as-api-name">' + escapeHtml(api.apiName) + '</span></td>'
|
||||
+ '<td><span class="as-badge ' + cls + '">' + escapeHtml(api.currentStatusLabel) + '</span></td>'
|
||||
+ '<td class="as-num">' + formatPercent(api.uptime90d) + '%</td>'
|
||||
+ '</tr>';
|
||||
}).join('');
|
||||
|
||||
card.style.display = '';
|
||||
card.querySelectorAll('tbody tr').forEach(function (row) {
|
||||
row.addEventListener('click', function () {
|
||||
window.location.href = issuesHref({
|
||||
apiId: row.getAttribute('data-api-id'),
|
||||
apiName: row.getAttribute('data-api-name')
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------- ❹ 점검 사항 ----------------
|
||||
function renderMaintenance(cards) {
|
||||
const list = document.getElementById('maintenanceList');
|
||||
const count = document.getElementById('maintenanceCount');
|
||||
|
||||
if (!cards || !cards.length) {
|
||||
count.textContent = '0건';
|
||||
list.innerHTML = '<div class="as-empty">예정된 점검이 없습니다.</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
count.textContent = cards.length + '건';
|
||||
list.innerHTML = cards.map(function (card) {
|
||||
const start = parseDateTime(card.startedAt);
|
||||
const ongoing = start && start <= now;
|
||||
const phase = ongoing ? '진행중' : '예정';
|
||||
const range = formatDateTime(card.startedAt)
|
||||
+ (card.endAt ? ' ~ ' + formatDateTime(card.endAt) : '')
|
||||
+ (card.durationMinutes != null ? ' (' + formatDuration(card.durationMinutes) + ')' : '');
|
||||
|
||||
return '<article class="as-maint-card' + (ongoing ? ' is-ongoing' : '') + '">'
|
||||
+ '<div class="as-maint-head">'
|
||||
+ ' <h3 class="as-maint-title">' + escapeHtml(card.title) + '</h3>'
|
||||
+ ' <span class="as-schedule">' + escapeHtml(phase + ' · ' + range) + '</span>'
|
||||
+ '</div>'
|
||||
+ (card.summary ? '<div class="as-maint-body">' + escapeHtml(card.summary) + '</div>' : '')
|
||||
+ apiPillsHtml(card.impactedApis, '영향 API:')
|
||||
+ '<div class="as-maint-meta">등록 ' + escapeHtml(formatDateTime(card.registeredAt))
|
||||
+ (card.lastModifiedAt ? ' (최종 수정 ' + escapeHtml(formatDateTime(card.lastModifiedAt)) + ')' : '')
|
||||
+ '</div>'
|
||||
+ '</article>';
|
||||
}).join('');
|
||||
}
|
||||
|
||||
// ---------------- ❺ 지난 이슈 사항 ----------------
|
||||
function issueCardHtml(issue) {
|
||||
const kindClass = KIND_CLASS[issue.kind] || 'is-incident';
|
||||
const kindBadge = kindClass;
|
||||
|
||||
let inner;
|
||||
if (issue.kind === 'MAINTENANCE') {
|
||||
inner = '<div class="as-tl-block"><div class="as-tl-item state-RESOLVED">'
|
||||
+ '<span class="as-dot"></span>'
|
||||
+ '<p class="as-tl-label">점검 완료</p>'
|
||||
+ (issue.summary ? '<p class="as-tl-body">' + escapeHtml(issue.summary) + '</p>' : '')
|
||||
+ '<p class="as-tl-ts">' + escapeHtml(formatDateTime(issue.startedAt))
|
||||
+ ' ~ ' + escapeHtml(formatDateTime(issue.endAt)) + '</p>'
|
||||
+ '</div></div>';
|
||||
} else {
|
||||
const items = (issue.timeline || []).map(function (entry) {
|
||||
return '<div class="as-tl-item state-' + escapeHtml(entry.stateAfter || 'NONE') + '">'
|
||||
+ '<span class="as-dot"></span>'
|
||||
+ '<p class="as-tl-label">' + escapeHtml(entry.labelKo || '진행 상황') + '</p>'
|
||||
+ '<p class="as-tl-body">' + escapeHtml(entry.body) + '</p>'
|
||||
+ '<p class="as-tl-ts">' + escapeHtml(formatDateTime(entry.eventAt)) + '</p>'
|
||||
+ '</div>';
|
||||
}).join('');
|
||||
inner = items
|
||||
? '<div class="as-tl-block">' + items + '</div>'
|
||||
: '<p class="as-tl-body">' + escapeHtml(issue.summary || '상세 진행 내역이 등록되지 않았습니다.') + '</p>';
|
||||
}
|
||||
|
||||
const duration = issue.durationMinutes != null ? ' · ' + formatDuration(issue.durationMinutes) : '';
|
||||
|
||||
return '<div class="as-issue-group">'
|
||||
+ '<div class="as-date-head">' + escapeHtml(formatDate(issue.startedAt)) + '</div>'
|
||||
+ '<article class="as-issue-card ' + kindClass + '">'
|
||||
+ ' <div class="as-issue-meta-row">'
|
||||
+ ' <span class="as-badge ' + kindBadge + '">' + escapeHtml(KIND_LABEL[issue.kind] || '') + '</span>'
|
||||
+ ' <span>' + escapeHtml(formatDateTime(issue.startedAt) + duration) + '</span>'
|
||||
+ (issue.stateLabel ? '<span>' + escapeHtml(issue.stateLabel) + '</span>' : '')
|
||||
+ ' </div>'
|
||||
+ ' <h3 class="as-issue-title">' + escapeHtml(issue.title) + '</h3>'
|
||||
+ inner
|
||||
+ apiPillsHtml(issue.impactedApis, '영향 API:')
|
||||
+ '</article>'
|
||||
+ '</div>';
|
||||
}
|
||||
|
||||
function renderRecentIssues(issues) {
|
||||
const list = document.getElementById('recentIssueList');
|
||||
if (!issues || !issues.length) {
|
||||
list.innerHTML = '<div class="as-empty">종결된 이슈가 없습니다.</div>';
|
||||
return;
|
||||
}
|
||||
list.innerHTML = issues.map(issueCardHtml).join('');
|
||||
}
|
||||
|
||||
function handleError(target, message) {
|
||||
const element = document.getElementById(target);
|
||||
if (element) element.innerHTML = '<div class="as-empty">' + escapeHtml(message) + '</div>';
|
||||
}
|
||||
|
||||
// ---------------- 초기 로딩 ----------------
|
||||
// 영향 API 태그의 링크 여부를 판단해야 하므로 오픈 API 목록을 먼저 받는다
|
||||
fetchJson(base + '/apis.json')
|
||||
.then(function (apis) {
|
||||
(apis || []).forEach(function (api) {
|
||||
if (api.apiId) linkableApiIds.add(api.apiId);
|
||||
});
|
||||
})
|
||||
.catch(function () { /* 실패 시 전부 링크 없이 표시된다 */ })
|
||||
.then(loadSections);
|
||||
|
||||
function loadSections() {
|
||||
fetchJson(base + '/active.json')
|
||||
.then(renderActiveIncidents)
|
||||
.catch(function () { handleError('activeIncidents', '진행 중 장애 정보를 불러올 수 없습니다.'); });
|
||||
|
||||
fetchJson(base + '/uptime.json?days=' + windowDays)
|
||||
.then(renderUptime)
|
||||
.catch(function () { handleError('uptimeChart', '서비스 상태 정보를 불러올 수 없습니다.'); });
|
||||
|
||||
fetchJson(base + '/maintenance.json')
|
||||
.then(renderMaintenance)
|
||||
.catch(function () { handleError('maintenanceList', '점검 정보를 불러올 수 없습니다.'); });
|
||||
|
||||
fetchJson(base + '/recent-issues.json?size=5')
|
||||
.then(renderRecentIssues)
|
||||
.catch(function () { handleError('recentIssueList', '지난 이슈를 불러올 수 없습니다.'); });
|
||||
|
||||
if (authenticated) {
|
||||
fetchJson(base + '/my-apis.json')
|
||||
.then(renderMyApis)
|
||||
.catch(function () { /* 비인증/권한 없음은 조용히 숨긴다 */ });
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -2,8 +2,10 @@
|
||||
* 비밀번호 문자열 정책 라이브 검증 (공용)
|
||||
*
|
||||
* 서버 검증기 PasswordRuleValidator.isValid(= @PasswordRule) 의
|
||||
* "문자열" 규칙을 그대로 클라이언트로 포팅한다. 아이디/휴대전화 포함 여부는
|
||||
* 민감정보 노출을 피하기 위해 서버 검증에만 맡긴다.
|
||||
* 규칙을 클라이언트로 포팅한다. 아이디/휴대전화 포함 규칙(noid/nomobile)은
|
||||
* 사용자가 폼에 직접 입력한 값이 페이지에 이미 있을 때만 ul 의
|
||||
* data-context-loginid/data-context-mobile 로 연결해 쓴다 — DB 값을 새로
|
||||
* 내려받아야 하는 화면(비밀번호 변경)은 서버 AJAX(/password/content-check)로 판정한다.
|
||||
*
|
||||
* 사용법(마크업 구동):
|
||||
* <ul class="password-policy-checklist" data-password-input="newPassword">
|
||||
@@ -31,7 +33,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
// 규칙별 판정 함수 (통과=true)
|
||||
// 규칙별 판정 함수 (통과=true). ctx = { loginId, mobile } — 값이 없으면 해당 규칙은 통과 처리
|
||||
var RULES = {
|
||||
length: function (pw) { return pw.length >= 8 && pw.length <= 50; },
|
||||
letter: function (pw) { return /[a-zA-Z]/.test(pw); },
|
||||
@@ -39,23 +41,46 @@
|
||||
special: function (pw) { return /[^A-Za-z0-9_]/.test(pw); }, // 서버 정규식 \W 기준 (밑줄 제외)
|
||||
nospace: function (pw) { return !/\s/.test(pw); },
|
||||
norepeat: function (pw) { return !/(\w)\1\1/.test(pw.toUpperCase()); },
|
||||
noseq: function (pw) { return !hasSequential(pw); }
|
||||
noseq: function (pw) { return !hasSequential(pw); },
|
||||
// 아이디(이메일 local part) 포함 금지 — 서버 PasswordRuleValidator.containsLoginIdLocalPart 포팅
|
||||
noid: function (pw, ctx) {
|
||||
var id = ctx && ctx.loginId ? String(ctx.loginId).split('@')[0].toUpperCase() : '';
|
||||
return !id || pw.toUpperCase().indexOf(id) === -1;
|
||||
},
|
||||
// 휴대전화 하이픈 세그먼트 포함 금지 — 서버 containsMobileSegment 포팅
|
||||
nomobile: function (pw, ctx) {
|
||||
var m = ctx && ctx.mobile ? String(ctx.mobile) : '';
|
||||
if (!m) { return true; }
|
||||
var up = pw.toUpperCase();
|
||||
var parts = m.split('-');
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
if (parts[i] && up.indexOf(parts[i]) !== -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// 전체 문자열 규칙 통과 여부
|
||||
function isValid(pw) {
|
||||
// 전체 문자열 규칙 통과 여부 (ctx 미전달 시 noid/nomobile 은 통과 — 서버 검증에 위임)
|
||||
function isValid(pw, ctx) {
|
||||
if (!pw) {
|
||||
return false;
|
||||
}
|
||||
for (var key in RULES) {
|
||||
if (RULES.hasOwnProperty(key) && !RULES[key](pw)) {
|
||||
if (RULES.hasOwnProperty(key) && !RULES[key](pw, ctx || {})) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 체크리스트(ul) 하나를 대상 input 에 바인딩
|
||||
// bind 된 체크리스트들의 update 함수 목록 (컨텍스트 값 변경 시 refresh 용)
|
||||
var updaters = [];
|
||||
|
||||
// 체크리스트(ul) 하나를 대상 input 에 바인딩.
|
||||
// ul 의 data-context-loginid / data-context-mobile 속성에 소스 input 의 id 를 주면
|
||||
// noid/nomobile 규칙이 해당 값 기준으로 라이브 판정된다.
|
||||
function bind(input, list) {
|
||||
var $input = (input && input.jquery) ? input : $(input);
|
||||
var $list = (list && list.jquery) ? list : $(list);
|
||||
@@ -64,8 +89,18 @@
|
||||
return;
|
||||
}
|
||||
|
||||
function ctxValue(attr) {
|
||||
var id = $list.attr(attr);
|
||||
var el = id ? document.getElementById(id) : null;
|
||||
return el ? el.value : '';
|
||||
}
|
||||
|
||||
function update() {
|
||||
var pw = $input.val() || '';
|
||||
var ctx = {
|
||||
loginId: ctxValue('data-context-loginid'),
|
||||
mobile: ctxValue('data-context-mobile')
|
||||
};
|
||||
$items.each(function () {
|
||||
var $li = $(this);
|
||||
var rule = RULES[$li.attr('data-rule')];
|
||||
@@ -76,15 +111,29 @@
|
||||
if (pw.length === 0) {
|
||||
$li.addClass('is-idle');
|
||||
} else {
|
||||
$li.addClass(rule(pw) ? 'is-pass' : 'is-fail');
|
||||
$li.addClass(rule(pw, ctx) ? 'is-pass' : 'is-fail');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 컨텍스트 소스 input 이 직접 타이핑되는 경우도 즉시 반영
|
||||
['data-context-loginid', 'data-context-mobile'].forEach(function (attr) {
|
||||
var id = $list.attr(attr);
|
||||
if (id && document.getElementById(id)) {
|
||||
$(document.getElementById(id)).on('input.passwordPolicy change.passwordPolicy', update);
|
||||
}
|
||||
});
|
||||
|
||||
updaters.push(update);
|
||||
$input.on('input.passwordPolicy', update);
|
||||
update();
|
||||
}
|
||||
|
||||
// hidden input 등 이벤트 없이 값이 세팅되는 컨텍스트 변경 후 수동 재판정
|
||||
function refresh() {
|
||||
updaters.forEach(function (u) { u(); });
|
||||
}
|
||||
|
||||
// 마크업 구동 자동 초기화
|
||||
function init(root) {
|
||||
var $root = root ? $(root) : $(document);
|
||||
@@ -101,7 +150,8 @@
|
||||
RULES: RULES,
|
||||
isValid: isValid,
|
||||
bind: bind,
|
||||
init: init
|
||||
init: init,
|
||||
refresh: refresh
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
@@ -142,7 +142,11 @@ const customPopups = {
|
||||
$('#passwordPopupMessage').html(customPopups._sanitizeHtml(message));
|
||||
|
||||
// 입력 필드 및 에러 초기화 (placeholder 는 호출부 커스텀 허용)
|
||||
$('#passwordPopupInput').val('').removeClass('error').attr('placeholder', placeholder);
|
||||
// type 은 열려 있는 동안만 password 로 전환한다.
|
||||
// 상주 DOM 에 password 입력이 있으면 브라우저가 페이지의 다른 텍스트 입력을
|
||||
// 아이디 칸으로 오인해 계정 자동완성을 띄우기 때문 (닫을 때 text 로 복원).
|
||||
$('#passwordPopupInput').val('').removeClass('error')
|
||||
.attr('type', 'password').attr('placeholder', placeholder);
|
||||
$('#passwordPopupError').removeClass('show').text('');
|
||||
|
||||
// 팝업 표시 (modal 구조 사용)
|
||||
@@ -219,8 +223,8 @@ const customPopups = {
|
||||
// Body 스크롤 복원
|
||||
$('body').css('overflow', '');
|
||||
|
||||
// 입력 필드 초기화
|
||||
$('#passwordPopupInput').val('').removeClass('error');
|
||||
// 입력 필드 초기화 (type 도 text 로 복원 — 상주 password 로 남기지 않는다)
|
||||
$('#passwordPopupInput').val('').removeClass('error').attr('type', 'text');
|
||||
$('#passwordPopupError').removeClass('show').text('');
|
||||
|
||||
// 이벤트 리스너 제거
|
||||
@@ -246,6 +250,110 @@ const customPopups = {
|
||||
$('#passwordPopupError').removeClass('show');
|
||||
$('#passwordPopupInput').removeClass('error');
|
||||
},
|
||||
/**
|
||||
* API 이용 해지 신청 팝업 표시 (경고문 + 사유 필수 — 본인 확인은 step-up 2FA가 담당)
|
||||
* @param {Object} options - 팝업 옵션
|
||||
* @param {Function} options.onConfirm - 해지 신청 버튼 클릭 시 호출되는 콜백 (파라미터: reason)
|
||||
* @param {Function} options.onCancel - 취소 버튼 클릭 시 호출되는 콜백 (선택사항)
|
||||
*/
|
||||
showTerminateRequest: function (options) {
|
||||
options = options || {};
|
||||
|
||||
const onConfirm = options.onConfirm;
|
||||
const onCancel = options.onCancel;
|
||||
|
||||
// 입력 필드 및 에러 초기화
|
||||
$('#terminateReasonInput').val('').removeClass('error');
|
||||
$('#terminatePopupError').removeClass('show').text('');
|
||||
|
||||
// 팝업 표시 (modal 구조 사용)
|
||||
$('#terminateRequestPopup').show();
|
||||
setTimeout(function() {
|
||||
$('#terminateModalBackdrop').addClass('show');
|
||||
$('#terminateModal').addClass('show');
|
||||
}, 10);
|
||||
|
||||
// Body 스크롤 방지
|
||||
$('body').css('overflow', 'hidden');
|
||||
|
||||
// 사유 입력 필드에 포커스
|
||||
setTimeout(function() {
|
||||
$('#terminateReasonInput').focus();
|
||||
}, 350);
|
||||
|
||||
// 확인 버튼 이벤트 (기존 이벤트 제거 후 재등록)
|
||||
$('#terminatePopupConfirmButton').off('click').on('click', function () {
|
||||
const reason = $('#terminateReasonInput').val().trim();
|
||||
|
||||
if (!reason) {
|
||||
customPopups.showTerminateError('해지 사유를 입력해주세요.');
|
||||
$('#terminateReasonInput').addClass('error').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof onConfirm === 'function') {
|
||||
onConfirm(reason);
|
||||
}
|
||||
});
|
||||
|
||||
// 취소 버튼 이벤트
|
||||
$('#terminatePopupCancelButton').off('click').on('click', function () {
|
||||
customPopups.hideTerminateRequest();
|
||||
if (typeof onCancel === 'function') {
|
||||
onCancel();
|
||||
}
|
||||
});
|
||||
|
||||
// 닫기 버튼 이벤트
|
||||
$('#terminatePopupCloseButton').off('click').on('click', function () {
|
||||
customPopups.hideTerminateRequest();
|
||||
if (typeof onCancel === 'function') {
|
||||
onCancel();
|
||||
}
|
||||
});
|
||||
|
||||
// 입력 시 에러 초기화
|
||||
$('#terminateReasonInput').off('input').on('input', function () {
|
||||
$(this).removeClass('error');
|
||||
$('#terminatePopupError').removeClass('show').text('');
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 해지 신청 팝업 숨기기
|
||||
*/
|
||||
hideTerminateRequest: function () {
|
||||
// Modal 숨김 애니메이션
|
||||
$('#terminateModalBackdrop').removeClass('show');
|
||||
$('#terminateModal').removeClass('show');
|
||||
|
||||
// 애니메이션 완료 후 숨김
|
||||
setTimeout(function() {
|
||||
$('#terminateRequestPopup').hide();
|
||||
}, 300);
|
||||
|
||||
// Body 스크롤 복원
|
||||
$('body').css('overflow', '');
|
||||
|
||||
// 입력 필드 초기화
|
||||
$('#terminateReasonInput').val('').removeClass('error');
|
||||
$('#terminatePopupError').removeClass('show').text('');
|
||||
|
||||
// 이벤트 리스너 제거
|
||||
$('#terminatePopupConfirmButton').off('click');
|
||||
$('#terminatePopupCancelButton').off('click');
|
||||
$('#terminatePopupCloseButton').off('click');
|
||||
$('#terminateReasonInput').off('input');
|
||||
},
|
||||
|
||||
/**
|
||||
* 해지 신청 팝업 에러 메시지 표시
|
||||
* @param {string} message - 에러 메시지
|
||||
*/
|
||||
showTerminateError: function (message) {
|
||||
$('#terminatePopupError').text(message).addClass('show');
|
||||
},
|
||||
|
||||
/**
|
||||
* 확인 팝업 표시
|
||||
* @param {string} message - 확인 메시지
|
||||
@@ -407,8 +515,12 @@ const customPopups = {
|
||||
return;
|
||||
}
|
||||
|
||||
// 하이픈 유무 무관 입력을 저장 표준(010-1234-5678)으로 통일해 전달
|
||||
const formattedMobile = mobile.replace(/-/g, '')
|
||||
.replace(/^(01[016-9])(\d{3,4})(\d{4})$/, '$1-$2-$3');
|
||||
|
||||
if (typeof onConfirm === 'function') {
|
||||
onConfirm(mobile, notifyConsent);
|
||||
onConfirm(formattedMobile, notifyConsent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -598,6 +598,14 @@
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
background: #cbd5e1 !important;
|
||||
color: #94a3b8 !important;
|
||||
cursor: not-allowed !important;
|
||||
transform: none !important;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
&.md {
|
||||
font-size: 14px;
|
||||
padding: 11px 45px;
|
||||
|
||||
@@ -478,7 +478,7 @@ select.form-control {
|
||||
|
||||
&:disabled,
|
||||
&.input-readonly {
|
||||
background: $gray-bg;
|
||||
background: #e9ecef !important;
|
||||
color: $text-gray;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@
|
||||
line-height: 1;
|
||||
|
||||
&::before {
|
||||
content: "\2022"; // •
|
||||
content: "•";
|
||||
}
|
||||
}
|
||||
|
||||
&.is-idle {
|
||||
color: #888;
|
||||
color: #718096;
|
||||
|
||||
.policy-icon {
|
||||
color: #b5b5b5;
|
||||
color: #a0aec0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,5 +71,5 @@
|
||||
margin: 10px 0 0 0;
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
color: #888;
|
||||
color: #ef5555;
|
||||
}
|
||||
@@ -65,6 +65,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
.footer-link--external {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
|
||||
.footer-link-external-icon {
|
||||
flex-shrink: 0;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
color: currentColor;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-separator {
|
||||
color: #D1D5DB;
|
||||
font-size: 16px;
|
||||
|
||||
@@ -913,7 +913,7 @@
|
||||
.nav-menu {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
gap: 28px;
|
||||
gap: 24px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
@@ -925,6 +925,7 @@
|
||||
>.nav-link {
|
||||
background: var(--light-bg);
|
||||
color: var(--primary-blue);
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
@@ -978,7 +979,7 @@
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: var(--text-gray);
|
||||
padding: 8px;
|
||||
padding: 12px;
|
||||
position: relative;
|
||||
transition: var(--transition-smooth);
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
@use 'components/partners' as *;
|
||||
@use 'components/cta' as *;
|
||||
@use 'components/password-popup' as *;
|
||||
@use 'components/password-policy' as *;
|
||||
@use 'components/header-auth' as *;
|
||||
@use 'components/session-timer' as *;
|
||||
@use 'components/tables' as *;
|
||||
@@ -71,6 +72,7 @@
|
||||
@use 'pages/service' as *;
|
||||
@use 'pages/api-statistics' as *;
|
||||
@use 'pages/webhook' as *;
|
||||
@use 'pages/api-status' as *;
|
||||
|
||||
// 6. Themes
|
||||
@use 'themes/dark' as *;
|
||||
|
||||
@@ -9,33 +9,35 @@
|
||||
|
||||
.account-recovery-page {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
padding: 100px 20px;
|
||||
position: relative;
|
||||
min-height: auto;
|
||||
margin: 0;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.account-recovery-container {
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
max-width: 650px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
padding: $spacing-lg;
|
||||
}
|
||||
|
||||
.account-recovery-card {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
|
||||
padding: 36px 36px 28px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
position: relative;
|
||||
|
||||
@media (max-width: 576px) {
|
||||
padding: 0 20px;
|
||||
padding: 24px 20px 20px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,14 +51,13 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Tab Navigation (Figma 디자인: 약관 페이지와 동일)
|
||||
// Tab Navigation (Design 2: 클래식 폴더 탭)
|
||||
.account-recovery-tabs {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
margin-bottom: 0;
|
||||
margin-bottom: 28px;
|
||||
width: 100%;
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
|
||||
.tab-link {
|
||||
@@ -64,45 +65,46 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 14px 24px;
|
||||
padding: 14px 20px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #8c959f;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
color: #adb5bd;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
background: #eceff4;
|
||||
background: #FFFFFF;
|
||||
// 비활성 탭: 하단 border만 (바닥선 역할)
|
||||
border: 1.5px solid transparent;
|
||||
border-bottom: 1.5px solid #dee2e6;
|
||||
border-radius: 0;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
// 왼쪽 탭 둥근 모서리
|
||||
&:first-child {
|
||||
border-radius: 30px 0 0 0;
|
||||
}
|
||||
|
||||
// 오른쪽 탭 둥근 모서리
|
||||
&:last-child {
|
||||
border-radius: 0 30px 0 0;
|
||||
}
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
color: #3ba4ed;
|
||||
background: #e4e8ed;
|
||||
color: $primary-blue;
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: #FFFFFF;
|
||||
background: #3ba4ed;
|
||||
color: $primary-blue;
|
||||
font-weight: 700;
|
||||
// 활성 탭: 상/좌/우 파란 테두리 + 하단 흰색으로 바닥선 가려 콘텐츠와 연결
|
||||
border-top: 1.5px solid $primary-blue;
|
||||
border-left: 1.5px solid $primary-blue;
|
||||
border-right: 1.5px solid $primary-blue;
|
||||
border-bottom: 2px solid #FFFFFF;
|
||||
border-radius: 8px 8px 0px 0px;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
padding: 12px 16px;
|
||||
font-size: 14px;
|
||||
padding: 12px 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Alert Messages
|
||||
.account-alert {
|
||||
width: 100%;
|
||||
@@ -140,73 +142,45 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Form Content Area (Figma: 아이디찾기BG_box)
|
||||
// Form Content Area (세로 스택형, 라벨 없는 심플 스타일)
|
||||
.account-recovery-form {
|
||||
width: 100%;
|
||||
margin-bottom: 0;
|
||||
background: #F6F9FB;
|
||||
padding: 40px;
|
||||
border-radius: 0 0 12px 12px;
|
||||
|
||||
@media (max-width: 576px) {
|
||||
padding: 24px 16px;
|
||||
}
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
|
||||
.form-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-bottom: 20px;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
margin-bottom: 12px;
|
||||
|
||||
&:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
// 라벨은 숨김 (placeholder로 대체)
|
||||
.form-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
width: 170px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
color: #212529;
|
||||
margin-bottom: 0;
|
||||
|
||||
.required {
|
||||
color: #ed5b5b;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
flex: 1;
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
padding: 0 16px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #212529;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #dadada;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #E2E8F0;
|
||||
border-radius: 10px;
|
||||
outline: none;
|
||||
transition: all 0.3s ease;
|
||||
transition: all 0.25s ease;
|
||||
|
||||
&::placeholder {
|
||||
color: #dadada;
|
||||
color: #B0B8C1;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
@@ -215,7 +189,7 @@
|
||||
|
||||
&:focus {
|
||||
border-color: #3ba4ed;
|
||||
box-shadow: 0 0 0 2px rgba(59, 164, 237, 0.1);
|
||||
box-shadow: 0 0 0 3px rgba(59, 164, 237, 0.12);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
@@ -231,24 +205,24 @@
|
||||
}
|
||||
|
||||
.form-select {
|
||||
height: 40px;
|
||||
padding: 0 32px 0 16px;
|
||||
height: 48px;
|
||||
padding: 0 24px 0 12px; // padding을 좀 더 좁혀서 내용이 더 잘 보이도록 수정
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #515151;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #dadada;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #E2E8F0;
|
||||
border-radius: 10px;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
transition: all 0.25s ease;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='5' viewBox='0 0 10 5'%3E%3Cpath fill='%231D1B20' d='M5 5L0 0h10z'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 12px center;
|
||||
background-position: right 8px center; // 화살표 아이콘 위치도 조정
|
||||
background-size: 10px 5px;
|
||||
|
||||
&:hover {
|
||||
@@ -257,7 +231,7 @@
|
||||
|
||||
&:focus {
|
||||
border-color: #3ba4ed;
|
||||
box-shadow: 0 0 0 2px rgba(59, 164, 237, 0.1);
|
||||
box-shadow: 0 0 0 3px rgba(59, 164, 237, 0.12);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
@@ -275,55 +249,99 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Phone Input Group (Figma: 휴대폰번호+텍스트필드)
|
||||
// 인증 방식 선택 pill 탭 (비밀번호 초기화 탭 내부)
|
||||
.reset-method-group {
|
||||
margin-bottom: 16px !important;
|
||||
}
|
||||
|
||||
.reset-method-tabs {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
background: #f0f2f5;
|
||||
border-radius: 10px;
|
||||
padding: 4px;
|
||||
|
||||
.reset-method-tab {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
|
||||
input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
span {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 9px 12px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #8c959f;
|
||||
border-radius: 7px;
|
||||
transition: all 0.2s ease;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[type="radio"]:checked+span {
|
||||
background: #FFFFFF;
|
||||
color: #212529;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.09);
|
||||
}
|
||||
|
||||
&:hover span {
|
||||
color: #3ba4ed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Phone Input Group
|
||||
.phone-input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
|
||||
.phone-prefix {
|
||||
width: 100px;
|
||||
width: 90px;
|
||||
min-width: 90px; // select가 줄어들지 않도록 고정
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.phone-middle,
|
||||
.phone-last {
|
||||
width: 100px;
|
||||
flex-shrink: 0;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.phone-separator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 8px;
|
||||
height: 1px;
|
||||
background: #515151;
|
||||
color: #B0B8C1;
|
||||
font-size: 14px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
width: 10px;
|
||||
height: auto;
|
||||
background: transparent;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
|
||||
.phone-prefix,
|
||||
.phone-middle,
|
||||
.phone-last {
|
||||
flex: 1;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
.phone-separator {
|
||||
width: 6px;
|
||||
&::before {
|
||||
content: '-';
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.phone-prefix,
|
||||
.phone-middle,
|
||||
.phone-last {
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
|
||||
.phone-prefix {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.phone-separator {
|
||||
@@ -332,7 +350,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Auth Number Group (Figma: 인증번호+텍스트필드)
|
||||
// Auth Number Group
|
||||
.auth-number-group {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -341,95 +359,103 @@
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
gap: 8px;
|
||||
|
||||
|
||||
&.mg-y {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
}
|
||||
|
||||
.auth-input {
|
||||
flex: 1;
|
||||
padding-right: 60px;
|
||||
min-width: 0;
|
||||
|
||||
}
|
||||
|
||||
.auth-timer {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
right: 20px; // verify button width + gap
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #ed5b5b;
|
||||
pointer-events: none;
|
||||
|
||||
@media (max-width: 576px) {
|
||||
font-size: 12px;
|
||||
right: 12px;
|
||||
right: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Buttons (Figma: 인증번호 받기/확인)
|
||||
// Buttons: 인증번호 받기 / 확인
|
||||
.auth-request-button,
|
||||
.auth-verify-button {
|
||||
width: 140px;
|
||||
height: 40px;
|
||||
padding: 8px;
|
||||
height: 48px;
|
||||
padding: 0 16px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: #FFFFFF;
|
||||
background: #a4d6ea;
|
||||
background: #3ba4ed;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
margin: 0;
|
||||
transition: all 0.25s ease;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
line-height: 1;
|
||||
|
||||
&:hover {
|
||||
background: darken(#a4d6ea, 5%);
|
||||
background: darken(#3ba4ed, 8%);
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: darken(#a4d6ea, 10%);
|
||||
background: darken(#3ba4ed, 14%);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.6;
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
height: 44px;
|
||||
font-size: 13px;
|
||||
margin-top: 8px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
// Form Actions (Figma: btn_취소, btn_신청)
|
||||
// Form Actions
|
||||
.account-recovery-card .form-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
margin-top: 32px;
|
||||
padding: 32px 0;
|
||||
gap: 12px;
|
||||
margin-top: 28px;
|
||||
padding: 0;
|
||||
border-top: none;
|
||||
background: transparent;
|
||||
|
||||
.cancel-button,
|
||||
.submit-button {
|
||||
width: 160px;
|
||||
height: 40px;
|
||||
padding: 8px;
|
||||
flex: 1;
|
||||
height: 48px;
|
||||
padding: 0 8px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
transition: all 0.25s ease;
|
||||
line-height: 1;
|
||||
// <a> 태그 지원
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -438,14 +464,14 @@
|
||||
|
||||
.cancel-button {
|
||||
color: #5f666c;
|
||||
background: #e5e7eb;
|
||||
background: #f0f2f5;
|
||||
|
||||
&:hover {
|
||||
background: darken(#e5e7eb, 5%);
|
||||
background: darken(#f0f2f5, 5%);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: darken(#e5e7eb, 10%);
|
||||
background: darken(#f0f2f5, 10%);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +480,9 @@
|
||||
background: #0049B4;
|
||||
|
||||
&:hover {
|
||||
background: darken(#0049B4, 5%);
|
||||
// background: darken(#0049B4, 5%);
|
||||
background: rgb(6 54 125);
|
||||
|
||||
}
|
||||
|
||||
&:active {
|
||||
@@ -468,15 +496,12 @@
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 20px 0;
|
||||
|
||||
.cancel-button,
|
||||
.submit-button {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
font-size: 13px;
|
||||
height: 44px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,6 +546,7 @@
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
@@ -545,7 +571,6 @@
|
||||
// Result Page Styles (아이디 찾기 결과 페이지)
|
||||
.account-recovery-result {
|
||||
width: 100%;
|
||||
background: #F6F9FB;
|
||||
padding: 60px 40px;
|
||||
border-radius: 0 0 12px 12px;
|
||||
text-align: center;
|
||||
@@ -701,7 +726,7 @@
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Figma Mobile Design - node 1152-7047 (sm: 768px breakpoint)
|
||||
// Mobile Design (sm: 768px breakpoint)
|
||||
// -----------------------------------------------------------------------------
|
||||
@include respond-to('sm') {
|
||||
.account-recovery-page {
|
||||
@@ -710,164 +735,78 @@
|
||||
}
|
||||
|
||||
.account-recovery-container {
|
||||
padding: 20px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.account-recovery-card {
|
||||
padding: 0;
|
||||
padding: 24px 16px 20px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
// Figma: 탭 - 167px × 40px, 14px Bold
|
||||
.account-recovery-tabs {
|
||||
margin-bottom: 20px;
|
||||
|
||||
.tab-link {
|
||||
height: 40px;
|
||||
padding: 10px 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
|
||||
&:first-child {
|
||||
border-radius: 8px 0 0 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-radius: 0 8px 0 0;
|
||||
}
|
||||
padding: 9px 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
// Figma: 폼 영역
|
||||
.account-recovery-form {
|
||||
padding: 20px;
|
||||
border-radius: 0 0 8px 8px;
|
||||
|
||||
.form-group {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
// Figma: 라벨 - 14px Medium
|
||||
.form-label {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
// Figma: 입력 필드 - 335px × 40px, border-radius 8px
|
||||
.form-input {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0 16px;
|
||||
font-size: 12px;
|
||||
border-radius: 8px;
|
||||
|
||||
&::placeholder {
|
||||
color: #8c959f;
|
||||
}
|
||||
height: 44px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
// Figma: 셀렉트 - 40px 높이, 8px radius
|
||||
.form-select {
|
||||
height: 40px;
|
||||
padding: 0 32px 0 12px;
|
||||
font-size: 12px;
|
||||
border-radius: 8px;
|
||||
background-position: right 10px center;
|
||||
height: 44px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
// 모바일: 휴대폰 번호 입력 - 화면 폭 채우기
|
||||
.phone-input-group {
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 6px;
|
||||
|
||||
.phone-prefix {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.phone-middle,
|
||||
.phone-last {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.phone-separator {
|
||||
display: flex;
|
||||
width: auto;
|
||||
height: auto;
|
||||
background: transparent;
|
||||
font-size: 12px;
|
||||
color: #000;
|
||||
|
||||
&::before {
|
||||
content: '-';
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
// 모바일: 인증번호 입력 그룹 - 화면 폭 채우기
|
||||
.auth-input-group {
|
||||
width: 100%;
|
||||
|
||||
.auth-input {
|
||||
width: 100%;
|
||||
padding-right: 60px;
|
||||
}
|
||||
|
||||
// 타이머 - 12px, #ed5b5b
|
||||
.auth-timer {
|
||||
font-size: 12px;
|
||||
right: 12px;
|
||||
right: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
// 모바일: 인증번호 받기/확인 버튼 - 화면 폭 채우기, 다음 줄에 배치
|
||||
.auth-request-button,
|
||||
.auth-verify-button {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
border-radius: 8px;
|
||||
margin-top: 8px;
|
||||
height: 44px;
|
||||
font-size: 13px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
// Figma: 하단 버튼 - 144px × 40px, gap 21px, 가로 배치
|
||||
.account-recovery-card .form-actions {
|
||||
flex-direction: row;
|
||||
gap: 21px;
|
||||
margin-top: 24px;
|
||||
padding: 24px 0;
|
||||
gap: 10px;
|
||||
margin-top: 20px;
|
||||
|
||||
.cancel-button,
|
||||
.submit-button {
|
||||
flex: 1;
|
||||
min-width: 144px;
|
||||
height: 40px;
|
||||
height: 44px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
// Figma: 취소 버튼 - #e5e7eb 배경, #5f666c 텍스트
|
||||
.cancel-button {
|
||||
background: #e5e7eb;
|
||||
color: #5f666c;
|
||||
}
|
||||
|
||||
// Figma: 제출 버튼 - #0049b4 배경, 흰색 텍스트
|
||||
.submit-button {
|
||||
background: #0049b4;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -467,16 +467,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-badge {
|
||||
/* 그룹 배지 + 현재 상태 태그를 한 줄에 둔다.
|
||||
기존 그룹 배지가 갖고 있던 절대 위치(top 39 / left 32)를 이 래퍼가 이어받는다 */
|
||||
&-badges {
|
||||
position: absolute;
|
||||
top: 39px;
|
||||
left: 32px;
|
||||
right: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&-badge {
|
||||
background-color: #f2f2f3;
|
||||
border-radius: 10px;
|
||||
padding: 2px 20px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 0;
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
@@ -484,9 +495,34 @@
|
||||
font-weight: 500;
|
||||
color: #1b4ab7;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
/* 현재 상태 태그. 색 규격은 API Status 화면(.as-badge)과 동일.
|
||||
상태를 못 받았을 때(빈 값)는 자리만 차지하지 않도록 숨긴다 */
|
||||
&-status {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 3px 12px;
|
||||
border-radius: 10px;
|
||||
font-size: 12px;
|
||||
font-family: 'Spoqa Han Sans Neo', sans-serif;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
background: #eef1f5;
|
||||
color: #4b5563;
|
||||
|
||||
&:empty { display: none; }
|
||||
|
||||
&.is-outage { background: #feeae7; color: #c8362f; }
|
||||
&.is-maintenance { background: #e7f0fb; color: #0a66c2; }
|
||||
&.is-degraded { background: #fef3c7; color: #c77800; }
|
||||
&.is-normal { background: #e7f6ec; color: #1b8c4a; }
|
||||
}
|
||||
|
||||
&-title {
|
||||
position: absolute;
|
||||
top: 86px;
|
||||
@@ -846,7 +882,7 @@
|
||||
}
|
||||
|
||||
// API Overview Card (Flat Style)
|
||||
/* "기본 정보" 헤더: 좌측 제목 + 우측 "API 사용 신청" 버튼 */
|
||||
/* "기본 정보" 헤더: 좌측 제목 + 우측 현재 상태/상태 이력 */
|
||||
.api-basic-info-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -855,6 +891,41 @@
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* 현재 상태 배지 + "상태 이력 확인" 버튼.
|
||||
색 규격은 API Status 화면(.as-badge)과 동일하게 맞춘다 */
|
||||
.api-status-inline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.api-status-inline__label {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #4b5563;
|
||||
}
|
||||
|
||||
.api-status-inline__badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
padding: 5px 12px;
|
||||
border-radius: 999px;
|
||||
letter-spacing: 0.02em;
|
||||
white-space: nowrap;
|
||||
background: #eef1f5;
|
||||
color: #4b5563;
|
||||
|
||||
&.is-outage { background: #feeae7; color: #c8362f; }
|
||||
&.is-maintenance { background: #e7f0fb; color: #0a66c2; }
|
||||
&.is-degraded { background: #fef3c7; color: #c77800; }
|
||||
&.is-normal { background: #e7f6ec; color: #1b8c4a; }
|
||||
&.is-loading { color: #6b7280; }
|
||||
&.is-muted { background: #eef1f5; color: #6b7280; }
|
||||
}
|
||||
}
|
||||
|
||||
/* 하단 중앙 "API 사용 신청" 버튼 */
|
||||
.api-apply-footer {
|
||||
display: flex;
|
||||
|
||||
@@ -0,0 +1,882 @@
|
||||
// ============================================================
|
||||
// API Status 페이지 (/apistatus, /apistatus/issues)
|
||||
// 설계: architecture/01-api-status/02-screen-design
|
||||
// 타이틀 배너: Figma eapim-portal node 1:16
|
||||
// ============================================================
|
||||
@use '../abstracts/variables' as *;
|
||||
|
||||
// API Status 화면은 제목 포함 전부 본문 폰트(Spoqa Han Sans)를 쓴다.
|
||||
// 전역 타이포가 h1~h6 에 $font-family-heading(OneShinhan 우선)을 지정하므로 페이지 범위에서 되돌린다.
|
||||
.as-title-banner,
|
||||
.as-title-banner h1,
|
||||
.api-status,
|
||||
.api-status h1,
|
||||
.api-status h2,
|
||||
.api-status h3,
|
||||
.api-status h4 {
|
||||
font-family: $font-family-primary;
|
||||
}
|
||||
|
||||
// 타이틀 배너 — 레이아웃의 .container 안에 놓이므로 컨테이너 폭을 따른다
|
||||
.as-title-banner {
|
||||
// 상단 여백은 fixed 헤더(80px) 아래로 배너를 내리기 위한 값이다
|
||||
margin: 44px 0 28px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(110deg, #003080 0%, #0049b4 60%, #066ae5 100%);
|
||||
color: #fff;
|
||||
overflow: hidden;
|
||||
|
||||
.as-title-banner-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.as-title-meta {
|
||||
text-align: right;
|
||||
|
||||
p { margin: 0; font-weight: 400; }
|
||||
}
|
||||
|
||||
.as-title-meta-main {
|
||||
font-size: 13px;
|
||||
color: #fff;
|
||||
|
||||
strong { font-weight: 500; }
|
||||
}
|
||||
|
||||
.as-title-meta-sub {
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
color: #c9d1dc;
|
||||
}
|
||||
|
||||
.as-title-dot {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin-right: 6px;
|
||||
border-radius: 50%;
|
||||
background: #56e3a6;
|
||||
box-shadow: 0 0 0 4px rgba(86, 227, 166, 0.25);
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.as-title-banner-inner { padding: 24px 20px; }
|
||||
|
||||
h1 { font-size: 20px; }
|
||||
|
||||
.as-title-meta { text-align: left; }
|
||||
}
|
||||
}
|
||||
|
||||
.api-status {
|
||||
// ---- 토큰 (설계서 색상 규격) ----
|
||||
--as-ok: #1b8c4a;
|
||||
--as-ok-bg: #e7f6ec;
|
||||
--as-warn: #c77800;
|
||||
--as-warn-bg: #fef3c7;
|
||||
--as-err: #c8362f;
|
||||
--as-err-bg: #feeae7;
|
||||
--as-info: #0a66c2;
|
||||
--as-info-bg: #e7f0fb;
|
||||
--as-both: #6b21a8;
|
||||
--as-gray-bg: #eef1f5;
|
||||
// 이슈 없음 = 정상. API Status 메인 가동률 바와 같은 색을 쓴다
|
||||
--as-none-bg: var(--as-ok);
|
||||
--as-border: #e0e6f1;
|
||||
--as-border-strong: #d1d5db;
|
||||
--as-text: #020616;
|
||||
--as-text-2: #252b37;
|
||||
--as-text-3: #4b5563;
|
||||
--as-muted: #6b7280;
|
||||
--as-radius: 12px;
|
||||
--as-pill: 999px;
|
||||
|
||||
display: grid;
|
||||
// minmax(0,1fr): grid 자식의 암묵적 min-width(auto)를 해제한다.
|
||||
// 90일 막대(90개 × 최소폭)가 카드의 최소 폭을 밀어올려 좁은 화면에서 카드가 잘리는 것 방지
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: 20px;
|
||||
padding: 0 0 70px;
|
||||
|
||||
// 상단 헤더가 fixed 라 브레드크럼 위를 덮는다. 첫 카드가 헤더에 붙지 않도록 띄운다.
|
||||
&.is-standalone { padding-top: 44px; }
|
||||
|
||||
// 제목(h1~h3) 외 본문은 기본 굵기를 쓴다.
|
||||
// 포털 전역 타이포가 본문을 600 으로 잡고 있어 페이지 범위에서 되돌린다.
|
||||
font-weight: 400;
|
||||
|
||||
p,
|
||||
span,
|
||||
li,
|
||||
a,
|
||||
td,
|
||||
th,
|
||||
label,
|
||||
button,
|
||||
input,
|
||||
select { font-weight: 400; }
|
||||
|
||||
b,
|
||||
strong { font-weight: 500; }
|
||||
|
||||
// ---------------- 공통 카드/배지 ----------------
|
||||
.as-card {
|
||||
background: #fff;
|
||||
border: 1px solid var(--as-border);
|
||||
border-radius: var(--as-radius);
|
||||
padding: 24px;
|
||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
|
||||
}
|
||||
|
||||
.as-card-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 14px;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
letter-spacing: -0.01em;
|
||||
color: var(--as-text);
|
||||
}
|
||||
|
||||
.as-desc {
|
||||
margin: 4px 0 0;
|
||||
font-size: 13px;
|
||||
color: var(--as-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.as-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
padding: 4px 10px;
|
||||
border-radius: var(--as-pill);
|
||||
letter-spacing: 0.02em;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-incident,
|
||||
&.is-outage { background: var(--as-err-bg); color: var(--as-err); }
|
||||
&.is-maintenance { background: var(--as-info-bg); color: var(--as-info); }
|
||||
&.is-degraded { background: var(--as-warn-bg); color: var(--as-warn); }
|
||||
&.is-normal { background: var(--as-ok-bg); color: var(--as-ok); }
|
||||
&.is-muted { background: var(--as-gray-bg); color: var(--as-text-3); }
|
||||
}
|
||||
|
||||
.as-section-title {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
margin: 6px 4px 14px;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.as-desc { font-size: 13px; color: var(--as-muted); }
|
||||
|
||||
.as-count {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--as-muted);
|
||||
background: #f6f9fb;
|
||||
padding: 2px 8px;
|
||||
border-radius: var(--as-pill);
|
||||
}
|
||||
}
|
||||
|
||||
.as-empty {
|
||||
color: var(--as-muted);
|
||||
font-size: 14px;
|
||||
padding: 26px;
|
||||
background: #fff;
|
||||
border: 1px dashed var(--as-border);
|
||||
border-radius: var(--as-radius);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.as-api-pills {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
margin-top: 12px;
|
||||
font-size: 13px;
|
||||
color: var(--as-text-3);
|
||||
|
||||
.as-api-pill {
|
||||
background: var(--as-gray-bg);
|
||||
color: var(--as-text-2);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 4px 10px;
|
||||
border-radius: var(--as-pill);
|
||||
}
|
||||
|
||||
// 오픈 API 목록에 있는 API — 상세로 이동
|
||||
a.as-api-pill {
|
||||
text-decoration: none;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
background: var(--as-info-bg);
|
||||
color: var(--as-info);
|
||||
}
|
||||
}
|
||||
|
||||
// 목록에 없는 API — 링크 없음, 채도를 낮춰 구분
|
||||
.as-api-pill.is-unlinked {
|
||||
background: #f3f5f8;
|
||||
color: var(--as-muted);
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- 진행 중 장애 카드 ----------------
|
||||
.as-alert-card {
|
||||
border-left: 4px solid var(--as-err);
|
||||
|
||||
.as-alert-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.as-alert-title {
|
||||
margin: 8px 0 6px;
|
||||
font-size: 20px;
|
||||
color: var(--as-err);
|
||||
}
|
||||
|
||||
.as-meta { font-size: 13px; color: var(--as-text-3); }
|
||||
|
||||
.as-alert-timeline {
|
||||
margin-top: 16px;
|
||||
border-top: 1px dashed var(--as-border);
|
||||
padding-top: 14px;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.as-tl-row {
|
||||
display: grid;
|
||||
grid-template-columns: 60px 76px 1fr;
|
||||
gap: 12px;
|
||||
font-size: 13px;
|
||||
|
||||
.as-tl-time {
|
||||
color: var(--as-muted);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.as-tl-who {
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
height: -webkit-fit-content;
|
||||
height: fit-content;
|
||||
padding: 2px 8px;
|
||||
border-radius: var(--as-pill);
|
||||
background: var(--as-gray-bg);
|
||||
color: var(--as-text-2);
|
||||
|
||||
&.is-system { background: var(--as-info-bg); color: var(--as-info); }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 진행 중 장애가 노출 상한을 넘을 때 안내
|
||||
.as-alert-overflow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
padding: 14px 20px;
|
||||
border: 1px dashed var(--as-err);
|
||||
border-radius: var(--as-radius);
|
||||
background: var(--as-err-bg);
|
||||
font-size: 13px;
|
||||
color: var(--as-err);
|
||||
|
||||
a { color: var(--as-err); font-weight: 500; text-decoration: none; }
|
||||
}
|
||||
|
||||
// ---------------- 90일 서비스 상태 ----------------
|
||||
.as-uptime {
|
||||
.as-bar-chart {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
align-items: flex-end;
|
||||
height: 56px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.as-axis {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 14px;
|
||||
font-size: 11px;
|
||||
color: var(--as-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.as-bar {
|
||||
flex: 1 0 4px;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
border-radius: 2px;
|
||||
background: var(--as-ok);
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s;
|
||||
|
||||
&.is-outage { background: var(--as-err); }
|
||||
&.is-maintenance { background: var(--as-info); }
|
||||
&.is-degraded { background: var(--as-warn); }
|
||||
&:hover { opacity: 0.75; }
|
||||
}
|
||||
|
||||
.as-legend {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 18px;
|
||||
font-size: 12px;
|
||||
color: var(--as-muted);
|
||||
|
||||
.as-sw {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 2px;
|
||||
margin-right: 4px;
|
||||
vertical-align: middle;
|
||||
|
||||
&.is-ok { background: var(--as-ok); }
|
||||
&.is-outage { background: var(--as-err); }
|
||||
&.is-maintenance { background: var(--as-info); }
|
||||
&.is-degraded { background: var(--as-warn); }
|
||||
&.is-none { background: var(--as-none-bg); }
|
||||
// 장애·지연·점검 중 2종 이상이 겹친 날
|
||||
&.is-mixed,
|
||||
&.is-both { background: var(--as-both); }
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- My APIs ----------------
|
||||
.as-my-apis {
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
th,
|
||||
td { text-align: left; padding: 12px 14px; }
|
||||
|
||||
th {
|
||||
background: #f6f9fb;
|
||||
color: var(--as-text-3);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-bottom: 1px solid var(--as-border);
|
||||
}
|
||||
|
||||
tbody tr {
|
||||
border-bottom: 1px solid var(--as-border);
|
||||
cursor: pointer;
|
||||
|
||||
&:last-child { border-bottom: 0; }
|
||||
&:hover { background: #f6f9fb; }
|
||||
}
|
||||
|
||||
.as-api-name { font-weight: 500; color: var(--as-text); }
|
||||
.as-num { font-variant-numeric: tabular-nums; }
|
||||
}
|
||||
|
||||
// ---------------- 점검 사항 ----------------
|
||||
.as-maint-list { display: grid; gap: 14px; }
|
||||
|
||||
.as-maint-card {
|
||||
background: #fff;
|
||||
border: 1px solid var(--as-border);
|
||||
border-left: 4px solid var(--as-info);
|
||||
border-radius: var(--as-radius);
|
||||
padding: 22px 24px;
|
||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
|
||||
|
||||
&.is-ongoing { border-left-color: var(--as-warn); }
|
||||
|
||||
.as-maint-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.as-maint-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--as-text); }
|
||||
|
||||
.as-schedule {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--as-info);
|
||||
background: var(--as-info-bg);
|
||||
padding: 4px 12px;
|
||||
border-radius: var(--as-pill);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
&.is-ongoing .as-schedule { color: var(--as-warn); background: var(--as-warn-bg); }
|
||||
|
||||
.as-maint-body { margin: 14px 0 12px; font-size: 14px; line-height: 1.6; color: var(--as-text-3); }
|
||||
|
||||
.as-maint-meta {
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
color: var(--as-muted);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- 지난 이슈 / 이슈 이력 카드 ----------------
|
||||
.as-issue-list { display: grid; gap: 24px; }
|
||||
|
||||
.as-issue-group {
|
||||
.as-date-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
margin: 0 4px 10px;
|
||||
padding-bottom: 8px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--as-text-2);
|
||||
border-bottom: 1px solid var(--as-border);
|
||||
}
|
||||
}
|
||||
|
||||
.as-issue-card {
|
||||
background: #fff;
|
||||
border: 1px solid var(--as-border);
|
||||
border-radius: var(--as-radius);
|
||||
padding: 22px 26px 24px;
|
||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
|
||||
|
||||
&.is-incident { border-left: 4px solid var(--as-err); }
|
||||
&.is-degraded { border-left: 4px solid var(--as-warn); }
|
||||
&.is-maintenance { border-left: 4px solid var(--as-info); }
|
||||
|
||||
.as-issue-meta-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 12px;
|
||||
color: var(--as-muted);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.as-issue-title {
|
||||
margin: 0 0 18px;
|
||||
font-size: 19px;
|
||||
font-weight: 800;
|
||||
line-height: 1.3;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
&.is-incident .as-issue-title { color: var(--as-err); }
|
||||
&.is-degraded .as-issue-title { color: var(--as-warn); }
|
||||
&.is-maintenance .as-issue-title { color: var(--as-info); }
|
||||
}
|
||||
|
||||
// 세로 타임라인
|
||||
.as-tl-block {
|
||||
position: relative;
|
||||
padding-left: 24px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 8px;
|
||||
bottom: 8px;
|
||||
width: 1px;
|
||||
background: var(--as-border);
|
||||
}
|
||||
}
|
||||
|
||||
.as-tl-item {
|
||||
position: relative;
|
||||
padding-bottom: 22px;
|
||||
|
||||
&:last-child { padding-bottom: 0; }
|
||||
|
||||
+ .as-tl-item {
|
||||
margin-top: 4px;
|
||||
padding-top: 22px;
|
||||
border-top: 1px dashed var(--as-border);
|
||||
}
|
||||
|
||||
.as-dot {
|
||||
position: absolute;
|
||||
left: -24px;
|
||||
top: 6px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #fff;
|
||||
background: var(--as-muted);
|
||||
box-shadow: 0 0 0 1px var(--as-border-strong);
|
||||
}
|
||||
|
||||
&.state-RESOLVED .as-dot { background: var(--as-ok); box-shadow: 0 0 0 1px var(--as-ok); }
|
||||
&.state-MONITORING .as-dot { background: var(--as-warn); box-shadow: 0 0 0 1px var(--as-warn); }
|
||||
&.state-IDENTIFIED .as-dot { background: #c95a0f; box-shadow: 0 0 0 1px #c95a0f; }
|
||||
&.state-INVESTIGATING .as-dot { background: var(--as-warn); box-shadow: 0 0 0 1px var(--as-warn); }
|
||||
&.state-CANCELED .as-dot { background: var(--as-muted); box-shadow: 0 0 0 1px var(--as-muted); }
|
||||
|
||||
.as-tl-label { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--as-text); }
|
||||
.as-tl-body { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--as-text); white-space: pre-line; }
|
||||
|
||||
.as-tl-ts {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: var(--as-muted);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
}
|
||||
|
||||
.as-more-link {
|
||||
display: block;
|
||||
margin-top: 14px;
|
||||
text-align: right;
|
||||
font-size: 13px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
// ---------------- 이슈 이력 페이지 ----------------
|
||||
.as-index-bar {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
align-items: stretch;
|
||||
height: 44px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.as-index-cell {
|
||||
flex: 1 0 4px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
border-radius: 2px;
|
||||
background: var(--as-none-bg); // 이슈 없음 = 정상(메인 가동률 바와 동일)
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s;
|
||||
|
||||
&.has-incident { background: var(--as-err); }
|
||||
&.has-degraded { background: var(--as-warn); }
|
||||
&.has-maintenance { background: var(--as-info); }
|
||||
// 유형이 2종 이상 섞인 날
|
||||
&.has-mixed,
|
||||
&.has-both { background: var(--as-both); }
|
||||
&.is-selected { outline: 2px solid var(--as-text-2); outline-offset: 1px; }
|
||||
&:hover { opacity: 0.75; }
|
||||
}
|
||||
|
||||
.as-filter-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
flex-wrap: wrap;
|
||||
background: #fff;
|
||||
border: 1px solid var(--as-border);
|
||||
border-radius: var(--as-radius);
|
||||
padding: 14px 18px;
|
||||
font-size: 13px;
|
||||
|
||||
.as-filter-field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.as-filter-label {
|
||||
font-weight: 500;
|
||||
color: var(--as-text-2);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.as-filter-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-left: auto;
|
||||
color: var(--as-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.as-filter-count b { color: var(--as-text); }
|
||||
}
|
||||
|
||||
.as-input {
|
||||
height: 34px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--as-border-strong);
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
color: var(--as-text);
|
||||
background: #fff;
|
||||
max-width: 100%;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: var(--as-info);
|
||||
box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
// 값 지우기 버튼이 붙는 입력 컨트롤 (날짜 / API)
|
||||
.as-field-control {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
input { padding-right: 30px; }
|
||||
|
||||
// type=search 의 네이티브 지우기 버튼은 자체 버튼과 중복이라 감춘다
|
||||
input[type='search'] {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
|
||||
&::-webkit-search-cancel-button,
|
||||
&::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
|
||||
}
|
||||
}
|
||||
|
||||
.as-field-clear {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 6px;
|
||||
transform: translateY(-50%);
|
||||
display: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 50%;
|
||||
background: var(--as-gray-bg);
|
||||
color: var(--as-text-3);
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover { background: var(--as-border-strong); color: var(--as-text); }
|
||||
}
|
||||
|
||||
.as-filter-field.has-value .as-field-clear { display: block; }
|
||||
|
||||
// 날짜 입력은 네이티브 달력 아이콘과 겹치지 않게 여유를 둔다
|
||||
#filterDateInput { padding-right: 52px; }
|
||||
|
||||
// API 라이브서치 콤보박스
|
||||
.as-combo {
|
||||
.as-field-control {
|
||||
min-width: 240px;
|
||||
flex: 1 1 240px;
|
||||
}
|
||||
|
||||
input { width: 100%; }
|
||||
|
||||
.as-combo-list {
|
||||
position: absolute;
|
||||
z-index: 20;
|
||||
top: calc(100% + 4px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
max-height: 280px;
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
overflow-y: auto;
|
||||
list-style: none;
|
||||
background: #fff;
|
||||
border: 1px solid var(--as-border-strong);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
|
||||
}
|
||||
|
||||
.as-combo-item {
|
||||
padding: 8px 10px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
&:hover { background: var(--as-info-bg); }
|
||||
}
|
||||
|
||||
.as-combo-empty {
|
||||
padding: 10px;
|
||||
color: var(--as-muted);
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
// 포탈에 게시되지 않은 API 필터 안내
|
||||
.as-unlisted-banner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 12px 18px;
|
||||
border: 1px solid var(--as-border);
|
||||
border-left: 4px solid var(--as-muted);
|
||||
border-radius: var(--as-radius);
|
||||
background: #f6f8fa;
|
||||
font-size: 13px;
|
||||
color: var(--as-text-3);
|
||||
|
||||
b { color: var(--as-text); }
|
||||
|
||||
.as-unlisted-icon {
|
||||
flex: 0 0 auto;
|
||||
color: var(--as-muted);
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.as-pager {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
margin-top: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
// 필터/페이저 버튼 (전역 버튼 클래스에 의존하지 않는다)
|
||||
.as-btn {
|
||||
min-width: 32px;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid var(--as-border-strong);
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
color: var(--as-text-2);
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover { background: #f6f9fb; }
|
||||
|
||||
&.is-current {
|
||||
border-color: var(--as-info);
|
||||
background: var(--as-info);
|
||||
color: #fff;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- 반응형 ----------------
|
||||
@media (max-width: 960px) {
|
||||
.as-filter-bar {
|
||||
gap: 10px;
|
||||
|
||||
.as-filter-right { margin-left: 0; width: 100%; justify-content: flex-end; }
|
||||
}
|
||||
|
||||
.as-my-apis {
|
||||
table { display: block; overflow-x: auto; white-space: nowrap; }
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
gap: 16px;
|
||||
padding-bottom: 48px;
|
||||
|
||||
&.is-standalone { padding-top: 32px; }
|
||||
|
||||
.as-card { padding: 18px 16px; }
|
||||
|
||||
.as-card-head { margin-bottom: 12px; }
|
||||
|
||||
.as-alert-card .as-tl-row { grid-template-columns: 52px 1fr; }
|
||||
.as-alert-card .as-tl-who { display: none; }
|
||||
.as-alert-card .as-alert-title { font-size: 18px; }
|
||||
|
||||
// 필터: 라벨 + 입력을 한 줄씩 쌓는다
|
||||
.as-filter-bar {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
padding: 14px;
|
||||
|
||||
.as-filter-field { flex-direction: column; align-items: flex-start; gap: 6px; }
|
||||
|
||||
// 세로 스택에서는 flex-basis 가 높이로 해석되므로 반드시 해제한다
|
||||
.as-input,
|
||||
.as-field-control { flex: 0 0 auto; width: 100%; min-width: 0; }
|
||||
|
||||
.as-filter-right { justify-content: space-between; }
|
||||
}
|
||||
|
||||
// 90일 바: 셀을 균등 축소하지 않고 최소 터치 폭을 보장한 뒤 가로 스크롤
|
||||
.as-index-bar {
|
||||
height: 40px;
|
||||
|
||||
.as-index-cell { flex: 0 0 12px; }
|
||||
}
|
||||
|
||||
.as-uptime .as-bar-chart .as-bar { flex: 0 0 12px; }
|
||||
|
||||
.as-issue-card { padding: 18px 16px; }
|
||||
.as-issue-title { font-size: 17px; }
|
||||
|
||||
.as-maint-card { padding: 18px 16px; }
|
||||
|
||||
.as-uptime .as-bar-chart { height: 44px; }
|
||||
|
||||
.as-issue-list { gap: 16px; }
|
||||
|
||||
.as-pager button { min-width: 30px; padding: 0 8px; }
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.as-section-title h2 { font-size: 18px; }
|
||||
|
||||
.as-legend { gap: 8px; font-size: 11px; }
|
||||
|
||||
.as-tl-block { padding-left: 18px; }
|
||||
.as-tl-item .as-dot { left: -18px; }
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
.form-input:disabled,
|
||||
.input-readonly {
|
||||
background: #ededed;
|
||||
background: #e9ecef !important;
|
||||
}
|
||||
|
||||
.compound-input {
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
background: none;
|
||||
padding: 0 0 $spacing-md 0;
|
||||
border-radius: 0;
|
||||
border-bottom: 2px solid #212529;
|
||||
border-bottom: 1px solid #212529;
|
||||
margin-bottom: $spacing-xl;
|
||||
|
||||
h3 {
|
||||
@@ -124,82 +124,77 @@
|
||||
|
||||
// Info Notice
|
||||
.org-info-notice {
|
||||
border-radius: $border-radius-md;
|
||||
margin-bottom: $spacing-md;
|
||||
background: #FFF5F5;
|
||||
border: 1px solid #FED7D7;
|
||||
border-radius: 8px;
|
||||
padding: 14px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-top: $spacing-md;
|
||||
margin-bottom: $spacing-xl;
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
.notice-icon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #E53E3E;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.notice-text {
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #C53030;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
|
||||
li {
|
||||
position: relative;
|
||||
padding-left: $spacing-lg;
|
||||
color: $text-gray;
|
||||
font-size: $font-size-sm;
|
||||
line-height: 1.6;
|
||||
|
||||
&::before {
|
||||
content: '•';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
color: $primary-blue;
|
||||
font-weight: $font-weight-bold;
|
||||
}
|
||||
|
||||
& + li {
|
||||
margin-top: $spacing-sm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Form Groups
|
||||
.org-form-group {
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 26px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 20px;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 13px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@include respond-to('sm') {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.org-form-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $spacing-sm;
|
||||
font-size: 15px;
|
||||
font-weight: $font-weight-regular;
|
||||
color: $text-dark;
|
||||
min-width: 160px;
|
||||
padding-top: 10px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #1A202C;
|
||||
width: auto;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
.required-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2px 8px;
|
||||
background: #3BA4ED;
|
||||
color: $white;
|
||||
font-size: 12px;
|
||||
font-weight: $font-weight-medium;
|
||||
border-radius: 4px;
|
||||
line-height: 1.2;
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
width: 10px;
|
||||
|
||||
&::after {
|
||||
content: '*';
|
||||
visibility: visible;
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 0;
|
||||
color: #f4253c;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include respond-to('sm') {
|
||||
min-width: auto;
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.org-form-input-wrapper {
|
||||
flex: 1;
|
||||
@@ -217,6 +212,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $spacing-md;
|
||||
width: 100%;
|
||||
max-width: 650px;
|
||||
|
||||
.org-form-input,
|
||||
.org-compound-input,
|
||||
@@ -249,18 +246,20 @@
|
||||
// Input Fields
|
||||
.org-form-input {
|
||||
width: 100%;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid $border-gray;
|
||||
border-radius: $border-radius-md;
|
||||
padding: 10px 16px;
|
||||
border: 1px solid #CBD5E0;
|
||||
border-radius: 8px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
color: $text-dark;
|
||||
transition: $transition-base;
|
||||
background: $white;
|
||||
color: #1A202C;
|
||||
transition: all 0.3s ease;
|
||||
background: #FCFDFD;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: $primary-blue;
|
||||
box-shadow: 0 0 0 3px rgba(75, 155, 255, 0.1);
|
||||
border-color: #0049B4; // Brand primary blue
|
||||
box-shadow: 0 0 0 3px rgba(0, 73, 180, 0.15);
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
@@ -278,7 +277,7 @@
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: $text-light;
|
||||
color: #A0AEC0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,9 +288,13 @@
|
||||
gap: $spacing-sm;
|
||||
width: 100%;
|
||||
|
||||
&.phone-input-group {
|
||||
flex: none;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.org-form-input,
|
||||
.org-form-select {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@@ -448,18 +451,23 @@
|
||||
}
|
||||
|
||||
.org-btn-check {
|
||||
padding: 8px 16px;
|
||||
padding: 10px 20px;
|
||||
width: auto;
|
||||
min-width: 100px;
|
||||
background: #A4D6EA;
|
||||
color: $white;
|
||||
border: 1px solid #A4D6EA;
|
||||
border-radius: $border-radius-md;
|
||||
border-radius: 8px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
// transition: all 0.2s ease;
|
||||
background: #3BA4ED;
|
||||
border: 1px solid #3BA4ED;
|
||||
|
||||
&:not(:disabled):hover {
|
||||
background: #008BC0;
|
||||
border-color: #008BC0;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
@@ -564,10 +572,9 @@
|
||||
.org-action-buttons {
|
||||
display: flex;
|
||||
gap: $spacing-lg;
|
||||
justify-content: center;
|
||||
justify-content: end;
|
||||
margin-top: $spacing-4xl;
|
||||
padding-top: $spacing-3xl;
|
||||
border-top: 1px solid $border-gray;
|
||||
|
||||
.btn {
|
||||
width: 220px;
|
||||
@@ -627,15 +634,18 @@
|
||||
padding: $spacing-sm $spacing-md;
|
||||
border-radius: $border-radius-sm;
|
||||
font-size: $font-size-sm;
|
||||
display: none;
|
||||
|
||||
&.success {
|
||||
background: rgba(107, 207, 127, 0.1);
|
||||
color: $accent-green;
|
||||
display: block;
|
||||
}
|
||||
|
||||
&.error {
|
||||
background: rgba(255, 107, 107, 0.1);
|
||||
color: $accent-orange;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,6 +720,7 @@
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
margin-bottom: 90px;
|
||||
font-family: $font-family-primary;
|
||||
}
|
||||
|
||||
// Agree All Section
|
||||
@@ -847,13 +858,15 @@
|
||||
// Agreement Content
|
||||
.agreement-content {
|
||||
margin-top: $spacing-md;
|
||||
background: $main-bg;
|
||||
background: #f9f9f9;
|
||||
border-radius: 10px;
|
||||
padding: 22px;
|
||||
}
|
||||
|
||||
.agreement-scroll {
|
||||
max-height: 300px;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
padding: $spacing-lg;
|
||||
// padding: $spacing-lg;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
@@ -879,7 +892,12 @@
|
||||
line-height: 1.8;
|
||||
color: $text-gray;
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
color: $text-dark;
|
||||
margin-top: $spacing-lg;
|
||||
margin-bottom: $spacing-md;
|
||||
@@ -890,7 +908,8 @@
|
||||
margin-bottom: $spacing-md;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
ul,
|
||||
ol {
|
||||
margin-left: $spacing-lg;
|
||||
margin-bottom: $spacing-md;
|
||||
}
|
||||
@@ -900,7 +919,8 @@
|
||||
border-collapse: collapse;
|
||||
margin-bottom: $spacing-md;
|
||||
|
||||
th, td {
|
||||
th,
|
||||
td {
|
||||
border: 1px solid $border-gray;
|
||||
padding: $spacing-sm;
|
||||
text-align: left;
|
||||
@@ -947,3 +967,22 @@
|
||||
padding: $spacing-md;
|
||||
}
|
||||
}
|
||||
|
||||
// Premium card wrapper for registration forms
|
||||
.register-card-wrapper {
|
||||
background: #FFFFFF;
|
||||
border: 1px solid rgba(226, 232, 240, 0.8);
|
||||
border-radius: 20px;
|
||||
padding: 48px 40px;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
|
||||
margin-top: 30px;
|
||||
margin-bottom: 60px;
|
||||
width: 100%;
|
||||
|
||||
@include respond-to('sm') {
|
||||
padding: 24px 16px;
|
||||
border-radius: 12px;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
}
|
||||
@@ -7,16 +7,14 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
.signup-selection-page {
|
||||
min-height: calc(100vh - 380px); // Account for header and footer
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #EDF9FE; // Light blue background from Figma (same as login)
|
||||
padding: 30px 20px;
|
||||
padding: 100px 20px;
|
||||
position: relative;
|
||||
border-radius: 12px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
margin-top: 60px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.signup-selection-container {
|
||||
@@ -38,118 +36,225 @@
|
||||
}
|
||||
}
|
||||
|
||||
.signup-logo {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
margin-bottom: 15px;
|
||||
|
||||
img {
|
||||
.signup-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 40px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.signup-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
color: #000000;
|
||||
|
||||
.signup-title-icon {
|
||||
color: #000000;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.signup-title {
|
||||
font-family: $font-family-primary;
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
margin: 0;
|
||||
letter-spacing: -0.5px;
|
||||
}
|
||||
}
|
||||
|
||||
.signup-message {
|
||||
font-family: $font-family-primary;
|
||||
font-size: 20px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
color: #718096;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.signup-buttons {
|
||||
.signup-cards {
|
||||
width: 100%;
|
||||
max-width: 504px;
|
||||
max-width: 760px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 28px;
|
||||
margin-bottom: 45px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.signup-card-item {
|
||||
flex: 1;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid rgba(226, 232, 240, 0.8);
|
||||
border-radius: 24px;
|
||||
padding: 45px 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.signup-btn {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
padding: 10px;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 12px;
|
||||
transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
color: #1A202C;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
line-height: 1;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
// Background subtle glow effect on hover
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.8), transparent 70%);
|
||||
opacity: 0;
|
||||
transition: opacity 0.4s ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.signup-btn-icon {
|
||||
width: 26px;
|
||||
height: 30px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.signup-btn-individual {
|
||||
background: #0049B4;
|
||||
}
|
||||
|
||||
.signup-btn-organization {
|
||||
background: #00A1D7;
|
||||
}
|
||||
|
||||
.signup-navigation {
|
||||
.card-icon-wrapper {
|
||||
width: 76px;
|
||||
height: 76px;
|
||||
border-radius: 22px; // Squircle style
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 26px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
margin-bottom: 24px;
|
||||
transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
.signup-nav-link {
|
||||
.card-text-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-family: $font-family-primary;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
transition: color 0.3s ease;
|
||||
line-height: 1;
|
||||
font-size: 22px;
|
||||
font-weight: 800;
|
||||
margin-top: 0;
|
||||
margin-bottom: 12px;
|
||||
line-height: 1.3;
|
||||
color: #1A202C;
|
||||
transition: all 0.4s ease;
|
||||
}
|
||||
|
||||
.card-desc {
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
color: #718096;
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
max-width: 250px;
|
||||
word-break: keep-all;
|
||||
transition: color 0.4s ease;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: #0049B4;
|
||||
text-decoration: underline;
|
||||
transform: translateY(-8px);
|
||||
background: #FFFFFF;
|
||||
|
||||
&::before {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.signup-nav-separator {
|
||||
color: #000000;
|
||||
font-size: 16px;
|
||||
line-height: 1;
|
||||
&.individual-card {
|
||||
.card-icon-wrapper {
|
||||
background: linear-gradient(135deg, #F0F5FF 0%, #D8E5FF 100%);
|
||||
color: #0049B4;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: #0049B4;
|
||||
box-shadow: 0 20px 40px rgba(0, 73, 180, 0.12);
|
||||
|
||||
.card-title {
|
||||
color: #0049B4;
|
||||
}
|
||||
|
||||
.card-icon-wrapper {
|
||||
background: linear-gradient(135deg, #0049B4 0%, #0066FF 100%);
|
||||
color: #FFFFFF;
|
||||
transform: scale(1.05) rotate(3deg);
|
||||
box-shadow: 0 10px 20px rgba(0, 73, 180, 0.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.organization-card {
|
||||
.card-icon-wrapper {
|
||||
background: linear-gradient(135deg, #EBF8FF 0%, #CAF0F8 100%);
|
||||
color: #00A1D7;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: #00A1D7;
|
||||
box-shadow: 0 20px 40px rgba(0, 161, 215, 0.12);
|
||||
|
||||
.card-title {
|
||||
color: #00A1D7;
|
||||
}
|
||||
|
||||
.card-icon-wrapper {
|
||||
background: linear-gradient(135deg, #00A1D7 0%, #33C2FF 100%);
|
||||
color: #FFFFFF;
|
||||
transform: scale(1.05) rotate(-3deg);
|
||||
box-shadow: 0 10px 20px rgba(0, 161, 215, 0.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signup-navigation-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #EDF4FF;
|
||||
border: 1px solid #0049B4;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
height: 42px;
|
||||
max-width: 280px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
|
||||
.signup-nav-btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: $font-family-primary;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: #0049B4;
|
||||
text-decoration: none;
|
||||
height: 100%;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: #DCE7FF;
|
||||
}
|
||||
}
|
||||
|
||||
.signup-nav-divider {
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
background: #0049B4;
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive adjustments - Figma Mobile Design (sm: 768px)
|
||||
@include respond-to('sm') {
|
||||
.signup-selection-page {
|
||||
// Figma: 전체 배경 #ebfbff, 풀 높이
|
||||
background: #ebfbff;
|
||||
min-height: calc(100vh - 44px);
|
||||
padding: 40px 20px;
|
||||
@@ -163,73 +268,83 @@
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.signup-selection-card {
|
||||
padding: 0;
|
||||
.signup-header {
|
||||
margin-bottom: 30px;
|
||||
|
||||
.signup-title-row {
|
||||
margin-bottom: 8px;
|
||||
|
||||
.signup-title-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.signup-logo {
|
||||
// Figma: 64px × 64px
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin-bottom: 24px;
|
||||
.signup-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signup-message {
|
||||
// Figma: 14px Regular, #212529
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #212529;
|
||||
margin-bottom: 80px;
|
||||
line-height: 26px;
|
||||
margin-bottom: 40px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.signup-buttons {
|
||||
// Figma: 버튼 간격 24px
|
||||
.signup-cards {
|
||||
max-width: 335px;
|
||||
gap: 24px;
|
||||
margin-bottom: 80px;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.signup-btn {
|
||||
// Figma: 335px × 44px, border-radius 8px
|
||||
.signup-card-item {
|
||||
padding: 24px 20px;
|
||||
border-radius: 12px;
|
||||
flex-direction: row;
|
||||
text-align: left;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
|
||||
.card-icon-wrapper {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
border-radius: 8px;
|
||||
padding: 8px 12px;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
|
||||
svg {
|
||||
width: 14px;
|
||||
height: 16px;
|
||||
flex-shrink: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
text-align: center;
|
||||
.card-text-wrapper {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.card-desc {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
.signup-navigation {
|
||||
// Figma: 14px Regular, #515961, gap 12px
|
||||
gap: 12px;
|
||||
.signup-navigation-box {
|
||||
max-width: 260px;
|
||||
height: 38px;
|
||||
|
||||
.signup-nav-link {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #515961;
|
||||
}
|
||||
|
||||
.signup-nav-separator {
|
||||
font-size: 14px;
|
||||
color: #515961;
|
||||
.signup-nav-btn {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,9 +69,18 @@
|
||||
<div class="tab-content" th:classappend="${activeTab == 'testbed'} ? '' : 'active'" id="api-info-tab">
|
||||
<!-- API Overview Card (Merged with Additional Information) -->
|
||||
<div class="api-overview-card">
|
||||
<!--/* 현재 상태는 게시된 장애·점검 공지 기준(/apistatus/current.json). 조회 실패해도 화면은 유지 */-->
|
||||
<div class="org-section-header org-section-header--agreement api-basic-info-header">
|
||||
<h3>기본 정보</h3>
|
||||
<button type="button" class="btn-action-primary md api-apply-btn">API 사용 신청</button>
|
||||
<div class="api-status-inline" id="apiStatusInline"
|
||||
th:attr="data-api-id=${apiSpecInfo.apiId},
|
||||
data-status-url=@{/apistatus/current.json}">
|
||||
<span class="api-status-inline__label">현재 상태</span>
|
||||
<span class="api-status-inline__badge is-loading" id="apiStatusBadge">조회 중</span>
|
||||
<!--/* apiName 은 표시용 - 이슈 이력 화면 필터는 apiId 로 동작한다 */-->
|
||||
<a class="btn-action-primary md"
|
||||
th:href="@{/apistatus/issues(apiId=${apiSpecInfo.apiId},apiName=${apiSpecInfo.apiName})}">상태 이력 확인</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="api-overview-header">
|
||||
<div class="api-method-badge" th:text="${apiSpecInfo.apiMethod}">GET</div>
|
||||
@@ -475,6 +484,51 @@
|
||||
btn.addEventListener('click', requestApiUse);
|
||||
});
|
||||
|
||||
// ===== 기본 정보: 현재 상태 =====
|
||||
// 게시된 장애·점검 공지 기준(/apistatus/current.json). 상태 이력은 /apistatus/issues?apiId= 로 이어진다.
|
||||
(function loadApiCurrentStatus() {
|
||||
const box = document.getElementById('apiStatusInline');
|
||||
const badge = document.getElementById('apiStatusBadge');
|
||||
if (!box || !badge) return;
|
||||
|
||||
const apiId = box.getAttribute('data-api-id');
|
||||
const statusUrl = box.getAttribute('data-status-url');
|
||||
if (!apiId || !statusUrl) return;
|
||||
|
||||
const BADGE_CLASS = {
|
||||
OUTAGE: 'is-outage',
|
||||
DEGRADED: 'is-degraded',
|
||||
MAINTENANCE: 'is-maintenance',
|
||||
NORMAL: 'is-normal'
|
||||
};
|
||||
|
||||
function paint(cls, text, tooltip) {
|
||||
badge.className = 'api-status-inline__badge ' + cls;
|
||||
badge.textContent = text;
|
||||
if (tooltip) badge.setAttribute('title', tooltip);
|
||||
else badge.removeAttribute('title');
|
||||
}
|
||||
|
||||
fetch(statusUrl + '?apiId=' + encodeURIComponent(apiId), { credentials: 'same-origin' })
|
||||
.then(function (r) {
|
||||
if (!r.ok) throw new Error('HTTP ' + r.status);
|
||||
return r.json();
|
||||
})
|
||||
.then(function (status) {
|
||||
const tooltip = [
|
||||
status.activeIncidentTitle,
|
||||
status.statusSince ? '시작 ' + status.statusSince : null,
|
||||
status.expectedEndAt ? '종료 예정 ' + status.expectedEndAt : null
|
||||
].filter(Boolean).join('\n');
|
||||
paint(BADGE_CLASS[status.currentStatus] || 'is-muted',
|
||||
status.currentStatusLabel || '정상', tooltip);
|
||||
})
|
||||
.catch(function (e) {
|
||||
console.error('API 현재 상태 조회 실패', e);
|
||||
paint('is-muted', '상태 확인 불가');
|
||||
});
|
||||
})();
|
||||
|
||||
// ===== DJPGPT0001: 앱 인증 정보 자동 주입 =====
|
||||
const DEFAULT_TOKEN_API_ID = 'default-token-api-spec';
|
||||
const appsSelect = document.getElementById('apps');
|
||||
|
||||
@@ -75,14 +75,21 @@
|
||||
</div>
|
||||
|
||||
<!-- API Cards Grid -->
|
||||
<div class="api-card-grid" th:if="${apis != null and !apis.isEmpty()}">
|
||||
<div class="api-card-grid" th:if="${apis != null and !apis.isEmpty()}"
|
||||
th:attr="data-status-url=@{/apistatus/current-list.json}">
|
||||
<div class="api-card" th:each="api : ${apis}" th:data-href="@{/apis/detail(id=${api.apiId})}" role="button"
|
||||
tabindex="0">
|
||||
|
||||
<!-- Group Badge -->
|
||||
<!-- Group Badge + 현재 상태 태그 -->
|
||||
<div class="api-card-badges">
|
||||
<div class="api-card-badge">
|
||||
<span th:text="${api.apiGroupName}">그룹 이름</span>
|
||||
</div>
|
||||
<!--/* 상태 태그 노출은 PTL_PROPERTY(djb.apistatus.api-list-status-badge) 로 제어.
|
||||
값은 로드 후 JS가 채우며, 비어 있는 동안은 CSS(:empty)로 숨긴다 */-->
|
||||
<span th:if="${apiStatusBadgeEnabled}" class="api-card-status"
|
||||
th:attr="data-api-id=${api.apiId}"></span>
|
||||
</div>
|
||||
|
||||
<!-- API Name -->
|
||||
<h3 class="api-card-title" th:text="${api.apiName}">API 이름</h3>
|
||||
@@ -152,6 +159,62 @@
|
||||
});
|
||||
});
|
||||
|
||||
// ===== 카드 현재 상태 태그 =====
|
||||
// 게시된 장애·점검 공지 기준(/apistatus/current-list.json). 태그 자체는 PTL_PROPERTY 로 노출 제어된다.
|
||||
(function loadApiCardStatuses() {
|
||||
const grid = document.querySelector('.api-card-grid');
|
||||
if (!grid) return;
|
||||
|
||||
const statusUrl = grid.getAttribute('data-status-url');
|
||||
const slots = Array.prototype.slice.call(grid.querySelectorAll('.api-card-status[data-api-id]'));
|
||||
if (!statusUrl || !slots.length) return;
|
||||
|
||||
const BADGE_CLASS = {
|
||||
OUTAGE: 'is-outage',
|
||||
DEGRADED: 'is-degraded',
|
||||
MAINTENANCE: 'is-maintenance',
|
||||
NORMAL: 'is-normal'
|
||||
};
|
||||
const CHUNK = 50; // 서버 일괄 조회 상한(100) 이내로 나눠 요청
|
||||
|
||||
// 같은 API 가 여러 카드에 나올 수 있어 apiId → 슬롯 목록으로 묶는다
|
||||
const slotsByApiId = {};
|
||||
slots.forEach(function (el) {
|
||||
const apiId = el.getAttribute('data-api-id');
|
||||
if (!apiId) return;
|
||||
(slotsByApiId[apiId] = slotsByApiId[apiId] || []).push(el);
|
||||
});
|
||||
const apiIds = Object.keys(slotsByApiId);
|
||||
|
||||
function paint(list) {
|
||||
(list || []).forEach(function (status) {
|
||||
const targets = slotsByApiId[status.apiId];
|
||||
const cls = BADGE_CLASS[status.currentStatus];
|
||||
if (!targets || !cls) return;
|
||||
targets.forEach(function (el) {
|
||||
el.className = 'api-card-status ' + cls;
|
||||
el.textContent = status.currentStatusLabel || '';
|
||||
if (status.activeIncidentTitle) el.setAttribute('title', status.activeIncidentTitle);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
for (let index = 0; index < apiIds.length; index += CHUNK) {
|
||||
const query = apiIds.slice(index, index + CHUNK).map(function (apiId) {
|
||||
return 'apiId=' + encodeURIComponent(apiId);
|
||||
}).join('&');
|
||||
|
||||
fetch(statusUrl + '?' + query, { credentials: 'same-origin' })
|
||||
.then(function (r) {
|
||||
if (!r.ok) throw new Error('HTTP ' + r.status);
|
||||
return r.json();
|
||||
})
|
||||
.then(paint)
|
||||
// 상태 조회 실패는 목록 자체를 막지 않는다 (태그는 비어 있는 채로 숨겨진다)
|
||||
.catch(function (e) { console.error('API 현재 상태 조회 실패', e); });
|
||||
}
|
||||
})();
|
||||
|
||||
// Category/Service Selection
|
||||
const menuTitles = document.querySelectorAll('.js-menu-trigger');
|
||||
menuTitles.forEach(function (title) {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
</div>
|
||||
</section>
|
||||
<section layout:fragment="contentFragment">
|
||||
<div class="service-main">
|
||||
<div class="service-main container" style="padding-top: 70px; padding-bottom:100px;">
|
||||
<th:block th:replace="~{fragment/djbank/service_sidebar :: sidebar('profile')}"></th:block>
|
||||
<div class="app-management-content">
|
||||
<div class="password-change-wrapper">
|
||||
<h2 class="page-outer-title">본인 확인</h2>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<!-- Form Content -->
|
||||
<form name="inquiryForm" id="inquiryForm" th:action="${isNew}? @{/inquiry} : @{/inquiry/edit}"
|
||||
th:object="${inquiry}" method="post" enctype="multipart/form-data" class="djb-board-form">
|
||||
<input type="hidden" th:field="*{id}" th:if="${!isNew}">
|
||||
<input type="hidden" th:field="*{id}" th:unless="${isNew}">
|
||||
|
||||
<!-- Subject Field -->
|
||||
<div class="form-group">
|
||||
@@ -85,7 +85,7 @@
|
||||
<input type="file" id="inquiryImage" name="image" class="djb-input"
|
||||
accept="image/png,image/jpeg,image/gif">
|
||||
<small class="form-help-text">jpg, jpeg, png, gif 이미지 1개만 첨부할 수 있습니다.</small>
|
||||
<small th:if="${!isNew and inquiry.attachFile != null and !inquiry.attachFile.isEmpty()}"
|
||||
<small th:if="${isNew != true and inquiry.attachFile != null and !inquiry.attachFile.isEmpty()}"
|
||||
class="form-help-text">현재 첨부된 이미지가 있습니다. 새 파일을 선택하면 교체됩니다.</small>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
const file = fileInput.files[0];
|
||||
|
||||
if (file) {
|
||||
/*[# th:if="${!isInternalUser}"]*/
|
||||
/*[# th:unless="${isInternalUser}"]*/
|
||||
const allowedExtensions = ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.hwp', '.gif', '.jpg', '.jpeg', '.png'];
|
||||
const fileExt = '.' + file.name.split('.').pop().toLowerCase();
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<!doctype html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/kbank_base_layout}">
|
||||
|
||||
<body>
|
||||
<section layout:fragment="contentFragment" class="content">
|
||||
<div class="content_wrap">
|
||||
<div class="account-recovery-container">
|
||||
<div class="account-recovery-card">
|
||||
<!-- 탭 메뉴 -->
|
||||
|
||||
<!-- 탭 메뉴 (pill 스타일) -->
|
||||
<div class="account-recovery-tabs">
|
||||
<a href="#tab1" class="tab-link active" data-tab="tab1">아이디 찾기</a>
|
||||
<a href="#tab2" class="tab-link" data-tab="tab2">비밀번호 초기화</a>
|
||||
@@ -14,19 +16,18 @@
|
||||
|
||||
<!-- 아이디 찾기 폼 -->
|
||||
<div id="tab1" class="account-recovery-form">
|
||||
<form id="findIdForm" role="form" name="findIdForm" th:action="@{/find_id}" method="post" data-form-type="findId">
|
||||
<form id="findIdForm" role="form" name="findIdForm" th:action="@{/find_id}" method="post"
|
||||
data-form-type="findId">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
<input type="hidden" id="findId-phoneNumber" name="phoneNumber">
|
||||
|
||||
<!-- 성명 입력 -->
|
||||
<div class="form-group">
|
||||
<label class="form-label">성명</label>
|
||||
<input type="text" name="name" class="form-input" placeholder="이름" required>
|
||||
<input type="text" name="name" class="form-input" placeholder="성명" required>
|
||||
</div>
|
||||
|
||||
<!-- 휴대폰 번호 입력 -->
|
||||
<div class="form-group">
|
||||
<label class="form-label">휴대폰 번호</label>
|
||||
<div class="phone-input-group">
|
||||
<select class="form-select phone-prefix select_mobile_prefix">
|
||||
<option>선택</option>
|
||||
@@ -46,7 +47,6 @@
|
||||
|
||||
<!-- 인증번호 입력 -->
|
||||
<div class="form-group auth-number-container" id="findId-authNumberContainer" style="display: none;">
|
||||
<label class="form-label">인증번호 입력</label>
|
||||
<div class="auth-input-group">
|
||||
<input type="number" class="form-input auth-input auth-number-input" placeholder="SMS 인증번호" required>
|
||||
<span class="auth-timer" id="findId-certify_time">03:00</span>
|
||||
@@ -63,41 +63,38 @@
|
||||
</div>
|
||||
|
||||
<!-- 비밀번호 초기화 폼 -->
|
||||
<div id="tab2" class="account-recovery-form">
|
||||
<form id="resetPasswordForm" role="form" name="resetPasswordForm" th:action="@{/reset_password}" method="post" data-form-type="resetPassword">
|
||||
<div id="tab2" class="account-recovery-form" style="display: none;">
|
||||
<form id="resetPasswordForm" role="form" name="resetPasswordForm" th:action="@{/reset_password}"
|
||||
method="post" data-form-type="resetPassword">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
<input type="hidden" id="resetPassword-phoneNumber" name="phoneNumber">
|
||||
|
||||
<!-- 인증 방식 선택 -->
|
||||
<div class="form-group">
|
||||
<label class="form-label">초기화 방법</label>
|
||||
<div style="display: flex; gap: 20px; align-items: center;">
|
||||
<label style="display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0;">
|
||||
<!-- 인증 방식 선택 (pill 버튼 스타일) -->
|
||||
<div class="form-group reset-method-group">
|
||||
<div class="reset-method-tabs">
|
||||
<label class="reset-method-tab">
|
||||
<input type="radio" id="radio_hp" name="resetMethod" value="hp" checked>
|
||||
휴대폰 번호
|
||||
<span>휴대폰 번호</span>
|
||||
</label>
|
||||
<label style="display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0;">
|
||||
<label class="reset-method-tab">
|
||||
<input type="radio" id="radio_email" name="resetMethod" value="email_id">
|
||||
이메일 아이디
|
||||
<span>이메일 아이디</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 성명 입력 -->
|
||||
<div class="form-group">
|
||||
<label class="form-label">성명</label>
|
||||
<input type="text" name="name" class="form-input" placeholder="성명" required>
|
||||
</div>
|
||||
|
||||
<!-- 아이디 입력 (이메일) -->
|
||||
<div class="form-group" id="emailInputContainer" style="display: none;">
|
||||
<label class="form-label">이메일 아이디</label>
|
||||
<input type="text" name="emailId" class="form-input" placeholder="이메일 아이디">
|
||||
</div>
|
||||
|
||||
<!-- 휴대폰 번호 입력 -->
|
||||
<div class="form-group" id="phoneInputContainer">
|
||||
<label class="form-label">휴대폰 번호</label>
|
||||
<div class="phone-input-group">
|
||||
<select class="form-select phone-prefix select_mobile_prefix">
|
||||
<option>선택</option>
|
||||
@@ -117,8 +114,7 @@
|
||||
|
||||
<!-- 인증번호 입력 -->
|
||||
<div class="form-group auth-number-container" id="authNumberContainer" style="display: none;">
|
||||
<label class="form-label">인증번호 입력</label>
|
||||
<div class="auth-input-group">
|
||||
<div class="auth-input-group mg-y">
|
||||
<input type="number" class="form-input auth-input auth-number-input" placeholder="SMS 인증번호" required>
|
||||
<span class="auth-timer" id="certify_time">03:00</span>
|
||||
<button type="button" class="auth-verify-button btn_verify_auth">확인</button>
|
||||
@@ -132,6 +128,7 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -216,4 +213,5 @@
|
||||
});
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
<!doctype html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/djbank_title_layout}">
|
||||
|
||||
<body>
|
||||
<section layout:fragment="title">
|
||||
<div class="page-title-banner">
|
||||
@@ -22,13 +23,15 @@
|
||||
<div id="alertContainer"></div>
|
||||
|
||||
<!-- Account Recovery Form -->
|
||||
<form id="accountForm" role="form" name="accountForm" th:action="@{/find_id}" method="post" class="account-recovery-form">
|
||||
<form id="accountForm" role="form" name="accountForm" th:action="@{/find_id}" method="post"
|
||||
class="account-recovery-form">
|
||||
<input type="hidden" id="mobileNumber" name="mobileNumber" th:value="${mobileNumber}">
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group">
|
||||
<label for="userName" class="form-label">성명<span class="required-badge">필수</span></label>
|
||||
<input type="text" id="userName" name="userName" th:value="${userName}" class="form-input" placeholder="성명" required>
|
||||
<input type="text" id="userName" name="userName" th:value="${userName}" class="form-input"
|
||||
placeholder="성명" required>
|
||||
</div>
|
||||
|
||||
<!-- Phone Number Fields -->
|
||||
@@ -45,27 +48,13 @@
|
||||
<option value="018">018</option>
|
||||
</select>
|
||||
<span class="separator">-</span>
|
||||
<input type="tel"
|
||||
id="phoneMiddle"
|
||||
name="phoneMiddle"
|
||||
maxlength="4"
|
||||
class="form-input phone-number"
|
||||
placeholder="1234"
|
||||
pattern="[0-9]*"
|
||||
inputmode="numeric"
|
||||
required>
|
||||
<input type="tel" id="phoneMiddle" name="phoneMiddle" maxlength="4" class="form-input phone-number"
|
||||
placeholder="1234" pattern="[0-9]*" inputmode="numeric" required>
|
||||
<span class="separator">-</span>
|
||||
<input type="tel"
|
||||
id="phoneLast"
|
||||
name="phoneLast"
|
||||
maxlength="4"
|
||||
class="form-input phone-number"
|
||||
placeholder="1234"
|
||||
pattern="[0-9]*"
|
||||
inputmode="numeric"
|
||||
required>
|
||||
<input type="tel" id="phoneLast" name="phoneLast" maxlength="4" class="form-input phone-number"
|
||||
placeholder="1234" pattern="[0-9]*" inputmode="numeric" required>
|
||||
</div>
|
||||
<button type="button" class="btn org-btn-check btn_auth" id="requestAuthButton">
|
||||
<button type="button" class="org-btn-check btn_auth" id="requestAuthButton">
|
||||
인증번호 받기
|
||||
</button>
|
||||
</div>
|
||||
@@ -74,16 +63,9 @@
|
||||
<!-- Auth Number Input -->
|
||||
<div class="form-group auth-number-group" id="authNumberGroup" style="display: none;">
|
||||
<label for="authNumber" class="form-label">인증번호 입력<span class="required-badge">필수</span></label>
|
||||
<div class="auth-input-group">
|
||||
<input type="text"
|
||||
id="authNumber"
|
||||
name="authNumber"
|
||||
maxlength="6"
|
||||
class="form-input auth-input"
|
||||
placeholder="인증번호 6자리"
|
||||
pattern="[0-9]*"
|
||||
inputmode="numeric"
|
||||
required>
|
||||
<div class="auth-input-group mg-y">
|
||||
<input type="text" id="authNumber" name="authNumber" maxlength="6" class="form-input auth-input"
|
||||
placeholder="인증번호 6자리" pattern="[0-9]*" inputmode="numeric" required>
|
||||
<span class="auth-timer" id="authTimer">03:00</span>
|
||||
</div>
|
||||
<button type="button" class="auth-verify-button" id="verifyAuthButton">
|
||||
@@ -343,4 +325,5 @@
|
||||
});
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
<!doctype html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/djbank_title_layout}">
|
||||
|
||||
<body>
|
||||
<section layout:fragment="title">
|
||||
<div class="page-title-banner">
|
||||
@@ -22,32 +23,23 @@
|
||||
<div id="alertContainer"></div>
|
||||
|
||||
<!-- Account Recovery Form -->
|
||||
<form id="accountForm" role="form" name="accountForm" th:action="@{/reset_password}" method="post" class="account-recovery-form">
|
||||
<form id="accountForm" role="form" name="accountForm" th:action="@{/reset_password}" method="post"
|
||||
class="account-recovery-form">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
<input type="hidden" id="mobileNumber" name="mobileNumber" th:value="${mobileNumber}">
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group">
|
||||
<label for="userName" class="form-label">성명<span class="required-badge">필수</span></label>
|
||||
<input type="text"
|
||||
id="userName"
|
||||
name="userName"
|
||||
th:value="${userName}"
|
||||
class="form-input"
|
||||
placeholder="성명"
|
||||
required>
|
||||
<input type="text" id="userName" name="userName" th:value="${userName}" class="form-input"
|
||||
placeholder="성명" required>
|
||||
</div>
|
||||
|
||||
<!-- Email ID Field -->
|
||||
<div class="form-group">
|
||||
<label for="loginId" class="form-label">이메일 아이디<span class="required-badge">필수</span></label>
|
||||
<input type="email"
|
||||
id="loginId"
|
||||
name="loginId"
|
||||
th:value="${loginId}"
|
||||
class="form-input"
|
||||
placeholder="이메일 아이디"
|
||||
required>
|
||||
<input type="email" id="loginId" name="loginId" th:value="${loginId}" class="form-input"
|
||||
placeholder="이메일 아이디" required>
|
||||
</div>
|
||||
|
||||
<!-- Phone Number Fields -->
|
||||
@@ -64,27 +56,13 @@
|
||||
<option value="018">018</option>
|
||||
</select>
|
||||
<span class="separator">-</span>
|
||||
<input type="tel"
|
||||
id="phoneMiddle"
|
||||
name="phoneMiddle"
|
||||
maxlength="4"
|
||||
class="form-input phone-number"
|
||||
placeholder="1234"
|
||||
pattern="[0-9]*"
|
||||
inputmode="numeric"
|
||||
required>
|
||||
<input type="tel" id="phoneMiddle" name="phoneMiddle" maxlength="4" class="form-input phone-number"
|
||||
placeholder="1234" pattern="[0-9]*" inputmode="numeric" required>
|
||||
<span class="separator">-</span>
|
||||
<input type="tel"
|
||||
id="phoneLast"
|
||||
name="phoneLast"
|
||||
maxlength="4"
|
||||
class="form-input phone-number"
|
||||
placeholder="1234"
|
||||
pattern="[0-9]*"
|
||||
inputmode="numeric"
|
||||
required>
|
||||
<input type="tel" id="phoneLast" name="phoneLast" maxlength="4" class="form-input phone-number"
|
||||
placeholder="1234" pattern="[0-9]*" inputmode="numeric" required>
|
||||
</div>
|
||||
<button type="button" class="btn org-btn-check btn_auth" id="requestAuthButton">
|
||||
<button type="button" class="org-btn-check btn_auth" id="requestAuthButton">
|
||||
인증번호 받기
|
||||
</button>
|
||||
</div>
|
||||
@@ -93,16 +71,9 @@
|
||||
<!-- Auth Number Input -->
|
||||
<div class="form-group auth-number-group" id="authNumberGroup" style="display: none;">
|
||||
<label for="authNumber" class="form-label">인증번호 입력<span class="required-badge">필수</span></label>
|
||||
<div class="auth-input-group">
|
||||
<input type="text"
|
||||
id="authNumber"
|
||||
name="authNumber"
|
||||
maxlength="6"
|
||||
class="form-input auth-input"
|
||||
placeholder="인증번호 6자리"
|
||||
pattern="[0-9]*"
|
||||
inputmode="numeric"
|
||||
required>
|
||||
<div class="auth-input-group mg-y">
|
||||
<input type="text" id="authNumber" name="authNumber" maxlength="6" class="form-input auth-input"
|
||||
placeholder="인증번호 6자리" pattern="[0-9]*" inputmode="numeric" required>
|
||||
<span class="auth-timer" id="authTimer">03:00</span>
|
||||
</div>
|
||||
<button type="button" class="auth-verify-button" id="verifyAuthButton">
|
||||
@@ -396,4 +367,5 @@
|
||||
});
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
@@ -32,57 +32,7 @@
|
||||
<!-- App List Container -->
|
||||
<div class="app-list-container-figma">
|
||||
|
||||
<!-- App Requests (Pending) -->
|
||||
<th:block th:if="${appRequests != null and !appRequests.isEmpty()}">
|
||||
<a class="app-card-figma" th:each="request : ${appRequests}"
|
||||
th:href="@{/clients/app_request_detail(id=${request.id})}">
|
||||
|
||||
<!-- App Icon -->
|
||||
<div class="app-card-icon-box">
|
||||
<img th:if="${request.appIconFileId != null}"
|
||||
th:src="@{/file/download(fileSn=1,fileId=${request.appIconFileId})}" alt="App Icon">
|
||||
<svg th:unless="${request.appIconFileId != null}" width="46" height="46" viewBox="0 0 24 24"
|
||||
fill="none" stroke="#64748b" stroke-width="1.5">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
||||
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
||||
<polyline points="21 15 16 10 5 21"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<!-- App Info -->
|
||||
<div class="app-card-info">
|
||||
<div class="app-card-header">
|
||||
<!-- App Name -->
|
||||
<h3 class="app-card-title" th:text="${request.clientName}">앱 이름</h3>
|
||||
<!-- Status Badge -->
|
||||
<span class="app-card-badge"
|
||||
th:classappend="${request.approval != null and request.approval.approvalStatus != null and request.approval.approvalStatus.toString() == 'REQUESTED' ? 'badge-requested' : 'badge-pending'}"
|
||||
th:text="${request.approval != null and request.approval.approvalStatus != null ? request.approval.approvalStatus.description : '승인정보 없음'}">
|
||||
승인정보 없음
|
||||
</span>
|
||||
</div>
|
||||
<!-- App Description & Expected Completion Date -->
|
||||
<div class="app-card-footer-row">
|
||||
<p class="app-card-desc"
|
||||
th:text="${request.appDescription != null ? request.appDescription : '설명 없음'}">
|
||||
앱 설명이 여기에 표시됩니다.
|
||||
</p>
|
||||
<!-- Expected date or placeholder to keep structure aligned -->
|
||||
<span class="app-card-expected-date"
|
||||
th:if="${request.approval != null and request.approval.expectEndDate != null and #strings.length(request.approval.expectEndDate) >= 8}"
|
||||
th:text="|예상 완료일 : ${#strings.substring(request.approval.expectEndDate,4,6)}월 ${#strings.substring(request.approval.expectEndDate,6,8)}일 (${request.approval.expectEndDateDayOfWeek})|">
|
||||
예상 완료일 : 05월 30일 (토)
|
||||
</span>
|
||||
<span class="app-card-expected-date"
|
||||
th:unless="${request.approval != null and request.approval.expectEndDate != null and #strings.length(request.approval.expectEndDate) >= 8}">
|
||||
예상 완료일 : -
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</th:block>
|
||||
|
||||
<!-- API Keys (Approved/Inactive) -->
|
||||
<!-- API Keys (Approved/Inactive) — 승인완료 우선 표시 -->
|
||||
<th:block th:if="${apiKeys != null and !apiKeys.isEmpty()}">
|
||||
<a class="app-card-figma" th:each="apikey : ${apiKeys}"
|
||||
th:href="@{/clients/credential_detail(id=${apikey.clientid})}">
|
||||
@@ -119,6 +69,59 @@
|
||||
</a>
|
||||
</th:block>
|
||||
|
||||
<!-- App Requests (Pending) — 진행중 → 요청됨, 최근 신청 순 -->
|
||||
<th:block th:if="${appRequests != null and !appRequests.isEmpty()}">
|
||||
<a class="app-card-figma" th:each="request : ${appRequests}"
|
||||
th:href="@{/clients/app_request_detail(id=${request.id})}">
|
||||
|
||||
<!-- App Icon -->
|
||||
<div class="app-card-icon-box">
|
||||
<img th:if="${request.appIconFileId != null}"
|
||||
th:src="@{/file/download(fileSn=1,fileId=${request.appIconFileId})}" alt="App Icon">
|
||||
<svg th:unless="${request.appIconFileId != null}" width="46" height="46" viewBox="0 0 24 24"
|
||||
fill="none" stroke="#64748b" stroke-width="1.5">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
||||
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
||||
<polyline points="21 15 16 10 5 21"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<!-- App Info -->
|
||||
<div class="app-card-info">
|
||||
<div class="app-card-header">
|
||||
<!-- App Name -->
|
||||
<h3 class="app-card-title" th:text="${request.clientName}">앱 이름</h3>
|
||||
<!-- Request Type Badge (해지 신청 구분) -->
|
||||
<span class="app-card-badge badge-pending"
|
||||
th:if="${request.type != null and request.type.name() == 'DELETE'}">해지 신청</span>
|
||||
<!-- Status Badge -->
|
||||
<span class="app-card-badge"
|
||||
th:classappend="${request.approval != null and request.approval.approvalStatus != null and request.approval.approvalStatus.toString() == 'REQUESTED' ? 'badge-requested' : 'badge-pending'}"
|
||||
th:text="${request.approval != null and request.approval.approvalStatus != null ? request.approval.approvalStatus.description : '승인정보 없음'}">
|
||||
승인정보 없음
|
||||
</span>
|
||||
</div>
|
||||
<!-- App Description & Expected Completion Date -->
|
||||
<div class="app-card-footer-row">
|
||||
<p class="app-card-desc"
|
||||
th:text="${request.appDescription != null ? request.appDescription : '설명 없음'}">
|
||||
앱 설명이 여기에 표시됩니다.
|
||||
</p>
|
||||
<!-- Expected date or placeholder to keep structure aligned -->
|
||||
<span class="app-card-expected-date"
|
||||
th:if="${request.approval != null and request.approval.expectEndDate != null and #strings.length(request.approval.expectEndDate) >= 8}"
|
||||
th:text="|예상 완료일 : ${#strings.substring(request.approval.expectEndDate,4,6)}월 ${#strings.substring(request.approval.expectEndDate,6,8)}일 (${request.approval.expectEndDateDayOfWeek})|">
|
||||
예상 완료일 : 05월 30일 (토)
|
||||
</span>
|
||||
<span class="app-card-expected-date"
|
||||
th:unless="${request.approval != null and request.approval.expectEndDate != null and #strings.length(request.approval.expectEndDate) >= 8}">
|
||||
예상 완료일 : -
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</th:block>
|
||||
|
||||
<!-- Empty State -->
|
||||
<div class="app-list-empty-figma"
|
||||
th:if="${(appRequests == null or appRequests.isEmpty()) and (apiKeys == null or apiKeys.isEmpty())}">
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<body>
|
||||
<th:block th:fragment="commonUserInfo">
|
||||
<div class="form-row">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">이메일 아이디</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper">
|
||||
<input type="text" th:value="${loginId}" name="loginId" class="form-input input-readonly"
|
||||
placeholder="이메일" disabled="disabled">
|
||||
placeholder="이메일" disabled="disabled" style="background: #ededed !important;">
|
||||
<input type="hidden" th:value="${loginId}" name="loginId">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">성명</span> <span class="required-badge">필수</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper">
|
||||
<input type="text" th:value="${userName}" id="userName" name="userName" class="form-input"
|
||||
placeholder="성명">
|
||||
<input type="text" th:value="${userName}" id="userName" name="userName" class="form-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">휴대폰 번호</span> <span class="required-badge">필수</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper input-with-button"
|
||||
@@ -34,32 +34,21 @@
|
||||
mobileMiddle=${hasHyphen ? (parts != null and #arrays.length(parts) > 1 ? parts[1] : '') : (len == 11 ? #strings.substring(mobileNumber, 3, 7) : (len == 10 ? #strings.substring(mobileNumber, 3, 6) : ''))},
|
||||
mobileLast=${hasHyphen ? (parts != null and #arrays.length(parts) > 2 ? parts[2] : '') : (len == 11 ? #strings.substring(mobileNumber, 7, 11) : (len == 10 ? #strings.substring(mobileNumber, 6, 10) : ''))}">
|
||||
<div class="compound-input">
|
||||
<input type="text"
|
||||
th:value="${mobilePrefix}"
|
||||
name="mobilePrefix"
|
||||
class="form-input input-readonly"
|
||||
maxlength="3"
|
||||
disabled="disabled">
|
||||
<input type="text" th:value="${mobilePrefix}" name="mobilePrefix" class="form-input input-readonly"
|
||||
maxlength="3" disabled="disabled" style="background: #ededed !important;">
|
||||
<span class="separator">-</span>
|
||||
<input type="text"
|
||||
th:value="${mobileMiddle}"
|
||||
name="mobileMiddle"
|
||||
class="form-input input-readonly"
|
||||
maxlength="4"
|
||||
disabled="disabled">
|
||||
<input type="text" th:value="${mobileMiddle}" name="mobileMiddle" class="form-input input-readonly"
|
||||
maxlength="4" disabled="disabled" style="background: #ededed !important;">
|
||||
<span class="separator">-</span>
|
||||
<input type="text"
|
||||
th:value="${mobileLast}"
|
||||
name="mobileLast"
|
||||
class="form-input input-readonly"
|
||||
maxlength="4"
|
||||
disabled="disabled">
|
||||
<input type="text" th:value="${mobileLast}" name="mobileLast" class="form-input input-readonly"
|
||||
maxlength="4" disabled="disabled" style="background: #ededed !important;">
|
||||
</div>
|
||||
<button type="button" class="btn-input-action btn-change change_mobile_phone" id="changePhoneBtn">변경</button>
|
||||
<button type="button" class="btn-input-action btn-change change_mobile_phone"
|
||||
id="changePhoneBtn">변경</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row" id="newPhoneNumberContainer" style="display: none;">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">새 휴대폰 번호</span> <span class="required-badge">필수</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper input-with-button">
|
||||
@@ -88,14 +77,13 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row" id="authNumberContainer" style="display: none;">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">인증번호 입력</span> <span class="required-badge">필수</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper input-with-button">
|
||||
<div class="auth-input-group">
|
||||
<input type="text" id="authNumber" name="authNumber" maxlength="6" pattern="[0-9]*"
|
||||
inputmode="numeric" class="form-input"
|
||||
placeholder="SMS 인증번호 6자리">
|
||||
inputmode="numeric" class="form-input" placeholder="SMS 인증번호 6자리">
|
||||
<span class="auth-timer" id="certify_time">03:00</span>
|
||||
</div>
|
||||
<button type="button" class="btn-input-action btn-auth btn_verify_auth">
|
||||
@@ -410,4 +398,5 @@
|
||||
</script>
|
||||
</th:block>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -190,8 +190,10 @@
|
||||
<div class="dt-actions" style="justify-content: flex-end; gap: 11px; margin-top: 30px;">
|
||||
<a th:href="@{/clients}" class="dt-btn-gray">목록</a>
|
||||
<button type="button" sec:authorize="hasRole('ROLE_API_KEY_REQUEST')" class="dt-btn-red"
|
||||
th:data-client-id="${apiKey.clientid}" onclick="deleteApiKeyFromButton(this)">API 이용 해지</button>
|
||||
<a sec:authorize="hasRole('ROLE_API_KEY_REQUEST')" class="dt-btn-blue"
|
||||
th:data-client-id="${apiKey.clientid}" onclick="deleteApiKeyFromButton(this)"
|
||||
th:disabled="${pendingDeleteRequest}"
|
||||
th:text="${pendingDeleteRequest} ? '해지 승인 대기중' : 'API 이용 해지'">API 이용 해지</button>
|
||||
<a sec:authorize="hasRole('ROLE_API_KEY_REQUEST')" th:unless="${pendingDeleteRequest}" class="dt-btn-blue"
|
||||
th:href="@{/clients/modify/step1(clientId=${apiKey.clientid})}">변경 신청</a>
|
||||
</div>
|
||||
|
||||
@@ -295,44 +297,44 @@
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
|
||||
// Delete API Key function - called from button with data-client-id attribute
|
||||
// API 이용 해지 신청 진입 - 경고 + 사유 모달 (본인 확인은 step-up 2FA가 담당)
|
||||
function deleteApiKeyFromButton(button) {
|
||||
var clientId = $(button).data('client-id');
|
||||
|
||||
customPopups.showConfirm('정말로 이 인증키를 삭제하시겠습니까?', function (confirmed) {
|
||||
if (!confirmed) {
|
||||
return;
|
||||
customPopups.showTerminateRequest({
|
||||
onConfirm: function (reason) {
|
||||
doDeleteApiKey(clientId, reason);
|
||||
}
|
||||
doDeleteApiKey(clientId);
|
||||
});
|
||||
}
|
||||
|
||||
// 인증키 삭제 요청 (step-up 필요 시 2FA 후 동일 요청 재시도)
|
||||
function doDeleteApiKey(clientId) {
|
||||
// 해지 신청 요청 (step-up 필요 시 2FA 후 동일 요청 재시도)
|
||||
function doDeleteApiKey(clientId, reason) {
|
||||
$('.loading-overlay').show();
|
||||
|
||||
$.ajax({
|
||||
url: /*[[@{/clients/api_key_delete}]]*/ '/clients/api_key_delete',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({ clientId: clientId }),
|
||||
data: JSON.stringify({ clientId: clientId, reason: reason }),
|
||||
headers: {
|
||||
'X-XSRF-TOKEN': /*[[${_csrf.token}]]*/ 'token'
|
||||
}
|
||||
}).done(function (response) {
|
||||
if (response && response.success === false) {
|
||||
customPopups.showAlert(response.msg || 'API 삭제에 실패했습니다.');
|
||||
customPopups.showTerminateError(response.msg || '해지 신청에 실패했습니다.');
|
||||
return;
|
||||
}
|
||||
customPopups.showAlert(response.msg || 'API Key가 삭제되었습니다.', function () {
|
||||
customPopups.hideTerminateRequest();
|
||||
customPopups.showAlert(response.msg || '해지 신청이 접수되었습니다. 관리자 승인 후 인증키가 삭제됩니다.', function () {
|
||||
window.location.href = /*[[@{/clients}]]*/ '/clients';
|
||||
});
|
||||
}).fail(function (jqXHR, textStatus, errorThrown) {
|
||||
if (isStepUpRequired(jqXHR)) {
|
||||
requireStepUp('/clients/api_key_delete', function () { doDeleteApiKey(clientId); });
|
||||
requireStepUp('/clients/api_key_delete', function () { doDeleteApiKey(clientId, reason); });
|
||||
return;
|
||||
}
|
||||
customPopups.showAlert('API 삭제 요청 중 오류가 발생했습니다: ' + errorThrown);
|
||||
customPopups.showTerminateError('해지 신청 요청 중 오류가 발생했습니다: ' + errorThrown);
|
||||
}).always(function () {
|
||||
$('.loading-overlay').hide();
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org"
|
||||
layout:decorate="~{layout/djbank_base_layout}">
|
||||
layout:decorate="~{layout/djbank_title_layout}">
|
||||
<body>
|
||||
<section layout:fragment="title">
|
||||
<div class="page-title-banner">
|
||||
@@ -10,19 +10,32 @@
|
||||
</div>
|
||||
</section>
|
||||
<section layout:fragment="contentFragment" class="content">
|
||||
<div class="org-register-page corporate-register">
|
||||
<div class="org-register-container">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
||||
<input type="hidden" name="registrationType" th:value="${registrationType}"/>
|
||||
|
||||
<div class="register-card-wrapper">
|
||||
<!-- Info Notice -->
|
||||
<div class="org-info-notice">
|
||||
<div class="notice-icon-wrapper">
|
||||
<svg class="notice-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<line x1="12" y1="8" x2="12" y2="12" />
|
||||
<line x1="12" y1="16" x2="12.01" y2="16" />
|
||||
</svg>
|
||||
</div>
|
||||
<p class="notice-text">법인회원 전환 신청 완료 후 서비스 또는 API 이용을 하실 수 있습니다.</p>
|
||||
</div>
|
||||
|
||||
<!-- 약관동의 섹션 -->
|
||||
<th:block
|
||||
th:replace="apps/register/userAgreementContent :: agreementContent(${termsOfUse}, ${privacyCollect})"></th:block>
|
||||
<th:block th:replace="~{apps/register/userAgreementContent :: agreementContent(${termsOfUse}, ${privacyCollect})}"></th:block>
|
||||
|
||||
<!-- 법인 기본 정보 폼 -->
|
||||
<form name="portalOrg" id="businessTransferForm" method="post" th:action="@{/mypage/org-transfer}"
|
||||
th:object="${portalOrg}" enctype="multipart/form-data">
|
||||
|
||||
<div class="org-section-header">
|
||||
<div class="org-section-header org-section-header--agreement">
|
||||
<h3>법인 기본 정보</h3>
|
||||
<span class="required-badge">필수 입력</span>
|
||||
</div>
|
||||
@@ -30,16 +43,20 @@
|
||||
<th:block th:replace="~{apps/register/components/orgBasicInfoForm :: orgInfoForm}"></th:block>
|
||||
|
||||
<!-- 법인 관리자 정보 -->
|
||||
<div class="org-section-header">
|
||||
<div class="org-section-header org-section-header--agreement" style="margin-top: 48px;">
|
||||
<h3>법인 관리자 정보</h3>
|
||||
<span class="required-badge">필수 입력</span>
|
||||
</div>
|
||||
|
||||
<div class="org-info-notice">
|
||||
<ul>
|
||||
<li>법인 관리자는 API 신청 및 개발자 초대 등 모든 권한을 보유합니다.</li>
|
||||
<li>법인회원 전환은 반드시 법인이메일 주소로 입력하시기 바랍니다. 개인이메일로 전환 신청시, 법인 승인이 거절 될 수 있습니다</li>
|
||||
</ul>
|
||||
<div class="notice-icon-wrapper">
|
||||
<svg class="notice-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<line x1="12" y1="8" x2="12" y2="12" />
|
||||
<line x1="12" y1="16" x2="12.01" y2="16" />
|
||||
</svg>
|
||||
</div>
|
||||
<p class="notice-text">법인 관리자는 API 신청 및 개발자 초대 등 모든 권한을 보유합니다. 법인회원 전환은 반드시 법인이메일 주소로 입력하시기 바랍니다.</p>
|
||||
</div>
|
||||
|
||||
<div class="org-form-container">
|
||||
@@ -63,6 +80,8 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<th:block layout:fragment="contentScript">
|
||||
<script th:if="${error}" th:inline="javascript">
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/djbank_title_layout}">
|
||||
|
||||
<head>
|
||||
<title>비밀번호 변경</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section layout:fragment="title">
|
||||
<div class="page-title-banner">
|
||||
@@ -21,10 +22,10 @@
|
||||
|
||||
<form id="passwordChangeForm" th:action="@{/password/change}" method="post">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
|
||||
<div class="register-form-container">
|
||||
<div class="info-notice-box">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4685ef" stroke-width="2">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4685ef"
|
||||
stroke-width="2">
|
||||
<circle cx="12" cy="12" r="10"></circle>
|
||||
<path d="M12 16v-4"></path>
|
||||
<path d="M12 8h.01"></path>
|
||||
@@ -54,15 +55,25 @@
|
||||
</div>
|
||||
|
||||
<ul class="password-policy-checklist" data-password-input="newPassword">
|
||||
<li data-rule="length" class="is-idle"><span class="policy-icon"></span><span class="policy-text">영문/숫자/특수문자 포함 8~50자</span></li>
|
||||
<li data-rule="letter" class="is-idle"><span class="policy-icon"></span><span class="policy-text">영문 포함</span></li>
|
||||
<li data-rule="digit" class="is-idle"><span class="policy-icon"></span><span class="policy-text">숫자 포함</span></li>
|
||||
<li data-rule="special" class="is-idle"><span class="policy-icon"></span><span class="policy-text">특수문자 포함</span></li>
|
||||
<li data-rule="nospace" class="is-idle"><span class="policy-icon"></span><span class="policy-text">공백 사용 불가</span></li>
|
||||
<li data-rule="norepeat" class="is-idle"><span class="policy-icon"></span><span class="policy-text">동일 문자 3자리 이상 반복 불가</span></li>
|
||||
<li data-rule="noseq" class="is-idle"><span class="policy-icon"></span><span class="policy-text">연속된 문자/숫자 3자리 이상 불가</span></li>
|
||||
<li data-rule="length" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">영문/숫자/특수문자 포함 8~50자</span></li>
|
||||
<li data-rule="letter" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">영문 포함</span></li>
|
||||
<li data-rule="digit" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">숫자 포함</span></li>
|
||||
<li data-rule="special" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">특수문자 포함</span></li>
|
||||
<li data-rule="nospace" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">공백 사용 불가</span></li>
|
||||
<li data-rule="norepeat" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">동일 문자 3자리 이상 반복 불가</span></li>
|
||||
<li data-rule="noseq" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">연속된 문자/숫자 3자리 이상 불가</span></li>
|
||||
<li data-rule="noid-server" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">아이디(이메일) 포함 불가</span></li>
|
||||
<li data-rule="nomobile-server" class="is-idle"><span class="policy-icon"></span><span
|
||||
class="policy-text">휴대전화 번호 포함 불가</span></li>
|
||||
</ul>
|
||||
<p class="password-policy-note">아이디, 휴대전화 번호는 비밀번호에 사용할 수 없습니다.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-actions" style="justify-content: flex-end;">
|
||||
@@ -80,6 +91,52 @@
|
||||
customPopups.showAlert([[${ error }]]);
|
||||
})
|
||||
</script>
|
||||
<script th:inline="javascript">
|
||||
// 아이디/휴대전화 포함 여부 라이브 체크 — 민감정보를 페이지에 내리지 않고
|
||||
// 서버(/password/content-check, 세션 사용자 기준)로 판정한다. data-rule 이
|
||||
// RULES 에 없는 *-server 항목은 password-policy.js 가 건드리지 않는다.
|
||||
(function () {
|
||||
var input = document.getElementById('newPassword');
|
||||
var liId = document.querySelector('li[data-rule="noid-server"]');
|
||||
var liMobile = document.querySelector('li[data-rule="nomobile-server"]');
|
||||
if (!input || !liId || !liMobile) return;
|
||||
|
||||
function setState(li, state) {
|
||||
li.classList.remove('is-idle', 'is-pass', 'is-fail');
|
||||
li.classList.add(state);
|
||||
}
|
||||
|
||||
var csrfToken = document.querySelector('meta[name="_csrf"]');
|
||||
var csrfHeader = document.querySelector('meta[name="_csrf_header"]');
|
||||
var timer = null;
|
||||
|
||||
input.addEventListener('input', function () {
|
||||
var pw = input.value;
|
||||
if (timer) clearTimeout(timer);
|
||||
if (!pw) {
|
||||
setState(liId, 'is-idle');
|
||||
setState(liMobile, 'is-idle');
|
||||
return;
|
||||
}
|
||||
timer = setTimeout(function () {
|
||||
var headers = {};
|
||||
if (csrfToken && csrfHeader) {
|
||||
headers[csrfHeader.content] = csrfToken.content;
|
||||
}
|
||||
$.ajax({
|
||||
url: /*[[@{/password/content-check}]]*/ '/password/content-check',
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
data: { password: pw }
|
||||
}).done(function (res) {
|
||||
if (input.value !== pw) return; // 입력이 이미 바뀐 응답은 무시
|
||||
setState(liId, res.idIncluded ? 'is-fail' : 'is-pass');
|
||||
setState(liMobile, res.mobileIncluded ? 'is-fail' : 'is-pass');
|
||||
});
|
||||
}, 300);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script th:inline="javascript">
|
||||
// 반영 직전 2FA: twofaRequired 면 제출을 가로채 2FA 팝업 → 성공 시 실제 제출.
|
||||
(function () {
|
||||
@@ -111,4 +168,5 @@
|
||||
</script>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -402,16 +402,17 @@
|
||||
const last = document.getElementById('newMobileLast')?.value.trim();
|
||||
|
||||
if (prefix === '선택' || !middle || !last) return null;
|
||||
return prefix + middle + last;
|
||||
// 저장 표준(하이픈 정규형)에 맞춰 조합
|
||||
return `${prefix}-${middle}-${last}`;
|
||||
},
|
||||
|
||||
// 기존 휴대폰 번호 가져오기 (하이픈 없이)
|
||||
// 기존 휴대폰 번호 가져오기 (하이픈 정규형)
|
||||
getExistingMobileNumber: () => {
|
||||
const prefix = document.querySelector('[name="mobilePrefix"]')?.value;
|
||||
const middle = document.querySelector('[name="mobileMiddle"]')?.value;
|
||||
const last = document.querySelector('[name="mobileLast"]')?.value;
|
||||
|
||||
return prefix + middle + last;
|
||||
return `${prefix}-${middle}-${last}`;
|
||||
},
|
||||
|
||||
// 휴대폰 번호 변경 여부 확인
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</section>
|
||||
<section layout:fragment="contentFragment">
|
||||
<div class="org-register-container">
|
||||
|
||||
<div class="corp-manager-wrapper">
|
||||
<div class="common-title-bar">
|
||||
<h2 class="common-title">기본 정보</h2>
|
||||
</div>
|
||||
@@ -19,7 +19,7 @@
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
||||
<div class="register-form">
|
||||
<div class="form-row">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">소속기관</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper">
|
||||
@@ -40,6 +40,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<th:block layout:fragment="contentScript">
|
||||
@@ -76,7 +77,8 @@
|
||||
const originalPrefix = document.querySelector('input[name="mobilePrefix"]').value;
|
||||
const originalMiddle = document.querySelector('input[name="mobileMiddle"]').value;
|
||||
const originalLast = document.querySelector('input[name="mobileLast"]').value;
|
||||
const originalMobileNumber = `${originalPrefix}${originalMiddle}${originalLast}`;
|
||||
// 저장 표준(하이픈 정규형)에 맞춰 조합 — 미변경 제출 시에도 이 값이 그대로 전송된다
|
||||
const originalMobileNumber = `${originalPrefix}-${originalMiddle}-${originalLast}`;
|
||||
|
||||
// 현재 값들 가져오기
|
||||
const currentName = document.querySelector('input[name="userName"]').value.trim();
|
||||
@@ -102,7 +104,7 @@
|
||||
|
||||
// 하이픈 제거 후 비교
|
||||
const newMobileRaw = newMobileNumber.replace(/-/g, '');
|
||||
if (newMobileRaw !== originalMobileNumber) {
|
||||
if (newMobileRaw !== originalMobileNumber.replace(/-/g, '')) {
|
||||
hasChanges = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/djbank_title_layout}">
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/djbank_title_layout}">
|
||||
|
||||
<body>
|
||||
<section layout:fragment="title">
|
||||
<div class="page-title-banner">
|
||||
@@ -9,54 +9,75 @@
|
||||
</div>
|
||||
</section>
|
||||
<section layout:fragment="contentFragment">
|
||||
<div class="org-register-container">
|
||||
|
||||
<div class="service-main container" style="padding-top: 70px; padding-bottom:100px;">
|
||||
<th:block th:replace="~{fragment/djbank/service_sidebar :: sidebar('profile')}"></th:block>
|
||||
<div class="app-management-content">
|
||||
<div class="corp-manager-wrapper">
|
||||
<!-- 초대 알림 배너 -->
|
||||
<div th:if="${hasPendingInvitation}" class="invitation_alert_banner" style="background-color: #f0f8ff; border: 1px solid #2196F3; border-radius: 4px; padding: 15px 20px; margin: 20px 0;">
|
||||
<div th:if="${hasPendingInvitation}" class="invitation_alert_banner"
|
||||
style="background-color: #f0f8ff; border: 1px solid #2196F3; border-radius: 4px; padding: 15px 20px; margin: 20px 0;">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between;">
|
||||
<div>
|
||||
<strong style="color: #1976D2;">법인 회원 초대가 대기 중입니다</strong>
|
||||
<p style="margin: 5px 0 0 0; color: #666;">기관에서 귀하를 법인 회원으로 초대했습니다. 초대를 수락하면 해당 기관의 법인 회원으로 전환됩니다.</p>
|
||||
<p style="margin: 5px 0 0 0; color: #666;">기관에서 귀하를 법인 회원으로 초대했습니다. 초대를 수락하면 해당 기관의 법인
|
||||
회원으로 전환됩니다.</p>
|
||||
</div>
|
||||
<div>
|
||||
<a th:href="@{/signup/decision(invitation=${invitationToken})}" class="common_btn_type_1 blue" style="white-space: nowrap;">
|
||||
<a th:href="@{/signup/decision(invitation=${invitationToken})}"
|
||||
class="common_btn_type_1 blue" style="white-space: nowrap;">
|
||||
<span>초대 확인</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="page-outer-title">정보 관리</h2>
|
||||
|
||||
<div class="common-title-bar">
|
||||
<h2 class="common-title">기본 정보</h2>
|
||||
</div>
|
||||
<div class="register-form-container">
|
||||
<form id="updateForm" method="post" th:action="@{/mypage/update}" th:object="${user}">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
|
||||
<div class="register-form-container">
|
||||
<!-- Section Title -->
|
||||
<div class="inner-section-title">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="#000"
|
||||
stroke-width="2">
|
||||
<rect x="3" y="3" width="7" height="7"></rect>
|
||||
<rect x="14" y="3" width="7" height="7"></rect>
|
||||
<rect x="14" y="14" width="7" height="7"></rect>
|
||||
<rect x="3" y="14" width="7" height="7"></rect>
|
||||
</svg>
|
||||
<h3>기본 정보</h3>
|
||||
</div>
|
||||
|
||||
<div class="register-form">
|
||||
<th:block th:replace="~{apps/mypage/components/commonUserInfo :: commonUserInfo}"></th:block>
|
||||
<th:block th:replace="~{apps/mypage/components/commonUserInfo :: commonUserInfo}">
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<!-- Corporate Transfer Button -->
|
||||
<div class="corporate-transfer-section">
|
||||
<button type="button" class="btn btn-secondary btn_business btn-block">
|
||||
<div class="corporate-transfer-section" style="margin-top: 24px;">
|
||||
<button type="button" class="btn btn_business"
|
||||
style="background: #FFFFFF; border: 1.5px solid #2a69de; color: #2a69de; font-weight: 700; border-radius: 12px; padding: 12px 24px; font-size: 15px; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; width: 100%; box-shadow: none;">
|
||||
법인회원 전환
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<input type="hidden" name="finalMobileNumber" />
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="form-actions form-actions--with-withdrawal">
|
||||
<a class="withdrawal-link"><img th:src="@{/img/btn_withdrawal.png}" alt="회원탈퇴">회원탈퇴</a>
|
||||
<div class="form-actions-buttons">
|
||||
<button type="button" class="btn btn-submit btn-secondary" th:onclick="|location.href='@{/}'|">취소</button>
|
||||
<button type="button" class="btn btn-submit btn-primary submit-btn">수정</button>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<a class="withdrawal-link btn-withdrawal">회원탈퇴</a>
|
||||
<div class="right-buttons">
|
||||
<button type="button" class="btn-cancel" th:onclick="|location.href='@{/}'|">취소</button>
|
||||
<button type="button" class="btn-apply btn-primary submit-btn">수정</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<th:block layout:fragment="contentScript">
|
||||
<script th:if="${error}" th:inline="javascript">
|
||||
@@ -195,4 +216,5 @@
|
||||
<th:block th:replace="~{fragment/popup/withdrawalPopup :: withdrawalPopup}"></th:block>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/djbank_title_layout}">
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/djbank_title_layout}">
|
||||
|
||||
<body>
|
||||
<section layout:fragment="title">
|
||||
<div class="page-title-banner">
|
||||
@@ -9,61 +9,63 @@
|
||||
</div>
|
||||
</section>
|
||||
<section layout:fragment="contentFragment">
|
||||
<div class="org-register-container">
|
||||
<div class="service-main">
|
||||
<div class="app-management-content">
|
||||
<div class="password-change-wrapper">
|
||||
<h2 class="page-outer-title">이메일 인증</h2>
|
||||
|
||||
<div class="common-title-bar">
|
||||
<h2 class="common-title">이메일 인증</h2>
|
||||
</div>
|
||||
|
||||
<div class="register-form-container">
|
||||
<form id="verificationEmailForm" role="form" name="verificationEmailForm" method="post">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
|
||||
<input type="hidden" id="userId" name="userId" th:value="${userId}">
|
||||
|
||||
<div class="register-form">
|
||||
<!-- 이메일 주소 + 인증코드 받기 버튼 (한 줄) -->
|
||||
<div class="form-row" style="margin-bottom: 0">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<div class="register-form-container">
|
||||
<!-- 안내 Notice Box -->
|
||||
<div class="info-notice-box" style="margin-bottom: 24px;">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4685ef" stroke-width="2">
|
||||
<circle cx="12" cy="12" r="10"></circle>
|
||||
<path d="M12 16v-4"></path>
|
||||
<path d="M12 8h.01"></path>
|
||||
</svg>
|
||||
<p>본인 확인을 위해 이메일 인증을 진행해 주세요. 아래 이메일 주소로 인증코드가 발송됩니다.</p>
|
||||
</div>
|
||||
|
||||
<!-- 이메일 주소 행 -->
|
||||
<div class="form-row">
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">이메일 주소</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper input-with-button">
|
||||
<input type="email" id="email" name="email" class="form-input input-readonly"
|
||||
th:value="${email}" readonly disabled="disabled">
|
||||
<input type="email" id="email" name="email" class="form-input input-readonly" th:value="${email}"
|
||||
readonly disabled="disabled" style="flex: 1;">
|
||||
<button type="button" class="btn-input-action btn-auth btn_send_code">인증코드 받기</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row" style="margin-bottom: 0">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<span class="form-label-text"> </span>
|
||||
</div>
|
||||
<div class="form-field-wrapper">
|
||||
<p class="form-hint" style="margin-top: 0;">위 이메일 주소로 인증코드가 발송됩니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 인증번호 입력 -->
|
||||
<!-- 인증번호 입력 행 (초기 숨김) -->
|
||||
<div class="form-row" id="authCodeContainer" style="display: none;">
|
||||
<div class="form-label-wrapper label-offset">
|
||||
<span class="form-label-text">인증코드 입력</span> <span class="required-badge">필수</span>
|
||||
<div class="form-label-wrapper">
|
||||
<span class="form-label-text">인증코드 입력</span>
|
||||
</div>
|
||||
<div class="form-field-wrapper input-with-button">
|
||||
<div class="auth-input-group">
|
||||
<input type="text" id="authCode" name="authCode" maxlength="6" pattern="[0-9]*"
|
||||
inputmode="numeric" class="form-input"
|
||||
placeholder="이메일로 받은 인증코드 6자리">
|
||||
<span class="auth-timer" id="certify_time">05:00</span>
|
||||
<div class="auth-input-group" style="flex: 1; position: relative;">
|
||||
<input type="text" id="authCode" name="authCode" maxlength="6" pattern="[0-9]*" inputmode="numeric"
|
||||
class="form-input" placeholder="이메일로 받은 인증코드 6자리" style="width: 100%; padding-right: 70px;">
|
||||
<span class="auth-timer" id="certify_time"
|
||||
style="position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 500; font-size: 13px;">05:00</span>
|
||||
</div>
|
||||
<button type="button" class="btn-input-action btn-auth btn_verify_code">인증코드 확인</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="form-actions">
|
||||
<button type="button" class="btn-submit btn-secondary">취소</button>
|
||||
<div class="form-actions" style="justify-content: flex-end; margin-top: 24px;">
|
||||
<div class="right-buttons">
|
||||
<button type="button" class="btn-cancel btn_cancel">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -268,4 +270,5 @@
|
||||
});
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
+24
-25
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/kbank_base_layout}">
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/kbank_base_layout}">
|
||||
|
||||
<body>
|
||||
<th:block th:fragment="commonUserInfo">
|
||||
<div class="org-form-group">
|
||||
@@ -9,23 +10,16 @@
|
||||
</label>
|
||||
<div class="org-form-input-wrapper">
|
||||
<div class="org-input-row">
|
||||
<div class="org-compound-input">
|
||||
<div class="org-compound-input email-input-group">
|
||||
<input type="text" id="userId" class="org-form-input"
|
||||
th:classappend="${isInvited ? 'input-readonly' : ''}"
|
||||
maxlength="30"
|
||||
th:value="${emailId}"
|
||||
th:readonly="${isInvited}"
|
||||
th:placeholder="#{portalUser.Register.email}">
|
||||
th:classappend="${isInvited ? 'input-readonly' : ''}" maxlength="30" th:value="${emailId}"
|
||||
th:readonly="${isInvited}" th:placeholder="#{portalUser.Register.email}">
|
||||
<span class="separator">@</span>
|
||||
<input type="text" id="domain" class="org-form-input"
|
||||
th:classappend="${isInvited ? 'input-readonly' : ''}"
|
||||
maxlength="50"
|
||||
th:value="${domain}"
|
||||
th:readonly="${isInvited}"
|
||||
th:placeholder="#{portalUser.Register.domain}">
|
||||
th:classappend="${isInvited ? 'input-readonly' : ''}" maxlength="50" th:value="${domain}"
|
||||
th:readonly="${isInvited}" th:placeholder="#{portalUser.Register.domain}">
|
||||
</div>
|
||||
<button type="button" class="btn org-btn-check btn_check_email"
|
||||
th:classappend="${isInvited ? 'hidden' : ''}">
|
||||
<button type="button" class="btn-action-primary md" th:classappend="${isInvited ? 'hidden' : ''}">
|
||||
중복체크
|
||||
</button>
|
||||
</div>
|
||||
@@ -33,7 +27,10 @@
|
||||
<input type="hidden" name="registrationType" th:value="${registrationType}" />
|
||||
<input type="hidden" id="registrationScenario" name="registrationScenario" value="new" />
|
||||
<div id="email-validation" class="org-validation-message"></div>
|
||||
</div>
|
||||
<div id="emailTestNotice" class="test-env-notice"
|
||||
style="display: none; margin-top: 8px; padding: 10px 12px; background-color: #FFF4E6; border: 1px solid #FFB84D; border-radius: 4px; font-size: 13px; color: #5D4037; line-height: 1.5;"></div>
|
||||
<input type="hidden" id="emailVerified" name="emailVerified" value="false"/>
|
||||
<div id="email-auth-validation" class="org-validation-message"></div>
|
||||
</div>
|
||||
|
||||
<!-- 이메일 인증 (중복체크 통과 후 노출) -->
|
||||
@@ -43,21 +40,17 @@
|
||||
</label>
|
||||
<div class="org-form-input-wrapper">
|
||||
<div class="org-input-row">
|
||||
<button type="button" class="btn org-btn-check" id="btnSendEmailCode">인증번호 발송</button>
|
||||
<button type="button" class="btn-action-primary md" id="btnSendEmailCode">인증번호 발송</button>
|
||||
</div>
|
||||
<div class="org-input-row" id="emailCodeRow" style="display: none; margin-top: 8px;">
|
||||
<div class="org-compound-input" style="position: relative; flex: 1;">
|
||||
<input type="text" id="emailAuthCode" class="org-form-input" maxlength="6"
|
||||
inputmode="numeric" autocomplete="one-time-code" placeholder="인증번호 6자리">
|
||||
<input type="text" id="emailAuthCode" class="org-form-input" maxlength="6" inputmode="numeric"
|
||||
autocomplete="one-time-code" placeholder="인증번호 6자리">
|
||||
<span class="org-timer" id="emailCertifyTime"
|
||||
style="position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #E11D48;">03:00</span>
|
||||
</div>
|
||||
<button type="button" class="btn org-btn-check" id="btnVerifyEmailCode">인증확인</button>
|
||||
<button type="button" class="btn-action-primary md" id="btnVerifyEmailCode">인증확인</button>
|
||||
</div>
|
||||
<div id="emailTestNotice" class="test-env-notice"
|
||||
style="display: none; margin-top: 8px; padding: 10px 12px; background-color: #FFF4E6; border: 1px solid #FFB84D; border-radius: 4px; font-size: 13px; color: #5D4037; line-height: 1.5;"></div>
|
||||
<input type="hidden" id="emailVerified" name="emailVerified" value="false"/>
|
||||
<div id="email-auth-validation" class="org-validation-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
@@ -197,7 +190,12 @@
|
||||
function setEmailAuthMsg(msg, isError) {
|
||||
var el = $('#email-auth-validation');
|
||||
el.text(msg || '');
|
||||
el.css('color', isError ? '#E11D48' : '#0049B4');
|
||||
if (msg) {
|
||||
el.removeClass('success error').addClass(isError ? 'error' : 'success');
|
||||
el.css('display', 'block');
|
||||
} else {
|
||||
el.css('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
function startEmailCodeTimer() {
|
||||
@@ -292,4 +290,5 @@
|
||||
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/kbank_base_layout}">
|
||||
|
||||
<body>
|
||||
<th:block th:fragment="newUserForm">
|
||||
<div id="newUserFields">
|
||||
@@ -23,7 +24,7 @@
|
||||
</label>
|
||||
<div class="org-form-input-wrapper">
|
||||
<div class="org-input-row">
|
||||
<div class="org-compound-input">
|
||||
<div class="org-compound-input phone-input-group">
|
||||
<select class="org-form-select phone-number" id="phoneMobile">
|
||||
<option value="">선택</option>
|
||||
<option value="010">010</option>
|
||||
@@ -39,7 +40,7 @@
|
||||
<input type="text" id="cellPhone2" maxlength="4" class="org-form-input phone-number"
|
||||
th:placeholder="#{portal.Register.phone2}">
|
||||
</div>
|
||||
<button type="button" class="btn org-btn-check btn_auth">
|
||||
<button type="button" class="btn btn-action-primary md btn_auth">
|
||||
인증번호 받기
|
||||
</button>
|
||||
</div>
|
||||
@@ -57,7 +58,8 @@
|
||||
<div class="org-input-row">
|
||||
<div class="org-auth-input-group">
|
||||
<input type="text" th:field="*{authNumber}" id="authNumber" maxlength="6" pattern="[0-9]*"
|
||||
inputmode="numeric" class="org-form-input" th:placeholder="#{ncrdRegister.validate.authNumber}" required>
|
||||
inputmode="numeric" class="org-form-input" th:placeholder="#{ncrdRegister.validate.authNumber}"
|
||||
required>
|
||||
<span class="org-timer" id="certify_time">03:00</span>
|
||||
</div>
|
||||
<button type="button" class="btn org-btn-check btn_verify_auth">
|
||||
@@ -78,16 +80,27 @@
|
||||
th:placeholder="#{portalUser.Register.pass}">
|
||||
<input type="hidden" name="isPasswordValid" id="isPasswordValid" />
|
||||
<div id="password-validation" class="org-validation-message"></div>
|
||||
<ul class="password-policy-checklist" data-password-input="password">
|
||||
<li data-rule="length" class="is-idle"><span class="policy-icon"></span><span class="policy-text">영문/숫자/특수문자 포함 8~50자</span></li>
|
||||
<li data-rule="letter" class="is-idle"><span class="policy-icon"></span><span class="policy-text">영문 포함</span></li>
|
||||
<li data-rule="digit" class="is-idle"><span class="policy-icon"></span><span class="policy-text">숫자 포함</span></li>
|
||||
<li data-rule="special" class="is-idle"><span class="policy-icon"></span><span class="policy-text">특수문자 포함</span></li>
|
||||
<li data-rule="nospace" class="is-idle"><span class="policy-icon"></span><span class="policy-text">공백 사용 불가</span></li>
|
||||
<li data-rule="norepeat" class="is-idle"><span class="policy-icon"></span><span class="policy-text">동일 문자 3자리 이상 반복 불가</span></li>
|
||||
<li data-rule="noseq" class="is-idle"><span class="policy-icon"></span><span class="policy-text">연속된 문자/숫자 3자리 이상 불가</span></li>
|
||||
<ul class="password-policy-checklist" data-password-input="password"
|
||||
data-context-loginid="loginId" data-context-mobile="mobileNumber">
|
||||
<li data-rule="length" class="is-idle"><span class="policy-icon"></span><span class="policy-text">영문/숫자/특수문자
|
||||
포함 8~50자</span></li>
|
||||
<li data-rule="letter" class="is-idle"><span class="policy-icon"></span><span class="policy-text">영문
|
||||
포함</span></li>
|
||||
<li data-rule="digit" class="is-idle"><span class="policy-icon"></span><span class="policy-text">숫자
|
||||
포함</span></li>
|
||||
<li data-rule="special" class="is-idle"><span class="policy-icon"></span><span class="policy-text">특수문자
|
||||
포함</span></li>
|
||||
<li data-rule="nospace" class="is-idle"><span class="policy-icon"></span><span class="policy-text">공백 사용
|
||||
불가</span></li>
|
||||
<li data-rule="norepeat" class="is-idle"><span class="policy-icon"></span><span class="policy-text">동일 문자
|
||||
3자리 이상 반복 불가</span></li>
|
||||
<li data-rule="noseq" class="is-idle"><span class="policy-icon"></span><span class="policy-text">연속된 문자/숫자
|
||||
3자리 이상 불가</span></li>
|
||||
<li data-rule="noid" class="is-idle"><span class="policy-icon"></span><span class="policy-text">아이디(이메일)
|
||||
포함 불가</span></li>
|
||||
<li data-rule="nomobile" class="is-idle"><span class="policy-icon"></span><span class="policy-text">휴대전화 번호
|
||||
포함 불가</span></li>
|
||||
</ul>
|
||||
<p class="password-policy-note">아이디, 휴대전화 번호는 비밀번호에 사용할 수 없습니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -132,6 +145,10 @@
|
||||
if (mobileNumberInput) {
|
||||
mobileNumberInput.value = formattedNumber;
|
||||
}
|
||||
// hidden 값 변경은 input 이벤트가 없으므로 체크리스트(nomobile) 수동 재판정
|
||||
if (window.PasswordPolicy) {
|
||||
PasswordPolicy.refresh();
|
||||
}
|
||||
return formattedNumber;
|
||||
}
|
||||
|
||||
@@ -423,4 +440,5 @@
|
||||
});
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
@@ -24,8 +24,18 @@
|
||||
<!-- Alert Container -->
|
||||
<div id="alertContainer"></div>
|
||||
|
||||
<div class="org-section-header" style="margin-top: 60px;margin-bottom: 60px;">
|
||||
<h3>법인 회원 가입 후 서비스 또는 API 이용을 하실 수 있습니다.</h3>
|
||||
<!-- Registration Card Wrapper -->
|
||||
<div class="register-card-wrapper">
|
||||
<!-- Info Notice -->
|
||||
<div class="org-info-notice">
|
||||
<div class="notice-icon-wrapper">
|
||||
<svg class="notice-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<line x1="12" y1="8" x2="12" y2="12" />
|
||||
<line x1="12" y1="16" x2="12.01" y2="16" />
|
||||
</svg>
|
||||
</div>
|
||||
<p class="notice-text">법인 회원 가입 후 서비스 또는 API 이용을 하실 수 있습니다.</p>
|
||||
</div>
|
||||
|
||||
<!-- Agreement Section -->
|
||||
@@ -48,9 +58,14 @@
|
||||
</div>
|
||||
|
||||
<div class="org-info-notice">
|
||||
<ul>
|
||||
<li>법인관리자는 API 신청 및 개발자 초대 등 모든 권한을 보유합니다.</li>
|
||||
</ul>
|
||||
<div class="notice-icon-wrapper">
|
||||
<svg class="notice-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<line x1="12" y1="8" x2="12" y2="12" />
|
||||
<line x1="12" y1="16" x2="12.01" y2="16" />
|
||||
</svg>
|
||||
</div>
|
||||
<p class="notice-text">법인관리자는 API 신청 및 개발자 초대 등 모든 권한을 보유합니다.</p>
|
||||
</div>
|
||||
|
||||
<th:block th:if="${registrationType == 'corporate'}">
|
||||
@@ -63,6 +78,7 @@
|
||||
<button type="button" class="btn btn-primary btn_register">가입신청</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Loading Overlay -->
|
||||
<div class="org-loading-overlay" id="loadingOverlay">
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user