Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • J jz-api-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • jizhi-backend
  • jz-api-core
  • Wiki
  • Home

Home · Changes

Page history
xigua created page: home authored Jul 16, 2017 by xigua's avatar xigua
Hide whitespace changes
Inline Side-by-side
Showing with 41 additions and 1 deletion
+41 -1
  • home.md home.md +41 -1
  • No files found.
home.md
View page @ 33b80d42
...@@ -129,4 +129,44 @@ logger.fatal('message'); ...@@ -129,4 +129,44 @@ logger.fatal('message');
``` ```
# Lib # Lib
常用方法 一些常用方法
\ No newline at end of file ```
/**
* 返回错误信息
* @param res response object
* @param err error object
*/
export function errorRes(res, err) {}
/**
* 返回正常http处理结果
* @param res response object
* @param data data object to be returned
*/
export function okRes(res, data) {}
/**
* will throw error if current user is not logged in
* @param rootValue the rootValue
*/
export function requireLogin(rootValue) => {}
/**
* Return a basic object structure with a generated id, createdAt, updatedAt timestamp and isRemove set to false
*/
export function createBasicOj () {}
/**
* Randomly genreate a password from abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-+= these characters with the given length
* @param length length of string to be generated
*/
export function generatePassword (length: number) : string {}
/**
* Randomly generate a string from ABCDEFGHJKMNOPQRSTUVWXYZ0123456789 these characters, useful for genreating invitation code etc..
* @param length length of string to be generated
*/
export function generateCode (length: number) : string {}
```
\ No newline at end of file
Clone repository
  • Home
  • jz backend project skeleton