OfficialAccountEnum.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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\common\enum;
  15. /**
  16. * 微信公众号枚举
  17. * Class OfficialAccountEnum
  18. * @package app\common\enum
  19. */
  20. class OfficialAccountEnum
  21. {
  22. /**
  23. * 菜单类型
  24. * click - 关键字
  25. * view - 跳转网页链接
  26. * miniprogram - 小程序
  27. */
  28. const MENU_TYPE = ['click', 'view', 'miniprogram'];
  29. /**
  30. * 关注回复
  31. */
  32. const REPLY_TYPE_FOLLOW = 1;
  33. /**
  34. * 关键字回复
  35. */
  36. const REPLY_TYPE_KEYWORD = 2;
  37. /**
  38. * 默认回复
  39. */
  40. const REPLY_TYPE_DEFAULT= 3;
  41. /**
  42. * 回复类型
  43. * follow - 关注回复
  44. * keyword - 关键字回复
  45. * default - 默认回复
  46. */
  47. const REPLY_TYPE = [
  48. self::REPLY_TYPE_FOLLOW => 'follow',
  49. self::REPLY_TYPE_KEYWORD => 'keyword',
  50. self::REPLY_TYPE_DEFAULT => 'default'
  51. ];
  52. /**
  53. * 匹配类型 - 全匹配
  54. */
  55. const MATCHING_TYPE_FULL = 1;
  56. /**
  57. * 匹配类型 - 模糊匹配
  58. */
  59. const MATCHING_TYPE_FUZZY = 2;
  60. /**
  61. * 消息类型 - 事件
  62. */
  63. const MSG_TYPE_EVENT = 'event';
  64. /**
  65. * 消息类型 - 文本
  66. */
  67. const MSG_TYPE_TEXT = 'text';
  68. /**
  69. * 事件类型 - 关注
  70. */
  71. const EVENT_SUBSCRIBE = 'subscribe';
  72. /**
  73. * @notes 获取类型英文名称
  74. * @param $type
  75. * @return string
  76. * @author Tab
  77. * @date 2021/7/29 16:32
  78. */
  79. public static function getReplyType($type)
  80. {
  81. return self::REPLY_TYPE[$type] ?? '';
  82. }
  83. }