Commit f9b51644 by huangchengyi

1..0

parent 75a28d2b
...@@ -2,11 +2,9 @@ package main ...@@ -2,11 +2,9 @@ package main
import ( import (
"flag" "flag"
"fmt"
"go_sku_server/boot" "go_sku_server/boot"
"go_sku_server/pkg/logger" "go_sku_server/pkg/logger"
"go_sku_server/service" "go_sku_server/service"
"github.com/jasonlvhit/gocron"
) )
//定时任务计算系数价格 //定时任务计算系数价格
...@@ -25,21 +23,4 @@ func main() { ...@@ -25,21 +23,4 @@ func main() {
logger.Log("启动任务","ratio",1) logger.Log("启动任务","ratio",1)
ZyCronService := service.ZyCronService{} ZyCronService := service.ZyCronService{}
ZyCronService.ZyDiscount(goods_id) ZyCronService.ZyDiscount(goods_id)
if goods_id != "" {
//定时任务,每隔3天统计一次
err := gocron.Every(3).Day().At("1:20").Do(ZyDiscount,goods_id)
<- gocron.Start()
fmt.Print("启动任务状态",err)
}
}
/*
任务执行
*/
func ZyDiscount(goods_id string) {
logger.Log("定时执行任务","ratio",1)
ZyCronService := service.ZyCronService{}
ZyCronService.ZyDiscount(goods_id)
} }
...@@ -16,6 +16,9 @@ func InitRouter() *gin.Engine { ...@@ -16,6 +16,9 @@ func InitRouter() *gin.Engine {
r.GET("synchronization", controller.Synchronization) r.GET("synchronization", controller.Synchronization)
r.POST("synchronization",controller.Synchronization) r.POST("synchronization",controller.Synchronization)
//联营参数选择搜索
r.GET("Synchronization", controller.Synchronization)
r.POST("Synchronization",controller.Synchronization)
//心跳 //心跳
r.GET("Health", controller.Health) r.GET("Health", controller.Health)
r.POST("Health",controller.Health) r.POST("Health",controller.Health)
......
...@@ -32,7 +32,6 @@ type ZiyingService struct { ...@@ -32,7 +32,6 @@ type ZiyingService struct {
@param power[verify_blacklist] 是否验证黑名单,用于折扣活动提交订单页面与后台下单 :true @param power[verify_blacklist] 是否验证黑名单,用于折扣活动提交订单页面与后台下单 :true
*/ */
func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string,goodsRes *sync.Map, wg *sync.WaitGroup) { func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string,goodsRes *sync.Map, wg *sync.WaitGroup) {
redisConn := gredis.Conn("search_r") redisConn := gredis.Conn("search_r")
defer func() { defer func() {
wg.Done(); wg.Done();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment