This commit is contained in:
lu7213 committed 2026-05-10 05:16:10 -04:00
1 parent 36e5ab3308
commit b77f5b0701
6 files changed
+54 -16

No files matched your search

@@ -4,14 +4,7 @@ import com.ruoyi.common.select.SelectItem;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -82,7 +75,15 @@ public class DmPlayerConfigController extends BaseController
{
return AjaxResult.success(dmPlayerConfigService.selectDmPlayerConfigById(id));
}
/**
* 获取玩家配置详细信息
*/
@PreAuthorize("@ss.hasPermi('system:dmplayerconfig:query-by-player-id')")
@GetMapping(value = "/query-by-player-id")
public AjaxResult getInfoByPlayerId(@RequestParam("id") Long id)
{
return AjaxResult.success(dmPlayerConfigService.selectDmPlayerConfigByPlayerId(id));
}
/**
* 新增玩家配置
*/
@@ -29,7 +29,8 @@ public class DmPlayerConfig extends BaseEntity
/** 喊话蓝量 */
@Excel(name = "喊话蓝量")
private Integer shoutMana;
@Excel(name = "喊话编码 对应按键值表")
private Integer shoutKey;
/** 是否自动加蓝 */
@Excel(name = "是否自动加蓝")
private Integer autoAddMana;
@@ -145,6 +146,14 @@ public class DmPlayerConfig extends BaseEntity
return fixedDirection;
}
public Integer getShoutKey() {
return shoutKey;
}
public void setShoutKey(Integer shoutKey) {
this.shoutKey = shoutKey;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -23,6 +23,8 @@ public interface DmPlayerConfigMapper extends BaseMapper<DmPlayerConfigPlus>
*/
public DmPlayerConfig selectDmPlayerConfigById(Long id);
public DmPlayerConfig selectDmPlayerConfigByPlayerId(Long playerId);
/**
* 查询玩家配置列表
*
@@ -32,6 +32,8 @@ public interface IDmPlayerConfigService extends IService<DmPlayerConfigPlus>
*/
public List<DmPlayerConfig> selectDmPlayerConfigList(DmPlayerConfig dmPlayerConfig);
public DmPlayerConfig selectDmPlayerConfigByPlayerId(Long playerId);
/**
* 新增玩家配置
*
@@ -7,14 +7,11 @@ import com.github.pagehelper.PageHelper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.*;
import com.luqj.util.HttpHelper;
import com.ruoyi.common.utils.StringUtils;
import com.alibaba.fastjson.JSONArray;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -165,6 +162,29 @@ public class DmPlayerConfigServiceImpl extends ServiceImpl<DmPlayerConfigMapper,
{
return dmPlayerConfigMapper.selectDmPlayerConfigById(id);
}
@Override
public DmPlayerConfig selectDmPlayerConfigByPlayerId(Long playerId)
{
DmPlayerConfig dmPlayerConfig= dmPlayerConfigMapper.selectDmPlayerConfigByPlayerId(playerId);
if(dmPlayerConfig == null){
DmPlayerConfig playerConfigPlus = new DmPlayerConfig();
playerConfigPlus.setPlayerId(playerId);
playerConfigPlus.setAutoAddMana(0);
playerConfigPlus.setAddManaThreshold(10);
playerConfigPlus.setCreateTime(new Date());
playerConfigPlus.setYoloHeight(160);
playerConfigPlus.setYoloWidth(100);
playerConfigPlus.setCustomParams("");
playerConfigPlus.setUpdateTime(new Date());
playerConfigPlus.setFixedDirection(0);
playerConfigPlus.setShoutInterval(12000);
playerConfigPlus.setShoutMana(55);
playerConfigPlus.setShoutKey(69);
this.dmPlayerConfigMapper.insertDmPlayerConfig(playerConfigPlus);
return playerConfigPlus;
}
return dmPlayerConfig;
}
/**
* 查询玩家配置列表
@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="yoloWidth" column="yolo_width" />
<result property="customParams" column="custom_params" />
<result property="fixedDirection" column="fixed_direction" />
<result property="shoutKey" column="shout_key" />
</resultMap>
<sql id="selectDmPlayerConfigVo">
select id, player_id, create_time, update_time, shout_interval, shout_mana, auto_add_mana, add_mana_threshold, yolo_height, yolo_width, custom_params, fixed_direction from dm_player_config
select id, player_id, create_time,shout_key, update_time, shout_interval, shout_mana, auto_add_mana, add_mana_threshold, yolo_height, yolo_width, custom_params, fixed_direction from dm_player_config
</sql>
<select id="selectDmPlayerConfigList" parameterType="DmPlayerConfig" resultMap="DmPlayerConfigResult">
@@ -35,7 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDmPlayerConfigVo"/>
where id = #{id}
</select>
<select id="selectDmPlayerConfigByPlayerId" parameterType="Long" resultMap="DmPlayerConfigResult">
<include refid="selectDmPlayerConfigVo"/>
where player_id = #{playerId}
</select>
<insert id="insertDmPlayerConfig" parameterType="DmPlayerConfig" useGeneratedKeys="true" keyProperty="id">
insert into dm_player_config
<trim prefix="(" suffix=")" suffixOverrides=",">