新增腾讯im。
This commit is contained in:
@@ -105,4 +105,39 @@ class InquiryController extends AbstractController
|
||||
$data = $InquiryService->getPatientInquiryOrderInfo();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消患者问诊订单
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function putCancelPatientInquiryOrder(): ResponseInterface
|
||||
{
|
||||
$InquiryService = new InquiryService();
|
||||
$data = $InquiryService->putCancelPatientInquiryOrder();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除问诊订单
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function deletePatientInquiryOrder(): ResponseInterface
|
||||
{
|
||||
$InquiryService = new InquiryService();
|
||||
$data = $InquiryService->deletePatientInquiryOrder();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 问诊订单取消支付
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function putPatientInquiryOrderCancelPay(): ResponseInterface
|
||||
{
|
||||
$InquiryService = new InquiryService();
|
||||
$data = $InquiryService->putPatientInquiryOrderCancelPay();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,12 @@ use App\Request\UserRequest;
|
||||
use App\Services\UserDoctorService;
|
||||
use App\Services\UserService;
|
||||
use App\Utils\Http;
|
||||
use Extend\TencentIm\Account;
|
||||
use Extend\TencentIm\Friend;
|
||||
use Extend\TencentIm\Group;
|
||||
use Extend\TencentIm\Message;
|
||||
use Extend\TencentIm\MessageParams;
|
||||
use Extend\TencentIm\Profile;
|
||||
use Extend\Wechat\Wechat;
|
||||
use Extend\Wechat\WechatPay;
|
||||
use Hyperf\Amqp\Producer;
|
||||
@@ -75,27 +81,22 @@ class UserController extends AbstractController
|
||||
|
||||
// 支付测试
|
||||
public function testpay(){
|
||||
// $weChat = new Wechat(1);
|
||||
//
|
||||
// $wx_info_data = $weChat->codeToSession("0219AIFa1ROoUE0e4lIa1bO27I29AIF9");
|
||||
// dump($wx_info_data);die;
|
||||
|
||||
// 发起支付
|
||||
$out_trade_no = $this->request->input('out_trade_no');
|
||||
$generator = $this->container->get(IdGeneratorInterface::class);
|
||||
|
||||
$WechatPay = new WechatPay(1);
|
||||
|
||||
// 获取预支付交易会话标识
|
||||
$total = 0.01 * 100;
|
||||
$prepay = $WechatPay->getJsapiPrepayId($out_trade_no,$total,"omgU35DlE-rxTAGgcBjOuc4xdcX8");
|
||||
if (empty($prepay)){
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
||||
}
|
||||
|
||||
// 获取小程序支付配置
|
||||
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||
return $this->response->json($pay_config);
|
||||
// $out_trade_no = $this->request->input('out_trade_no');
|
||||
// $generator = $this->container->get(IdGeneratorInterface::class);
|
||||
//
|
||||
// $WechatPay = new WechatPay(1);
|
||||
//
|
||||
// // 获取预支付交易会话标识
|
||||
// $total = 0.01 * 100;
|
||||
// $prepay = $WechatPay->getJsapiPrepayId($out_trade_no,$total,"omgU35DlE-rxTAGgcBjOuc4xdcX8");
|
||||
// if (empty($prepay)){
|
||||
// return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
||||
// }
|
||||
//
|
||||
// // 获取小程序支付配置
|
||||
// $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||
// return $this->response->json($pay_config);
|
||||
|
||||
// 发起退款
|
||||
// $WechatPay = new WechatPay(1);
|
||||
@@ -117,5 +118,53 @@ class UserController extends AbstractController
|
||||
//
|
||||
// $result = $WechatPay->refund($options);
|
||||
// dump($result);
|
||||
|
||||
// 创建账号
|
||||
$account = new Account();
|
||||
$profile = new Profile();
|
||||
$group = new Group();
|
||||
$friend = new Friend();
|
||||
$message = new Message();
|
||||
// $result = $account->createAccount(1234567,'测试患者',"https://img.applets.igandanyiyuan.com/applet/doctor/avatar/03dc8df2-e7c0-4ad9-b87e-5133e40e0f76.jpg");
|
||||
|
||||
// 查询账号导入状态
|
||||
// $result = $account->checkAccountStatus("123456");
|
||||
|
||||
// 设置账户资料
|
||||
// $arg = array();
|
||||
// $arg['Tag_Profile_IM_Gender'] = "Gender_Type_Male";
|
||||
// $arg['Tag_Profile_IM_BirthDay'] = 19961007;
|
||||
// $arg['Tag_Profile_Custom_Hname'] = "协和医院";
|
||||
// $arg['Tag_Profile_Custom_Title'] = "主任医师";
|
||||
// $result = $profile->setProfile("123456",$arg);
|
||||
|
||||
// 添加用户好友分组
|
||||
// $result = $group->addUserGroup('123456');
|
||||
|
||||
// 获取用户好友分组
|
||||
// $result = $group->getUserGroup('123456');
|
||||
|
||||
// 添加好友
|
||||
// $result = $friend->addFriend("123456",'1234567',"快速问诊");
|
||||
|
||||
// 发送消息
|
||||
$arg = array();
|
||||
$arg['From_Account'] = "1234567"; // 发送方user_id 如系统发送,无需填写
|
||||
$arg['To_Account'] = "123456"; // 接收方user_id
|
||||
$arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback'];
|
||||
|
||||
$arg['MsgBody'] = [
|
||||
[
|
||||
"MsgType" => "TIMTextElem",
|
||||
"MsgContent" => [
|
||||
"Text" => "测试消息",
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
$result = $message->sendMessage($arg);
|
||||
dump($result);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,18 @@ use App\Request\UserDoctorRequest;
|
||||
use App\Services\DoctorAuthService;
|
||||
use App\Services\DoctorInquiryService;
|
||||
use App\Services\UserDoctorService;
|
||||
use Extend\TencentIm\Account;
|
||||
use Hyperf\Amqp\Producer;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Utils\ApplicationContext;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||
|
||||
class UserDoctorController extends AbstractController
|
||||
{
|
||||
@@ -280,6 +286,13 @@ class UserDoctorController extends AbstractController
|
||||
/**
|
||||
* 获取医生名片
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws ClientExceptionInterface
|
||||
* @throws DecodingExceptionInterface
|
||||
* @throws RedirectionExceptionInterface
|
||||
* @throws ServerExceptionInterface
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
public function getDoctorInfoCard(): ResponseInterface
|
||||
{
|
||||
@@ -287,4 +300,9 @@ class UserDoctorController extends AbstractController
|
||||
$data = $UserDoctorService->getDoctorInfoCard();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
// 获取医生问诊消息列表
|
||||
public function getDoctorMessageList(){
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user