AssetController.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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\logic\notice\NoticeLogic;
  18. use app\adminapi\validate\asset\AssetValidate;
  19. use app\adminapi\validate\notice\NoticeValidate;
  20. /**
  21. * 资产控制器
  22. * Class NoticeController
  23. * @package app\adminapi\controller\notice
  24. */
  25. class AssetController extends BaseAdminController
  26. {
  27. /**
  28. * @notes 查看资产列表
  29. * @return \think\response\Json
  30. * @author 段誉
  31. * @date 2021/12/29 9:55
  32. */
  33. public function lists()
  34. {
  35. return $this->dataLists(new AssetLists());
  36. }
  37. /**
  38. * @notes 添加资产
  39. * @return \think\response\Json
  40. * @author heshihu
  41. * @date 2022/2/22 9:57
  42. */
  43. public function add()
  44. {
  45. $params = (new AssetValidate())->post()->goCheck('add');
  46. AssetLists::add($params);
  47. return $this->success('添加成功', [], 1, 1);
  48. }
  49. /**
  50. * @notes 查看通知设置详情
  51. * @return \think\response\Json
  52. * @author 段誉
  53. * @date 2022/3/29 11:18
  54. */
  55. public function detail()
  56. {
  57. $params = (new NoticeValidate())->goCheck('detail');
  58. $result = NoticeLogic::detail($params);
  59. return $this->data($result);
  60. }
  61. /**
  62. * @notes 通知设置
  63. * @return \think\response\Json
  64. * @author 段誉
  65. * @date 2022/3/29 11:18
  66. */
  67. public function set()
  68. {
  69. $params = $this->request->post();
  70. $result = NoticeLogic::set($params);
  71. if ($result) {
  72. return $this->success('设置成功');
  73. }
  74. return $this->fail(NoticeLogic::getError());
  75. }
  76. }