business.go 1009 B

12345678910111213141516171819202122232425262728293031323334
  1. package http
  2. import (
  3. bm "go-common/library/net/http/blademaster"
  4. "go-common/library/net/http/blademaster/binding"
  5. )
  6. // UpBusinessExtra update business extra
  7. func upBusinessExtra(c *bm.Context) {
  8. ap := new(struct {
  9. Cid int32 `form:"cid" validate:"required"`
  10. Mid int64 `form:"mid" validate:"required"`
  11. Business int8 `form:"business" validate:"required"`
  12. Key string `form:"key" validate:"required"`
  13. Val string `form:"val" validate:"required"`
  14. })
  15. if err := c.BindWith(ap, binding.FormPost); err != nil {
  16. return
  17. }
  18. c.JSON(nil, wkfSvc.UpBusinessExtraV2(c, ap.Cid, ap.Mid, ap.Business, ap.Key, ap.Val))
  19. }
  20. // BusinessExtra get business extra
  21. func businessExtra(c *bm.Context) {
  22. ap := new(struct {
  23. Cid int32 `form:"cid" validate:"required"`
  24. Mid int64 `form:"mid" validate:"required"`
  25. Business int8 `form:"business" validate:"required"`
  26. })
  27. if err := c.Bind(ap); err != nil {
  28. return
  29. }
  30. c.JSON(wkfSvc.BusinessExtraV2(c, ap.Cid, ap.Mid, ap.Business))
  31. }