From a3f7b661a1b7d2d4b48ae5144041b916cd40e6d4 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 01 Jul 2024 16:11:47 +0800
Subject: [PATCH] 后台

---
 src/test/java/cc/mrbird/febs/AgentTest.java |   67 ++++++---------------------------
 1 files changed, 12 insertions(+), 55 deletions(-)

diff --git a/src/test/java/cc/mrbird/febs/AgentTest.java b/src/test/java/cc/mrbird/febs/AgentTest.java
index 1ba4792..401a3bf 100644
--- a/src/test/java/cc/mrbird/febs/AgentTest.java
+++ b/src/test/java/cc/mrbird/febs/AgentTest.java
@@ -1,19 +1,11 @@
 package cc.mrbird.febs;
 
-import cc.mrbird.febs.common.enumerates.AgentLevelEnum;
-import cc.mrbird.febs.mall.entity.AgentInfo;
-import cc.mrbird.febs.mall.entity.DataDictionaryCustom;
-import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper;
-import cc.mrbird.febs.mall.service.IAgentService;
-import cc.mrbird.febs.rabbit.producter.AgentProducer;
-import com.alibaba.fastjson.JSONObject;
+import cc.mrbird.febs.mall.dto.ApiCreateRoomDto;
+import cc.mrbird.febs.mall.service.GameService;
 import lombok.extern.slf4j.Slf4j;
-import org.aspectj.weaver.loadtime.Agent;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
-
-import java.math.BigDecimal;
 
 /**
  * @author wzy
@@ -24,53 +16,18 @@
 public class AgentTest {
 
     @Autowired
-    private AgentProducer agentProducer;
+    private GameService gameService;
 
-    @Autowired
-    private DataDictionaryCustomMapper dataDictionaryCustomMapper;
-
-    @Autowired
-    private IAgentService agentService;
-
+    /**
+     * 房主操作
+     */
+    //创建房间
     @Test
-    public void agentTest() {
-//        agentProducer.sendDelayMsg(1L, 10000L);
-    }
+    public void createRoom() {
 
-    @Test
-    public void insertAgentTest() {
-        AgentInfo agentInfo = new AgentInfo();
-        agentInfo.setOrderType(2);
-        agentInfo.setOrderCnt(2000);
-        agentInfo.setLastCnt(3);
-        agentInfo.setDirectIncome(BigDecimal.valueOf(50));
-        agentInfo.setTeamIncome(BigDecimal.valueOf(15));
-        agentInfo.setTeamIncomeType(2);
-
-        DataDictionaryCustom data = new DataDictionaryCustom();
-        data.setType("AGENT_LEVEL_REQUIRE");
-        data.setCode(AgentLevelEnum.FOUR_LEVEL.name());
-        data.setValue(JSONObject.toJSONString(agentInfo));
-        dataDictionaryCustomMapper.insert(data);
-    }
-
-    @Test
-    public void insertData() {
-        int i = 1;
-        for (AgentLevelEnum value : AgentLevelEnum.values()) {
-            DataDictionaryCustom data = new DataDictionaryCustom();
-            data.setType("AGENT_LEVEL");
-            data.setDescription(value.getName());
-            data.setCode(value.name());
-            data.setValue(String.valueOf(i));
-            dataDictionaryCustomMapper.insert(data);
-        }
-
-    }
-
-    @Test
-    public void autoLevelUp() {
-        // agentService.autoUpAgentLevel(3L);
-        agentProducer.sendAutoLevelUpMsg(3L);
+        ApiCreateRoomDto apiCreateRoomDto = new ApiCreateRoomDto();
+        apiCreateRoomDto.setRoomType(1);
+        apiCreateRoomDto.setGameTime(10);
+        gameService.createRoom(apiCreateRoomDto);
     }
 }

--
Gitblit v1.9.1