배치 api 파라미터 패턴 변경 수정
This commit is contained in:
parent
0cee2ec00d
commit
f83636af17
@ -23,6 +23,8 @@ import QInput from './common/input/Qinput'
|
||||
import QSelect from './common/select/QSelect'
|
||||
import QPagination from './common/pagination/QPagination'
|
||||
|
||||
import { trestleRequestModels, constructionRequestModels, trestleDetailRequestModels } from '@/models/apiModels'
|
||||
|
||||
export default function Playground() {
|
||||
const [useCadFile, setUseCadFile] = useRecoilState(useCadFileState)
|
||||
const [cadFileName, setCadFileName] = useRecoilState(cadFileNameState)
|
||||
@ -48,8 +50,51 @@ export default function Playground() {
|
||||
|
||||
const [users, setUsers] = useState([])
|
||||
|
||||
const [trestleRequestData, setTrestleRequestData] = useState(trestleRequestModels)
|
||||
const [constructionRequestData, setConstructionRequestData] = useState(constructionRequestModels)
|
||||
const [trestleDetailRequestData, setTrestleDetailRequestData] = useState(trestleDetailRequestModels)
|
||||
|
||||
useEffect(() => {
|
||||
console.log('textInput:', textInput)
|
||||
setTrestleRequestData({
|
||||
moduleTpCd: 'testData_1',
|
||||
roofMatlCd: '',
|
||||
raftBaseCd: 'testData_2',
|
||||
trestleMkrCd: 'testData_3',
|
||||
constMthdCd: '',
|
||||
roofBaseCd: 'testData_4',
|
||||
})
|
||||
|
||||
setConstructionRequestData({
|
||||
moduleTpCd: 'testData_1',
|
||||
roofMatlCd: 'testData_2',
|
||||
trestleMkrCd: 'testData_3',
|
||||
constMthdCd: 'testData_4',
|
||||
roofBaseCd: 'testData_5',
|
||||
illuminationTp: 'testData_6',
|
||||
instHt: 'testData_7',
|
||||
stdWindSpeed: 'testData_8',
|
||||
stdSnowLd: 'testData_9',
|
||||
inclCd: 'testData_10',
|
||||
raftBaseCd: 'testData_11',
|
||||
roofPitch: 30,
|
||||
})
|
||||
|
||||
setTrestleDetailRequestData({
|
||||
moduleTpCd: 'testData_1',
|
||||
roofMatlCd: 'testData_2',
|
||||
trestleMkrCd: 'testData_3',
|
||||
constMthdCd: 'testData_4',
|
||||
roofBaseCd: 'testData_5',
|
||||
illuminationTp: 'testData_6',
|
||||
instHt: 'testData_7',
|
||||
stdWindSpeed: 'testData_8',
|
||||
stdSnowLd: 'testData_9',
|
||||
inclCd: 'testData_10',
|
||||
constTp: 'testData_11',
|
||||
mixMatlNo: 10,
|
||||
roofPitch: 20,
|
||||
})
|
||||
}, [textInput])
|
||||
useEffect(() => {
|
||||
console.log('numberInput:', numberInput)
|
||||
@ -154,41 +199,6 @@ export default function Playground() {
|
||||
console.log('users:', users)
|
||||
}, [users])
|
||||
|
||||
const trestleData = [{ moduleTpCd: '1', roofMatlCd: '2', raftBaseCd: '', trestleMkrCd: '4', constMthdCd: '', roofBaseCd: '6' }]
|
||||
const constructionData = [
|
||||
{
|
||||
moduleTpCd: '',
|
||||
roofMatlCd: '',
|
||||
trestleMkrCd: '',
|
||||
constMthdCd: '',
|
||||
roofBaseCd: '',
|
||||
illuminationTp: '',
|
||||
instHt: '',
|
||||
stdWindSpeed: '',
|
||||
stdSnowLd: '',
|
||||
inclCd: '',
|
||||
raftBaseCd: '',
|
||||
roofPitch: 0,
|
||||
},
|
||||
]
|
||||
const trestleDetailData = [
|
||||
{
|
||||
moduleTpCd: '',
|
||||
roofMatlCd: '',
|
||||
trestleMkrCd: '',
|
||||
constMthdCd: '',
|
||||
roofBaseCd: '',
|
||||
illuminationTp: '',
|
||||
instHt: '',
|
||||
stdWindSpeed: '',
|
||||
stdSnowLd: '',
|
||||
inclCd: '',
|
||||
constTp: '',
|
||||
mixMatlNo: 0,
|
||||
roofPitch: 0,
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="container mx-auto p-4 m-4 border">
|
||||
@ -213,7 +223,7 @@ export default function Playground() {
|
||||
<button
|
||||
className="btn-frame deepgray"
|
||||
onClick={() => {
|
||||
getTrestleList(trestleData)
|
||||
getTrestleList(trestleRequestData)
|
||||
}}
|
||||
>
|
||||
가대 목록 조회 API 호출
|
||||
@ -221,7 +231,7 @@ export default function Playground() {
|
||||
<button
|
||||
className="btn-frame deepgray"
|
||||
onClick={() => {
|
||||
getConstructionList(constructionData)
|
||||
getConstructionList(constructionRequestData)
|
||||
}}
|
||||
>
|
||||
시공법 목록 조회 API 호출
|
||||
@ -229,7 +239,7 @@ export default function Playground() {
|
||||
<button
|
||||
className="btn-frame deepgray"
|
||||
onClick={() => {
|
||||
getTrestleDetailList(trestleDetailData)
|
||||
getTrestleDetailList(trestleDetailRequestData)
|
||||
}}
|
||||
>
|
||||
가대 상세 조회 API 호출
|
||||
|
||||
@ -2,6 +2,7 @@ import { useAxios } from '@/hooks/useAxios'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
import { getQueryString } from '@/util/common-utils'
|
||||
import { trestleRequest, constructionRequest, trestleDetailRequest } from '@/models/apiModels'
|
||||
|
||||
/**
|
||||
* 마스터 컨트롤러 훅
|
||||
@ -52,16 +53,9 @@ export function useMasterController() {
|
||||
* @returns
|
||||
*/
|
||||
const getTrestleList = async (params) => {
|
||||
console.log('🚀🚀 ~ getTrestleList ~ params:', params)
|
||||
params = getQueryString({
|
||||
moduleTpCd: params.moduleTpCd ? params.moduleTpCd : '',
|
||||
roofMatlCd: params.roofMatlCd ? params.roofMatlCd : '',
|
||||
raftBaseCd: params.raftBaseCd ? params.raftBaseCd : '',
|
||||
trestleMkrCd: params.trestleMkrCd ? params.trestleMkrCd : '',
|
||||
constMthdCd: params.constMthdCd ? params.constMthdCd : '',
|
||||
roofBaseCd: params.roofBaseCd ? params.roofBaseCd : '',
|
||||
})
|
||||
return await get({ url: '/api/v1/master/getTrestleList' + params }).then((res) => {
|
||||
const paramString = getQueryString(params)
|
||||
console.log('🚀🚀 ~ getTrestleList ~ paramString:', paramString)
|
||||
return await get({ url: '/api/v1/master/getTrestleList' + paramString }).then((res) => {
|
||||
console.log('🚀🚀 ~ getTrestleList ~ res:', res)
|
||||
return res
|
||||
})
|
||||
@ -85,22 +79,9 @@ export function useMasterController() {
|
||||
* @returns
|
||||
*/
|
||||
const getConstructionList = async (params) => {
|
||||
console.log('🚀🚀 ~ getConstructionList ~ params:', params)
|
||||
params = getQueryString({
|
||||
moduleTpCd: params.moduleTpCd ? params.moduleTpCd : '',
|
||||
roofMatlCd: params.roofMatlCd ? params.roofMatlCd : '',
|
||||
trestleMkrCd: params.trestleMkrCd ? params.trestleMkrCd : '',
|
||||
constMthdCd: params.constMthdCd ? params.constMthdCd : '',
|
||||
roofBaseCd: params.roofBaseCd ? params.roofBaseCd : '',
|
||||
illuminationTp: params.illuminationTp ? params.illuminationTp : '',
|
||||
instHt: params.instHt ? params.instHt : '',
|
||||
stdWindSpeed: params.stdWindSpeed ? params.stdWindSpeed : '',
|
||||
stdSnowLd: params.stdSnowLd ? params.stdSnowLd : '',
|
||||
inclCd: params.inclCd ? params.inclCd : '',
|
||||
raftBaseCd: params.raftBaseCd ? params.raftBaseCd : '',
|
||||
roofPitch: params.roofPitch ? params.roofPitch : 0,
|
||||
})
|
||||
return await get({ url: '/api/v1/master/getConstructionList' + params }).then((res) => {
|
||||
const paramString = getQueryString(params)
|
||||
console.log('🚀🚀 ~ getConstructionList ~ paramString:', paramString)
|
||||
return await get({ url: '/api/v1/master/getConstructionList' + paramString }).then((res) => {
|
||||
console.log('🚀🚀 ~ getConstructionList ~ res:', res)
|
||||
return res
|
||||
})
|
||||
@ -124,23 +105,9 @@ export function useMasterController() {
|
||||
* @returns
|
||||
*/
|
||||
const getTrestleDetailList = async (params) => {
|
||||
console.log('🚀🚀 ~ getConstructionList ~ params:', params)
|
||||
params = getQueryString({
|
||||
moduleTpCd: params.moduleTpCd ? params.moduleTpCd : '',
|
||||
roofMatlCd: params.roofMatlCd ? params.roofMatlCd : '',
|
||||
trestleMkrCd: params.trestleMkrCd ? params.trestleMkrCd : '',
|
||||
constMthdCd: params.constMthdCd ? params.constMthdCd : '',
|
||||
roofBaseCd: params.roofBaseCd ? params.roofBaseCd : '',
|
||||
illuminationTp: params.illuminationTp ? params.illuminationTp : '',
|
||||
instHt: params.instHt ? params.instHt : '',
|
||||
stdWindSpeed: params.stdWindSpeed ? params.stdWindSpeed : '',
|
||||
stdSnowLd: params.stdSnowLd ? params.stdSnowLd : '',
|
||||
inclCd: params.inclCd ? params.inclCd : '',
|
||||
constTp: params.constTp ? params.constTp : '',
|
||||
mixMatlNo: params.mixMatlNo ? params.mixMatlNo : 0,
|
||||
roofPitch: params.roofPitch ? params.roofPitch : 0,
|
||||
})
|
||||
return await get({ url: '/api/v1/master/getTrestleDetailList' + params }).then((res) => {
|
||||
const paramString = getQueryString(params)
|
||||
console.log('🚀🚀 ~ getTrestleDetailList ~ paramString:', paramString)
|
||||
return await get({ url: '/api/v1/master/getTrestleDetailList' + paramString }).then((res) => {
|
||||
console.log('🚀🚀 ~ getTrestleDetailList ~ res:', res)
|
||||
return res
|
||||
})
|
||||
|
||||
42
src/models/apiModels.js
Normal file
42
src/models/apiModels.js
Normal file
@ -0,0 +1,42 @@
|
||||
// 가대 목록 Request Models
|
||||
export const trestleRequestModels = {
|
||||
moduleTpCd: '',
|
||||
roofMatlCd: '',
|
||||
raftBaseCd: '',
|
||||
trestleMkrCd: '',
|
||||
constMthdCd: '',
|
||||
roofBaseCd: '',
|
||||
}
|
||||
|
||||
// 시공법 목록 Request Models
|
||||
export const constructionRequestModels = {
|
||||
moduleTpCd: '',
|
||||
roofMatlCd: '',
|
||||
trestleMkrCd: '',
|
||||
constMthdCd: '',
|
||||
roofBaseCd: '',
|
||||
illuminationTp: '',
|
||||
instHt: '',
|
||||
stdWindSpeed: '',
|
||||
stdSnowLd: '',
|
||||
inclCd: '',
|
||||
raftBaseCd: '',
|
||||
roofPitch: 0,
|
||||
}
|
||||
|
||||
// 가대 상세 Request Models
|
||||
export const trestleDetailRequestModels = {
|
||||
moduleTpCd: '',
|
||||
roofMatlCd: '',
|
||||
trestleMkrCd: '',
|
||||
constMthdCd: '',
|
||||
roofBaseCd: '',
|
||||
illuminationTp: '',
|
||||
instHt: '',
|
||||
stdWindSpeed: '',
|
||||
stdSnowLd: '',
|
||||
inclCd: '',
|
||||
constTp: '',
|
||||
mixMatlNo: 0,
|
||||
roofPitch: 0,
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user