package com.ruoyi.web.controller.zhang;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.domain.ShareMore;
|
import com.ruoyi.domain.ZfDownload;
|
import com.ruoyi.service.ZfCollectionDownloadService;
|
import com.ruoyi.service.ZfCollectionShareService;
|
import com.ruoyi.service.ZfEventDownloadService;
|
import com.ruoyi.service.ZfEventShareService;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
|
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
|
|
@RestController
|
@RequestMapping("/zfCollectionShare")
|
public class ZfCollectionShareController extends BaseController {
|
@Resource
|
ZfCollectionShareService zfCollectionShareService;
|
|
@Resource
|
ZfCollectionDownloadService zfCollectionDownloadService;
|
|
@PostMapping("/share")
|
public AjaxResult share(@RequestBody ShareMore zfDoctor){
|
zfDoctor.setSysMenuId(2018L);
|
return zfCollectionShareService.saveZa(zfDoctor);
|
}
|
|
/**
|
* 根据UserId和分享人shareId查看已经授权给那些人那些数据
|
*/
|
@PostMapping("/getInfoByUserId")
|
public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
|
zfDoctor.setSysMenuId(2018L);
|
Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
|
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
return zfCollectionShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
|
}
|
|
/**
|
* 用户自己查看别人分享的数据和分享人
|
*/
|
@GetMapping("/getInfoByShareId")
|
public AjaxResult empowerGetInfo2(){
|
Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
|
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
return zfCollectionShareService.listUserId(pageNo ,pageSize);
|
}
|
/**
|
* 根据userId和shareId收回已经授权给那些人
|
*/
|
@PostMapping("/deleteInfoByUserId")
|
public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
|
zfDoctor.setSysMenuId(2018L);
|
return zfCollectionShareService.deleteZa(zfDoctor);
|
}
|
|
/**
|
* 下载分享的数据
|
*/
|
@PostMapping("/downloadDate")
|
public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
|
zfDownload.setSysMenuId(2018L);
|
return zfCollectionDownloadService.addData(zfDownload);
|
}
|
|
/**
|
* 展示下载分享的数据
|
*/
|
@GetMapping("/all")
|
public AjaxResult data(ZfDownload zfDownload){
|
zfDownload.setSysMenuId(2018L);
|
Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
|
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
return zfCollectionDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
|
}
|
}
|