package com.vci.web.controller; import com.vci.pagemodel.SmFunctionVO; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.web.service.SmFavFunctionServiceI; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 收藏功能 * @author weidy * @date 2020/7/12 */ @RestController @RequestMapping("/favFunctionController") public class SmFavFunctionController { /** * 收藏功能服务 */ @Autowired private SmFavFunctionServiceI favFunctionService; /** * 收藏功能 * @param functionId 功能编号 * @return 执行结果 */ @PostMapping("/addFav") public BaseResult addFav(String functionId){ favFunctionService.addFav(functionId); return BaseResult.success(); } /** * 移除收藏 * @param functionId 功能编号 * @return 执行结果 */ @PostMapping("/removeFav") public BaseResult removeFav(String functionId){ favFunctionService.removeFav(functionId); return BaseResult.success(); } /** * 当前用户所有收藏功能 * @return 功能的显示对象 */ @GetMapping("/listFavFunction") public List listFavFunction(){ return favFunctionService.listFavFunction(); } }