package routers import ( "github.com/gin-gonic/gin" "hongze/fms_api/controller/contract" "hongze/fms_api/middleware" ) func InitContract(rg *gin.RouterGroup) { // 合同登记 cr := new(contract.RegisterController) crGroup := rg.Group("register/").Use(middleware.Token()) crGroup.GET("list", cr.List) crGroup.POST("add", cr.Add) crGroup.POST("edit", cr.Edit) crGroup.POST("del", cr.Del) crGroup.GET("detail", cr.Detail) crGroup.POST("update_status", cr.UpdateStatus) crGroup.GET("export", cr.Export) crGroup.POST("invoice", cr.Invoice) crGroup.POST("payment", cr.Invoice) // 与开票登记用同一个func, 路由作区分划分权限 crGroup.GET("invoice_list", cr.InvoiceList) crGroup.POST("import", cr.Import) crGroup.GET("currency_list", cr.CurrencyList) crGroup.GET("check_contract_code", cr.CheckContractName) crGroup.POST("check_contract_duplicate", cr.CheckContractDuplicate) // 合同套餐 sr := new(contract.ServiceController) srGroup := rg.Group("service/").Use(middleware.Token()) srGroup.GET("list", sr.List) srGroup.GET("simple", sr.SimpleList) // 到款登记 pay := new(contract.PaymentController) payGroup := rg.Group("payment/").Use(middleware.Token()) payGroup.POST("update_pay_type", pay.UpdatePaymentPayType) payGroup.POST("distribute_service_amount", pay.DistributePaymentServiceAmount) //预登记 preRegister := new(contract.PreRegisterController) preRegisterGroup := rg.Group("pre_register/").Use(middleware.Token()) preRegisterGroup.GET("list", preRegister.List) preRegisterGroup.POST("add", preRegister.Add) preRegisterGroup.POST("edit", preRegister.Edit) preRegisterGroup.POST("del", preRegister.Del) preRegisterGroup.POST("detail", preRegister.Detail) preRegisterGroup.POST("save", preRegister.Save) }