Browse Source

Merge remote-tracking branch 'origin/dev-lingfeng' into dev0.0.1

bilingfeng 2 years ago
parent
commit
5beeff6b22

+ 38 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/GamePictureController.java

@@ -0,0 +1,38 @@
+package com.zanxiang.manage.controller;
+
+import com.zanxiang.common.domain.ResultVo;
+import com.zanxiang.manage.domain.vo.GamePictureVO;
+import com.zanxiang.manage.service.GamePictureService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-12
+ * @description : 游戏图片
+ */
+@Api(tags = {"游戏图片管理接口"})
+@RestController
+@RequestMapping("/game/picture")
+@Slf4j
+public class GamePictureController {
+
+    @Autowired
+    private GamePictureService gamePictureService;
+
+    @ApiOperation(value = "获取游戏图片配置")
+    @GetMapping(value = "/info")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GamePictureVO.class)})
+    public ResultVo<GamePictureVO> getByGameId(@RequestParam Long id) {
+        return new ResultVo<>(gamePictureService.getByGameId(id));
+    }
+
+}

+ 97 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GamePictureVO.java

@@ -0,0 +1,97 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-12
+ * @description : 游戏图片信息
+ */
+@Data
+public class GamePictureVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "主键id")
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 游戏头像
+     */
+    @ApiModelProperty(notes = "游戏头像")
+    private String avatarImg;
+
+    /**
+     * 小程序码图片
+     */
+    @ApiModelProperty(notes = "小程序码图片")
+    private String appletImg;
+
+    /**
+     * 小游戏卡片标题
+     */
+    @ApiModelProperty(notes = "小游戏卡片标题")
+    private String cardTitle;
+
+    /**
+     * 小游戏卡片url
+     */
+    @ApiModelProperty(notes = "小游戏卡片url")
+    private String cardUrl;
+
+    /**
+     * 小游戏卡片图片
+     */
+    @ApiModelProperty(notes = "小游戏卡片图片")
+    private String cardImg;
+
+    /**
+     * 从入口图片打开
+     */
+    @ApiModelProperty(notes = "从入口图片打开")
+    private Boolean isOpenInlet;
+
+    /**
+     * 入口图片
+     */
+    @ApiModelProperty(notes = "入口图片")
+    private String inletImg;
+
+    /**
+     * 发现游戏图
+     */
+    @ApiModelProperty(notes = "发现游戏图")
+    private String findImg;
+
+    /**
+     * 精品推荐图
+     */
+    @ApiModelProperty(notes = "精品推荐图")
+    private String recommendImg;
+
+    /**
+     * 红包试玩图
+     */
+    @ApiModelProperty(notes = "红包试玩图")
+    private String tryPayImg;
+
+    /**
+     * 分享图名称
+     */
+    @ApiModelProperty(notes = "分享图名称")
+    private String shareImgName;
+
+    /**
+     * 分享图
+     */
+    @ApiModelProperty(notes = "分享图")
+    private String shareImg;
+}

+ 21 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GamePictureService.java

@@ -0,0 +1,21 @@
+package com.zanxiang.manage.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.manage.domain.vo.GamePictureVO;
+import com.zanxiang.mybatis.entity.GamePicture;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-12
+ * @description : 游戏图片
+ */
+public interface GamePictureService extends IService<GamePicture> {
+
+    /**
+     * 根据游戏id查询
+     *
+     * @param gameId : 游戏id
+     * @return 返回游戏图片信息
+     */
+    GamePictureVO getByGameId(Long gameId);
+}

+ 36 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GamePictureServiceImpl.java

@@ -0,0 +1,36 @@
+package com.zanxiang.manage.service.Impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.vo.GamePictureVO;
+import com.zanxiang.manage.service.GamePictureService;
+import com.zanxiang.mybatis.entity.GamePicture;
+import com.zanxiang.mybatis.mapper.GamePictureMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-12
+ * @description : 游戏图片
+ */
+@Slf4j
+@Service
+public class GamePictureServiceImpl extends ServiceImpl<GamePictureMapper, GamePicture> implements GamePictureService {
+
+    /**
+     * 根据游戏id查询
+     *
+     * @param gameId : 游戏id
+     * @return 返回游戏图片信息
+     */
+    @Override
+    public GamePictureVO getByGameId(Long gameId) {
+        GamePicture gamePicture = super.getOne(new LambdaQueryWrapper<GamePicture>().eq(GamePicture::getGameId, gameId));
+        if (gamePicture == null) {
+            gamePicture = GamePicture.builder().gameId(gameId).build();
+        }
+        return BeanUtils.copy(gamePicture, GamePictureVO.class);
+    }
+}

+ 103 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GamePicture.java

@@ -0,0 +1,103 @@
+package com.zanxiang.mybatis.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-12
+ * @description : 游戏图片
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Builder
+@TableName("h_game_picture")
+public class GamePicture {
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    private Long gameId;
+
+    /**
+     * 游戏头像
+     */
+    private String avatarImg;
+
+    /**
+     * 小程序码图片
+     */
+    private String appletImg;
+
+    /**
+     * 小游戏卡片标题
+     */
+    private String cardTitle;
+
+    /**
+     * 小游戏卡片url
+     */
+    private String cardUrl;
+
+    /**
+     * 小游戏卡片图片
+     */
+    private String cardImg;
+
+    /**
+     * 从入口图片打开
+     */
+    private Boolean isOpenInlet;
+
+    /**
+     * 入口图片
+     */
+    private String inletImg;
+
+    /**
+     * 发现游戏图
+     */
+    private String findImg;
+
+    /**
+     * 精品推荐图
+     */
+    private String recommendImg;
+
+    /**
+     * 红包试玩图
+     */
+    private String tryPayImg;
+
+    /**
+     * 分享图名称
+     */
+    private String shareImgName;
+
+    /**
+     * 分享图
+     */
+    private String shareImg;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 12 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/mapper/GamePictureMapper.java

@@ -0,0 +1,12 @@
+package com.zanxiang.mybatis.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zanxiang.mybatis.entity.GamePicture;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-12
+ * @description : ${description}
+ */
+public interface GamePictureMapper extends BaseMapper<GamePicture> {
+}

+ 4 - 0
game-module/game-mybatis/src/main/resources/mapper/GamePictureMapper.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zanxiang.mybatis.mapper.GamePictureMapper">
+</mapper>