xiangpei
7 天以前 2226679bda25ddf977f12367a9a37fcf4e377249
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
62
63
package cn.lili.controller.lmk;
 
import cn.lili.base.Result;
import cn.lili.group.Add;
import cn.lili.modules.lmk.domain.form.MyCollectForm;
import cn.lili.modules.lmk.domain.query.MyCollectQuery;
import cn.lili.modules.lmk.service.MyCollectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.validation.constraints.NotEmpty;
import java.util.List;
 
/**
 * 我的收藏 前端控制器
 *
 * @author xp
 * @since 2025-05-22
 */
@Validated
@RequiredArgsConstructor
@Api(value = "我的收藏", tags = "我的收藏管理")
@RestController
@RequestMapping("/buyer/lmk/my-collect")
public class MyCollectController {
 
    private final MyCollectService myCollectService;
 
    @PostMapping("/change")
    @ApiOperation(value = "收藏/取消收藏", notes = "收藏/取消收藏")
    public Result change(@RequestBody @Validated(Add.class) MyCollectForm form) {
        return myCollectService.change(form);
    }
 
    @DeleteMapping("/{id}")
    @ApiOperation(value = "ID删除", notes = "ID删除")
    public Result removeById(@PathVariable("id") String id) {
        return myCollectService.removeById(id);
    }
 
    @DeleteMapping("/batch")
    @ApiOperation(value = "批量删除", notes = "批量删除")
    public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) {
        return myCollectService.remove(ids);
    }
 
    @GetMapping("/page")
    @ApiOperation(value = "分页", notes = "分页")
    public Result page(MyCollectQuery query) {
        return myCollectService.page(query);
    }
 
 
    @GetMapping("/getMyCollectList")
    @ApiOperation(value = "获得我的收藏", notes = "获得我的收藏列表")
    public Result getMyCollectList(MyCollectQuery query){
        return myCollectService.getMyCollectList(query);
    }
 
}