h_report.go 754 B

123456789101112131415161718192021222324252627282930
  1. package handler
  2. import (
  3. "cicv-data-closedloop/common/entity"
  4. "github.com/gin-gonic/gin"
  5. "net/http"
  6. )
  7. type testStruct struct {
  8. Id int `db:"id"`
  9. Name string `db:"name"`
  10. }
  11. // Page 分页查询
  12. func Page(c *gin.Context) {
  13. //// 获取请求参数
  14. //param := c.Query("param")
  15. //c_log.GlobalLogger.Info("接受到请求参数:", param)
  16. //var tests []testStruct
  17. //// 查询数据库
  18. //var testSql string
  19. //if err := c_db.MysqlDb.Select(&tests, testSql); err != nil {
  20. // c_log.GlobalLogger.Error("数据库查询报错:", err)
  21. // c.JSON(http.StatusInternalServerError, entity.DefaultFailHttpResult)
  22. // return
  23. //}
  24. //c_log.GlobalLogger.Info("数据库查询成功:", tests)
  25. c.JSON(http.StatusOK, entity.DefaultSuccessHttpResult)
  26. }