contract.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. crGroup.GET("check_contract_code", cr.CheckContractName)
  24. crGroup.POST("check_contract_duplicate", cr.CheckContractDuplicate)
  25. // 合同套餐
  26. sr := new(contract.ServiceController)
  27. srGroup := rg.Group("service/").Use(middleware.Token())
  28. srGroup.GET("list", sr.List)
  29. srGroup.GET("simple", sr.SimpleList)
  30. // 到款登记
  31. pay := new(contract.PaymentController)
  32. payGroup := rg.Group("payment/").Use(middleware.Token())
  33. payGroup.POST("update_pay_type", pay.UpdatePaymentPayType)
  34. payGroup.POST("distribute_service_amount", pay.DistributePaymentServiceAmount)
  35. //预登记
  36. preRegister := new(contract.PreRegisterController)
  37. preRegisterGroup := rg.Group("pre_register/").Use(middleware.Token())
  38. preRegisterGroup.GET("list", preRegister.List)
  39. preRegisterGroup.POST("add", preRegister.Add)
  40. preRegisterGroup.POST("edit", preRegister.Edit)
  41. preRegisterGroup.POST("del", preRegister.Del)
  42. preRegisterGroup.POST("detail", preRegister.Detail)
  43. preRegisterGroup.POST("save", preRegister.Save)
  44. }