43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package apis
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"gitlink.org.cn/JointCloud/pcm-openi/common"
|
|
"gitlink.org.cn/JointCloud/pcm-openi/model"
|
|
"net/http"
|
|
)
|
|
|
|
func GetImageRecommended(ctx *gin.Context) {
|
|
token := ctx.Query(common.ACCESSTOKEN)
|
|
|
|
var param model.ImageRecommendedParam
|
|
if err := ctx.BindJSON(¶m); err != nil {
|
|
model.Response(ctx, http.StatusBadRequest, common.INVALIDPARAMS, err)
|
|
return
|
|
}
|
|
|
|
reqUrl := common.OPENIPREFIX + common.IMAGERECOMMENDED
|
|
|
|
var resp model.ImageRecommended
|
|
|
|
req := common.GetRestyRequest(common.TIMEOUT)
|
|
_, err := req.
|
|
SetQueryParam(common.ACCESSTOKEN, token).
|
|
SetQueryParam("", param.Python).
|
|
SetQueryParam("", param.Python).
|
|
SetQueryParam("", param.Python).
|
|
SetQueryParam("", param.Python).
|
|
SetQueryParam("", param.Python).
|
|
SetQueryParam("", param.Python).
|
|
SetQueryParam("", param.Python).
|
|
SetResult(&resp).
|
|
Get(reqUrl)
|
|
|
|
if err != nil {
|
|
model.Response(ctx, 500, common.INVOKEERROR, err)
|
|
return
|
|
}
|
|
|
|
model.Response(ctx, http.StatusOK, common.SUCCESS, resp)
|
|
}
|