From d14a1087cab58b80768d2e95c6b227eecd7b2483 Mon Sep 17 00:00:00 2001 From: chenjiahe <763432473@qq.com> Date: 星期五, 17 六月 2022 10:52:55 +0800 Subject: [PATCH] 新增启动项注解 --- src/main/java/com/hx/resultTool/Result.java | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/resultTool/Result.java b/src/main/java/com/hx/resultTool/Result.java index 32f35c9..8356a6a 100644 --- a/src/main/java/com/hx/resultTool/Result.java +++ b/src/main/java/com/hx/resultTool/Result.java @@ -1,5 +1,7 @@ package com.hx.resultTool; +import com.hx.exception.TipsException; + import java.io.Serializable; /** @@ -54,6 +56,21 @@ return Result; } + /**鏍¢獙杩斿洖鐮�*/ + public Boolean checkCode(){ + if(ResponseCode.SUCCESS.equals(code)){ + return true; + } + return false; + } + + /**鏍¢獙杩斿洖鐮侊紝杩涜閿欒鎻愮ず*/ + public void checkTips(){ + if(!ResponseCode.SUCCESS.equals(code)){ + throw new TipsException("璇锋眰澶辫触锛�"+this.code+","+this.msg); + } + } + /*******************************************************************************/ public String getCode() { -- Gitblit v1.8.0