From 2c953876eab1622e2598a3d1ab92ae29e1d88fe5 Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Thu, 18 Mar 2021 11:24:33 +0800 Subject: [PATCH] API项目: 更改全局异常处理器中的返回码常量 COMMON: 更改常量类和response枚举 --- screen-manage/src/main/java/com/moral/api/pojo/form/AccountUpdateForm.java | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/screen-manage/src/main/java/com/moral/api/pojo/form/AccountUpdateForm.java b/screen-manage/src/main/java/com/moral/api/pojo/form/AccountUpdateForm.java index 60060ff..77133d7 100644 --- a/screen-manage/src/main/java/com/moral/api/pojo/form/AccountUpdateForm.java +++ b/screen-manage/src/main/java/com/moral/api/pojo/form/AccountUpdateForm.java @@ -1,5 +1,10 @@ package com.moral.api.pojo.form; +import com.moral.api.pojo.dto.account.AccountInsertDTO; +import com.moral.api.pojo.dto.account.AccountUpdateDTO; +import com.moral.constant.ResponseCodeEnum; +import com.moral.util.AESUtils; +import com.moral.util.RegexUtils; import lombok.Data; import org.springframework.util.ObjectUtils; @@ -39,4 +44,23 @@ return true; } + public AccountUpdateDTO paramValid(){ + AccountUpdateDTO dto = new AccountUpdateDTO(); + //��������������������������������� + if(!RegexUtils.checkMobile(mobile)){ + dto.setCode(ResponseCodeEnum.MOBILE_INVALID.getCode()); + dto.setMsg(ResponseCodeEnum.MOBILE_INVALID.getMsg()); + return dto; + } + //������������������������������ + if(!RegexUtils.checkEmail(email)){ + dto.setCode(ResponseCodeEnum.EMAIL_INVALID.getCode()); + dto.setMsg(ResponseCodeEnum.EMAIL_INVALID.getMsg()); + return dto; + } + dto.setCode(ResponseCodeEnum.SUCCESS.getCode()); + dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); + return dto; + } + } -- Gitblit v1.8.0