package com.huimv.admin.controller;


import com.huimv.admin.common.token.TokenSign;
import com.huimv.admin.common.utils.Result;
import com.huimv.admin.service.IEartagData2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2023-09-19
 */
@RestController
@RequestMapping("/eartag-data2")
@CrossOrigin
public class EartagData2Controller {
    @Autowired
    private IEartagData2Service eartagDataService;

    @PostMapping("/getEnvByTime")
    public Result getEnvByTime(@RequestBody Map<String,String> map, HttpServletRequest request){
        Integer userId = TokenSign.getMemberIdByJwtToken(request);
        map.put("userId",userId+"");
        return eartagDataService.getEnvByTime(map);
    }
}
