parent
5360711d92
commit
0e4e9d6a6b
@ -1,19 +1,41 @@
|
||||
package kr.re.etri.autoflow.payload.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "프로젝트 요청 정보")
|
||||
public class ProjectRequest {
|
||||
|
||||
@Schema(description = "프로젝트 코드", example = "PRJ001")
|
||||
private String prjCd;
|
||||
|
||||
@Schema(description = "프로젝트 명", example = "AI 연구 프로젝트")
|
||||
private String prjNm;
|
||||
|
||||
@Schema(description = "프로젝트 설명", example = "이 프로젝트는 AI 모델 개발을 목표로 합니다.")
|
||||
private String prjDesc;
|
||||
|
||||
@Schema(description = "프로젝트 시작일 (YYYY-MM-DD)", example = "2025-08-01")
|
||||
private String prjStartDt;
|
||||
|
||||
@Schema(description = "프로젝트 종료일 (YYYY-MM-DD)", example = "2025-12-31")
|
||||
private String prjEndDt;
|
||||
|
||||
@Schema(description = "삭제 여부 (Y/N)", example = "N")
|
||||
private String delYn;
|
||||
|
||||
@Schema(description = "등록자 ID", example = "admin")
|
||||
private String regUserId;
|
||||
|
||||
@Schema(description = "등록자 이름", example = "홍길동")
|
||||
private String regUserNm;
|
||||
|
||||
@Schema(description = "수정자 ID", example = "editor01")
|
||||
private String modUserId;
|
||||
|
||||
@Schema(description = "수정자 이름", example = "김수정")
|
||||
private String modUserNm;
|
||||
}
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
package kr.re.etri.autoflow.swagger;
|
||||
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class OpenAPIConfig {
|
||||
|
||||
private static final String SECURITY_SCHEME_NAME = "bezkoder-jwt-cookie";
|
||||
private static final String PRODUCTION_SERVER_URL = "http://cuuva.com:2480/autoflow";
|
||||
private static final String LOCAL_SERVER_URL = "http://localhost:8080";
|
||||
|
||||
@Bean
|
||||
public OpenAPI customOpenAPI() {
|
||||
return new OpenAPI()
|
||||
.info(new Info()
|
||||
.title("My API")
|
||||
.version("v1"))
|
||||
.addSecurityItem(new SecurityRequirement().addList(SECURITY_SCHEME_NAME))
|
||||
.components(new io.swagger.v3.oas.models.Components()
|
||||
.addSecuritySchemes(SECURITY_SCHEME_NAME,
|
||||
.components(createComponents())
|
||||
.addSecurityItem(createSecurityRequirement())
|
||||
.info(createApiInfo())
|
||||
.servers(createServerList());
|
||||
}
|
||||
|
||||
private Components createComponents() {
|
||||
return new Components().addSecuritySchemes(SECURITY_SCHEME_NAME,
|
||||
new SecurityScheme()
|
||||
.name("bezkoder-jwt")
|
||||
.name("bezkoder-jwt") // 쿠키 이름
|
||||
.type(SecurityScheme.Type.APIKEY)
|
||||
.in(SecurityScheme.In.COOKIE)));
|
||||
.in(SecurityScheme.In.COOKIE)
|
||||
);
|
||||
}
|
||||
|
||||
private SecurityRequirement createSecurityRequirement() {
|
||||
return new SecurityRequirement().addList(SECURITY_SCHEME_NAME);
|
||||
}
|
||||
|
||||
private Info createApiInfo() {
|
||||
return new Info()
|
||||
.title("Autoflow API")
|
||||
.description("Autoflow 서비스의 Swagger 문서")
|
||||
.version("1.0.0")
|
||||
.contact(new Contact()
|
||||
.name("API Support")
|
||||
.email("jhg88@cuuva.com"))
|
||||
.license(new License()
|
||||
.name("CUUVA")
|
||||
.url("http://cuuva.com"));
|
||||
}
|
||||
|
||||
private List<Server> createServerList() {
|
||||
return List.of(
|
||||
new Server().url(PRODUCTION_SERVER_URL).description("Production Server"),
|
||||
new Server().url(LOCAL_SERVER_URL).description("Local Server")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue