Merge branch 'jieling' of http://60.1.1.230/backend/gm_tw_admin into jieling

master
jiahuiwen 2021-09-22 19:37:50 +08:00
commit 0b3b307571
4 changed files with 1061 additions and 848 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,185 @@
package config;
import com.jmfy.utils.FileCacheUtils;
import com.jmfy.utils.Table;
import java.util.HashMap;
import java.util.Map;
/**
* @Author hj
* @Date 2021/9/22 16:28:24
* @Description:
* @Version 1.0
*/
@Table(name ="ItemConfig")
public class SItemConfig {
private int id;
private String name;
private boolean backpackOrNot; //是否进背包
private int itemType;
private int itemBaseType; //道具类型(该道具在哪个背包显示)
private int quantity;
private int useType; //使用类型0不使用 1掉落组 2N选1
private int[] rewardGroup;
private int usePerCount;
private boolean isopen;
private int isSave;
private int[] heroStar;
private int ifopen;
private int ifResolve;
private String resolveReward;
private long itemNumlimit;
private int[][] extraReward;
private int recycle;
public static Map<Integer,String> toMap(){
Map<Integer,String> toMap = new HashMap<>();
FileCacheUtils.itemMap.values().forEach(v-> toMap.put(v.getId(),v.getName()));
return toMap;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isBackpackOrNot() {
return backpackOrNot;
}
public void setBackpackOrNot(boolean backpackOrNot) {
this.backpackOrNot = backpackOrNot;
}
public int getItemType() {
return itemType;
}
public void setItemType(int itemType) {
this.itemType = itemType;
}
public int getItemBaseType() {
return itemBaseType;
}
public void setItemBaseType(int itemBaseType) {
this.itemBaseType = itemBaseType;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public int getUseType() {
return useType;
}
public void setUseType(int useType) {
this.useType = useType;
}
public int[] getRewardGroup() {
return rewardGroup;
}
public void setRewardGroup(int[] rewardGroup) {
this.rewardGroup = rewardGroup;
}
public int getUsePerCount() {
return usePerCount;
}
public void setUsePerCount(int usePerCount) {
this.usePerCount = usePerCount;
}
public boolean isIsopen() {
return isopen;
}
public void setIsopen(boolean isopen) {
this.isopen = isopen;
}
public int getIsSave() {
return isSave;
}
public void setIsSave(int isSave) {
this.isSave = isSave;
}
public int[] getHeroStar() {
return heroStar;
}
public void setHeroStar(int[] heroStar) {
this.heroStar = heroStar;
}
public int getIfopen() {
return ifopen;
}
public void setIfopen(int ifopen) {
this.ifopen = ifopen;
}
public int getIfResolve() {
return ifResolve;
}
public void setIfResolve(int ifResolve) {
this.ifResolve = ifResolve;
}
public String getResolveReward() {
return resolveReward;
}
public void setResolveReward(String resolveReward) {
this.resolveReward = resolveReward;
}
public long getItemNumlimit() {
return itemNumlimit;
}
public void setItemNumlimit(long itemNumlimit) {
this.itemNumlimit = itemNumlimit;
}
public int[][] getExtraReward() {
return extraReward;
}
public void setExtraReward(int[][] extraReward) {
this.extraReward = extraReward;
}
public int getRecycle() {
return recycle;
}
public void setRecycle(int recycle) {
this.recycle = recycle;
}
}

View File

@ -1,5 +1,6 @@
package com.jmfy.utils;
import config.SItemConfig;
import config.SRechargeCommodityConfig;
import java.io.*;
@ -11,22 +12,28 @@ public class FileCacheUtils {
private static String path = "";
public static Map<Integer,String> itemNameMap ;
public static Map<Integer,SItemConfig> itemMap ;
public static Map<Integer,String> itemFlowResson ;
public static Map<Integer,SRechargeCommodityConfig> rechargeMap;
public static void initData(){
String osName = System.getProperty("os.name");
if (osName.matches("^(?i)Windows.*$")) {// Window 系统
if (osName.matches("^(?i)Windows.*$")) {
// Window 系统
path = "conf/jsonconf/";
} else {// Linux 系统
path = "../config/jsonconf/";
} else {
// Linux 系统
path = "/data/jieling/config/jsonconf/";
}
itemNameMap = readFile("ItemConfig.txt");
itemFlowResson = readFile("Reason.txt");
// 道具
itemMap = getConfig(SItemConfig.class);
itemNameMap = SItemConfig.toMap();
System.out.printf("道具表长度,{%s}\n",itemNameMap.size());
// 礼包
rechargeMap = getConfig(SRechargeCommodityConfig.class);
SRechargeCommodityConfig.init();
System.out.printf("礼包表长度,{%s}\n",rechargeMap.size());
}
public static Map<Integer,String> readFile(String fileName){
@ -38,8 +45,6 @@ public class FileCacheUtils {
String[] s = line.split("\t");
result.put(Integer.parseInt(s[0].trim()),s[1]);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
@ -71,6 +76,7 @@ public class FileCacheUtils {
try {
String tableName = clazz.getAnnotation(Table.class).name();
String path2 = path+tableName + ".txt";
System.out.printf("打表路径:%s\n",path2);
File file = new File(path2);
if (!file.exists()) {
throw new NullPointerException("clazz.null" + clazz.getName());

View File

@ -26,8 +26,8 @@
<h1><p class="f-20 text-success">太初行管理后台</p></h1>
</div>
<div style="margin-left: 20px;font-size: 18px">
<p style="color: red">更新日志[2021-9-3]</p>
<p>1、自动开服功能优化延迟30秒验证状态</p>
<p style="color: red">更新日志[2021-9-22]</p>
<p>1、更新道具和礼包表</p>
</div>
<footer class="footer mt-20">
</footer>