package v1

import (
	"dsbqj-admin/app/service"
	"dsbqj-admin/pkg/app"
	"dsbqj-admin/pkg/e"
	"dsbqj-admin/pkg/logger"
	"github.com/gin-gonic/gin"
	"net/http"
)

// UploadToken 上传授权
// @Summary Upload Token
// @Tags    用户授权
// @Produce json
// @Param filename query string true "上传的文件名"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /upload/token [post]
func UploadReport(c *gin.Context) {
	var appG = app.Gin{C: c}
	service := service.UploadReportService{}
	if err := c.ShouldBind(&service); err == nil {
		res := service.Create()
		appG.Response(http.StatusOK, e.SUCCESS, res)
	} else {
		appG.Response(http.StatusOK, e.INVALID_PARAMS, err.Error())
	}
}

func ThinkingData(c *gin.Context) {
	var appG = app.Gin{C: c}
	body, _ := c.GetRawData()
	logger.Info("PointApi.insert %s", string(body))
	appG.Response(http.StatusOK, e.SUCCESS, nil)
}
