case-data/api/api.js
zoujiandong 6e320c3944 8.3
2025-08-03 16:29:54 +08:00

205 lines
6.3 KiB
JavaScript

import {request} from '@/utils/request.js'
const loadingTime = 500;
const showLog = false;
const api = {
wxLogin(data) {
return request('/login/wechat/mobile', data, 'post', true);
},
mobileLogin(data) {
return request('/login/mobile', data, 'post', true);
},
getCode(data) {
return request('/code/phone', data, 'post', true);
},
getHomeData(data) { //首页数据
return request('/index/clinical', data, 'get', true);
},
getHomeStatics(data) { //首页统计数据
return request('/clinical/stats', data, 'get', true);
},
getArticleDetail(id) { //获取详情
return request('/clinical/article/'+id,{}, 'get', false);
},
getVideoDetail(id) { //获取详情
return request('/clinical/video/'+id,{}, 'get', false);
},
collectArticle(id){
return request('/clinical/article/collect/'+id, {}, 'post',false);
},
cancelCollectArticle(id){
return request('/clinical/article/collect/'+id, {}, 'delete',false);
},
collectVideo(id){
return request('/clinical/video/collect/'+id, {}, 'post',false);
},
cancelCollectVideo(id){
return request('/clinical/video/collect/'+id,{}, 'delete',false);
},
collectExchange(id){
return request('/exchange/collect/'+id, {}, 'post',false);
},
cancelCollectExchange(id){
return request('/exchange/collect/'+id,{}, 'delete',false);
},
addVideoComment(id,data){
return request('/clinical/video/comment/'+id,data, 'post',true,'application/json');
},
delVideoComment(id){
return request('/clinical/video/comment/'+id, {}, 'delete',false);
},
topVideoComment(id){
return request('/clinical/video/comment/top/'+id, {}, 'put',false);
},
cancelTopVideoComment(id){
return request('/clinical/video/comment/top/'+id, {}, 'delete',false);
},
addArticleComment(id,data){
return request('/clinical/article/comment/'+id, data, 'post',true,'application/json');
},
delArticleComment(id){
return request('/clinical/article/comment/'+id, {}, 'delete',false);
},
topArticleComment(id){
return request('/clinical/article/comment/top/'+id, {}, 'put',false);
},
cancelTopArticleComment(id){
return request('/clinical/article/comment/top/'+id, {}, 'delete',false);
},
getArticleComment(data){
return request('/clinical/article/comment/page',data, 'post', false,'application/json');
},
getVideoComment(data){
return request('/clinical/video/comment/page',data, 'post', false,'application/json');
},
searchArticle(data){
return request('/clinical/article/search', data, 'post',true,'application/json');
},
searchVideo(data){
return request('/clinical/video/search', data, 'post',true,'application/json');
},
searchDoctor(data){
return request('/clinical/doctor/search', data, 'post',true,'application/json');
},
searchHospital(data){
return request('/clinical/hospital/search', data, 'post',true,'application/json');
},
getStaticDoctor(id){
return request('/clinical/stats/doctor/'+id,{}, 'get',true);
},
getStaticSick(data) { //首页统计数据
return request('/clinical/stats/label', data, 'get', false);
},
getStaticHospital(id){
return request('/clinical/stats/hospital/'+id, {}, 'get',false);
},
getUserInfo(){
return request('/user',{}, 'get', false);
},
getExchangeStatic(){
return request('/exchange/stats',{}, 'get', false);
},
getExchangeStaticUser(id){
return request('/exchange/stats/user/'+id,{}, 'get', false);
},
searchExchage(data){
return request('/exchange/search', data, 'post',true,'application/json');
},
searchExchageGood(data){
return request('/exchange/list', data, 'post',true,'application/json');
},
getExchangeDetail(id){
return request('/exchange/'+id,{}, 'get', false);
},
getExchangeVote(id){
return request('/exchange/vote/'+id,{}, 'get', false);
},
exchangeCollect(id){
return request('/exchange/collect/'+id, {}, 'post',false);
},
cancelExchangeCollect(id){
return request('/exchange/collect/'+id, {}, 'delete',false);
},
addExchangeComment(id,data){
return request('/exchange/comment/'+id, data, 'post',true,'application/json');
},
delExchangeComment(id){
return request('/exchange/comment/'+id, {}, 'delete',false);
},
topExchangeComment(id){
return request('/exchange/comment/top/'+id, {}, 'put',false);
},
cancleTopExchangeComment(id){
return request('/exchange/comment/top/'+id, {}, 'delete',false);
},
getExchangeComment(data){
return request('/exchange/comment/page', data, 'post',false,'application/json');
},
getExchangeCommentUser(data){
return request('/exchange/user/comment/page', data, 'post',false,'application/json');
},
addExchange(data){
return request('/exchange', data, 'post',false,'application/json');
},
getDraftList(data){
return request('/exchange/draft/search', data, 'post',false,'application/json');
},
saveDraft(data){
return request('/exchange/draft', data, 'post',true,'application/json');
},
delDraft(id){
return request('/exchange/draft/'+id, {}, 'delete',false);
},
getVideoCommentUser(data){
return request('/clinical/video/user/comment/page', data, 'post',false,'application/json');
},
getArticleCommentUser(data){
return request('/clinical/article/user/comment/page', data, 'post',false,'application/json');
},
getMyCollect(data){
return request('/user/collect/search',data, 'post',false,'application/json');
},
getMyRead(data){
return request('/user/case/read/search',data, 'post',true,'application/json');
},
getOss(data){
return request('/sign/oss',data, 'get', false);
},
getCaseLabel(data){
return request('/case/label',data,'get', false);
},
getSearchLabel(data){
return request('/clinical/label/search',data,'post', true,'application/json');
},
addVote(id,data){
return request('/exchange/vote/'+id,data,'post',true,'application/json');
},
ossUpload(url,data){
return request(url,data,'post','multipart/form-data')
},
getUserPoint(data){
return request('/user/point',data,'get');
},
givePoint(data){
return request('/reward',data,'post',true);
},
h5Login(data){
return request('/login/hcp',data,'post',true);
},
readRecord(data){
return request('/user/case/read',data,'post',false,'application/json');
},
updateExchange(id,data){
return request('/exchange/'+id, data, 'put',true,'application/json');
},
delExchange(id){
return request('/exchange/'+id, {}, 'delete',true);
},
}
export default api