Commit 36f9d9cb authored by shiyu's avatar shiyu

返回数据新增商品状态的名称

parent 099df524
......@@ -86,6 +86,8 @@ public class CoinVo implements Entity {
*/
private Integer state;
private String stateName;
/**
* 钱币额外信息
*/
......
package com.wwdz.ch.admin.entity.vo;
import com.wwdz.ch.core.consts.ItemStateEnum;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.domain.Item;
import com.xxdxxs.entity.Entity;
......@@ -68,6 +69,8 @@ public class ItemVo implements Entity {
*/
private Integer state;
private String stateName;
/**
* 逻辑删除
*/
......@@ -166,6 +169,7 @@ public class ItemVo implements Entity {
public static final ItemVo fromItem(Item item) {
ItemVo itemVo = new ItemVo();
EntityMapper.copyAttribute(item, itemVo);
itemVo.setStateName(ItemStateEnum.getNameByCode(item.getState()));
itemVo.setId(item.getId());
itemVo.setName(item.getName());
itemVo.setCid(item.getCid());
......
......@@ -228,6 +228,7 @@ public class ItemServiceImpl implements ItemService {
try {
CoinVo coinVo = new CoinVo();
EntityMapper.copyAttribute(item, coinVo);
coinVo.setStateName(ItemStateEnum.getNameByCode(item.getState()));
String extra = item.getExtra();
if (StringUtils.hasLength(extra)) {
Map<String, Object> map = JsonUtils.toMap(extra);
......
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