contract.go 799 B

123456789101112131415161718192021222324252627
  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. // 合同套餐
  21. sr := new(contract.ServiceController)
  22. srGroup := rg.Group("service/").Use(middleware.Token())
  23. srGroup.GET("list", sr.List)
  24. }