广告平台(总站长使用)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
576 B

  1. package mw
  2. import (
  3. "github.com/gin-gonic/gin"
  4. )
  5. // DB is 中间件 用来检查master_id是否有对应的数据库engine
  6. func DB(c *gin.Context) {
  7. //fmt.Println(c.Request.Header)
  8. //masterID := svc.GetMasterId(c)
  9. //fmt.Println("master_id", masterID)
  10. //if masterID == "" {
  11. // e.OutErr(c, e.ERR_MASTER_ID, errors.New("not found master_id"))
  12. // return
  13. //}
  14. //
  15. //_, ok := db.DBs[masterID]
  16. //if !ok {
  17. // e.OutErr(c, e.ERR_MASTER_ID, errors.New("not found master_id in DBs"))
  18. // return
  19. //}
  20. //fmt.Println("master_id", masterID)
  21. //c.Set("mid", masterID)
  22. c.Next()
  23. }