You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
996 B
53 lines
996 B
const { Injectable } = require('flitter-di')
|
|
|
|
class FakeResponse extends Injectable {
|
|
_message = 'OK'
|
|
_status = 200
|
|
_api_data = undefined
|
|
_send_data = undefined
|
|
_view = undefined
|
|
_view_data = undefined
|
|
|
|
status(set = undefined) {
|
|
if ( set ) {
|
|
this._status = set
|
|
return this
|
|
} else {
|
|
return this._status
|
|
}
|
|
}
|
|
|
|
message(set = undefined) {
|
|
if ( set ) {
|
|
this._message = set
|
|
return this
|
|
} else {
|
|
return this._message
|
|
}
|
|
}
|
|
|
|
api(data = {}) {
|
|
this._api_data = data
|
|
return this
|
|
}
|
|
|
|
send(data = '') {
|
|
this._send_data = ''
|
|
return this
|
|
}
|
|
|
|
view(name, data = {}) {
|
|
this._view = name
|
|
this._view_data = data
|
|
return this
|
|
}
|
|
|
|
page(name, data = {}) {
|
|
this._view = name
|
|
this._view_data = data
|
|
return this
|
|
}
|
|
}
|
|
|
|
module.exports = exports = FakeResponse
|