import { ApiResponse } from '../../typings/iny' ; import { ApiResponseCode } from './responseCode' ; import { ApiResponseMsg } from './responseMsg' ; export function buildSuccess < T > ( data ? ) { return buildResponse < T > ( ApiResponseCode . SUCCESS , data || { } , ApiResponseMsg . SUCCESS ) ; } export function buildFail < T > ( code , msg ) { return buildResponse < T > ( code , { } as T , msg ) ; } export function buildResponse < T > ( code , data , msg ) { return { code , data , msg , } ; }