Browse Source

sprinkle: 撒料时间统计分析

Yi 1 year ago
parent
commit
6848474379
3 changed files with 10 additions and 13 deletions
  1. 4 1
      README.md
  2. 2 12
      http/handle/api/user.go
  3. 4 0
      module/group.go

+ 4 - 1
README.md

@@ -170,4 +170,7 @@ delete http://127.0.0.1:8000/api/restful/go_user/2
 swag init
 
 
-```
+```
+
+TODO 列表
+- 撒料时间统计分析接口,因数据量太多,目前limit 100条数据

+ 2 - 12
http/handle/api/user.go

@@ -31,16 +31,7 @@ type auth struct {
 	TypeIn     int    `json:"typein"`
 }
 
-// @Summary   获取登录token 信息
-// @Tags auth
-// @Accept json
-// @Produce  json
-// @Param username formData string true  "admin"
-// @Param password formData string true  "123456"
-// @Success 200 {string} json "{ "code": 200e, "data": { "token": "xxx" }, "msg": "ok" }"
-// @Failure 400 {string} json "{"code":400,  "data":null,"msg":"请求参数错误"}"
-// @Failure 404 {string} json "{ "code": 404, "data":null,"msg":"请求参数错误"}"
-// @Router /auth  [POST]
+// Auth   获取登录token 信息
 func Auth(c *gin.Context) {
 	appG := app.Gin{C: c}
 	var reqInfo auth
@@ -51,7 +42,7 @@ func Auth(c *gin.Context) {
 	valid.MaxSize(reqInfo.Password, 100, "password").Message("最长为100字符")
 	valid.MinSize(reqInfo.Password, 1, "password").Message("不能为空")
 	valid.MinSize(reqInfo.Password, 1, "password").Message("不能为空")
-	fmt.Println("==========reqInfo===========", reqInfo)
+
 	if valid.HasErrors() {
 		app.MarkErrors(valid.Errors)
 		appG.Response(http.StatusInternalServerError, e.ERROR_ADD_FAIL, valid.Errors)
@@ -60,7 +51,6 @@ func Auth(c *gin.Context) {
 
 	authService := user_service.User{Username: reqInfo.Username, Password: reqInfo.Password}
 	isExist, err := authService.Check()
-	fmt.Println("==========Check===========", isExist, err)
 	if err != nil {
 		appG.Response(http.StatusInternalServerError, e.ERROR_AUTH_CHECK_TOKEN_FAIL, err)
 		return

+ 4 - 0
module/group.go

@@ -1,6 +1,7 @@
 package module
 
 import (
+	"encoding/json"
 	"errors"
 	"fmt"
 	"strconv"
@@ -183,6 +184,9 @@ func SprinkleStatistics(req *models.SprinkleStatisticsRequest) ([]*models.Sprink
 		return nil, err
 	}
 
+	b, _ := json.Marshal(res)
+	fmt.Println("======SprinkleStatistics======", string(b))
+
 	return res, nil
 }