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);
|
}
|
|
}
|