package com.iailab.module.model.mpk.controller.admin; import com.iailab.framework.common.page.PageData; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.module.model.mpk.dto.ChartDTO; import com.iailab.module.model.mpk.dto.ChartParamDTO; import com.iailab.module.model.mpk.entity.ChartEntity; import com.iailab.module.model.mpk.entity.ChartParamEntity; import com.iailab.module.model.mpk.service.ChartService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.Map; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @description: * @author: dzd * @date: 2024/11/5 11:43 **/ @Tag(name = "图表参数") @RestController @RequestMapping("/model/chart") public class ChartController { @Autowired private ChartService chartService; @GetMapping("page") @Operation(summary = "分页") @PreAuthorize("@ss.hasPermission('model:chart:query')") public CommonResult> page(@RequestParam Map params) { PageData page = chartService.page(params); return success(page); } @GetMapping("/get") @Operation(summary = "获得详情") public CommonResult get(@RequestParam("id") String id) { ChartEntity data = chartService.get(id); return success(data); } @PostMapping("/create") @Operation(summary = "创建") @PreAuthorize("@ss.hasPermission('model:chart:create')") public CommonResult save(@RequestBody ChartEntity entity) { chartService.create(entity); return success(true); } @PutMapping("/update") @Operation(summary = "更新") @PreAuthorize("@ss.hasPermission('model:chart:update')") public CommonResult update(@RequestBody ChartEntity entity) { chartService.update(entity); return success(true); } @DeleteMapping("/delete") @PreAuthorize("@ss.hasPermission('model:chart:delete')") public CommonResult delete(@RequestParam("id") String id) { chartService.delete(id); return success(true); } }