Files
hubez-admin/frontend/src/modules/sendNumMgt/service/sendNumMgtApi.js
2022-07-18 01:06:10 +09:00

122 lines
3.8 KiB
JavaScript

import httpClient from '@/common/http-client';
// 공통 코드.
const getCommCode = (params) => {
return httpClient.post('/api/v1/bo/comm/getCode', params, { withCredentials: false });
}
const adminList = (params) => {
return httpClient.post('/api/v1/bo/sendNumMgt/adminList', params, {withCredentials: false});
}
const numberDetail = (params) => {
return httpClient.post('/api/v1/bo/sendNumMgt/numberDetail', params, {withCredentials: false});
}
const apprDetail = (params) => {
return httpClient.post('/api/v1/bo/sendNumMgt/apprDetail', params, {withCredentials: false});
}
const deleteNumber = (params) => {
return httpClient.post('/api/v1/bo/sendNumMgt/deleteNumber', params, {withCredentials: false});
}
// 사업자가 등록 요청.
const insertNumber = (adminId, custNm, bRegNo, nmineeDivCd, numberInputs, bizrAuthYn, custSeq) => {
let formData = new FormData();
const row = {}
row.adminId = adminId
row.custNm = custNm
row.bRegNo = bRegNo
row.list = numberInputs
row.bizrAuthYn = bizrAuthYn
row.custSeq = custSeq
console.log(row)
formData.append('key', new Blob([ JSON.stringify(row) ], {type : "application/json"}));
let url = "/api/v1/bo/sendNumMgt/insertNumber";
return httpClient.post(url, formData, {
headers: {
"Content-Type": "multipart/form-data",
"Show-Layer": "Yes"
}
});
};
// 사업자가 등록 요청.
const insertNumber1 = (tenureFile, businessFile, communicationFile, adminId, custNm, bRegNo, nmineeDivCd, numberInputs, bizrAuthYn, custSeq) => {
let formData = new FormData();
formData.append("tenureFile", tenureFile);
formData.append("businessFile", businessFile);
formData.append("communicationFile", communicationFile);
const row = {}
row.adminId = adminId
row.custNm = custNm
row.bRegNo = bRegNo
row.nmineeDivCd = nmineeDivCd
row.list = numberInputs
row.bizrAuthYn = bizrAuthYn
row.custSeq = custSeq
console.log(row)
formData.append('key', new Blob([ JSON.stringify(row) ], {type : "application/json"}));
let url = "/api/v1/bo/sendNumMgt/insertNumber";
return httpClient.post(url, formData, {
headers: {
"Content-Type": "multipart/form-data",
"Show-Layer": "Yes"
}
});
};
// 타사업자가 등록 요청.
const insertNumber2 = (trustFile, warrantFile, deputyFile, tenureFile, otherBusinessFile, businessFile, adminId, custNm, bRegNo, nmineeDivCd, numberInputs, bizrAuthYn, custSeq) => {
let formData = new FormData();
formData.append("trustFile", trustFile);
formData.append("warrantFile", warrantFile);
formData.append("deputyFile", deputyFile);
formData.append("tenureFile", tenureFile);
formData.append("businessFile", businessFile);
formData.append("otherBusinessFile", otherBusinessFile);
const row = {}
row.adminId = adminId
row.custNm = custNm
row.bRegNo = bRegNo
row.nmineeDivCd = nmineeDivCd
row.list = numberInputs
row.bizrAuthYn = bizrAuthYn
row.custSeq = custSeq
console.log(row)
formData.append('key', new Blob([ JSON.stringify(row) ], {type : "application/json"}));
let url = "/api/v1/bo/sendNumMgt/insertNumber";
return httpClient.post(url, formData, {
headers: {
"Content-Type": "multipart/form-data",
"Show-Layer": "Yes"
}
});
};
const updateAppr = (params) => {
return httpClient.post('/api/v1/bo/sendNumMgt/updateAppr', params, {withCredentials: false});
}
export default {
getCommCode,
numberDetail,
adminList,
insertNumber,
insertNumber1,
insertNumber2,
apprDetail,
updateAppr,
deleteNumber,
}