Giải pháp chuyển đổi số trọn gói cho doanh nghiệp Việt

Xây dựng model cho item.js - Xây dựng api adayroi

Xây dựng api adayroi

← Toàn bộ tài liệu


Bước 6: Xây dựng model cho item.js

Bài 6/9 Xem dạng sách

Nơi tạo file apps/ecommerce/models

Tên file : item.js

Nội dung file :

var modelfrontenditem = require(`${path_root}/lib/mvc/models/modelfrontenditem`);
const express = require('express');
var model = require(`${path_root}/lib/mvc/models/model`);
class Item extends modelfrontenditem {

tableName() {
return "items";
}
async getItem(req, res, next,id) {
const item= await super.getItem(req, res, next,id);

return item;
}



}
module.exports = Item;

Sơ đồ quan hệ các bảng

Table Name: {{table.name}}
Num Name Type
{{field_index+1}}
{{field.name}} {{field.type}}

Hỏi đáp

Gửi với tên {{comment_full_name}}

Chưa có câu hỏi nào cho bài này.

Zalo 0936.006.058 Hotline 0936.006.058