package com.yh.saas.platform.controller;


import com.yh.saas.platform.entity.ThermalRouting;
import com.yh.saas.platform.service.IThermalRoutingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 热度路由
 * 解释:
 * 用来存储哪个路由对用户使用率最高
 * </p>
 *
 * @author ZhangMingYu
 * @since 2020年2月21日15:19:04
 */
@RestController
@RequestMapping("/thermalRouting")
public class ThermalRoutingController {

    @Autowired
    private IThermalRoutingService thermalRoutingService;

    /**
     * 更新热度
     */
    @PostMapping("/api/renewalHead")
    public void renewalHead(@Valid @RequestBody ThermalRouting thermalRouting) {
        thermalRoutingService.renewalHead(thermalRouting);
    }

    /**
     * 查询 - 最热路由
     */
    @GetMapping("/query/findHottestRouting")
    public List<ThermalRouting> findHottestRouting(ThermalRouting thermalRouting){
       return thermalRoutingService.findHottestRouting(thermalRouting);
    }
}
