FileValidate.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\validate;
  20. use app\common\validate\BaseValidate;
  21. class FileValidate extends BaseValidate
  22. {
  23. protected $rule = [
  24. 'id' => 'require|number',
  25. 'cid' => 'require|number',
  26. 'ids' => 'require|array',
  27. 'type' => 'require|in:10,20,30',
  28. 'pid' => 'require|number',
  29. 'name' => 'require'
  30. ];
  31. protected $message = [
  32. 'id.require' => '缺少id参数',
  33. 'cid.require' => '缺少cid参数',
  34. 'ids.require' => '缺少ids参数',
  35. 'type.require' => '缺少type参数',
  36. 'pid.require' => '缺少pid参数',
  37. 'name.require' => '缺少名称',
  38. ];
  39. /**
  40. * @notes id验证场景
  41. * @return FileValidate
  42. * @author 张无忌
  43. * @date 2021/7/28 15:40
  44. */
  45. public function sceneId()
  46. {
  47. return $this->only(['id']);
  48. }
  49. /**
  50. * @notes 重命名文件场景
  51. * @author 张无忌
  52. * @date 2021/7/29 17:14
  53. */
  54. public function sceneRename()
  55. {
  56. return $this->only(['id', 'name']);
  57. }
  58. /**
  59. * @notes 新增分类场景
  60. * @return FileValidate
  61. * @author 张无忌
  62. * @date 2021/7/28 15:39
  63. */
  64. public function sceneAddCate()
  65. {
  66. return $this->only(['type', 'pid', 'name']);
  67. }
  68. /**
  69. * @notes 编辑分类场景
  70. * @return FileValidate
  71. * @author 张无忌
  72. * @date 2021/7/28 15:39
  73. */
  74. public function sceneEditCate()
  75. {
  76. return $this->only(['id', 'name']);
  77. }
  78. /**
  79. * @notes 移动场景
  80. * @return FileValidate
  81. * @author 张无忌
  82. * @date 2021/7/28 15:39
  83. */
  84. public function sceneMove()
  85. {
  86. return $this->only(['ids', 'cid']);
  87. }
  88. /**
  89. * @notes 删除场景
  90. * @return FileValidate
  91. * @author 张无忌
  92. * @date 2021/7/28 15:39
  93. */
  94. public function sceneDelete()
  95. {
  96. return $this->only(['ids']);
  97. }
  98. }