mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
127 lines
3.1 KiB
JavaScript
127 lines
3.1 KiB
JavaScript
/* 案例模块的相关处理*/
|
||
import ajax from '@/utils/xajax.js'
|
||
|
||
/**首页查询
|
||
* pageSize
|
||
* orderField
|
||
* orderAsc
|
||
*/
|
||
const indexList = function(query) {
|
||
return ajax.post('/xboe/m/boe/cases/case-random', query);
|
||
}
|
||
/*
|
||
*案例分页搜索查询 是否推荐
|
||
*@param(String) keyWord 关键词
|
||
*@param(String) orderField 需要排序的字段 不传默认是最新
|
||
*@param (boolean) orderAsc 升序还是倒叙
|
||
*@param(Boolean) breCommend 是否推荐 true或者false
|
||
*@param(String) orgDomain 组织机构
|
||
*@param(String) majorType 专业分类
|
||
* @param(String) majorDomain 专业领域
|
||
*/
|
||
const queryList = function(query) {
|
||
return ajax.post('/xboe/m/boe/cases/queryList', query);
|
||
}
|
||
/* 案例分页搜索查询 是否置顶
|
||
*@param(String) keyWord 关键词
|
||
@param(Boolean) isTop 是否置顶 true或false
|
||
@param(String) orgDomain 组织机构
|
||
*@param(String) majorType 专业分类
|
||
* @param(String) majorDomain 专业领域
|
||
*/
|
||
const isTopList = function(query) {
|
||
return ajax.post('/xboe/m/boe/cases/isTopList', query);
|
||
}
|
||
/* 设置置顶 取消置顶
|
||
@param(String) id
|
||
@param(Integer) isTop 是否置顶 0:未置顶,1:已置顶
|
||
*/
|
||
const updateTop = function(id, isTop) {
|
||
return ajax.get(`/xboe/m/boe/cases/updateTop?id=${id}&isTop=${isTop}`);
|
||
}
|
||
/* 删除案例
|
||
*param(String) id 案例的id
|
||
*/
|
||
const del = function(id) {
|
||
return ajax.get('/xboe/m/boe/cases/delete?id=' + id);
|
||
}
|
||
/*案例详情
|
||
@param(String) id 案例的id
|
||
@param(Boolean) addView 是否增加浏览量
|
||
*/
|
||
const detail = function(id,addView) {
|
||
let pars='id=' + id;
|
||
if(addView){
|
||
pars+='&addView='+addView
|
||
}
|
||
return ajax.get('/xboe/m/boe/cases/detail?'+pars);
|
||
}
|
||
/*推荐
|
||
*@param (String) id 案例的id
|
||
*@param (String) title 案例的标题
|
||
*@param (String) acceptAid 受众id
|
||
*@param (String) recommentThat 推荐说明
|
||
*/
|
||
const savaRecommend = function(data) {
|
||
return ajax.post('/xboe/m/boe/recommend/save', data);
|
||
}
|
||
/* 推荐列表
|
||
*没有参数
|
||
*/
|
||
const query = function() {
|
||
return ajax.get('/xboe/m/boe/recommend/query');
|
||
}
|
||
/*
|
||
*作者排行榜
|
||
@param pageSize 长度
|
||
*/
|
||
const usernameList= function(pageSize){
|
||
return ajax.get(`/xboe/m/boe/cases/usernamelist?pageSize=${pageSize}`);
|
||
}
|
||
/*
|
||
人气榜
|
||
@param pageSize 长度
|
||
*/
|
||
const queryPraises=function(pageSize){
|
||
return ajax.get(`/xboe/m/boe/cases/query-praises?pageSize=${pageSize}`);
|
||
}
|
||
/*
|
||
好评榜
|
||
@param pageSize 长度
|
||
*/
|
||
const queryComments=function(pageSize){
|
||
return ajax.get(`/xboe/m/boe/cases/query-comments?pageSize=${pageSize}`);
|
||
}
|
||
|
||
/**
|
||
* 专业分类
|
||
* */
|
||
const majorTypes=function (){
|
||
return ajax.get('/xboe/m/boe/cases/majorTypes');
|
||
}
|
||
/**
|
||
* 详情新*/
|
||
const details = function (id, addView) {
|
||
let pars = 'id=' + id;
|
||
if (addView) {
|
||
pars += '&addView=' + addView
|
||
}
|
||
return ajax.get('/xboe/m/boe/cases/details?' + pars);
|
||
}
|
||
|
||
export default {
|
||
indexList,
|
||
queryList,
|
||
isTopList,
|
||
updateTop,
|
||
del,
|
||
detail,
|
||
savaRecommend,
|
||
query,
|
||
usernameList,
|
||
queryPraises,
|
||
queryComments,
|
||
majorTypes,
|
||
details
|
||
}
|