mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
119 lines
3.1 KiB
JavaScript
119 lines
3.1 KiB
JavaScript
/**文章模块的相关处理*/
|
||
// import ajax from '@/utils/xajax.js'
|
||
import ajax from '../ajax'
|
||
const baseURL = process.env.VUE_APP_STAT_BASE_API;
|
||
/**
|
||
* 发送事件,具体事件参考后台管理的事件查看
|
||
*参数如下:
|
||
{
|
||
"key": "ReadCase",//后台的事件key
|
||
"title": "浏览案例【案例名称】",//事件的标题
|
||
"parameters":"",//用户自定义参数 name:value,name:value
|
||
"content": "案例名称",//事件的内容
|
||
"objId": "案例id",//关联的id
|
||
"objType": "3",//关联的类型
|
||
"objInfo": "记录一般折内容部分",
|
||
"aid": "用户的id", //当前登录人的id
|
||
"aname": "用户的名称,用于显示",//当前人的姓名
|
||
"status": 1 //状态,直接写1
|
||
}
|
||
*
|
||
*/
|
||
const sendEvent = function(data) {
|
||
return ajax.postJson(baseURL,'/xboe/m/stat/event/send',data);
|
||
}
|
||
|
||
/**
|
||
* 用户的统计信息
|
||
* @param {Object} aid 主页人的id
|
||
* @param {Object} data 参数 []数组,10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数,空数组 返回用户的全部类型统计。
|
||
*/
|
||
const userTotal = function(aid,data) {
|
||
return ajax.postJson(baseURL,'/xboe/m/stat/user/total/'+aid,data);
|
||
}
|
||
|
||
/**
|
||
* 用户动态,分页查询
|
||
*
|
||
* @param {
|
||
pageIndex,
|
||
pageSize,
|
||
contentType:'',内容类型
|
||
aid:'', //指定用户的动态,
|
||
hidden:true/false,//是否隐藏,不指定,查询全部
|
||
} data
|
||
*/
|
||
const userDynamicList = function(data) {
|
||
return ajax.post(baseURL,'/xboe/m/stat/userdynamic/list',data);
|
||
}
|
||
|
||
/**
|
||
* 获取用户最近 days 天的U币记录
|
||
* @param {String} aid 用户的id
|
||
* @param {Integer} days 整数,最近几天的记录,默认为7天
|
||
*/
|
||
const userCoinList = function(aid,days) {
|
||
return ajax.get(baseURL,'/xboe/m/stat/usercoinrecord/list?aid='+aid+'&days='+days);
|
||
}
|
||
/**
|
||
* 获取用户全部勋章
|
||
* @param {String} aid 用户的id
|
||
*
|
||
*/
|
||
const userMedal = function(aid) {
|
||
return ajax.get(baseURL,'/xboe/m/stat/medal/user-medal?aid='+aid);
|
||
}
|
||
|
||
|
||
/**
|
||
* 勋章信息
|
||
* 页面上不能修改,删除
|
||
*/
|
||
// const userMedalConfig = function() {
|
||
// return ajax.get(baseURL,'/xboe/m/stat/medalinfo/config');
|
||
// }
|
||
// get 获取勋章配置,返回的是列表
|
||
const userMedalConfig = function() {
|
||
return ajax.get(baseURL,'/xboe/m/stat/medal/config');
|
||
}
|
||
|
||
/**
|
||
* 查询勋章下等级所对应的用户数量
|
||
* @author wn
|
||
* @param {String} medalId 勋章id(必填)
|
||
*/
|
||
const userMedalLevelInfo = function(medalId) {
|
||
return ajax.get(baseURL,'/xboe/m/stat/medal/getUserMedalLevelInfo?medalId='+medalId);
|
||
}
|
||
|
||
/**
|
||
* 根据用户统计表查询用户经验值及对应的等级
|
||
* @author wn
|
||
* @param {String} aid 用户id(必填)
|
||
*/
|
||
const getUserEValueAndLevel = function(aid) {
|
||
return ajax.post(baseURL,'/xboe/m/stat/user/getUserEValueAndLevel?aid='+aid);
|
||
}
|
||
|
||
/**
|
||
* 隐藏动态
|
||
* @author wn
|
||
* @param {String} id 动态id(必填)
|
||
*/
|
||
const dynamicHide = function(id) {
|
||
return ajax.post(baseURL,'/xboe/m/stat/userdynamic/hide?id='+id);
|
||
}
|
||
|
||
|
||
export default {
|
||
sendEvent,
|
||
userTotal,
|
||
userDynamicList,
|
||
userCoinList,
|
||
userMedal,
|
||
userMedalConfig,
|
||
userMedalLevelInfo,
|
||
getUserEValueAndLevel,
|
||
dynamicHide
|
||
}
|