AssetAreaController.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\controller\asset;
  15. use app\adminapi\controller\BaseAdminController;
  16. use app\adminapi\lists\asset\AssetLists;
  17. use app\adminapi\lists\asset\AssetAreaLists;
  18. use app\adminapi\logic\article\ArticleLogic;
  19. use app\adminapi\logic\notice\NoticeLogic;
  20. use app\adminapi\validate\article\ArticleValidate;
  21. use app\adminapi\validate\asset\AssetValidate;
  22. use app\adminapi\validate\asset\AssetAreaValidate;
  23. use app\adminapi\validate\notice\NoticeValidate;
  24. /**
  25. * 资产地址控制器
  26. * Class NoticeController
  27. * @package app\adminapi\controller\notice
  28. */
  29. class AssetAreaController extends BaseAdminController
  30. {
  31. // public array $notNeedLogin = ['getAssetData'];
  32. /**
  33. * @notes 查看资产列表
  34. * @return \think\response\Json
  35. * @author 段誉
  36. * @date 2021/12/29 9:55
  37. */
  38. public function lists()
  39. {
  40. return $this->dataLists(new AssetAreaLists());
  41. }
  42. /**
  43. * @notes 添加资产
  44. * @return \think\response\Json
  45. * @author heshihu
  46. * @date 2022/2/22 9:57
  47. */
  48. public function add()
  49. {
  50. $params = (new AssetAreaValidate())->post()->goCheck('add');
  51. AssetAreaLists::add($params);
  52. return $this->success('添加成功', [], 1, 1);
  53. }
  54. /**
  55. * @notes 编辑资产
  56. * @return \think\response\Json
  57. * @author heshihu
  58. * @date 2022/2/22 10:12
  59. */
  60. public function edit()
  61. {
  62. $params = (new AssetAreaValidate())->post()->goCheck('edit');
  63. $result = AssetAreaLists::edit($params);
  64. if (true === $result) {
  65. return $this->success('编辑成功', [], 1, 1);
  66. }
  67. return $this->fail(AssetAreaLists::getError());
  68. }
  69. /**
  70. * @notes 删除资讯
  71. * @return \think\response\Json
  72. * @author heshihu
  73. * @date 2022/2/22 10:17
  74. */
  75. public function delete()
  76. {
  77. $params = (new AssetAreaValidate())->post()->goCheck('delete');
  78. AssetAreaLists::delete($params);
  79. return $this->success('删除成功', [], 1, 1);
  80. }
  81. /**
  82. * @notes 资产详情
  83. * @return \think\response\Json
  84. * @author heshihu
  85. * @date 2022/2/22 10:15
  86. */
  87. public function detail()
  88. {
  89. $params = (new AssetAreaValidate())->goCheck('detail');
  90. $result = AssetAreaLists::detail($params);
  91. return $this->data($result);
  92. }
  93. /**
  94. * @notes 获取资产数据
  95. * @return \think\response\Json
  96. * @author 段誉
  97. * @date 2022/3/29 11:18
  98. */
  99. public function getAssetAreaData()
  100. {
  101. $result = AssetAreaLists::getAssetData();
  102. return $this->success('查询成功', $result, 1, 1);
  103. }
  104. }