package com.tofly.watermeter.custom.controller.meterBusiness;//package com.tofly.watermeter.custom.controller;

import com.tofly.api.CodeClient;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.common.log.annotation.ToFlyAppLog;
import com.tofly.pojo.CustomCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author by Wangjieliu
 * @date 2021/3/18.
 */
@RestController
@AllArgsConstructor
@RequestMapping("/code")
@Api(tags = "统一编码接口")
public class SysCodeController {
    private final CodeClient client;


    @ApiOperation(value = "获取父级和子级所有目录")
    @GetMapping("/getall")
    public ResultRespone getAll() {


        return client.getAll();
    }

    @ApiOperation(value = "获取父级目录")
    @GetMapping("/getFj")
    public ResultRespone getFj() {
        return client.getfj();
    }

    @ApiOperation(value = "根据父级ID获得子级所有")
    @GetMapping("/getByPid")
    public ResultRespone getBylistPcid(String pid) {
        return client.getBylistPcid(pid);
    }
}
