package com.huimv.admin.controller;


import com.huimv.admin.common.token.TokenSign;
import com.huimv.admin.common.utils.Result;
import com.huimv.admin.service.IEartagEartagRegister2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

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

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2023-09-19
 */
@RestController
@RequestMapping("/eartag-eartag-register2")
@CrossOrigin
public class EartagEartagRegister2Controller {
    @Autowired
    private IEartagEartagRegister2Service eartagRegisterService;

   /* @RequestMapping("/listFarmUnitEartagData")
    public Result listFarmUnitEartagData(@RequestBody Map<String, String> params){
        return eartagRegisterService.listFarmUnitEartagData(params);
    }*/

    @RequestMapping("/listFarmUnitEartagData")
    public Result listFarmUnitEartagData(@RequestBody Map<String, String> params, HttpServletRequest req){
        Integer userId = TokenSign.getMemberIdByJwtToken(req);
        params.put("userId",userId+"");
        return eartagRegisterService.listFarmUnitEartagData(params);
    }
}
