NewsUtils.php 795 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * NewsUtils.php UTF-8
  4. *
  5. *
  6. * @date : 2018/5/4 15:21
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace huolib\utils;
  13. use huolib\constant\GameConst;
  14. use huolib\constant\NewsConst;
  15. use huolib\status\NewsStatus;
  16. class NewsUtils {
  17. /**
  18. * 校验资讯类型
  19. *
  20. * @param int $post_type
  21. *
  22. * @return int
  23. */
  24. public static function checkNewsType($post_type = 0) {
  25. if (empty($post_type)) {
  26. return NewsStatus::NO_ERROR;
  27. }
  28. $_rs = NewsConst::getNewsMsg($post_type);
  29. if (false == $_rs) {
  30. return NewsStatus::NEWS_TYPE_ERROR;
  31. }
  32. return NewsStatus::NO_ERROR;
  33. }
  34. }