AssetController.php 2.0 KB

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