package com.skr.mdm.api.app.service.impl;

import com.github.pagehelper.PageHelper;
import com.skr.mdm.api.app.service.MdmAppStoreInstallService;
import com.skr.mdm.dao.MdmAppStoreInstallDao;
import com.skr.mdm.dto.LoginAdminDTO;
import com.skr.mdm.result.ResponseResult;
import com.skr.mdm.bean.qo.app.MdmAppStoreInstallQO;
import com.skr.mdm.util.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author nfq
 * @date 2022-11-28 14:34
 */
@Service
public class MdmAppStoreInstallServiceImpl implements MdmAppStoreInstallService {

    @Autowired
    private MdmAppStoreInstallDao appStoreInstallDao;

    @Override
    public ResponseResult listAppStoreInstall(MdmAppStoreInstallQO mdmAppStoreInstallQO, LoginAdminDTO loginAdminDTO) {
        PageHelper.startPage(mdmAppStoreInstallQO.getPageNum(), mdmAppStoreInstallQO.getPageSize());
        mdmAppStoreInstallQO.setCompanyId(loginAdminDTO.getCompanyId());
        return ResponseResult.success(PageUtil.getPageResult(appStoreInstallDao.listMdmAppStoreInstallVO(mdmAppStoreInstallQO)));
    }
}
