From 88197f942cd186b111e1a632dc6db4dd8b361017 Mon Sep 17 00:00:00 2001 From: lizhengwei <171332584@qq.com> Date: Tue, 10 Mar 2026 23:12:20 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=E7=BB=84=E4=BB=B6=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi-h5/doc/http/component-category.http | 5 +- .../H5ComponentCategoryController.java | 2 +- .../api/controller/H5ComponentController.java | 10 +- .../luban/api/controller/H5TagController.java | 10 +- .../api/controller/ScriptsController.java | 100 +++++++++--------- 5 files changed, 62 insertions(+), 65 deletions(-) diff --git a/ruoyi-site/ruoyi-h5/doc/http/component-category.http b/ruoyi-site/ruoyi-h5/doc/http/component-category.http index e88086d84..b80c1498a 100644 --- a/ruoyi-site/ruoyi-h5/doc/http/component-category.http +++ b/ruoyi-site/ruoyi-h5/doc/http/component-category.http @@ -1,8 +1,5 @@ -### H5 组件分类管理接口测试 - - ### 1. 分页查询分类(查询一级分类) -GET {{baseUrl}}/h5/category/page?pageNum=1&pageSize=10 +GET http://localhost:19200/h5/h5/category/page?pageNum=1&pageSize=10&parentId=1 Content-Type: application/json ### 2. 分页查询分类(查询指定父分类的子分类) diff --git a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentCategoryController.java b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentCategoryController.java index aa6e30474..e09585005 100644 --- a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentCategoryController.java +++ b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentCategoryController.java @@ -23,7 +23,7 @@ import java.util.List; */ @Tag(name = "H5 组件分类管理") @RestController -@RequestMapping("/h5/category") +@RequestMapping("category") @RequiredArgsConstructor public class H5ComponentCategoryController { diff --git a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentController.java b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentController.java index 14ac84605..23056bcc2 100644 --- a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentController.java +++ b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5ComponentController.java @@ -24,7 +24,7 @@ import java.util.List; */ @Tag(name = "H5 组件管理") @RestController -@RequestMapping("/h5/component") +@RequestMapping("component") @RequiredArgsConstructor public class H5ComponentController { @@ -47,7 +47,7 @@ public class H5ComponentController { @Parameter(description = "搜索关键词") @RequestParam(required = false) String keyword, @Parameter(description = "分类 ID") @RequestParam(required = false) Long categoryId, @Parameter(description = "标签 ID") @RequestParam(required = false) Long tagId) { - + Page result = h5ComponentService.getPage(page, pageSize, type, keyword, categoryId, tagId); return new Result<>(result); } @@ -58,7 +58,7 @@ public class H5ComponentController { @Parameter(description = "组件信息", required = true) @RequestBody @Validated H5Component component, @Parameter(description = "分类 ID 列表") @RequestBody(required = false) List categoryIds, @Parameter(description = "标签 ID 列表") @RequestBody(required = false) List tagIds) { - + Long id = h5ComponentService.create(component, categoryIds, tagIds); return new Result<>(id); } @@ -70,7 +70,7 @@ public class H5ComponentController { @Parameter(description = "组件信息", required = true) @RequestBody @Validated H5Component component, @Parameter(description = "分类 ID 列表") @RequestBody(required = false) List categoryIds, @Parameter(description = "标签 ID 列表") @RequestBody(required = false) List tagIds) { - + component.setId(id); h5ComponentService.update(component, categoryIds, tagIds); return new Result<>(); @@ -113,7 +113,7 @@ public class H5ComponentController { public Result> getHotComponents( @Parameter(description = "组件类型") @RequestParam(required = false) String type, @Parameter(description = "数量限制", required = true) @RequestParam Integer limit) { - + List result = h5ComponentService.getHotComponents(type, limit); return new Result<>(result); } diff --git a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5TagController.java b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5TagController.java index 456adfffe..11c2c1669 100644 --- a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5TagController.java +++ b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/H5TagController.java @@ -20,7 +20,7 @@ import java.util.List; */ @Tag(name = "H5 组件标签管理") @RestController -@RequestMapping("/h5/tag") +@RequestMapping("tag") @RequiredArgsConstructor public class H5TagController { @@ -37,7 +37,7 @@ public class H5TagController { @GetMapping("/hot") public Result> getHotTags( @Parameter(description = "数量限制", required = true) @RequestParam Integer limit) { - + List result = h5TagService.getHotTags(limit); return new Result<>(result); } @@ -46,7 +46,7 @@ public class H5TagController { @GetMapping("/by-type") public Result> getTagsByType( @Parameter(description = "组件类型") @RequestParam(required = false) String type) { - + List result = h5TagService.getTagsByType(type); return new Result<>(result); } @@ -55,7 +55,7 @@ public class H5TagController { @PostMapping public Result create( @Parameter(description = "标签信息", required = true) @RequestBody @Validated H5Tag tag) { - + Long id = h5TagService.create(tag); return new Result<>(id); } @@ -65,7 +65,7 @@ public class H5TagController { public Result update( @Parameter(description = "标签 ID", required = true) @PathVariable Long id, @Parameter(description = "标签信息", required = true) @RequestBody @Validated H5Tag tag) { - + tag.setId(id); h5TagService.update(tag); return new Result<>(); diff --git a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/ScriptsController.java b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/ScriptsController.java index b0688d084..cf5fb50af 100644 --- a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/ScriptsController.java +++ b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/controller/ScriptsController.java @@ -1,50 +1,50 @@ -package com.luban.api.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.luban.api.entity.Scripts; -import com.luban.api.convert.ScriptsConvert; -import com.luban.api.service.ScriptsService; -import com.luban.api.vo.ScriptsVO; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -import java.util.stream.Collectors; - -/** - *

- * 作品 前端控制器 - *

- * - * @author lizhengwei - * @since 2024-06-21 - */ -@RestController -@RequestMapping("/scripts") -public class ScriptsController { - - - private final ScriptsService scriptsService; - - public ScriptsController(ScriptsService scriptsService) { - this.scriptsService = scriptsService; - } - - - @Operation(summary = "根据scriptsId查询") - @GetMapping("/{id}") - public ScriptsVO findScriptsById(@PathVariable Long id) { - return ScriptsConvert.toVO(scriptsService.getById(id)); - } - - @Operation(summary = "查询所有scripts") - @GetMapping - public List listAllScriptss(@RequestParam Integer _limit) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.last("limit " + _limit); - return scriptsService.list(wrapper).stream().map(ScriptsConvert::toVO).collect(Collectors.toList()); - } - -} - +//package com.luban.api.controller; +// +// +//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +//import com.luban.api.entity.Scripts; +//import com.luban.api.convert.ScriptsConvert; +//import com.luban.api.service.ScriptsService; +//import com.luban.api.vo.ScriptsVO; +//import io.swagger.v3.oas.annotations.Operation; +//import org.springframework.web.bind.annotation.*; +// +//import java.util.List; +//import java.util.stream.Collectors; +// +///** +// *

+// * 作品 前端控制器 +// *

+// * +// * @author lizhengwei +// * @since 2024-06-21 +// */ +//@RestController +//@RequestMapping("/scripts") +//public class ScriptsController { +// +// +// private final ScriptsService scriptsService; +// +// public ScriptsController(ScriptsService scriptsService) { +// this.scriptsService = scriptsService; +// } +// +// +// @Operation(summary = "根据scriptsId查询") +// @GetMapping("/{id}") +// public ScriptsVO findScriptsById(@PathVariable Long id) { +// return ScriptsConvert.toVO(scriptsService.getById(id)); +// } +// +// @Operation(summary = "查询所有scripts") +// @GetMapping +// public List listAllScriptss(@RequestParam Integer _limit) { +// QueryWrapper wrapper = new QueryWrapper<>(); +// wrapper.last("limit " + _limit); +// return scriptsService.list(wrapper).stream().map(ScriptsConvert::toVO).collect(Collectors.toList()); +// } +// +//} +//