service = new CustomerService(); parent::__construct($app); } public function add(Request $request) { $params = (new AddCustomerValidate())->message([ 'name_zh.require' => lang("The customer name_zh does not comply with the rule"), 'name_en.require' => lang("The customer name_en does not comply with the rule"), 'mobile.require' => lang("The mobile does not comply with the rule"), 'address.require' => lang("The address does not comply with the rule"), 'email.email' => lang("The email does not comply with the rule"), 'sex.require' => lang("The sex does not comply with the rule"), 'linkman.require' => lang("The linkman does not comply with the rule"), 'zue_coin.require' => lang("The zue_coin does not comply with the rule"), 'sun_calendar.require' => lang("The sun_calendar does not comply with the rule"), 'lunar_calendar.require' => lang("The lunar_calendar does not comply with the rule"), ])->requestBodyCheck($request); $res = $this->service->add($params); predicate($res->bool, $res->message); return $this->ok($res->data); } }