增加气站合同附件受控上传与预览
This commit is contained in:
@@ -65,8 +65,11 @@ func registerGasBusinessRoutes(group *gin.RouterGroup) {
|
||||
contract := group.Group("/gasorder_contract")
|
||||
contract.GET("", gaslogic.ListGasorderContract)
|
||||
contract.POST("", gaslogic.CreateGasorderContract)
|
||||
contract.POST("/attachment/upload", gaslogic.UploadGasorderContractAttachment)
|
||||
contract.POST("/attachment/cleanup", gaslogic.CleanupGasorderContractAttachment)
|
||||
contract.GET("/:identity", gaslogic.GetGasorderContract)
|
||||
contract.PUT("/:identity", gaslogic.UpdateGasorderContract)
|
||||
contract.GET("/:identity/attachment", gaslogic.ServeGasorderContractAttachment)
|
||||
contract.POST("/:identity/activate", gaslogic.ActivateGasorderContract)
|
||||
contract.POST("/:identity/renew", gaslogic.RenewGasorderContract)
|
||||
contract.POST("/:identity/terminate", gaslogic.TerminateGasorderContract)
|
||||
|
||||
@@ -100,3 +100,23 @@ func TestGasAvatarRoutes(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestGasContractAttachmentRoutes 验证合同附件通过气站鉴权域提供专用接口。
|
||||
func TestGasContractAttachmentRoutes(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{
|
||||
"POST /heqi/gas/v1/gasorder_contract/attachment/upload",
|
||||
"POST /heqi/gas/v1/gasorder_contract/attachment/cleanup",
|
||||
"GET /heqi/gas/v1/gasorder_contract/:identity/attachment",
|
||||
} {
|
||||
if !routes[path] {
|
||||
t.Fatalf("missing gas contract attachment route %s", path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user