Codota Logo
ResponseMessageCodeEnum.getCode
Code IndexAdd Codota to your IDE (free)

How to use
getCode
method
in
com.lcw.one.util.http.ResponseMessageCodeEnum

Best Java code snippets using com.lcw.one.util.http.ResponseMessageCodeEnum.getCode (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: lcw2004/one

  public boolean isOk() {
    return this.code.equals(ResponseMessageCodeEnum.SUCCESS.getCode());
  }
}
origin: lcw2004/one

public boolean isOk() {
  return this.resultCode.equals(ResponseMessageCodeEnum.SUCCESS.getCode());
}
origin: lcw2004/one

/**
 * Exception 异常
 * 这种异常一般是程序写的有问题,直接抛出了Exception。前端如果遇到这种异常,需要找到错误原因并进行修复。
 *
 * @param exception
 * @return
 */
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(Exception.class)
@ResponseBody
public ResponseMessage handlerException(Exception exception) {
  logger.error(exception.getMessage(), exception);
  return Result.error(ResponseMessageCodeEnum.ERROR.getCode(), "程序异常,请重试。如果重复出现请联系管理员处理!");
}
origin: lcw2004/one

public static ResponseMessage error(String message) {
  return error(ResponseMessageCodeEnum.ERROR.getCode(), message);
}
origin: lcw2004/one

public static <T> ResponseMessage<T> success(T t) {
  return new ResponseMessage(ResponseMessageCodeEnum.SUCCESS.getCode(), "", t);
}
origin: lcw2004/one

/**
 * 登录失效异常拦截器
 *
 * @param exception
 * @return
 */
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(LoginInvalidException.class)
@ResponseBody
public ResponseMessage handlerLoginInvalidException(LoginInvalidException exception) {
  logger.warn(exception.getMessage(), exception);
  return Result.error(ResponseMessageCodeEnum.RE_LOGIN.getCode(), "登录失效");
}
origin: lcw2004/one

@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(ConstraintViolationException.class)
@ResponseBody
public ResponseMessage<ValidError> handlerConstraintViolationException(ConstraintViolationException exception) {
  ConstraintViolation violation = Exceptions.getFirstError(exception);
  if (violation != null) {
    logger.warn("Valid Exception:{}", violation.getMessage());
  } else {
    logger.warn(exception.getMessage(), exception);
  }
  ValidError validError = new ValidError(violation.getPropertyPath().toString(), violation.getMessage());
  return Result.error(ResponseMessageCodeEnum.ERROR.getCode(), validError.getMessage(), validError);
}
com.lcw.one.util.httpResponseMessageCodeEnumgetCode

Popular methods of ResponseMessageCodeEnum

    Popular in Java

    • Updating database using SQL prepared statement
    • startActivity (Activity)
    • getSharedPreferences (Context)
    • getExternalFilesDir (Context)
    • GridLayout (java.awt)
      The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
    • URL (java.net)
      A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
    • Selector (java.nio.channels)
      A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
    • Connection (java.sql)
      A connection represents a link from a Java application to a database. All SQL statements and results
    • Locale (java.util)
      A Locale object represents a specific geographical, political, or cultural region. An operation that
    • Filter (javax.servlet)
      A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now