|
|
@ -1,9 +1,7 @@ |
|
|
|
package com.cloud.kicc.system.bigscreen.controller; |
|
|
|
package com.cloud.kicc.system.bigscreen.controller; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
@ -12,7 +10,6 @@ import com.cloud.kicc.system.api.bigscreen.entity.VisualComponent; |
|
|
|
import com.cloud.kicc.system.bigscreen.service.IVisualComponentService; |
|
|
|
import com.cloud.kicc.system.bigscreen.service.IVisualComponentService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
@ -36,29 +33,27 @@ public class VisualComponentController { |
|
|
|
|
|
|
|
|
|
|
|
private final IVisualComponentService visualComponentService; |
|
|
|
private final IVisualComponentService visualComponentService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
|
|
|
@ApiOperation(value = "分页列表", notes = "传入visualComponent") |
|
|
|
|
|
|
|
public R<IPage<VisualComponentDto>> list(Page page, VisualComponentDto visualComponent) { |
|
|
|
|
|
|
|
IPage<VisualComponentDto> pages = visualComponentService.selectVisualComponentPage(page, visualComponent); |
|
|
|
|
|
|
|
return R.ok(pages); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/detail") |
|
|
|
@GetMapping("/detail") |
|
|
|
@ApiOperation(value = "详情", notes = "传入visualComponent") |
|
|
|
@ApiOperation(value = "详情", notes = "传入id") |
|
|
|
public R<VisualComponent> detail(VisualComponent visualComponent) { |
|
|
|
public R<VisualComponent> getById(String id) { |
|
|
|
VisualComponent detail = visualComponentService.getOne(Wrappers.lambdaQuery()); |
|
|
|
VisualComponent detail = visualComponentService.getById(id); |
|
|
|
return R.ok(detail); |
|
|
|
return R.ok(detail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/content") |
|
|
|
@GetMapping("/content") |
|
|
|
@ApiOperation(value = "组件详情", notes = "传入id") |
|
|
|
@ApiOperation(value = "组件详情", notes = "传入id") |
|
|
|
public Map<String, Object> content(Long id) { |
|
|
|
public Map<String, Object> content(String id) { |
|
|
|
VisualComponent detail = visualComponentService.getById(id); |
|
|
|
VisualComponent detail = visualComponentService.getById(id); |
|
|
|
return JSONUtil.toBean(detail.getContent(), Map.class); |
|
|
|
return JSONUtil.toBean(detail.getContent(), Map.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
|
|
|
@ApiOperation(value = "分页", notes = "传入visualComponent") |
|
|
|
|
|
|
|
public R<IPage<VisualComponentDto>> list(Page page, VisualComponentDto visualComponent) { |
|
|
|
|
|
|
|
IPage<VisualComponentDto> pages = visualComponentService.selectVisualComponentPage(page, visualComponent); |
|
|
|
|
|
|
|
return R.ok(pages); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
@PostMapping("/save") |
|
|
|
@ApiOperation(value = "新增", notes = "传入visualComponent") |
|
|
|
@ApiOperation(value = "新增", notes = "传入visualComponent") |
|
|
|
public R save(@Valid @RequestBody VisualComponent visualComponent) { |
|
|
|
public R save(@Valid @RequestBody VisualComponent visualComponent) { |
|
|
@ -71,10 +66,11 @@ public class VisualComponentController { |
|
|
|
return R.ok(visualComponentService.updateById(visualComponent)); |
|
|
|
return R.ok(visualComponentService.updateById(visualComponent)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/remove") |
|
|
|
@PostMapping("/remove/{ids:[\\w,]+}") |
|
|
|
@ApiOperation(value = "删除", notes = "传入ids") |
|
|
|
@ApiOperation(value = "删除", notes = "传入ids") |
|
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
public R remove(@PathVariable String[] ids) { |
|
|
|
return R.ok(visualComponentService.removeByIds(Arrays.asList(StrUtil.join(",", ids)))); |
|
|
|
visualComponentService.removeByIds(Arrays.asList(ids)); |
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|