Commit 3f7824b1 by 崔彦峰

feat(tag): 修改维度标签枚举查询接口返回格式

- 添加了QueryTagDimensionEnumRespDTO响应DTO类
- 添加了SimpleTagEnumRespDTO简单标签枚举响应DTO类
- 修改queryDimensionTagEnum方法返回类型为QueryTagDimensionEnumRespDTO
- 使用FastJSON将原响应结果转换为新的枚举列表格式
- 重构了响应数据结构以支持简单的标签枚举值列表
1 parent 79d5767c
......@@ -12,6 +12,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.alibaba.fastjson.JSON;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
......@@ -20,6 +21,8 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 标签枚举值Controller
* @author yangwei_by_claude
......@@ -120,7 +123,7 @@ public class TagEnumController {
@ApiOperation("根据维度代码查询枚举列表")
@ServiceMethod(method = "dj.api.strategy.dimension.tag.enum")
// @PostMapping("/dj.api.strategy.dimension.tag.enum/1.0.0")
public RopResponse<TagDimensionEnumRespDTO> queryDimensionTagEnum(TagDimensionEnumQueryRequest request) {
public RopResponse<QueryTagDimensionEnumRespDTO> queryDimensionTagEnum(TagDimensionEnumQueryRequest request) {
try {
TagDimensionEnumQueryReqDTO queryReqDTO = new TagDimensionEnumQueryReqDTO();
......@@ -130,7 +133,12 @@ public class TagEnumController {
log.error("根据维度代码查询枚举列表失败: {}", response.getMessage());
return RopResponse.error(response.getError(), response.getMessage());
}
return RopResponse.success(response.getResult());
TagDimensionEnumRespDTO result = response.getResult();
List<SimpleTagEnumRespDTO> simpleTagEnumRespDTOS = JSON.parseArray(JSON.toJSONString(result.getEnums()), SimpleTagEnumRespDTO.class);
QueryTagDimensionEnumRespDTO respDTO = new QueryTagDimensionEnumRespDTO();
respDTO.setEnums(simpleTagEnumRespDTOS);
return RopResponse.success(respDTO);
} catch (RpcServiceException e) {
log.error("=====dj.api.strategy.dimension.tag.enum rpcServiceException", e);
return RopResponse.error(e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!