mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 01:25:28 +08:00
feat :组件分类
This commit is contained in:
parent
83438b76dd
commit
6315c60afe
@ -1,9 +1,11 @@
|
||||
package com.luban.api.convert;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.luban.api.dto.H5ComponentDTO;
|
||||
import com.luban.api.entity.H5Component;
|
||||
import com.luban.api.vo.H5ComponentVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
/**
|
||||
* H5 组件转换类
|
||||
@ -30,5 +32,20 @@ public interface H5ComponentConvert {
|
||||
* @param dto 数据传输对象
|
||||
* @return 实体
|
||||
*/
|
||||
@Mapping(target = "content", source = "content", qualifiedByName = "mapToJson")
|
||||
H5Component toEntity(H5ComponentDTO dto);
|
||||
|
||||
/**
|
||||
* 将 Map 转换为 JSON 字符串
|
||||
*
|
||||
* @param map Map 对象
|
||||
* @return JSON 字符串
|
||||
*/
|
||||
@org.mapstruct.Named("mapToJson")
|
||||
static String mapToJson(java.util.Map<String, Object> map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return JSONUtil.toJsonStr(map);
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ public class H5Component {
|
||||
/**
|
||||
* 组件完整配置数据 (JSON 格式)
|
||||
*/
|
||||
private Map<String, Object> content;
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 使用次数统计
|
||||
|
||||
Loading…
Reference in New Issue
Block a user