order_admin.go 550 B

12345678910111213141516171819202122
  1. package http
  2. import (
  3. "go-common/app/admin/ep/melloi/model"
  4. bm "go-common/library/net/http/blademaster"
  5. "go-common/library/net/http/blademaster/binding"
  6. )
  7. // get administrator for order by current username
  8. func queryOrderAdmin(c *bm.Context) {
  9. userName, _ := c.Request.Cookie("username")
  10. c.JSON(srv.QueryOrderAdmin(userName.Value))
  11. }
  12. // add administrator for order
  13. func addOrderAdmin(c *bm.Context) {
  14. admin := model.OrderAdmin{}
  15. if err := c.BindWith(&admin, binding.Form); err != nil {
  16. return
  17. }
  18. c.JSON(nil, srv.AddOrderAdmin(&admin))
  19. }