wordAction.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * 【文档】应用的接口
  4. * createname:雨中磐石
  5. * homeurl:http://www.rockoa.com/
  6. * Copyright (c) 2016 rainrock (www.rockoa.com)
  7. * Date:2016-08-08
  8. */
  9. class wordClassAction extends apiAction
  10. {
  11. //获取数据
  12. public function getdataAction()
  13. {
  14. $barr = m('word')->getdata();
  15. $this->showreturn($barr);
  16. }
  17. //保存文件
  18. public function savefileAction()
  19. {
  20. m('word')->savefile();
  21. $frs = m('file')->getone($this->post('sid'));
  22. $this->showreturn($frs);
  23. }
  24. //创建文件夹
  25. public function createfolderAction()
  26. {
  27. $cqid = $this->post('cqid');
  28. $typeid = (int)$this->post('typeid','0');
  29. $name = $this->rock->xssrepstr($this->post('name'));
  30. $arr = m('word')->createfolder($name, $cqid, $typeid);
  31. $this->showreturn($arr);
  32. }
  33. //从命名
  34. public function renameAction()
  35. {
  36. $id = (int)$this->post('id');
  37. $name = $this->rock->xssrepstr($this->getvals('name'));
  38. $type = $this->post('type');
  39. m('word')->update("`name`='$name'", $id);
  40. $this->showreturn('');
  41. }
  42. //删除
  43. public function delfileAction()
  44. {
  45. $id = (int)$this->post('id');
  46. $barr = m('word')->delword($id);
  47. if(!$barr['success']){
  48. $this->showreturn('',$barr['msg'],201);
  49. }else{
  50. $this->showreturn('');
  51. }
  52. }
  53. //共享
  54. public function shatefileAction()
  55. {
  56. m('word')->sharefile();
  57. $this->showreturn('');
  58. }
  59. public function movegetAction()
  60. {
  61. return m('word')->getworcfolder();
  62. }
  63. public function movefileAction()
  64. {
  65. $barr = m('word')->movefile();
  66. if(!$barr['success']){
  67. $this->showreturn('',$barr['msg'],201);
  68. }else{
  69. $this->showreturn('');
  70. }
  71. }
  72. }
粤ICP备19079148号