mr.php 942 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * The mr entry point of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author liyuchun <liyuchun@easysoft.ltd>
  8. * @package repo
  9. * @version 1
  10. * @link https://www.zentao.net
  11. */
  12. class mrEntry extends baseEntry
  13. {
  14. /**
  15. * Create mr.
  16. *
  17. * @access public
  18. * @return string
  19. */
  20. public function post()
  21. {
  22. $this->loadController('mr', 'create');
  23. $fields = 'repoID,jobID,sourceBranch,targetBranch,diffs,mergeStatus';
  24. $this->batchSetPost($fields);
  25. $MRID = $this->loadModel('mr')->apiCreate();
  26. if(dao::isError()) $this->sendError(400, dao::getError());
  27. $MR = $this->mr->fetchByID($MRID);
  28. return $this->send(201, $MR);
  29. }
  30. }