package com.njcn.product.event.transientes.controller;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.product.event.transientes.pojo.po.PqsDicTreePO;
import com.njcn.product.event.transientes.service.PqsDicTreeService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.HttpResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: cdf
 * @CreateTime: 2025-08-01
 * @Description:
 */
@Api(tags = "字典树")
@RequestMapping("dicTree")
@RestController
@RequiredArgsConstructor
@Slf4j
public class PqsDicTreeController extends BaseController {

    private final PqsDicTreeService pqsDicTreeService;


    @OperateInfo
    @GetMapping("/getDicTree")
    @ApiOperation("获取树结构")
    public HttpResult<List<PqsDicTreePO>> getDicTree(@RequestParam("code") String code){
        String methodDescribe = getMethodDescribe("getDicTree");

        List<PqsDicTreePO> pqsDicTreePOList = pqsDicTreeService.getDicTree(code);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDicTreePOList, methodDescribe);
    }

}
