Commit 1a562059 authored by 任国军's avatar 任国军

add course

parent dd401208
Pipeline #16297 passed with stage
in 46 seconds
'use strict';
const Controller = require('egg').Controller;
class InstitutionSubController extends Controller {
/**
* 机构列表
*/
async institutionList() {
const { ctx } = this;
const input_params = ctx.request.body;
const results = await ctx.service.course.institutionSub.getInstitutions(input_params);
ctx.success({ results });
}
/**
* 机构详情
*/
async institutionInfo() {
const { ctx } = this;
let input_params = ctx.params;
const query = ctx.query;
input_params = Object.assign(input_params, query);
const result = await ctx.service.course.institutionSub.getInstitution(input_params);
ctx.success({ result });
}
/**
* 课程列表
*/
async classList() {
const { ctx } = this;
const input_params = ctx.request.body;
const results = await ctx.service.course.institutionSub.getClasses(input_params);
ctx.success({ results });
}
/**
* 课程详情
*/
async classInfo() {
const { ctx } = this;
const class_id = ctx.params.class_id;
if (!class_id) {
ctx.failed('error class_id');
}
const ret = await ctx.service.course.institutionSub.getClass(class_id);
ctx.success(ret);
}
/**
* 老师列表
*/
async teacherList() {
const { ctx } = this;
const input_params = ctx.request.body;
const ret = await ctx.service.course.institutionSub.getTeachers(input_params);
ctx.success(ret);
}
/**
* 老师详情
*/
async teacherInfo() {
const { ctx } = this;
const teacher_id = ctx.params.teacher_id;
if (!teacher_id) {
ctx.failed('error teacher_id');
}
const ret = await ctx.service.course.institutionSub.getTeacher(teacher_id);
ctx.success(ret);
}
// 获取分类
async getCats() {
const { ctx } = this;
const ret = await ctx.service.course.institutionSub.getCats();
ctx.success(ret);
}
}
module.exports = InstitutionSubController;
'use strict';
const moment = require('moment');
module.exports = app => {
const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize;
const CourseStudentVideo = app.classModel.define('course_student_video', {
id: {
type: INTEGER,
primaryKey: true,
autoIncrement: true,
},
institution_id: INTEGER,
video_url: STRING,
title: STRING,
age: STRING,
time: STRING,
sort: INTEGER,
status: ENUM('offline', 'online'),
is_deleted: INTEGER,
created_time: {
type: DATE,
allowNull: true,
get() {
const date = this.getDataValue('created_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
},
updated_time: {
type: DATE,
allowNull: true,
get() {
const date = this.getDataValue('updated_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
},
}, {
timestamps: false,
tableName: 'course_student_video',
});
return CourseStudentVideo;
};
'use strict'; 'use strict';
'use strict';
const moment = require('moment'); const moment = require('moment');
module.exports = app => { module.exports = app => {
const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize; const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize;
const CourseCat = app.classModel.define('course_cat', { const CourseCat = app.classModel.define('course_cat', {
id: { id: {
type: INTEGER, type: INTEGER,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
}, },
first_id: INTEGER, parent_id: INTEGER,
parent_id: INTEGER, name: STRING,
level: INTEGER, image: STRING,
name: STRING, color: STRING,
image: STRING, tips: STRING,
color: STRING, status: ENUM('offline', 'online'),
tips: STRING, is_deleted: INTEGER,
status: ENUM('offline', 'online'), sort: INTEGER,
is_deleted: INTEGER, created_time: {
created_at: { type: DATE,
type: DATE, allowNull: true,
allowNull: true, get() {
get() { const date = this.getDataValue('created_time');
const date = this.getDataValue('created_at'); return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; },
}, },
}, updated_time: {
updated_at: { type: DATE,
type: DATE, allowNull: true,
allowNull: true, get() {
get() { const date = this.getDataValue('updated_time');
const date = this.getDataValue('updated_at'); return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; },
}, },
}, }, {
}, { timestamps: false,
timestamps: false, tableName: 'course_cat',
tableName: 'course_cat', });
});
CourseCat.one = async (data) => { CourseCat.one = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
return await CourseCat.findOne({ return await CourseCat.findOne({
attributes: attributes, attributes,
where: where, where,
}); });
} };
CourseCat.all = async (data) => { CourseCat.all = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
return await CourseCat.findAll({ return await CourseCat.findAll({
attributes: attributes, attributes,
where: where, where,
order, order,
}); });
} };
CourseCat.list = async (data = {}) => { CourseCat.list = async (data = {}) => {
const limit = data.limit ? Number(data.limit) : 10; const limit = data.limit ? Number(data.limit) : 10;
const page = data.page ? data.page : 1; const page = data.page ? data.page : 1;
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const condition = { const condition = {
offset: (page - 1) * limit, offset: (page - 1) * limit,
limit, limit,
where: where, where,
order: order, order,
attributes: attributes, attributes,
}; };
const { count, rows } = await CourseCat.findAndCountAll(condition); const { count, rows } = await CourseCat.findAndCountAll(condition);
return { page, count, rows }; return { page, count, rows };
} };
CourseCat.add = async (data) => { CourseCat.add = async data => {
try { try {
//返回promise对象实力 instance // 返回promise对象实力 instance
const res = await CourseCat.create(data); const res = await CourseCat.create(data);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null // 从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return res.id; return res.id;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
CourseCat.edit = async (data) => { CourseCat.edit = async data => {
const where = data.where; const where = data.where;
const params = data.params; const params = data.params;
try { try {
const res = await CourseCat.update(params, { where: where }) const res = await CourseCat.update(params, { where });
return res; return res;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
return CourseCat; return CourseCat;
}; };
\ No newline at end of file
'use strict'; 'use strict';
'use strict';
const moment = require('moment'); const moment = require('moment');
module.exports = app => { module.exports = app => {
const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize; const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize;
const CourseImages = app.classModel.define('course_images', { const CourseImages = app.classModel.define('course_images', {
id: { id: {
type: INTEGER, type: INTEGER,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
}, },
type: INTEGER, type: INTEGER,
type_id: INTEGER, type_id: INTEGER,
image_url: STRING, image_url: STRING,
video_url: STRING, video_url: STRING,
is_cover: INTEGER, is_cover: INTEGER,
is_video: INTEGER, is_video: INTEGER,
sort: INTEGER, sort: INTEGER,
created_time: { status: ENUM('offline', 'online'),
type: DATE, is_deleted: INTEGER,
allowNull: true, created_time: {
get() { type: DATE,
const date = this.getDataValue('created_time'); allowNull: true,
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; get() {
}, const date = this.getDataValue('created_time');
}, return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, { },
timestamps: false, },
tableName: 'course_images', }, {
}); timestamps: false,
tableName: 'course_images',
});
CourseImages.one = async (data) => { CourseImages.one = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
return await CourseImages.findOne({ return await CourseImages.findOne({
attributes: attributes, attributes,
where: where, where,
}); });
} };
CourseImages.all = async (data) => { CourseImages.all = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
return await CourseImages.findAll({ return await CourseImages.findAll({
attributes: attributes, attributes,
where: where, where,
order, order,
}); });
} };
CourseImages.list = async (data = {}) => { CourseImages.list = async (data = {}) => {
const limit = data.limit ? Number(data.limit) : 10; const limit = data.limit ? Number(data.limit) : 10;
const page = data.page ? data.page : 1; const page = data.page ? data.page : 1;
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const condition = { const condition = {
offset: (page - 1) * limit, offset: (page - 1) * limit,
limit, limit,
where: where, where,
order: order, order,
attributes: attributes, attributes,
}; };
const { count, rows } = await CourseImages.findAndCountAll(condition); const { count, rows } = await CourseImages.findAndCountAll(condition);
return { page, count, rows }; return { page, count, rows };
} };
CourseImages.add = async (data) => { CourseImages.add = async data => {
try { try {
//返回promise对象实力 instance // 返回promise对象实力 instance
const res = await CourseImages.create(data); const res = await CourseImages.create(data);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null // 从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return res.id; return res.id;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
CourseImages.edit = async (data) => { CourseImages.edit = async data => {
const where = data.where; const where = data.where;
const params = data.params; const params = data.params;
try { try {
const res = await CourseImages.update(params, { where: where }) const res = await CourseImages.update(params, { where });
return res; return res;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
return CourseImages; return CourseImages;
}; };
\ No newline at end of file
...@@ -16,19 +16,19 @@ module.exports = app => { ...@@ -16,19 +16,19 @@ module.exports = app => {
cat_id: INTEGER, cat_id: INTEGER,
status: ENUM('offline', 'online'), status: ENUM('offline', 'online'),
is_deleted: INTEGER, is_deleted: INTEGER,
created_at: { created_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('created_at'); const date = this.getDataValue('created_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
updated_at: { updated_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('updated_at'); const date = this.getDataValue('updated_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
......
...@@ -17,19 +17,19 @@ module.exports = app => { ...@@ -17,19 +17,19 @@ module.exports = app => {
lat: DECIMAL, lat: DECIMAL,
lng: DECIMAL, lng: DECIMAL,
is_deleted: INTEGER, is_deleted: INTEGER,
created_at: { created_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('created_at'); const date = this.getDataValue('created_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
updated_at: { updated_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('updated_at'); const date = this.getDataValue('updated_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
......
'use strict'; 'use strict';
'use strict';
const moment = require('moment'); const moment = require('moment');
module.exports = app => { module.exports = app => {
const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize; const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize;
const CourseUser = app.classModel.define('course_user', { const CourseUser = app.classModel.define('course_user', {
id: { id: {
type: INTEGER, type: INTEGER,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
}, },
uuid: STRING, uuid: STRING,
app_id: STRING, app_id: STRING,
app_user_id: STRING, app_user_id: STRING,
app_type_id: STRING, app_type_id: STRING,
user_id: STRING, user_id: STRING,
phone: STRING, phone: STRING,
nickname: STRING, nickname: STRING,
avatar: STRING, avatar: STRING,
sex: STRING, sex: STRING,
openid: STRING, openid: STRING,
is_deleted: INTEGER, is_deleted: INTEGER,
created_at: { created_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('created_at'); const date = this.getDataValue('created_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
updated_at: { updated_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('updated_at'); const date = this.getDataValue('updated_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
}, { }, {
timestamps: false, timestamps: false,
tableName: 'course_user', tableName: 'course_user',
}); });
CourseUser.one = async (data) => { CourseUser.one = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
return await CourseUser.findOne({ return await CourseUser.findOne({
attributes: attributes, attributes,
where: where, where,
}); });
} };
CourseUser.all = async (data) => { CourseUser.all = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
return await CourseUser.findAll({ return await CourseUser.findAll({
attributes: attributes, attributes,
where: where, where,
order, order,
}); });
} };
CourseUser.list = async (data = {}) => { CourseUser.list = async (data = {}) => {
const limit = data.limit ? Number(data.limit) : 10; const limit = data.limit ? Number(data.limit) : 10;
const page = data.page ? data.page : 1; const page = data.page ? data.page : 1;
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const condition = { const condition = {
offset: (page - 1) * limit, offset: (page - 1) * limit,
limit, limit,
where: where, where,
order: order, order,
attributes: attributes, attributes,
}; };
const { count, rows } = await CourseUser.findAndCountAll(condition); const { count, rows } = await CourseUser.findAndCountAll(condition);
return { page, count, rows }; return { page, count, rows };
} };
CourseUser.add = async (data) => { CourseUser.add = async data => {
try { try {
//返回promise对象实力 instance // 返回promise对象实力 instance
const res = await CourseUser.create(data); const res = await CourseUser.create(data);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null // 从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return res.id; return res.id;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
CourseUser.edit = async (data) => { CourseUser.edit = async data => {
const where = data.where; const where = data.where;
const params = data.params; const params = data.params;
try { try {
const res = await CourseUser.update(params, { where: where }) const res = await CourseUser.update(params, { where });
return res; return res;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
return CourseUser; return CourseUser;
}; };
\ No newline at end of file
'use strict'; 'use strict';
'use strict';
const moment = require('moment'); const moment = require('moment');
module.exports = app => { module.exports = app => {
const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize; const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM } = app.Sequelize;
const CourseUserBaby = app.classModel.define('course_user_baby', { const CourseUserBaby = app.classModel.define('course_user_baby', {
id: { id: {
type: INTEGER, type: INTEGER,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true,
}, },
user_uuid: STRING, user_uuid: STRING,
gender: ENUM('boy', 'girl'), gender: ENUM('boy', 'girl'),
birth: STRING, birth: STRING,
address: STRING, address: STRING,
lat: DECIMAL, lat: DECIMAL,
lng: DECIMAL, lng: DECIMAL,
is_deleted: INTEGER, is_deleted: INTEGER,
created_at: { created_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('created_at'); const date = this.getDataValue('created_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
updated_at: { updated_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('updated_at'); const date = this.getDataValue('updated_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
}, { }, {
timestamps: false, timestamps: false,
tableName: 'course_user_baby', tableName: 'course_user_baby',
}); });
CourseUserBaby.one = async (data) => { CourseUserBaby.one = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
return await CourseUserBaby.findOne({ return await CourseUserBaby.findOne({
attributes: attributes, attributes,
where: where, where,
}); });
} };
CourseUserBaby.all = async (data) => { CourseUserBaby.all = async data => {
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
return await CourseUserBaby.findAll({ return await CourseUserBaby.findAll({
attributes: attributes, attributes,
where: where, where,
order, order,
}); });
} };
CourseUserBaby.list = async (data = {}) => { CourseUserBaby.list = async (data = {}) => {
const limit = data.limit ? Number(data.limit) : 10; const limit = data.limit ? Number(data.limit) : 10;
const page = data.page ? data.page : 1; const page = data.page ? data.page : 1;
const order = data.order ? data.order : []; const order = data.order ? data.order : [];
const attributes = data.attributes ? data.attributes : {}; const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {}; const where = data.where ? data.where : {};
const condition = { const condition = {
offset: (page - 1) * limit, offset: (page - 1) * limit,
limit, limit,
where: where, where,
order: order, order,
attributes: attributes, attributes,
}; };
const { count, rows } = await CourseUserBaby.findAndCountAll(condition); const { count, rows } = await CourseUserBaby.findAndCountAll(condition);
return { page, count, rows }; return { page, count, rows };
} };
CourseUserBaby.add = async (data) => { CourseUserBaby.add = async data => {
try { try {
//返回promise对象实力 instance // 返回promise对象实力 instance
const res = await CourseUserBaby.create(data); const res = await CourseUserBaby.create(data);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null // 从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return res.id; return res.id;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
CourseUserBaby.edit = async (data) => { CourseUserBaby.edit = async data => {
const where = data.where; const where = data.where;
const params = data.params; const params = data.params;
try { try {
const res = await CourseUserBaby.update(params, { where: where }) const res = await CourseUserBaby.update(params, { where });
return res; return res;
} catch (error) { } catch (error) {
throw (error); throw (error);
}
} }
};
return CourseUserBaby; return CourseUserBaby;
}; };
\ No newline at end of file
...@@ -15,19 +15,19 @@ module.exports = app => { ...@@ -15,19 +15,19 @@ module.exports = app => {
user_uuid: STRING, user_uuid: STRING,
institution_id: INTEGER, institution_id: INTEGER,
is_deleted: INTEGER, is_deleted: INTEGER,
created_at: { created_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('created_at'); const date = this.getDataValue('created_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
updated_at: { updated_time: {
type: DATE, type: DATE,
allowNull: true, allowNull: true,
get() { get() {
const date = this.getDataValue('updated_at'); const date = this.getDataValue('updated_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined; return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
}, },
}, },
......
...@@ -31,4 +31,36 @@ module.exports = app => { ...@@ -31,4 +31,36 @@ module.exports = app => {
router.get('third', '/wechat/callbackAction', 'course.wechat.check'); router.get('third', '/wechat/callbackAction', 'course.wechat.check');
router.post('third', '/wechat/callbackAction', 'course.wechat.callbackAction'); router.post('third', '/wechat/callbackAction', 'course.wechat.callbackAction');
router.post('third', '/wechat/test', 'course.wechat.test'); router.post('third', '/wechat/test', 'course.wechat.test');
// 版本二
router.get('third', '/sub/cats', 'course.institutionSub.getCats');// 分类
router.get('third', '/sub/options', 'course.option.getOptions');// 筛选项
router.post('third', '/sub/address', miniAuth, 'course.location.getAddress');// 根据经纬度或ip获取地理位置信息
router.post('third', '/sub/institutions', miniAuth, 'course.institutionSub.institutionList');// 机构列表
router.get('third', '/sub/institutions', miniAuth, 'course.institutionSub.institutionList');// 机构列表
router.get('third', '/sub/institution/:institution_id', miniAuth, 'course.institutionSub.institutionInfo');// 机构详情
router.post('third', '/sub/classes', miniAuth, 'course.institution.classList');// 课程列表
router.get('third', '/sub/classes', miniAuth, 'course.institution.classList');// 课程列表
router.get('third', '/sub/class/:class_id', miniAuth, 'course.institution.classInfo');// 课程详情
router.post('third', '/sub/teachers', miniAuth, 'course.institution.teacherList');// 老师列表
router.get('third', '/sub/teachers', miniAuth, 'course.institution.teacherList');// 老师详情
router.get('third', '/sub/teacher/:teacher_id', miniAuth, 'course.institution.teacherInfo');// 老师详情
router.post('third', '/sub/user/auth', 'course.user.auth');// 微信授权登录
router.post('third', '/sub/user/register_user', miniAuth, 'course.user.registerUserInfo');// 授权后注册用户
router.get('third', '/sub/user/baby', miniAuth, 'course.user.getBabyInfo');// 获取baby信息
router.post('third', '/sub/user/baby', miniAuth, 'course.user.saveBabyInfo');// 保存baby信息
router.delete('third', '/sub/user/baby', miniAuth, 'course.user.delBabyInfo');// 删除baby信息
router.get('third', '/sub/user/collection/institution', miniAuth, 'course.user.getCollectInstitutions');// 收藏的机构列表
router.post('third', '/sub/user/collection/institution', miniAuth, 'course.user.collectInstitution');// 收藏机构
router.delete('third', '/sub/user/collection/institution', miniAuth, 'course.user.delCollectInstitution');// 取消收藏机构
router.get('third', '/sub/wechat/callbackAction', 'course.wechat.check');
router.post('third', '/sub/wechat/callbackAction', 'course.wechat.callbackAction');
router.post('third', '/sub/wechat/test', 'course.wechat.test');
}; };
This diff is collapsed.
...@@ -17,7 +17,7 @@ module.exports = appInfo => { ...@@ -17,7 +17,7 @@ module.exports = appInfo => {
domainWhiteList: [], domainWhiteList: [],
}; };
config.middleware = ['errorHandler', 'deviceLogin', 'deviceInit', 'responseSet']; config.middleware = [ 'errorHandler', 'deviceLogin', 'deviceInit', 'responseSet' ];
config.middleware = []; config.middleware = [];
exports.multipart = { exports.multipart = {
...@@ -90,7 +90,7 @@ module.exports = appInfo => { ...@@ -90,7 +90,7 @@ module.exports = appInfo => {
// other sequelize configurations // other sequelize configurations
dialect: 'mysql', dialect: 'mysql',
host: 'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com', host: 'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com',
database: 'prometheus_uat', database: 'prometheus_dev',
username: 'prometheus', username: 'prometheus',
password: 'q9t8Ay4qIUW4sw3s25K28', password: 'q9t8Ay4qIUW4sw3s25K28',
port: 3306, port: 3306,
...@@ -103,7 +103,7 @@ module.exports = appInfo => { ...@@ -103,7 +103,7 @@ module.exports = appInfo => {
// other sequelize configurations // other sequelize configurations
dialect: 'mysql', dialect: 'mysql',
host: 'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com', host: 'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com',
database: 'class_uat', database: 'class_dev',
username: 'class_testing', username: 'class_testing',
password: 'WV862L32451I6KD58tU9K', password: 'WV862L32451I6KD58tU9K',
port: 3306, port: 3306,
...@@ -170,11 +170,11 @@ module.exports = appInfo => { ...@@ -170,11 +170,11 @@ module.exports = appInfo => {
config.TX_LBS_URL = 'https://apis.map.qq.com/ws'; // 地址解析;逆地址解析 config.TX_LBS_URL = 'https://apis.map.qq.com/ws'; // 地址解析;逆地址解析
//我的信用-通化检测 // 我的信用-通化检测
config.YYS_APP_KEY = 'A86BB96F55B64DCE87A46E919A347993'; config.YYS_APP_KEY = 'A86BB96F55B64DCE87A46E919A347993';
config.YYS_APPLY_APPSECRET = 'a695e9b3c0f1e3f15fb0b958fd3a4b67'; config.YYS_APPLY_APPSECRET = 'a695e9b3c0f1e3f15fb0b958fd3a4b67';
//运营商报告 // 运营商报告
config.YYS_REPORT_KEY = 'F4E0CA710F484CFFB1756741696E29A3'; config.YYS_REPORT_KEY = 'F4E0CA710F484CFFB1756741696E29A3';
config.YYS_REPORT_APPSECRET = '233B8E10E31B4C899EE6FEB3AEC22F140B6528BF'; config.YYS_REPORT_APPSECRET = '233B8E10E31B4C899EE6FEB3AEC22F140B6528BF';
config.YYS_REPORT_URL = 'http://47.96.253.64:8049/mycredit/thxdReport'; config.YYS_REPORT_URL = 'http://47.96.253.64:8049/mycredit/thxdReport';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment