syntax = "proto3";


package com.ywt.gapi.user;

option java_multiple_files = true;
option java_package = "com.ywt.gapi.ordercenter";
option java_outer_classname = "OrdercenterProto";


//创建订单请求消息
message CreateOrderRequest{
    int32 userId = 1;
    string patientMobile = 2;
    int32 amount = 3;                           //单位：分
    string remark = 4;
    int32 orderType = 5;
    int32 bizId = 6;
    int32 doctorId = 7;
    string title = 8;
    string paymentCallbackMethod = 9;           //支付成功后回调grpc方法，结构：(/${package}.${service}/${method})，如：/com.ywt.gapi.mq.MQExecutorService/executeGRPC
    string statusChangedCallbackMethod = 10;
    string custom = 11;                         //自定义数据
    string payCode = 12;                        //支付代码--支付中心统一编码
    string payBody = 13;
    int32 terminal = 14;
    string refundNotifyRestUrl = 15;            //退款成功后回调rest服务方法，url格式: rest://com.ywt.MgDrugApiService/path1/path2
}
//创建订单响应消息
message CreateOrderResponse{
    int32 code = 1;
    string info = 2;
    int32 orderId = 3;
    string orderNo = 4;
}


//退款请求消息
message RefundRequest {
    string orderNo = 1;          //订单编号
    int32 orderId = 2;          //订单号
    int32 amount = 3;           //退款金额(单位：分), 当为0时，默认该订单总金额
    string opBy = 4;            //操作人, 当人工退款方式时必填
    int32 refundType = 5;       //退款方式，1: 人工, 2: 系统
    string refundNotifyMethod = 6; //退款成功后回调grpc方法，结构：(/${package}.${service}/${method})，如：/com.ywt.gapi.mq.MQExecutorService/executeGRPC
    string refundNotifyRestUrl = 7; //退款成功后回调rest服务方法，url格式: rest://com.ywt.MgDrugApiService/path1/path2
    string remark = 8;
    string custom = 9;          //本次操作自定义数据，【订单退款成功通知】会通过 custom 回发
    map<string, string> bizContent = 10;  // map 类型业务自定义参数，目前供支付宝医保使用
}
//退款响应消息
message RefundResponse {
    int32 code = 1;
    string info = 2;
    string refundNo = 3;    //退款流水号
}


//订单中心服务  // 对应 rpc-ordercenter-service 项目的 OrderCenterServiceImpl 类
service OrderCenterService {
    //创建订单
    rpc createOrder(CreateOrderRequest) returns (CreateOrderResponse);

    //退款
    rpc refund(RefundRequest) returns (RefundResponse);

}