2025-02-21 13:09:29 +00:00
|
|
|
|
package bundle
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2025-06-15 05:23:11 +00:00
|
|
|
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
2025-04-14 08:12:37 +00:00
|
|
|
|
"encoding/json"
|
2025-02-21 13:09:29 +00:00
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
2025-06-14 02:22:02 +00:00
|
|
|
|
"fonchain-fiee/api/accountFiee"
|
2025-02-21 13:09:29 +00:00
|
|
|
|
"fonchain-fiee/api/bundle"
|
|
|
|
|
"fonchain-fiee/api/order"
|
2025-04-14 08:12:37 +00:00
|
|
|
|
"fonchain-fiee/api/payment"
|
2025-02-22 07:44:16 +00:00
|
|
|
|
"fonchain-fiee/pkg/config"
|
2025-02-21 13:09:29 +00:00
|
|
|
|
"fonchain-fiee/pkg/model/login"
|
|
|
|
|
"fonchain-fiee/pkg/service"
|
|
|
|
|
"fonchain-fiee/pkg/service/bundle/common"
|
|
|
|
|
bundleModel "fonchain-fiee/pkg/service/bundle/model"
|
|
|
|
|
"io"
|
2025-03-29 02:53:46 +00:00
|
|
|
|
"math"
|
2025-02-21 13:09:29 +00:00
|
|
|
|
"net/http"
|
|
|
|
|
"strconv"
|
2025-03-25 08:30:58 +00:00
|
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"github.com/gin-gonic/gin/binding"
|
2025-02-21 13:09:29 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func CreateStripeCheckoutSession(c *gin.Context) {
|
|
|
|
|
var req order.CreateStripeCheckoutSessionRequest
|
|
|
|
|
|
|
|
|
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取 用户信息
|
|
|
|
|
userInfo := login.GetUserInfoFromC(c)
|
|
|
|
|
|
|
|
|
|
// 检查 订单信息
|
|
|
|
|
detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{
|
|
|
|
|
OrderNo: req.OutTradeNo,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if detailErr != nil {
|
|
|
|
|
service.Error(c, detailErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-29 02:33:27 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID)
|
|
|
|
|
|
2025-02-21 13:09:29 +00:00
|
|
|
|
// 判断 是否是 本人操作
|
|
|
|
|
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
|
|
|
|
|
service.Error(c, errors.New(common.NotMatchOrderInfo))
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-03-28 14:02:29 +00:00
|
|
|
|
|
2025-03-29 02:33:27 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount)
|
|
|
|
|
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
|
2025-03-29 02:46:33 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
|
2025-03-29 02:33:27 +00:00
|
|
|
|
|
2025-03-25 08:30:58 +00:00
|
|
|
|
//金额校验
|
2025-03-29 02:53:46 +00:00
|
|
|
|
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
|
|
|
|
|
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
|
|
|
|
if orderAmountInCents != reqAmountInCents {
|
2025-03-29 02:54:52 +00:00
|
|
|
|
fmt.Println("111111111111111111111111111111111111")
|
2025-03-25 08:30:58 +00:00
|
|
|
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-02-21 13:09:29 +00:00
|
|
|
|
|
2025-03-29 02:33:27 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
|
|
|
|
|
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
|
|
|
|
|
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
|
|
|
|
|
|
2025-02-21 13:09:29 +00:00
|
|
|
|
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
|
|
|
|
|
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
|
|
|
|
|
// 查询支付结果
|
|
|
|
|
stripeInfosRes, stripeInfosErr := service.OrderProvider.QueryStripeInfoByCheckSessionIds(context.Background(), &order.QueryStripeInfoRequest{
|
|
|
|
|
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if stripeInfosErr != nil {
|
|
|
|
|
service.Error(c, errors.New(common.ErrorQueryStripeInfo))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if stripeInfosRes != nil && len(stripeInfosRes.StripeInfos) > 0 {
|
|
|
|
|
for _, stripeInfo := range stripeInfosRes.StripeInfos {
|
2025-02-23 01:46:05 +00:00
|
|
|
|
if stripeInfo.OutTradeNo == detail.OrderRecord.OrderNo && stripeInfo.PaymentIntentStatus == "paid" {
|
2025-02-21 13:09:29 +00:00
|
|
|
|
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
Uuid: detail.OrderRecord.Uuid,
|
|
|
|
|
Status: bundleModel.OrderPaid,
|
|
|
|
|
PayTime: common.GetBeijingTime(),
|
|
|
|
|
})
|
2025-02-23 03:11:31 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.Uuid :", detail.OrderRecord.Uuid)
|
2025-02-21 13:09:29 +00:00
|
|
|
|
if updateOrderRecordErr != nil {
|
|
|
|
|
service.Error(c, detailErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
service.Success(c, &service.Response{
|
|
|
|
|
Msg: common.HadPay,
|
|
|
|
|
Code: 0,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//调用微服务获取支付地址
|
|
|
|
|
result, err := service.OrderProvider.CreateStripeCheckoutSession(context.Background(), &req)
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-29 02:33:27 +00:00
|
|
|
|
fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId)
|
|
|
|
|
fmt.Println("result.CheckoutSessionUrl :", result.CheckoutSessionUrl)
|
|
|
|
|
|
2025-02-21 13:09:29 +00:00
|
|
|
|
//更新订单状态
|
|
|
|
|
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
Uuid: detail.OrderRecord.Uuid,
|
|
|
|
|
CheckoutSessionId: result.CheckoutSessionId,
|
|
|
|
|
CheckoutSessionUrl: result.CheckoutSessionUrl,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if updateOrderRecordErr != nil {
|
|
|
|
|
service.Error(c, updateOrderRecordErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
service.Success(c, result)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-14 08:12:37 +00:00
|
|
|
|
func CreateAntomPay(c *gin.Context) {
|
|
|
|
|
var req order.CreateStripeCheckoutSessionRequest
|
|
|
|
|
|
|
|
|
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取 用户信息
|
|
|
|
|
userInfo := login.GetUserInfoFromC(c)
|
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
// outTradeNo就是orderNo,根据这个去查询子表的source,如果是2就时单独的子套餐,如果是1就是主套餐
|
|
|
|
|
orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{
|
2025-04-14 08:12:37 +00:00
|
|
|
|
OrderNo: req.OutTradeNo,
|
|
|
|
|
})
|
2025-06-15 05:23:11 +00:00
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,查询订单source报错:", err)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,查询订单source报错:", err)
|
|
|
|
|
service.Error(c, err)
|
2025-04-14 08:12:37 +00:00
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-19 01:51:44 +00:00
|
|
|
|
currencyType := 0
|
|
|
|
|
if req.ProductPriceCurrency == "cny" || req.ProductPriceCurrency == "CNY" {
|
|
|
|
|
currencyType = 1
|
|
|
|
|
}
|
|
|
|
|
if req.ProductPriceCurrency == "usd" || req.ProductPriceCurrency == "USD" {
|
|
|
|
|
currencyType = 2
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-16 01:56:09 +00:00
|
|
|
|
bundleName := "" // 套餐名称
|
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
if orderLimit != nil && orderLimit.Type == 1 { // 这儿的type实际就是source
|
|
|
|
|
// 检查 订单信息 type是1说明既有主套餐又有增值服务
|
|
|
|
|
detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{
|
|
|
|
|
OrderNo: req.OutTradeNo,
|
|
|
|
|
})
|
|
|
|
|
if detailErr != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,查询主订单信息报错:", detailErr)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,查询主订单信息报错:", detailErr)
|
|
|
|
|
service.Error(c, detailErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
|
|
|
|
|
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
|
|
|
|
|
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
|
2025-06-16 01:56:09 +00:00
|
|
|
|
|
|
|
|
|
bundleName = detail.OrderRecord.BundleName
|
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
// 主套餐
|
|
|
|
|
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
|
|
|
|
|
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
|
|
|
|
|
// 查询支付结果
|
|
|
|
|
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
|
|
|
|
|
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if stripeInfosErr != nil {
|
|
|
|
|
service.Error(c, errors.New(common.ErrorQueryStripeInfo))
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
if stripeInfosRes != nil && len(stripeInfosRes.Infos) > 0 {
|
|
|
|
|
for _, info := range stripeInfosRes.Infos {
|
|
|
|
|
if info.OutTradeNo == detail.OrderRecord.OrderNo && info.Status == "paid" {
|
|
|
|
|
// 更新主套餐和子套餐 TODO
|
|
|
|
|
// 更新子套餐,TODO
|
|
|
|
|
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
OrderNo: req.OutTradeNo,
|
|
|
|
|
PayTime: common.GetBeijingTime(),
|
|
|
|
|
Status: bundleModel.OrderPaid,
|
|
|
|
|
})
|
|
|
|
|
fmt.Println("detail.OrderRecord.Uuid :", detail.OrderRecord.Uuid)
|
|
|
|
|
if updateStatusErr != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,更新主套餐和子套餐支付状态报错:", updateStatusErr)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,更新主套餐和子套餐支付状态报错:", updateStatusErr)
|
|
|
|
|
service.Error(c, updateStatusErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
service.Success(c, &service.Response{
|
|
|
|
|
Msg: common.HadPay,
|
|
|
|
|
Code: 0,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID)
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
// 判断 是否是 本人操作
|
|
|
|
|
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
|
|
|
|
|
service.Error(c, errors.New(common.NotMatchOrderInfo))
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount)
|
|
|
|
|
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
|
|
|
|
|
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
//金额校验
|
|
|
|
|
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
|
|
|
|
|
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
|
|
|
|
if orderAmountInCents != reqAmountInCents {
|
|
|
|
|
fmt.Println("111111111111111111111111111111111111")
|
|
|
|
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
2025-04-14 08:12:37 +00:00
|
|
|
|
return
|
|
|
|
|
}
|
2025-06-15 05:23:11 +00:00
|
|
|
|
}
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
if orderLimit != nil && orderLimit.Type == 2 {
|
2025-06-15 11:19:10 +00:00
|
|
|
|
|
|
|
|
|
res, listErr := service.BundleProvider.OnlyAddValueListByOrderNo(context.Background(), &bundle.OnlyAddValueListByOrderNoRequest{
|
|
|
|
|
OrderNo: req.OutTradeNo,
|
2025-06-15 05:23:11 +00:00
|
|
|
|
})
|
|
|
|
|
if listErr != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,查询单独增值服务列表报错:", listErr)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,查询单独增值服务列表报错:", listErr)
|
|
|
|
|
service.Error(c, listErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-06-15 11:19:10 +00:00
|
|
|
|
if res != nil && len(res.AddBundleInfos) > 0 {
|
|
|
|
|
firstAddBundle := res.AddBundleInfos[0]
|
2025-06-15 05:23:11 +00:00
|
|
|
|
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
|
2025-06-15 11:19:10 +00:00
|
|
|
|
if firstAddBundle.PaymentStatus == bundleModel.OrderSigned && firstAddBundle.CheckOutSessionId != "" {
|
2025-06-15 05:23:11 +00:00
|
|
|
|
// 查询支付结果
|
|
|
|
|
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
|
2025-06-15 11:19:10 +00:00
|
|
|
|
CheckoutSessionIds: []string{firstAddBundle.CheckOutSessionId},
|
2025-06-15 05:23:11 +00:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if stripeInfosErr != nil {
|
|
|
|
|
service.Error(c, errors.New(common.ErrorQueryStripeInfo))
|
2025-04-14 08:12:37 +00:00
|
|
|
|
return
|
|
|
|
|
}
|
2025-06-15 05:23:11 +00:00
|
|
|
|
|
|
|
|
|
if stripeInfosRes != nil && len(stripeInfosRes.Infos) > 0 {
|
|
|
|
|
for _, info := range stripeInfosRes.Infos {
|
2025-06-15 11:19:10 +00:00
|
|
|
|
if info.OutTradeNo == firstAddBundle.OrderNo && info.Status == "paid" {
|
2025-06-15 05:23:11 +00:00
|
|
|
|
// 更新子套餐,TODO
|
|
|
|
|
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
OrderNo: req.OutTradeNo,
|
|
|
|
|
PayTime: common.GetBeijingTime(),
|
|
|
|
|
Status: bundleModel.OrderPaid,
|
|
|
|
|
})
|
|
|
|
|
fmt.Println("req.OutTradeNo :", req.OutTradeNo)
|
|
|
|
|
if updateStatusErr != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,更新子套餐支付状态报错:", updateStatusErr)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,更新子套餐支付状态报错:", updateStatusErr)
|
|
|
|
|
service.Error(c, updateStatusErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
service.Success(c, &service.Response{
|
|
|
|
|
Msg: common.HadPay,
|
|
|
|
|
Code: 0,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Println("firstAddBundle.CustomerID :", firstAddBundle.CustomerID)
|
|
|
|
|
|
|
|
|
|
// 判断 是否是 本人操作
|
|
|
|
|
if strconv.FormatUint(userInfo.ID, 10) != firstAddBundle.CustomerID {
|
|
|
|
|
service.Error(c, errors.New(common.NotMatchOrderInfo))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
orderAmountInCents := int64(0.0)
|
2025-06-15 11:19:10 +00:00
|
|
|
|
for _, info := range res.AddBundleInfos {
|
2025-06-15 05:23:11 +00:00
|
|
|
|
temp := int64(math.Round(float64(info.Amount * 100)))
|
|
|
|
|
orderAmountInCents += temp
|
|
|
|
|
}
|
|
|
|
|
if orderAmountInCents == 0 {
|
|
|
|
|
fmt.Println("子套餐金额加起来是0,orderAmountInCents:", orderAmountInCents)
|
|
|
|
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Println("orderAmountInCents :", orderAmountInCents)
|
|
|
|
|
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
|
|
|
|
|
|
|
|
|
|
//金额校验
|
|
|
|
|
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
|
|
|
|
if orderAmountInCents != reqAmountInCents {
|
|
|
|
|
fmt.Println("111111111111111111111111111111111111")
|
|
|
|
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
|
|
|
|
return
|
2025-04-14 08:12:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-19 01:51:44 +00:00
|
|
|
|
if req.ProductAllPrice == 0 {
|
|
|
|
|
////创建对账单 todo 待修改
|
|
|
|
|
_, err = service.BundleProvider.CreateReconciliation(context.Background(), &bundle.ReconciliationInfo{
|
|
|
|
|
BundleOrderOn: req.OutTradeNo,
|
|
|
|
|
BundleAddOrderOn: req.OutTradeNo,
|
|
|
|
|
UserName: userInfo.Name,
|
|
|
|
|
UserTel: userInfo.TelNum,
|
|
|
|
|
BundleName: bundleName,
|
|
|
|
|
PayAmount: float32(req.ProductAllPrice),
|
|
|
|
|
CurrencyType: int32(currencyType),
|
|
|
|
|
PayStatus: 2,
|
|
|
|
|
PayTime: common.GetBeijingTime(),
|
|
|
|
|
UserID: userInfo.ID,
|
|
|
|
|
SerialNumber: "zero-price-serial-number",
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,创建对账单报错:", err)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,创建对账单报错:", err)
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
OrderNo: req.OutTradeNo,
|
|
|
|
|
PayTime: common.GetBeijingTime(),
|
|
|
|
|
Status: bundleModel.OrderPaid,
|
|
|
|
|
})
|
|
|
|
|
if updateStatusErr != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,更新订单报错:", updateStatusErr)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,更新订单报错:", updateStatusErr)
|
|
|
|
|
service.Error(c, updateStatusErr)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch orderLimit.Type {
|
|
|
|
|
case common.OrderTypePackage:
|
|
|
|
|
//如果是购买套餐 1:创建新的余量信息CreateBundleBalance 2 添加扩展记录BundleExtend
|
|
|
|
|
_, err = service.BundleProvider.CreateBundleBalance(context.Background(), &bundle.CreateBundleBalanceReq{
|
|
|
|
|
UserId: int32(orderLimit.UserId),
|
|
|
|
|
OrderUUID: orderLimit.OrderUUID,
|
|
|
|
|
AccountNumber: orderLimit.AccountNumber,
|
|
|
|
|
VideoNumber: orderLimit.VideoNumber,
|
|
|
|
|
ImageNumber: orderLimit.ImageNumber,
|
|
|
|
|
DataAnalysisNumber: orderLimit.DataNumber,
|
|
|
|
|
ExpansionPacksNumber: 1,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,OrderTypePackage报错:", err)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,OrderTypePackage报错:", err)
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
case common.OrderTypeAddon:
|
|
|
|
|
//如果是购买增值服务 1:修改余量信息AddBundleBalance 2 添加扩展记录BundleExtend
|
|
|
|
|
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
|
|
|
|
|
UserId: int32(orderLimit.UserId),
|
|
|
|
|
OrderUUID: orderLimit.OrderUUID,
|
|
|
|
|
AccountNumber: orderLimit.AccountNumber,
|
|
|
|
|
VideoNumber: orderLimit.VideoNumber,
|
|
|
|
|
ImageNumber: orderLimit.ImageNumber,
|
|
|
|
|
DataAnalysisNumber: orderLimit.DataNumber,
|
|
|
|
|
ExpansionPacksNumber: 1,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,OrderTypePackage报错:", err)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,OrderTypePackage报错:", err)
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
fmt.Println("=============== antom创建支付,无效的订单类型:", err)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,无效的订单类型:", err)
|
|
|
|
|
service.Error(c, errors.New("无效的订单类型"))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var timeUnit uint32
|
|
|
|
|
switch orderLimit.Unit {
|
|
|
|
|
case "天":
|
|
|
|
|
timeUnit = common.TimeUnitDay
|
|
|
|
|
case "月":
|
|
|
|
|
timeUnit = common.TimeUnitMonth
|
|
|
|
|
case "年":
|
|
|
|
|
timeUnit = common.TimeUnitYear
|
|
|
|
|
default:
|
|
|
|
|
timeUnit = 0
|
|
|
|
|
}
|
|
|
|
|
_, err = service.BundleProvider.BundleExtend(context.Background(), &bundle.BundleExtendRequest{
|
|
|
|
|
UserId: int64(orderLimit.UserId),
|
|
|
|
|
AccountAdditional: uint32(orderLimit.AccountNumber),
|
|
|
|
|
VideoAdditional: uint32(orderLimit.VideoNumber),
|
|
|
|
|
ImagesAdditional: uint32(orderLimit.ImageNumber),
|
|
|
|
|
DataAdditional: uint32(orderLimit.DataNumber),
|
|
|
|
|
AvailableDurationAdditional: uint32(orderLimit.Duration),
|
|
|
|
|
TimeUnit: timeUnit,
|
|
|
|
|
AssociatedorderNumber: req.OutTradeNo, //增值服务订单号
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
service.Success(c)
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-14 08:12:37 +00:00
|
|
|
|
var antomReq payment.CreatePayRequest
|
|
|
|
|
antomReq.Payee = "Antom"
|
|
|
|
|
antomReq.Platform = "antom"
|
|
|
|
|
antomReq.ChannelType = "antom"
|
|
|
|
|
antomReq.ProductDescription = req.ProductDescription
|
|
|
|
|
antomReq.BusinessType = "useless"
|
|
|
|
|
antomReq.Domain = "fiee"
|
|
|
|
|
antomReq.Amount = req.ProductAllPrice
|
|
|
|
|
antomReq.Currency = req.ProductPriceCurrency
|
|
|
|
|
antomReq.OutTradeNo = req.OutTradeNo
|
|
|
|
|
antomReq.ReturnUrl = req.SuccessUrl
|
|
|
|
|
|
|
|
|
|
//调用微服务获取支付地址
|
|
|
|
|
result, err := service.PaymentProvider.CreatePay(context.Background(), &antomReq)
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId)
|
|
|
|
|
fmt.Println("result.Url :", result.Url)
|
|
|
|
|
|
2025-06-15 05:23:11 +00:00
|
|
|
|
//更新订单url和checkSessionId
|
|
|
|
|
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
OrderNo: req.OutTradeNo,
|
2025-04-14 08:12:37 +00:00
|
|
|
|
CheckoutSessionId: result.CheckoutSessionId,
|
|
|
|
|
CheckoutSessionUrl: result.Url,
|
|
|
|
|
})
|
2025-04-15 02:40:21 +00:00
|
|
|
|
fmt.Println("=====================================")
|
|
|
|
|
resp := &order.CreateStripeCheckoutSessionResponse{}
|
2025-04-15 01:21:39 +00:00
|
|
|
|
resp.CheckoutSessionUrl = result.Url
|
|
|
|
|
resp.CheckoutSessionId = result.CheckoutSessionId
|
2025-06-15 05:23:11 +00:00
|
|
|
|
fmt.Println("req.OutTradeNo :", req.OutTradeNo)
|
|
|
|
|
if updateStatusErr != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,更新订单的请求id报错:", updateStatusErr)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,更新订单的请求id报错:", updateStatusErr)
|
|
|
|
|
service.Error(c, updateStatusErr)
|
2025-04-14 08:12:37 +00:00
|
|
|
|
return
|
|
|
|
|
}
|
2025-06-15 05:23:11 +00:00
|
|
|
|
fmt.Println("resp:", resp)
|
|
|
|
|
|
2025-06-15 02:06:57 +00:00
|
|
|
|
////创建对账单 todo 待修改
|
2025-06-16 01:56:09 +00:00
|
|
|
|
_, err = service.BundleProvider.CreateReconciliation(context.Background(), &bundle.ReconciliationInfo{
|
|
|
|
|
BundleOrderOn: req.OutTradeNo,
|
|
|
|
|
BundleAddOrderOn: req.OutTradeNo,
|
|
|
|
|
UserName: userInfo.Name,
|
|
|
|
|
UserTel: userInfo.TelNum,
|
|
|
|
|
BundleName: bundleName,
|
|
|
|
|
PayAmount: float32(req.ProductAllPrice),
|
|
|
|
|
CurrencyType: int32(currencyType),
|
|
|
|
|
PayStatus: 1,
|
|
|
|
|
UserID: userInfo.ID,
|
|
|
|
|
SerialNumber: result.CheckoutSessionId,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("=============== antom创建支付,创建对账单报错:", err)
|
|
|
|
|
logger.Errorf("=============== antom创建支付,创建对账单报错:", err)
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-15 01:45:48 +00:00
|
|
|
|
service.Success(c, resp)
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-21 13:09:29 +00:00
|
|
|
|
func StripeCheckoutSessionWebhook(c *gin.Context) {
|
|
|
|
|
var req order.GetCheckoutWebhookRequest
|
|
|
|
|
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, int64(65536))
|
|
|
|
|
payloadBytes, err := io.ReadAll(c.Request.Body)
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
req.Payload = string(payloadBytes)
|
|
|
|
|
req.Signature = c.GetHeader("Stripe-Signature")
|
|
|
|
|
req.WebhookKey = config.Webhookkey
|
|
|
|
|
fmt.Printf("webhookKey:%s\n", req.WebhookKey)
|
|
|
|
|
resp, err := service.OrderProvider.CommonCheckoutWebhook(c, &req)
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("resp.PaymentIntentStatus:", resp.PaymentIntentStatus)
|
|
|
|
|
if resp.PaymentIntentStatus == "paid" {
|
|
|
|
|
//支付成功
|
|
|
|
|
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
OrderNo: resp.OutTradeNo,
|
|
|
|
|
PayTime: common.GetBeijingTime(),
|
|
|
|
|
Status: bundleModel.OrderPaid,
|
|
|
|
|
})
|
|
|
|
|
if updateStatusErr != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
service.Success(c)
|
|
|
|
|
}
|
2025-04-14 08:12:37 +00:00
|
|
|
|
|
|
|
|
|
func AntomWebhook(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
data, err := io.ReadAll(c.Request.Body)
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将数据转换为字符串形式并记录日志(如果数据过大则不记录)
|
|
|
|
|
dataStr := string(data)
|
|
|
|
|
fmt.Println("================ Antom回调参数:", dataStr)
|
|
|
|
|
|
|
|
|
|
// 将读取到的数据解析为 map[string]interface{}
|
|
|
|
|
var reqMap map[string]interface{}
|
|
|
|
|
if err := json.Unmarshal(data, &reqMap); err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 提取需要的字段
|
|
|
|
|
notifyType, _ := reqMap["notifyType"].(string)
|
|
|
|
|
resultMap, resultExists := reqMap["result"].(map[string]interface{})
|
|
|
|
|
if !resultExists {
|
|
|
|
|
service.Error(c, errors.New("result 字段不存在或类型错误"))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
requestId, _ := reqMap["paymentRequestId"].(string)
|
|
|
|
|
paymentId, _ := reqMap["paymentId"].(string)
|
|
|
|
|
paymentTime, _ := reqMap["paymentTime"].(string)
|
|
|
|
|
|
|
|
|
|
// 提取 result 字段中的子字段
|
|
|
|
|
resultStatus, _ := resultMap["resultStatus"].(string)
|
|
|
|
|
resultMessage, _ := resultMap["resultMessage"].(string)
|
|
|
|
|
|
|
|
|
|
// 打印提取的字段(可以根据需要处理)
|
|
|
|
|
fmt.Println("通知类型:", notifyType)
|
|
|
|
|
fmt.Println("订单号:", requestId)
|
|
|
|
|
fmt.Println("支付ID:", paymentId)
|
|
|
|
|
fmt.Println("支付时间:", paymentTime)
|
|
|
|
|
fmt.Println("支付结果状态:", resultStatus)
|
|
|
|
|
fmt.Println("支付结果消息:", resultMessage)
|
|
|
|
|
/*
|
|
|
|
|
* S: 当 notifyType 为PAYMENT_RESULT时,表示支付成功;当 notifyType 为PAYMENT_PENDING时,表示支付处理中。
|
|
|
|
|
* F: 表示支付失败。
|
|
|
|
|
* */
|
|
|
|
|
params := &payment.AntomNotifyPayRequest{
|
|
|
|
|
NotifyType: notifyType,
|
|
|
|
|
RequestId: requestId,
|
|
|
|
|
PaymentId: paymentId,
|
|
|
|
|
PaymentTime: paymentTime,
|
|
|
|
|
ResultStatus: resultStatus,
|
|
|
|
|
ResultMessage: resultMessage,
|
2025-04-17 07:47:33 +00:00
|
|
|
|
ChannelCode: "Antom", // fiee对应payment的渠道码
|
2025-04-14 08:12:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resp, err := service.PaymentProvider.AntomWebhook(c, params)
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("resp.Status:", resp.Status)
|
|
|
|
|
if resp.Status == "paid" {
|
|
|
|
|
//支付成功
|
|
|
|
|
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
|
|
|
|
|
OrderNo: resp.OutTradeNo,
|
|
|
|
|
PayTime: common.GetBeijingTime(),
|
|
|
|
|
Status: bundleModel.OrderPaid,
|
|
|
|
|
})
|
|
|
|
|
if updateStatusErr != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-06-16 01:56:09 +00:00
|
|
|
|
// 更新对账单
|
|
|
|
|
_, err = service.BundleProvider.UpdateReconciliationStatusBySerialNumber(context.Background(), &bundle.UpdateStatusAndPayTimeBySerialNumber{
|
|
|
|
|
PayTime: paymentTime,
|
|
|
|
|
PaymentStatus: 2,
|
2025-06-16 05:57:30 +00:00
|
|
|
|
SerialNumber: requestId,
|
2025-06-16 01:56:09 +00:00
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("=============== antom回调,更新对账单报错:", err)
|
|
|
|
|
logger.Errorf("=============== antom回调,更新对账单报错:", err)
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-14 07:23:14 +00:00
|
|
|
|
//添加余额
|
|
|
|
|
orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{
|
|
|
|
|
OrderNo: resp.OutTradeNo,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
//购买套餐
|
|
|
|
|
switch orderLimit.Type {
|
|
|
|
|
case common.OrderTypePackage:
|
|
|
|
|
//如果是购买套餐 1:创建新的余量信息CreateBundleBalance 2 添加扩展记录BundleExtend
|
|
|
|
|
_, err = service.BundleProvider.CreateBundleBalance(context.Background(), &bundle.CreateBundleBalanceReq{
|
|
|
|
|
UserId: int32(orderLimit.UserId),
|
|
|
|
|
OrderUUID: orderLimit.OrderUUID,
|
|
|
|
|
AccountNumber: orderLimit.AccountNumber,
|
|
|
|
|
VideoNumber: orderLimit.VideoNumber,
|
|
|
|
|
ImageNumber: orderLimit.ImageNumber,
|
|
|
|
|
DataAnalysisNumber: orderLimit.DataNumber,
|
|
|
|
|
ExpansionPacksNumber: 1,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
case common.OrderTypeAddon:
|
|
|
|
|
//如果是购买增值服务 1:修改余量信息AddBundleBalance 2 添加扩展记录BundleExtend
|
|
|
|
|
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
|
|
|
|
|
UserId: int32(orderLimit.UserId),
|
|
|
|
|
OrderUUID: orderLimit.OrderUUID,
|
|
|
|
|
AccountNumber: orderLimit.AccountNumber,
|
|
|
|
|
VideoNumber: orderLimit.VideoNumber,
|
|
|
|
|
ImageNumber: orderLimit.ImageNumber,
|
|
|
|
|
DataAnalysisNumber: orderLimit.DataNumber,
|
|
|
|
|
ExpansionPacksNumber: 1,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
service.Error(c, errors.New("无效的订单类型"))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
var timeUnit uint32
|
|
|
|
|
switch orderLimit.Unit {
|
|
|
|
|
case "天":
|
|
|
|
|
timeUnit = common.TimeUnitDay
|
|
|
|
|
case "月":
|
|
|
|
|
timeUnit = common.TimeUnitMonth
|
|
|
|
|
case "年":
|
|
|
|
|
timeUnit = common.TimeUnitYear
|
|
|
|
|
default:
|
|
|
|
|
timeUnit = 0
|
|
|
|
|
}
|
|
|
|
|
_, err = service.BundleProvider.BundleExtend(context.Background(), &bundle.BundleExtendRequest{
|
|
|
|
|
UserId: int64(orderLimit.UserId),
|
|
|
|
|
AccountAdditional: uint32(orderLimit.AccountNumber),
|
|
|
|
|
VideoAdditional: uint32(orderLimit.VideoNumber),
|
|
|
|
|
ImagesAdditional: uint32(orderLimit.ImageNumber),
|
|
|
|
|
DataAdditional: uint32(orderLimit.DataNumber),
|
|
|
|
|
AvailableDurationAdditional: uint32(orderLimit.Duration),
|
|
|
|
|
TimeUnit: timeUnit,
|
|
|
|
|
AssociatedorderNumber: resp.OutTradeNo, //增值服务订单号
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-04-14 08:12:37 +00:00
|
|
|
|
}
|
|
|
|
|
service.Success(c)
|
|
|
|
|
}
|
2025-06-14 02:22:02 +00:00
|
|
|
|
func HomePageRoll(c *gin.Context) {
|
|
|
|
|
//var req order.HomePageRollRequest
|
|
|
|
|
res, err := service.BundleProvider.OrderRecordsListV2(context.Background(), &bundle.OrderRecordsRequestV2{
|
|
|
|
|
Page: 1,
|
|
|
|
|
PageSize: 5,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if len(res.BundleInfo) == 0 {
|
|
|
|
|
service.Success(c, nil)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
type Roll struct {
|
|
|
|
|
Tel string `json:"tel"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
}
|
|
|
|
|
var userIds []int64
|
|
|
|
|
for _, i := range res.BundleInfo {
|
|
|
|
|
userIds = append(userIds, i.CustomerId)
|
|
|
|
|
}
|
|
|
|
|
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
|
|
|
|
|
Ids: userIds,
|
|
|
|
|
Domain: "app",
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
service.Error(c, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 建立用户ID -> 用户信息映射
|
|
|
|
|
userMap := make(map[int64]*accountFiee.UserListInfo, len(userListResp.UserList))
|
|
|
|
|
for _, u := range userListResp.UserList {
|
|
|
|
|
userMap[int64(u.Id)] = u
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var roll []Roll
|
|
|
|
|
for _, i := range res.BundleInfo {
|
2025-06-17 07:39:47 +00:00
|
|
|
|
tel := ""
|
|
|
|
|
name := i.BundleName // Use bundle name as fallback
|
|
|
|
|
if userInfo, exists := userMap[i.CustomerId]; exists && userInfo != nil {
|
|
|
|
|
tel = userInfo.TelNum
|
2025-06-19 02:32:44 +00:00
|
|
|
|
if len(tel) >= 2 {
|
|
|
|
|
masked := ""
|
|
|
|
|
for j := 0; j < len(tel)-2; j++ {
|
|
|
|
|
masked += "*"
|
|
|
|
|
}
|
|
|
|
|
tel = masked + tel[len(tel)-2:]
|
2025-06-17 07:39:47 +00:00
|
|
|
|
}
|
2025-06-14 02:22:02 +00:00
|
|
|
|
}
|
|
|
|
|
roll = append(roll, Roll{
|
2025-06-17 07:39:47 +00:00
|
|
|
|
Tel: tel,
|
|
|
|
|
Name: name,
|
2025-06-14 02:22:02 +00:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
service.Success(c, roll)
|
|
|
|
|
return
|
|
|
|
|
}
|