Description
snippet cho lixi core source cu
Reference
For route
@register-api
register api
@jp-x is Joip with x is type
example: @jp-object
@jr-x is Joir with x is type
example: @jr-array
For biz
@n-biz
make new a biz
result:
const {core} = require('../../const/handler');",
"const Util = require(core.util);",
"const Biz = require(core.biz);",
"module.exports = new Biz({ model: 'example' });
Require
@r-core
require core
@r-handler:
require handler
@r-util:
require util
@r-elastic:
require elastic
Get
@g-list
get list
result:
"const {items, total} = await $1.list({",
" page,",
" page_size,",
" ${2:sort},",
" condition: {",
" filter_must: ${3:filter_must},",
" }",
"})"
@g-detail
get detail
@g-uuid
get by uuid
@g-all
get all
@g-agg
aggregate
Migrate
@mi-normal
result
"module.exports = {",
" up: async (queryInterface, Sequelize) => {",
" let exc = queryInterface;",
" await exc.addColumn('$2', '$3', {",
" type: Sequelize.DataTypes.${4|STRING(),INTEGER(),BOOLEAN(),JSON(),TEXT()|}",
"});",
" return exc;",
" },",
"\n",
" down: (queryInterface, Sequelize) => { }",
"};"
@mi-add
add a column
@mi-rename
rename column
@mi-change
change data type of column
@mi-raw
raw migrate
Model
@md-es-new
make new model es
@md-mapping
mapping
@md-new
make model template
@md-type
make model type