diff --git a/go.mod b/go.mod index e7e04d3..f6dbc87 100644 --- a/go.mod +++ b/go.mod @@ -17,9 +17,9 @@ go 1.18 //github.com/fonchain_enterprise/utils/ipAddrQuery => ../utils/ipAddrQuery //github.com/fonchain_enterprise/utils/jwt => ../utils/jwt //github.com/fonchain_enterprise/utils/logger => ../utils/logger -//replace github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-新/utils/objstorage +replace github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-新/utils/objstorage -replace github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage +//replace github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage require ( dubbo.apache.org/dubbo-go/v3 v3.0.2 diff --git a/pkg/service/base.go b/pkg/service/base.go index 0246402..794b54f 100644 --- a/pkg/service/base.go +++ b/pkg/service/base.go @@ -134,3 +134,12 @@ func translateErrorMessage(c *gin.Context, message string) string { return common.EnMessages[message] } } + +func ResponseQuickMsg(c *gin.Context, Status uint8, Msg string, Data interface{}) { + //var c gin.Context + c.JSON(http.StatusOK, gin.Response{ + Status: int(Status), + Msg: Msg, + Data: Data, + }) +} diff --git a/pkg/service/bundle/bundleOrder.go b/pkg/service/bundle/bundleOrder.go index bca17d8..77a3e8c 100644 --- a/pkg/service/bundle/bundleOrder.go +++ b/pkg/service/bundle/bundleOrder.go @@ -320,7 +320,7 @@ func UpdateFinancialConfirmationStatus(c *gin.Context) { return } - if detail.OrderRecord.Status != 2 { + if detail.OrderRecord.Status != bundleModel.OrderPaid { service.Error(c, errors.New("订单未支付,不可确认")) return } @@ -371,15 +371,15 @@ func ExportOrderInfo(c *gin.Context) { } status := "" - if orderRecord.Status == 1 { + if orderRecord.Status == bundleModel.OrderSigned { status = "未支付" - } else if orderRecord.Status == 2 { + } else if orderRecord.Status == bundleModel.OrderPaid { status = "已支付" } financialConfirmation := "" - if orderRecord.FinancialConfirmation == 1 { + if orderRecord.FinancialConfirmation == bundleModel.UnConfirm { financialConfirmation = "未确认" - } else if orderRecord.FinancialConfirmation == 2 { + } else if orderRecord.FinancialConfirmation == bundleModel.Confirmed { financialConfirmation = "已确认" } @@ -420,7 +420,5 @@ func ExportOrderInfo(c *gin.Context) { var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s%s", httpType, c.Request.Host), 1), "runtime", "static", 1) //var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path) - service.Success(c, e.Ok, map[string]string{ - "ExportUrl": exportUrl, - }) + service.Success(c, e.Ok, &bundleModel.ExportResponse{ExportUrl: exportUrl}) } diff --git a/pkg/service/bundle/model/orderStatus.go b/pkg/service/bundle/model/orderStatus.go index b2868b1..ca17c8d 100644 --- a/pkg/service/bundle/model/orderStatus.go +++ b/pkg/service/bundle/model/orderStatus.go @@ -4,3 +4,12 @@ const ( OrderSigned = 1 OrderPaid = 2 ) + +const ( + UnConfirm = 1 + Confirmed = 2 +) + +type ExportResponse struct { + ExportUrl string `json:"exportUrl"` +}