瀏覽代碼

blockly编程游戏
1、加入学生端查询单条数据
2、配置动态任务初始朝向

liyanbo 5 月之前
父節點
當前提交
a47dd6d951

+ 1 - 1
byzs-module-ai/src/main/java/cn/iocoder/byzs/module/ai/controller/admin/mapgame/vo/MapGamePageReqVO.java

@@ -24,7 +24,7 @@ public class MapGamePageReqVO extends PageParam {
     private String userImage;
 
     @Schema(description = "人物初始坐标")
-    private String userPosition;
+    private Integer userDirection;
 
     @Schema(description = "地图背景图")
     @ExcelProperty("地图背景图")

+ 1 - 1
byzs-module-ai/src/main/java/cn/iocoder/byzs/module/ai/controller/admin/mapgame/vo/MapGameRespVO.java

@@ -30,7 +30,7 @@ public class MapGameRespVO {
 
     @Schema(description = "人物初始坐标")
     @ExcelProperty("人物初始坐标")
-    private String userPosition;
+    private Integer userDirection;
 
     @Schema(description = "地图方格尺寸")
     @ExcelProperty("地图方格尺寸")

+ 1 - 1
byzs-module-ai/src/main/java/cn/iocoder/byzs/module/ai/controller/admin/mapgame/vo/MapGameSaveReqVO.java

@@ -24,7 +24,7 @@ public class MapGameSaveReqVO {
     private String userImage;
 
     @Schema(description = "人物初始坐标")
-    private String userPosition;
+    private Integer userDirection;
 
     @Schema(description = "地图方格尺寸")
     private Double mapTileSize;

+ 1 - 1
byzs-module-ai/src/main/java/cn/iocoder/byzs/module/ai/dal/dataobject/mapgame/MapGameDO.java

@@ -42,7 +42,7 @@ public class MapGameDO extends BaseDO {
     /**
      * 人物初始坐标
      */
-    private String userPosition;
+    private Integer userDirection;
     /**
      * 地图方格大小
      */

+ 2 - 2
byzs-module-ai/src/main/java/cn/iocoder/byzs/module/ai/dal/mysql/mapgame/MapGameMapper.java

@@ -22,7 +22,7 @@ public interface MapGameMapper extends BaseMapperX<MapGameDO> {
                 .likeIfPresent(MapGameDO::getName, reqVO.getName())
                 .eqIfPresent(MapGameDO::getInfo, reqVO.getInfo())
                 .eqIfPresent(MapGameDO::getUserImage, reqVO.getUserImage())
-                .eqIfPresent(MapGameDO::getUserPosition, reqVO.getUserPosition())
+                .eqIfPresent(MapGameDO::getUserDirection, reqVO.getUserDirection())
                 .eqIfPresent(MapGameDO::getMapTileSize, reqVO.getMapTileSize())
                 .eqIfPresent(MapGameDO::getMapStartPoint, reqVO.getMapStartPoint())
                 .eqIfPresent(MapGameDO::getMapBackground, reqVO.getMapBackground())
@@ -33,7 +33,7 @@ public interface MapGameMapper extends BaseMapperX<MapGameDO> {
                 .eqIfPresent(MapGameDO::getStatus, reqVO.getStatus())
                 .betweenIfPresent(MapGameDO::getCreateTime, reqVO.getCreateTime())
                 .eqIfPresent(MapGameDO::getTenantId, reqVO.getTenantId())
-                .orderByDesc(MapGameDO::getId));
+                .orderByAsc(MapGameDO::getSort));
     }
 
 }

+ 14 - 2
byzs-web/src/main/java/cn/iocoder/byzs/module/web/controller/admin/ai/WebAiController.java

@@ -33,6 +33,7 @@ import cn.iocoder.byzs.module.ai.service.model.AiChatRoleService;
 import cn.iocoder.byzs.module.ai.service.model.AiModelService;
 import cn.iocoder.byzs.module.ai.service.video.AiVideoService;
 import cn.iocoder.byzs.module.ai.service.virtualdevice.VirtualDeviceService;
+import cn.iocoder.byzs.module.web.controller.admin.ai.vo.MapGameVO;
 import cn.iocoder.byzs.module.web.controller.admin.ai.vo.WebAiChatRoleVO;
 import cn.iocoder.byzs.module.web.service.ai.WebAiServiceImpl;
 import io.swagger.v3.oas.annotations.Operation;
@@ -203,11 +204,22 @@ public class WebAiController {
     @Operation(summary = "获得AI-blockly地图编程游戏分页")
     @PermitAll
     @TenantIgnore
-    public CommonResult<PageResult<MapGameRespVO>> selectMapGame(@Valid MapGamePageReqVO pageReqVO) {
+    public CommonResult<PageResult<MapGameVO>> selectMapGame(@Valid MapGamePageReqVO pageReqVO) {
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
         pageReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
 
         PageResult<MapGameDO> pageResult = mapGameService.getMapGamePage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, MapGameRespVO.class));
+        return success(BeanUtils.toBean(pageResult, MapGameVO.class));
+    }
+    @GetMapping("/getMapGameById")
+    @Operation(summary = "获得AI-blockly地图编程游戏详情")
+    @PermitAll
+    @TenantIgnore
+    public CommonResult<MapGameRespVO> getMapGameById(@RequestParam("id") Integer id) {
+        MapGameDO mapGame = mapGameService.getMapGame(id);
+        if (mapGame == null) {
+            return success(null);
+        }
+        return success(BeanUtils.toBean(mapGame, MapGameRespVO.class));
     }
 }

+ 40 - 0
byzs-web/src/main/java/cn/iocoder/byzs/module/web/controller/admin/ai/vo/MapGameVO.java

@@ -0,0 +1,40 @@
+package cn.iocoder.byzs.module.web.controller.admin.ai.vo;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+@Data
+public class MapGameVO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Integer id;
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 简介
+     */
+    private String info;
+    /**
+     * 地图背景图
+     */
+    private String mapBackground;
+    /**
+     * 排序
+     */
+    private Integer sort;
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 租户id
+     */
+    private Long tenantId;
+
+}