package com.red.circle.other.app.command.sys.query;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.other.app.convertor.sys.SysConfigAppConvertor;
import com.red.circle.other.app.dto.clientobject.sys.AppStartPageCO;
import com.red.circle.other.infra.database.rds.service.sys.StartPagePlanService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * app 启动页.
 *
 * @author pengliang on 2021/6/30
 */
@Component
@RequiredArgsConstructor
public class AppPageStartQryExe {

  private final SysConfigAppConvertor sysConfigAppConvertor;
  private final StartPagePlanService startPagePlanService;

  public List<AppStartPageCO> execute(AppExtCommand cmd) {
    return sysConfigAppConvertor.toListAppStartPageCO(startPagePlanService
        .listBySysOrigin(cmd.requireReqSysOrigin()));
  }

}
