Commit 4ce6e6af authored by shiyu's avatar shiyu

extra信息设置

parent 3c02b3bb
...@@ -75,6 +75,7 @@ public class ShiroConfig { ...@@ -75,6 +75,7 @@ public class ShiroConfig {
public RedisSessionDAO redisSessionDAO() { public RedisSessionDAO redisSessionDAO() {
RedisSessionDAO redisSessionDAO = new RedisSessionDAO(); RedisSessionDAO redisSessionDAO = new RedisSessionDAO();
redisSessionDAO.setRedisManager(redisManager()); redisSessionDAO.setRedisManager(redisManager());
redisSessionDAO.setExpire(60*60*12);
return redisSessionDAO; return redisSessionDAO;
} }
......
...@@ -103,8 +103,10 @@ public class ItemServiceImpl implements ItemService { ...@@ -103,8 +103,10 @@ public class ItemServiceImpl implements ItemService {
//查询原有的数据 //查询原有的数据
Item oldItem = itemManager.findDetails(coinRequestDto.getId()); Item oldItem = itemManager.findDetails(coinRequestDto.getId());
String extra = oldItem.getExtra(); String extra = oldItem.getExtra();
Map<String, Object> map = new HashMap<>();
if (StringUtils.hasLength(extra)) { if (StringUtils.hasLength(extra)) {
Map<String, Object> map = JsonUtils.toMap(extra); map = JsonUtils.toMap(extra);
}
//直径 //直径
map.put("diameter", coinRequestDto.getDiameter()); map.put("diameter", coinRequestDto.getDiameter());
//厚度 //厚度
...@@ -113,7 +115,6 @@ public class ItemServiceImpl implements ItemService { ...@@ -113,7 +115,6 @@ public class ItemServiceImpl implements ItemService {
map.put("weight", coinRequestDto.getWeight()); map.put("weight", coinRequestDto.getWeight());
String extraInfo = JsonUtils.fromMap(map); String extraInfo = JsonUtils.fromMap(map);
item.setExtra(extraInfo); item.setExtra(extraInfo);
}
String imgBaseStr = coinRequestDto.getImgBaseStr(); String imgBaseStr = coinRequestDto.getImgBaseStr();
String keyName = String.valueOf(coinRequestDto.getId()) + System.currentTimeMillis() + IMG_SUFFIX ; String keyName = String.valueOf(coinRequestDto.getId()) + System.currentTimeMillis() + IMG_SUFFIX ;
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
...@@ -130,8 +131,8 @@ public class ItemServiceImpl implements ItemService { ...@@ -130,8 +131,8 @@ public class ItemServiceImpl implements ItemService {
itemManager.setCoin(item); itemManager.setCoin(item);
//记录钱币设置的操作日志 //记录钱币设置的操作日志
OperateLog operateLog = OperateLog.of(coinRequestDto.getId(), CommonEnum.OperateTypeEnum.COIN_SET.getDes(), OperateLog operateLog = OperateLog.of(coinRequestDto.getId(), CommonEnum.OperateTypeEnum.ITEM_SET.getDes(),
CommonEnum.OperateTypeEnum.COIN_SET.getCode(), AuthSupport.adminId(), AuthSupport.userName(), JsonUtils.fromMap(paramMap)); CommonEnum.OperateTypeEnum.ITEM_SET.getCode(), AuthSupport.adminId(), AuthSupport.userName(), JsonUtils.fromMap(paramMap));
operateLogService.insert(operateLog); operateLogService.insert(operateLog);
} catch (Exception e) { } catch (Exception e) {
logger.error("钱币设置 error :{}", e); logger.error("钱币设置 error :{}", e);
......
...@@ -3,7 +3,7 @@ package com.wwdz.ch.core.consts; ...@@ -3,7 +3,7 @@ package com.wwdz.ch.core.consts;
public class CommonEnum { public class CommonEnum {
public enum OperateTypeEnum { public enum OperateTypeEnum {
COIN_SET(1, "钱币设置"), ITEM_SET(1, "商品设置"),
; ;
private int code; private int code;
...@@ -34,4 +34,38 @@ public class CommonEnum { ...@@ -34,4 +34,38 @@ public class CommonEnum {
} }
public enum SourceTypeEnum {
SYSTEM_GET(1, "系统获取"),
USER_UPLOAD(2, "用户上传"),
;
private int code;
private String des;
SourceTypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (SourceTypeEnum sourceTypeEnum : SourceTypeEnum.values()) {
if (code == sourceTypeEnum.getCode()) {
return sourceTypeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment