|
|
|
@ -1,8 +1,8 @@
@@ -1,8 +1,8 @@
|
|
|
|
|
package com.cloud.kicc.system.bigscreen.controller; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
|
@ -10,13 +10,11 @@ import com.cloud.kicc.system.api.bigscreen.entity.VisualCategory;
@@ -10,13 +10,11 @@ import com.cloud.kicc.system.api.bigscreen.entity.VisualCategory;
|
|
|
|
|
import com.cloud.kicc.system.bigscreen.service.IVisualCategoryService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
*<p> |
|
|
|
@ -34,27 +32,23 @@ public class VisualCategoryController {
@@ -34,27 +32,23 @@ public class VisualCategoryController {
|
|
|
|
|
|
|
|
|
|
private final IVisualCategoryService visualCategoryService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperation(value = "详情", notes = "传入visualCategory") |
|
|
|
|
public R<VisualCategory> detail(VisualCategory visualCategory) { |
|
|
|
|
VisualCategory detail = visualCategoryService.getOne(Wrappers.lambdaQuery()); |
|
|
|
|
return R.ok(detail); |
|
|
|
|
private LambdaQueryWrapper<VisualCategory> getQueryWrapper(VisualCategory visualCategory) { |
|
|
|
|
return new LambdaQueryWrapper<VisualCategory>() |
|
|
|
|
.like(StrUtil.isNotBlank(visualCategory.getCategoryKey()), VisualCategory::getCategoryKey, visualCategory.getCategoryKey()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
@ApiOperation(value = "列表", notes = "传入visualCategory") |
|
|
|
|
public R<List<VisualCategory>> list(VisualCategory visualCategory) { |
|
|
|
|
List<VisualCategory> list = visualCategoryService.list(Wrappers.lambdaQuery()); |
|
|
|
|
return R.ok(list); |
|
|
|
|
@ApiOperation(value = "分页列表", notes = "传入visualCategory") |
|
|
|
|
public R<IPage<VisualCategory>> list(Page page, VisualCategory visualCategory) { |
|
|
|
|
IPage<VisualCategory> pages = visualCategoryService.page(page, getQueryWrapper(visualCategory)); |
|
|
|
|
return R.ok(pages); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/page") |
|
|
|
|
@ApiOperation(value = "分页", notes = "传入visualCategory") |
|
|
|
|
public R<IPage<VisualCategory>> page(Page page, VisualCategory visualCategory) { |
|
|
|
|
IPage<VisualCategory> pages = visualCategoryService.page(page, Wrappers.lambdaQuery()); |
|
|
|
|
return R.ok(pages); |
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperation(value = "根据ID查询", notes = "传入id") |
|
|
|
|
public R<VisualCategory> getById(String id) { |
|
|
|
|
VisualCategory visualCategory = visualCategoryService.getById(id); |
|
|
|
|
return R.ok(visualCategory); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
@ -69,10 +63,11 @@ public class VisualCategoryController {
@@ -69,10 +63,11 @@ public class VisualCategoryController {
|
|
|
|
|
return R.ok(visualCategoryService.submit(visualCategory)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/remove") |
|
|
|
|
@PostMapping("/remove/{ids:[\\w,]+}") |
|
|
|
|
@ApiOperation(value = "删除", notes = "传入ids") |
|
|
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
return R.ok(visualCategoryService.removeByIds(Arrays.asList(StrUtil.join(",", ids)))); |
|
|
|
|
public R remove(@PathVariable String[] ids) { |
|
|
|
|
visualCategoryService.removeByIds(Arrays.asList(ids)); |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|