api รายละเอียดโครงสร้างระดับ root, ระดับ1-2
This commit is contained in:
parent
7cd4ae2b5f
commit
5b8e4cc3ad
3 changed files with 90 additions and 49 deletions
|
|
@ -37,6 +37,38 @@ export class OrgChild2Controller extends Controller {
|
|||
private child3Repository = AppDataSource.getRepository(OrgChild3);
|
||||
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
||||
|
||||
/**
|
||||
* API รายละเอียดโครงสร้างระดับ 2
|
||||
*
|
||||
* @summary ORG_018 - รายละเอียดโครงสร้างระดับ2 (ADMIN) #20
|
||||
*
|
||||
* @param {string} id Id Child2
|
||||
*/
|
||||
@Get("{id}")
|
||||
async GetChild2(@Path() id: string) {
|
||||
try {
|
||||
const orgChild2 = await this.child2Repository.findOne({ where: { id } });
|
||||
if (!orgChild2) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
const getOrgChild2 = {
|
||||
"orgChild2Id" : orgChild2.id,
|
||||
"orgChild2Name" : orgChild2.orgChild2Name,
|
||||
"orgChild2ShortName" : orgChild2.orgChild2ShortName,
|
||||
"orgChild2Code" : orgChild2.orgChild2Code,
|
||||
"orgChild2Order" : orgChild2.orgChild2Order,
|
||||
"orgChild2PhoneEx" : orgChild2.orgChild2PhoneEx,
|
||||
"orgChild2PhoneIn" : orgChild2.orgChild2PhoneIn,
|
||||
"orgChild2Fax" : orgChild2.orgChild2Fax,
|
||||
"orgRevisionId" : orgChild2.orgRevisionId,
|
||||
"orgCode" : orgChild2.orgChild2Code+"00"
|
||||
}
|
||||
return new HttpSuccess(getOrgChild2);
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* สร้างโครงสร้างระดับ2 Child2
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue