contract.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package routers
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/fms_api/controller/contract"
  5. "hongze/fms_api/middleware"
  6. )
  7. func InitContract(rg *gin.RouterGroup) {
  8. // 合同登记
  9. cr := new(contract.RegisterController)
  10. crGroup := rg.Group("register/").Use(middleware.Token())
  11. crGroup.GET("list", cr.List)
  12. crGroup.POST("add", cr.Add)
  13. crGroup.POST("edit", cr.Edit)
  14. crGroup.POST("del", cr.Del)
  15. crGroup.GET("detail", cr.Detail)
  16. crGroup.POST("update_status", cr.UpdateStatus)
  17. crGroup.GET("export", cr.Export)
  18. crGroup.POST("invoice", cr.Invoice)
  19. crGroup.POST("payment", cr.Invoice) // 与开票登记用同一个func, 路由作区分划分权限
  20. crGroup.GET("invoice_list", cr.InvoiceList)
  21. crGroup.POST("import", cr.Import)
  22. crGroup.GET("currency_list", cr.CurrencyList)
  23. // 合同套餐
  24. sr := new(contract.ServiceController)
  25. srGroup := rg.Group("service/").Use(middleware.Token())
  26. srGroup.GET("list", sr.List)
  27. // 到款登记
  28. pay := new(contract.PaymentController)
  29. payGroup := rg.Group("payment/").Use(middleware.Token())
  30. payGroup.POST("update_pay_type", pay.UpdatePaymentPayType)
  31. payGroup.POST("distribute_service_amount", pay.DistributePaymentServiceAmount)
  32. }