notice.go 585 B

123456789101112131415161718192021222324252627282930
  1. package http
  2. import (
  3. "go-common/app/admin/main/space/model"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. func notice(c *bm.Context) {
  7. v := new(struct {
  8. Mid int64 `form:"mid" validate:"min=1"`
  9. })
  10. if err := c.Bind(v); err != nil {
  11. return
  12. }
  13. c.JSON(spcSvc.Notice(c, v.Mid))
  14. }
  15. func noticeUp(c *bm.Context) {
  16. v := new(model.NoticeUpArg)
  17. if err := c.Bind(v); err != nil {
  18. return
  19. }
  20. if uidInter, ok := c.Get("uid"); ok {
  21. v.UID = uidInter.(int64)
  22. }
  23. if usernameCtx, ok := c.Get("username"); ok {
  24. v.Uname = usernameCtx.(string)
  25. }
  26. c.JSON(nil, spcSvc.NoticeUp(c, v))
  27. }