column.go 617 B

1234567891011121314151617181920212223242526272829
  1. package http
  2. import (
  3. "go-common/library/ecode"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func joinColumn(c *bm.Context) {
  8. v := new(struct {
  9. AccountType int `form:"account_type"`
  10. SignType int `form:"sign_type"`
  11. })
  12. if err := c.Bind(v); err != nil {
  13. return
  14. }
  15. midI, ok := c.Get("mid")
  16. if !ok {
  17. c.JSON(nil, ecode.NoLogin)
  18. return
  19. }
  20. mid, _ := midI.(int64)
  21. err := svc.JoinColumn(c, mid, v.AccountType, v.SignType)
  22. if err != nil {
  23. log.Error("svc.JoinColumn mid(%d) accountType(%d) signType(%d) error(%v)", mid, v.AccountType, v.SignType, err)
  24. }
  25. c.JSON(nil, err)
  26. }