You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

  1. <?php
  2. namespace App\Controller;
  3. use App\Constants\ErrorCode;
  4. use App\Exception\BusinessException;
  5. use App\Request\EvaluateRequest;
  6. use App\Service\ServiceEvaluateServiceInterface;
  7. use Hyperf\Di\Annotation\Inject;
  8. class ServiceEvaluateController extends BaseController
  9. {
  10. /**
  11. * @Inject
  12. * @var ServiceEvaluateServiceInterface
  13. */
  14. protected $evaluateService;
  15. /**
  16. * 提交评价
  17. *
  18. * 评价内容:
  19. * 服务态度评分、服务质量评分、满意度评分、评价内容
  20. * 关联信息:
  21. * 服务专员ID、市场ID、评价的用户ID
  22. * 查询信息:
  23. * 用户注册/创建时间
  24. *
  25. */
  26. public function evaluate(EvaluateRequest $validator)
  27. {
  28. // TODO 数据保存失败的返回处理
  29. // TODO 自定义验证用户、市场、服务人员ID
  30. $ret = $this->evaluateService->evaluate();
  31. return $this->success($ret);
  32. }
  33. /**
  34. *获取服务专员基本信息
  35. */
  36. public function getPersonnelInfo()
  37. {
  38. //根据用户iD 获取服务专员详细信息
  39. $user_id = $this->request->input('user_id', 0);
  40. return $this->success($this->evaluateService->getPersonnelInfo($user_id));
  41. }
  42. /**
  43. *获取服务专员评价列表
  44. */
  45. public function getEvaluateList()
  46. {
  47. //根据用户iD 获取服务专员详细信息
  48. $service_personnel_id = $this->request->input('service_personnel_id', 0);
  49. return $this->success($this->evaluateService->getEvaluateList($service_personnel_id));
  50. }
  51. }