完成气站标准资源全页管理改造

This commit is contained in:
czl231
2026-08-18 00:26:39 +08:00
parent eef791427a
commit 084eccc3ec
51 changed files with 7081 additions and 1141 deletions

View File

@@ -72,9 +72,12 @@ func registerGasBusinessRoutes(group *gin.RouterGroup) {
contractProduct := group.Group("/gasorder_contract_product")
contractProduct.GET("", gaslogic.ListGasorderContractProduct)
contractProduct.POST("", gaslogic.BindGasorderContractProduct)
contractProduct.GET("/:identity", gaslogic.GetGasorderContractProduct)
contractProduct.POST("/:identity/unbind", gaslogic.UnbindGasorderContractProduct)
group.GET("/gasorder_contract_revision", gaslogic.ListGasorderContractRevision)
group.GET("/gasorder_contract_revision/:identity", gaslogic.GetGasorderContractRevision)
group.GET("/product_info", gaslogic.ListContractProductCandidate)
group.GET("/product_info/:identity", gaslogic.GetContractProductCandidate)
order := group.Group("/gasorder_basic")
order.GET("", gaslogic.ListGasorderBasic)
@@ -88,14 +91,22 @@ func registerGasBusinessRoutes(group *gin.RouterGroup) {
order.POST("/:identity/cancel", gaslogic.GasorderCancel)
group.GET("/wallet_basic", gaslogic.ListWalletBasic)
group.GET("/wallet_basic/:identity", gaslogic.GetWalletBasic)
group.GET("/wallet_bank", gaslogic.ListWalletBank)
group.GET("/wallet_bank/:identity", gaslogic.GetWalletBank)
group.GET("/payment_order", gaslogic.ListPaymentOrder)
group.GET("/payment_order/:identity", gaslogic.GetPaymentOrder)
group.GET("/wallet_record", gaslogic.ListWalletRecord)
group.GET("/wallet_record/:identity", gaslogic.GetWalletRecord)
group.GET("/payment_refund", gaslogic.ListPaymentRefund)
group.GET("/payment_refund/:identity", gaslogic.GetPaymentRefund)
group.GET("/wallet_apply_cash", gaslogic.ListWalletApplyCash)
group.GET("/wallet_apply_cash/:identity", gaslogic.GetWalletApplyCash)
group.POST("/wallet_apply_cash", gaslogic.CreateWalletApplyCash)
group.GET("/fin_settlement", gaslogic.ListFinSettlement)
group.GET("/fin_settlement/:identity", gaslogic.GetFinSettlement)
group.GET("/fin_reconciliation", gaslogic.ListFinReconciliation)
group.GET("/fin_reconciliation/:identity", gaslogic.GetFinReconciliation)
ticket := group.Group("/cs_ticket")
ticket.GET("", gaslogic.ListTicket)

View File

@@ -52,3 +52,32 @@ func TestGasOrderRoutesDoNotExposeDownstreamActions(t *testing.T) {
}
}
}
// TestGasReadonlyDetailRoutes 验证所有标准只读资源都支持独立详情页直达。
func TestGasReadonlyDetailRoutes(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
RegisterGas("heqi", engine)
routes := map[string]bool{}
for _, route := range engine.Routes() {
routes[route.Method+" "+route.Path] = true
}
for _, path := range []string{
"/gasorder_contract_product/:identity",
"/gasorder_contract_revision/:identity",
"/product_info/:identity",
"/wallet_basic/:identity",
"/wallet_bank/:identity",
"/payment_order/:identity",
"/wallet_record/:identity",
"/payment_refund/:identity",
"/wallet_apply_cash/:identity",
"/fin_settlement/:identity",
"/fin_reconciliation/:identity",
} {
fullPath := "GET /heqi/gas/v1" + path
if !routes[fullPath] {
t.Fatalf("missing gas detail route %s", fullPath)
}
}
}