mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
add baseController
This commit is contained in:
parent
904918b11b
commit
bebd11d715
16
server/controllers/base.js
Normal file
16
server/controllers/base.js
Normal file
@ -0,0 +1,16 @@
|
||||
import yapi from '../yapi.js'
|
||||
class baseController{
|
||||
constructor(ctx){
|
||||
console.log('baseControler init...')
|
||||
}
|
||||
|
||||
getUid(){
|
||||
return 0
|
||||
}
|
||||
|
||||
getLoginStatus(){
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = baseController
|
@ -1,9 +1,11 @@
|
||||
import groupModel from '../models/group.js'
|
||||
import yapi from '../yapi.js'
|
||||
import baseController from './base.js'
|
||||
|
||||
|
||||
class groupController{
|
||||
class groupController extends baseController{
|
||||
constructor(){
|
||||
super()
|
||||
console.log('constructor....')
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import yapi from '../yapi.js'
|
||||
const projectSchema = {
|
||||
uid: String,
|
||||
uid: Number,
|
||||
name: String,
|
||||
basepath: String,
|
||||
desc: String,
|
||||
group_id: String,
|
||||
group_id: Number,
|
||||
members: Array,
|
||||
prd_host: String,
|
||||
env: Object,
|
||||
|
38
server_dist/controllers/base.js
Normal file
38
server_dist/controllers/base.js
Normal file
@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||
|
||||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||
|
||||
var _createClass2 = require('babel-runtime/helpers/createClass');
|
||||
|
||||
var _createClass3 = _interopRequireDefault(_createClass2);
|
||||
|
||||
var _yapi = require('../yapi.js');
|
||||
|
||||
var _yapi2 = _interopRequireDefault(_yapi);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var baseController = function () {
|
||||
function baseController(ctx) {
|
||||
(0, _classCallCheck3.default)(this, baseController);
|
||||
|
||||
console.log('baseControler init...');
|
||||
}
|
||||
|
||||
(0, _createClass3.default)(baseController, [{
|
||||
key: 'getUid',
|
||||
value: function getUid() {
|
||||
return 0;
|
||||
}
|
||||
}, {
|
||||
key: 'getLoginStatus',
|
||||
value: function getLoginStatus() {
|
||||
return true;
|
||||
}
|
||||
}]);
|
||||
return baseController;
|
||||
}();
|
||||
|
||||
module.exports = baseController;
|
@ -12,6 +12,10 @@ var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
|
||||
|
||||
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
|
||||
|
||||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
||||
|
||||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
||||
|
||||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||
|
||||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||
@ -20,6 +24,14 @@ var _createClass2 = require('babel-runtime/helpers/createClass');
|
||||
|
||||
var _createClass3 = _interopRequireDefault(_createClass2);
|
||||
|
||||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
||||
|
||||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
||||
|
||||
var _inherits2 = require('babel-runtime/helpers/inherits');
|
||||
|
||||
var _inherits3 = _interopRequireDefault(_inherits2);
|
||||
|
||||
var _group = require('../models/group.js');
|
||||
|
||||
var _group2 = _interopRequireDefault(_group);
|
||||
@ -28,13 +40,22 @@ var _yapi = require('../yapi.js');
|
||||
|
||||
var _yapi2 = _interopRequireDefault(_yapi);
|
||||
|
||||
var _base = require('./base.js');
|
||||
|
||||
var _base2 = _interopRequireDefault(_base);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var groupController = function () {
|
||||
var groupController = function (_baseController) {
|
||||
(0, _inherits3.default)(groupController, _baseController);
|
||||
|
||||
function groupController() {
|
||||
(0, _classCallCheck3.default)(this, groupController);
|
||||
|
||||
var _this = (0, _possibleConstructorReturn3.default)(this, (groupController.__proto__ || (0, _getPrototypeOf2.default)(groupController)).call(this));
|
||||
|
||||
console.log('constructor....');
|
||||
return _this;
|
||||
}
|
||||
|
||||
(0, _createClass3.default)(groupController, [{
|
||||
@ -244,6 +265,6 @@ var groupController = function () {
|
||||
}()
|
||||
}]);
|
||||
return groupController;
|
||||
}();
|
||||
}(_base2.default);
|
||||
|
||||
module.exports = groupController;
|
@ -7,11 +7,11 @@ var _yapi2 = _interopRequireDefault(_yapi);
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var projectSchema = {
|
||||
uid: String,
|
||||
uid: Number,
|
||||
name: String,
|
||||
basepath: String,
|
||||
desc: String,
|
||||
group_id: String,
|
||||
group_id: Number,
|
||||
members: Array,
|
||||
prd_host: String,
|
||||
env: Object,
|
||||
|
Loading…
Reference in New Issue
Block a user