Files
gostock/internal/logic/restful/recommend.go
2026-02-27 13:26:22 +08:00

26 lines
547 B
Go

package restful
import (
"git.apinb.com/bsm-sdk/core/utils"
"git.apinb.com/quant/gostock/internal/impl"
"git.apinb.com/quant/gostock/internal/models"
"github.com/gin-gonic/gin"
)
func Recommend(ctx *gin.Context) {
ymdQuery := ctx.DefaultQuery("ymd", "")
var ymd int
if ymdQuery != "" {
ymd = utils.String2Int(ymdQuery)
}
if ymd == 0 {
ymd = models.GetYmd()
}
var stocks []string
impl.DBService.Model(&models.StratModel{}).Where("status=2 and ai_score>=5 and ymd=?", ymd).Pluck("code", &stocks)
ctx.JSON(200, stocks)
return
}