package cn.ey.biz.module.system.api.serviceline;

import cn.ey.biz.common.pojo.R;
import cn.ey.biz.module.system.service.serviceline.ServiceSubLineService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.web.bind.annotation.RestController;

import static cn.ey.biz.module.system.enums.ApiConstants.VERSION;

/**
 * @author zhangjunlong
 * @since 2023/10/31 17:16
 */
@RestController // 提供 RESTful API 接口，给 Feign 调用
@DubboService(version = VERSION) // 提供 Dubbo RPC 接口，给 Dubbo Consumer 调用
@RequiredArgsConstructor
public class ServiceLineApiImpl implements ServiceLineApi {
    private final ServiceSubLineService serviceSubLineService;

    /**
     * 根据编码获取业务子线的名称
     *
     * @param code 编码
     * @return
     */
    @Override
    public R<String> getSubServiceLineName(String code) {
        return R.success(serviceSubLineService.getSubServiceLineNameStr(code));
    }
}
