package com.lightinit.hsdataportal.controller.share;

import com.lightinit.hsdataportal.entity.BaseExample;
import com.lightinit.hsdataportal.model.MyFollowRequirementListModel;
import com.lightinit.hsdataportal.model.MyFollowRequirementSearchModel;
import com.lightinit.hsdataportal.model.ResultState;
import com.lightinit.hsdataportal.service.IMicroappService;
import com.lightinit.hsdataportal.service.IMyFollowRequirementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping(value = "/share/MyShareFollow")
public class MyFollowRequirementController {
    @Autowired
    private IMyFollowRequirementService myFollowRequirementService;
    @Autowired
    private IMicroappService microappService;

//    @RequestMapping(value = "list.action")
//    @ResponseBody
//    public ModelAndView list(MyFollowRequirementSearchModel inputModel, @RequestParam(defaultValue = "1") int pageNo) {
//        ModelAndView modelAndView = new ModelAndView("admin/microapp_register/list");
//        BaseExample.Page pager = new BaseExample.Page(pageNo, 10);
//        inputModel.setPage(pager);
//        List<MyFollowRequirementListModel> outputModel = myFollowRequirementService.selectShareList(inputModel);
//        modelAndView.addObject("list", outputModel);
//        modelAndView.addObject("pager", pager);
//        return modelAndView;
//    }

    @RequestMapping(value = "delfollow.action/{id}")
    @ResponseBody
    public ResultState delfollow(@PathVariable long id) {
        ResultState   resultState = myFollowRequirementService.delfollow(id);
        return resultState;
    }
}
