export enum ErrorCode {
  SERVICE_ERROR = 'SERVICE_ERROR',
  SERVICE_CANT_USE = 'SERVICE_CANT_USE',
  ES_ERROR = 'ES_ERROR',
  ES_INDEX_NOT_FOUND = 'ES_INDEX_NOT_FOUND',
  ES_DATA_NOT_FOUND = 'ES_DATA_NOT_FOUND',
  NOT_LOGIN = 'NOT_LOGIN',
  ACCOUNT_HAS_EXPIRED = 'ACCOUNT_HAS_EXPIRED',
  ACCOUNT_LOGGED_IN_ELESWHERE = 'ACCOUNT_LOGGED_IN_ELESWHERE',
  USER_NOT_FOUND = 'USER_NOT_FOUND',
  BAD_PASSWORD = 'BAD_PASSWORD',
  USER_IS_DISABLED = 'USER_IS_DISABLED',
  ROLE_IS_DISABLED = 'ROLE_IS_DISABLED',
  SERVICE_REPEAT = 'SERVICE_REPEAT',
  DUPLICATE_USERS_ACCOUNT = 'DUPLICATE_USERS_ACCOUNT',
  DUPLICATE_USERS_OPENID = 'DUPLICATE_USERS_OPENID',

  // 参数
  ID_NOT_FOUND = 'ID_NOT_FOUND',

  //admin
  ADMIN_BODY_NICK_NAME = 'ADMIN_BODY_NICK_NAME',
  ADMIN_BODY_ACCOUNT = 'ADMIN_BODY_ACCOUNT',
  ADMIN_BODY_PASSWORD = 'ADMIN_BODY_PASSWORD',
}
export class ServiceError extends Error {
  constructor(errcode: string) {
    super(errcode);
    this.name = 'ServiceError';
  }
}
