func (This *APIController) APILogStatsByType(c *gin.Context) { token := c.Query("token") list, err := app.Server.DS.LogStatsByType(token) response := new(gowebresponse.WebResponse) if err == nil { response.Success = true response.Message = "" response.AddData("list", list) } else { response.Success = false response.Message = "log-stats-by-type-error" response.AddDataError("error", err.Error()) } c.JSON(200, response) }
func (This *APIController) APILogList(c *gin.Context) { token := c.Query("token") createdAt, _ := time.Parse("2006-01-02T15:04:05.999", c.Query("created_at")) message := c.Query("message") list, err := app.Server.DS.LogList(token, message, createdAt) response := new(gowebresponse.WebResponse) if err == nil { response.Success = true response.Message = "" response.AddData("list", list) } else { response.Success = false response.Message = "log-list-error" response.AddDataError("error", err.Error()) } c.JSON(200, response) }