refactor: 가대상세조회 요청객체 빌더패턴 수정

This commit is contained in:
Daseul Kim 2025-01-08 18:18:00 +09:00
parent e8b13ae9c6
commit 6cd692b544
2 changed files with 45 additions and 146 deletions

View File

@ -1,138 +1,52 @@
package com.interplug.qcast.biz.master;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@Schema(description = "Api 가대 상세 조회 요청 객체 빌더")
public class ApiTrestleDetailBuilder {
@Schema(description = "모듈타입코드")
private String moduleTpCd;
@Schema(description = "모듈타입코드")
private String moduleTpCd;
@Schema(description = "지붕재코드")
private String roofMatlCd;
@Schema(description = "지붕재코드")
private String roofMatlCd;
@Schema(description = "가대메이커코드")
private String trestleMkrCd;
@Schema(description = "가대메이커코드")
private String trestleMkrCd;
@Schema(description = "공법코드")
private String constMthdCd;
@Schema(description = "공법코드")
private String constMthdCd;
@Schema(description = "지붕기초코드")
private String roofBaseCd;
@Schema(description = "지붕기초코드")
private String roofBaseCd;
@Schema(description = "면조도")
private String illuminationTp;
@Schema(description = "면조도")
private String illuminationTp;
@Schema(description = "설치높이")
private String instHt;
@Schema(description = "설치높이")
private String instHt;
@Schema(description = "풍속")
private String stdWindSpeed;
@Schema(description = "풍속")
private String stdWindSpeed;
@Schema(description = "적설량")
private String stdSnowLd;
@Schema(description = "적설량")
private String stdSnowLd;
@Schema(description = "경사도코드")
private String inclCd;
@Schema(description = "시공법")
private String constTp;
@Schema(description = "혼합모듈번호")
private Integer mixMatlNo;
@Schema(description = "하제(망둥어)피치")
private Integer roofPitch;
@Schema(description = "경사도코드")
private String inclCd;
public ApiTrestleDetailBuilder setModuleTpCd(String moduleTpCd){
this.moduleTpCd = moduleTpCd;
return this;
}
public ApiTrestleDetailBuilder setRoofMatlCd(String roofMatlCd){
this.roofMatlCd = roofMatlCd;
return this;
}
public ApiTrestleDetailBuilder setTrestleMkrCd(String trestleMkrCd){
this.trestleMkrCd = trestleMkrCd;
return this;
}
public ApiTrestleDetailBuilder setConstMthdCd(String constMthdCd){
this.constMthdCd = constMthdCd;
return this;
}
public ApiTrestleDetailBuilder setRoofBaseCd(String roofBaseCd){
this.roofBaseCd = roofBaseCd;
return this;
}
public ApiTrestleDetailBuilder setIlluminationTp(String illuminationTp){
this.illuminationTp = illuminationTp;
return this;
}
public ApiTrestleDetailBuilder setInstHt(String instHt){
this.instHt = instHt;
return this;
}
public ApiTrestleDetailBuilder setStdWindSpeed(String stdWindSpeed){
this.stdWindSpeed = stdWindSpeed;
return this;
}
public ApiTrestleDetailBuilder setStdSnowLd(String stdSnowLd){
this.stdSnowLd = stdSnowLd;
return this;
}
public ApiTrestleDetailBuilder setInclCd(String inclCd){
this.inclCd = inclCd;
return this;
}
public ApiTrestleDetailBuilder setConstTp(String constTp){
this.constTp = constTp;
return this;
}
public ApiTrestleDetailBuilder setMixMatlNo(int mixMatlNo){
this.mixMatlNo = mixMatlNo;
return this;
}
public ApiTrestleDetailBuilder setRoofPitch(int roofPitch){
this.roofPitch = roofPitch;
return this;
}
public ApiTrestleDetailBuilder (String moduleTpCd, String roofMatlCd, String trestleMkrCd, String constMthdCd, String roofBaseCd, String illuminationTp,
String instHt, String stdWindSpeed, String stdSnowLd, String inclCd, String constTp, Integer mixMatlNo, Integer roofPitch) {
this.moduleTpCd = moduleTpCd;
this.roofMatlCd = roofMatlCd;
this.trestleMkrCd = trestleMkrCd;
this.constMthdCd = constMthdCd;
this.roofBaseCd = roofBaseCd;
this.illuminationTp = illuminationTp;
this.instHt = instHt;
this.stdWindSpeed = stdWindSpeed;
this.stdSnowLd = stdSnowLd;
this.inclCd = inclCd;
this.constTp = constTp;
this.mixMatlNo = mixMatlNo;
this.roofPitch = roofPitch;
}
public ApiTrestleDetailBuilder build(){
return new ApiTrestleDetailBuilder(moduleTpCd, roofMatlCd, trestleMkrCd, constMthdCd, roofBaseCd, illuminationTp,
instHt, stdWindSpeed, stdSnowLd, inclCd, constTp, mixMatlNo, roofPitch);
}
}
@Schema(description = "시공법")
private String constTp;
@Schema(description = "혼합모듈번호")
private Integer mixMatlNo;
@Schema(description = "하제(망둥어)피치")
private Integer roofPitch;
}

View File

@ -205,36 +205,21 @@ public class MasterController {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
}
ApiTrestleDetailBuilder apiTrestleDetailBuilder =
new ApiTrestleDetailBuilder(
moduleTpCd,
roofMatlCd,
trestleMkrCd,
constMthdCd,
roofBaseCd,
illuminationTp,
instHt,
stdWindSpeed,
stdSnowLd,
inclCd,
constTp,
mixMatlNo,
roofPitch);
ApiTrestleDetailBuilder atdb =
apiTrestleDetailBuilder
.setModuleTpCd(moduleTpCd)
.setRoofMatlCd(roofMatlCd)
.setTrestleMkrCd(trestleMkrCd)
.setConstMthdCd(constMthdCd)
.setRoofBaseCd(roofBaseCd)
.setIlluminationTp(illuminationTp)
.setInstHt(instHt)
.setStdWindSpeed(stdWindSpeed)
.setStdSnowLd(stdSnowLd)
.setInclCd(inclCd)
.setConstTp(constTp)
.setMixMatlNo(mixMatlNo)
.setRoofPitch(roofPitch)
ApiTrestleDetailBuilder.builder()
.moduleTpCd(moduleTpCd)
.roofMatlCd(roofMatlCd)
.trestleMkrCd(trestleMkrCd)
.constMthdCd(constMthdCd)
.roofBaseCd(roofBaseCd)
.illuminationTp(illuminationTp)
.instHt(instHt)
.stdWindSpeed(stdWindSpeed)
.stdSnowLd(stdSnowLd)
.inclCd(inclCd)
.constTp(constTp)
.mixMatlNo(mixMatlNo)
.roofPitch(roofPitch)
.build();
return masterService.getTrestleDetailList(