search.go 481 B

1234567891011121314151617181920212223
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/library/ecode"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func segment(c *bm.Context) {
  8. var params = c.Request.Form
  9. idStr := params.Get("id")
  10. content := params.Get("content")
  11. withTagStr := params.Get("with_tag")
  12. id, _ := strconv.Atoi(idStr)
  13. withTag, _ := strconv.Atoi(withTagStr)
  14. if id == 0 || content == "" {
  15. c.JSON(nil, ecode.RequestErr)
  16. return
  17. }
  18. c.JSON(artSrv.Segment(c, int32(id), content, withTag, "draft"))
  19. }