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

38 lines
829 B
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package project
import (
"autogo/controllers"
"autogo/dbsql"
"net/http"
"github.com/gin-gonic/gin"
)
// @Tags Monkey相关 /api/project/v1/
// @Summary 获取应用信息
// @Description 根据应用名称app_name获取应用信息
// @accept x-www-form-urlencoded
// @Param app_name query string true "应用名称"
// @Success 200 {object} models.Response "返回任务结果"
// @Router /api/project/v1/app [get]
func GetMonkeyResult(c *gin.Context) {
rsp := controllers.NewResponse()
app_name := c.Query("app_name")
if app_name == "" {
rsp.Error("缺少参数app_name")
return
}
db, err := dbsql.GetConn(dbsql.DSN)
if err != nil {
rsp.Error(err.Error())
c.JSON(http.StatusOK, rsp)
return
}
defer dbsql.Close(db)
rsp.Success()
c.JSON(http.StatusOK, rsp)
}