ludc
2025-01-15 d42f321ca241ab7f8bb3cdc71f11fe5ec4ebc48d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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<SmFunctionVO> listFavFunction(){
       return favFunctionService.listFavFunction();
    }
 
 
}