From eb2d7d3d9fc64ac74a5f6575057d1566e6657b96 Mon Sep 17 00:00:00 2001 From: Jack <jack.su@pollex.com.tw> Date: 星期三, 29 十二月 2021 19:37:01 +0800 Subject: [PATCH] [ADD] 新增預約單備註API [ADD] 更新預約單備註API [ADD] 刪除預約單備註API [ADD] 顧問查詢自己的預約單清單時帶出備註資料 --- pamapi/src/main/java/com/pollex/pam/service/dto/OtpResponseDTO.java | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/service/dto/OtpResponseDTO.java b/pamapi/src/main/java/com/pollex/pam/service/dto/OtpResponseDTO.java index 758001a..68d0704 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/dto/OtpResponseDTO.java +++ b/pamapi/src/main/java/com/pollex/pam/service/dto/OtpResponseDTO.java @@ -1,20 +1,28 @@ package com.pollex.pam.service.dto; +import java.util.Arrays; +import java.util.List; + public class OtpResponseDTO { + private static final String OTP_SUCCESS_CODE = "0"; private final String indexKey; private final boolean success; private final String failCode; private final String failReason; public OtpResponseDTO(String[] strings) { - if(strings.length == 4) { - this.indexKey = strings[0]; - this.success = "0".equals(strings[1]); - this.failCode = strings[2]; - this.failReason = strings[3]; + this(Arrays.asList(strings)); + } + + public OtpResponseDTO(List<String> strings) { + if(strings.size() == 4) { + this.indexKey = strings.get(0); + this.success = OTP_SUCCESS_CODE.equals(strings.get(1)); + this.failCode = strings.get(2); + this.failReason = strings.get(3); } else { - throw new RuntimeException("the otp response can't format"); + throw new IllegalArgumentException("the otp response can't format: " + strings); } } -- Gitblit v1.8.0