package com.brilliance.isc.common.api.glentry;

import com.brilliance.isc.common.api.gle.service.GlentryApiService;
import com.brilliance.isc.common.api.gle.vo.GlentryRequest;
import com.brilliance.isc.common.api.gle.vo.GlentryResponse;
import com.brilliance.isc.common.glemod.service.GlemodService;
import com.brilliance.isc.common.glemod.vo.GlemodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GlentryApiServiceImpl implements GlentryApiService {

    @Autowired
    private GlemodService glemodService;

    @Override
    public GlentryResponse generateGlentry(GlentryRequest glentryRequest) {
        glentryRequest.reset();
        GlemodVo glemodVo = glentryRequest.getGlemodVo();
        glemodService.fillGLEStream(glemodVo);
        return GlentryResponse.builder()
                .gles(glemodVo.getGles())
                .build();
    }
}
