package com.org.hktshop.base;


import com.org.hktshop.Interface.coupon.HktCouponService;
import com.org.hktshop.Interface.portal.product.PortalSearchService;
import com.org.hktshop.service.hotking.BrandService;
import com.org.hktshop.service.hotking.SampleGoodsAttrQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author hotking03
 */
@RequestMapping("/")
@RestController
public class HktSearchRemindJob {

    @Autowired
    private PortalSearchService portalSearchService;

    @Autowired
    private HktCouponService hktCouponService;

    @Autowired
    private SampleGoodsAttrQueryService sampleGoodsAttrQueryService;

    @Autowired
    private BrandService brandService;

    /**
     * 同步索索数据库到缓存
     * 每天执行一次
     */
    @Scheduled(cron = "0 0 0 */1 * ?")
    @RequestMapping("job")
    public void job1() {
        portalSearchService.querHktSearchRemindList();
    }

    @Scheduled(cron = "0 * * * * ? ")
    @RequestMapping("job2")
    public void job2() {
        hktCouponService.updateStatusCoupon();
    }

}
