You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

account.go 692 B

3 years ago
3 years ago
123456789101112131415161718192021222324
  1. package point
  2. import (
  3. "code.gitea.io/gitea/models"
  4. "code.gitea.io/gitea/modules/context"
  5. "code.gitea.io/gitea/modules/log"
  6. "code.gitea.io/gitea/routers/response"
  7. "code.gitea.io/gitea/services/reward/point/account"
  8. "net/http"
  9. )
  10. func SearchPointAccount(ctx *context.Context) {
  11. q := ctx.Query("q")
  12. page := ctx.QueryInt("page")
  13. resopnse, err := account.SearchPointAccount(models.SearchPointAccountOpts{ListOptions: models.ListOptions{Page: page, PageSize: 20}, Keyword: q})
  14. if err != nil {
  15. log.Error("SearchPointAccount error.%v", err)
  16. ctx.JSON(http.StatusOK, response.ServerError(err.Error()))
  17. return
  18. }
  19. ctx.JSON(http.StatusOK, response.SuccessWithData(resopnse))
  20. return
  21. }