package cn.lili.controller.lmk;
|
|
import cn.lili.base.Result;
|
import cn.lili.group.Add;
|
import cn.lili.group.Update;
|
import cn.lili.modules.lmk.domain.form.TagForm;
|
import cn.lili.modules.lmk.domain.query.TagQuery;
|
import cn.lili.modules.lmk.service.TagService;
|
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-13
|
*/
|
@Validated
|
@RequiredArgsConstructor
|
@Api(value = "标签", tags = "标签管理")
|
@RestController
|
@RequestMapping("/manager/lmk/tag")
|
public class TagController {
|
|
private final TagService tagService;
|
|
@PostMapping
|
@ApiOperation(value = "添加", notes = "添加")
|
public Result add(@RequestBody @Validated(Add.class) TagForm form) {
|
return tagService.add(form);
|
}
|
|
@PutMapping
|
@ApiOperation(value = "修改", notes = "修改")
|
public Result update(@RequestBody @Validated(Update.class) TagForm form) {
|
return tagService.update(form);
|
}
|
|
@DeleteMapping("/{id}")
|
@ApiOperation(value = "ID删除", notes = "ID删除")
|
public Result removeById(@PathVariable("id") String id) {
|
return tagService.removeById(id);
|
}
|
|
@DeleteMapping("/batch")
|
@ApiOperation(value = "批量删除", notes = "批量删除")
|
public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) {
|
return tagService.remove(ids);
|
}
|
|
@GetMapping("/page")
|
@ApiOperation(value = "分页", notes = "分页")
|
public Result page(TagQuery query) {
|
return tagService.page(query);
|
}
|
|
}
|