package cn.com.countrygarden.bi.main.controller.experience;

import cn.com.countrygarden.bi.main.core.Result;
import cn.com.countrygarden.bi.main.dto.experience.TygInfoManageDto;
import cn.com.countrygarden.bi.main.dto.manager.TygInfoManage;
import cn.com.countrygarden.bi.main.service.experience.TygInfoManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

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

@Controller
@RequestMapping("/api/tyg/info")
public class TygInfoManageController {
    @Autowired
    private TygInfoManageService tygInfoManageService;
    @PostMapping("/add")
    @ResponseBody
    public Result add(@RequestBody TygInfoManage tygInfoManage, HttpServletRequest req){
        return tygInfoManageService.add(tygInfoManage,req);
    }
    @PostMapping("/list")
    @ResponseBody
    public Result list(@RequestBody TygInfoManageDto tygInfoManage){
        return tygInfoManageService.list(tygInfoManage);
    }
    @GetMapping("/no/page/list")
    @ResponseBody
    public Result noPageList(@RequestParam(required = false) TygInfoManageDto tygInfoManage){
        return tygInfoManageService.noPageList(tygInfoManage);
    }
    @PostMapping("/one")
    @ResponseBody
    public Result one(String id){
        return tygInfoManageService.one(id);
    }
    @PostMapping("/del")
    @ResponseBody
    public Result del(String id){
        return tygInfoManageService.del(id);
    }
}
