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.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.model.mpk.entity.IconEntity; import com.iailab.module.model.mpk.service.IconService; import com.iailab.module.model.mpk.vo.IconPageReqVO; 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.web.bind.annotation.*; import javax.validation.Valid; import java.util.List; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author PanZhibao * @Description * @createTime 2024年09月22日 */ @Tag(name = "模型服务 - MDK菜单图标管理") @RestController @RequestMapping("/model/mpk/icon") public class IconController { @Autowired private IconService iconService; @GetMapping("/page") @Operation(summary = "获得分页") public CommonResult> page(@Valid IconPageReqVO reqVO) { PageResult page = iconService.page(reqVO); return success(BeanUtils.toBean(page, IconEntity.class)); } @GetMapping("/list") @Operation(summary = "获得列表") public CommonResult> list() { List list = iconService.list(); return success(list); } @GetMapping("/get") @Operation(summary = "获得详情") public CommonResult get(@RequestParam("id") String id) { IconEntity data = iconService.get(id); return success(data); } @PostMapping("/create") @Operation(summary = "创建") public CommonResult save(@Valid @RequestBody IconEntity entity) { iconService.create(entity); return success(true); } @PutMapping("/update") @Operation(summary = "更新") public CommonResult update(@Valid @RequestBody IconEntity entity) { iconService.update(entity); return success(true); } @DeleteMapping("/delete") public CommonResult delete(@RequestParam("id") String id) { iconService.delete(id); return success(true); } }