| 123456789101112131415161718192021222324 |
- const http = require("../utils/axios");
- module.exports = class BaseModel {
- static MODULES = {
- HISTORY: 'history',
- PENDING: 'pending',
- FACTORY: 'factory'
- }
- constructor(chainId, module) {
- if (!chainId || !module) throw "Must have [chainId, module]."
- this.chainId = chainId
- this.module = module
- }
- async find() {
- const url = `/${this.module}/findByChainId`
- const rst = await http.post(url, {
- chainId: this.chainId
- })
- return rst.data
- }
- }
|