package org.jeecg.modules.api.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.api.bean.CaseBean;
import org.jeecg.modules.api.service.WebApiService;
import org.jeecg.modules.webBanner.entity.WebBanner;
import org.jeecg.modules.webBanner.service.IWebBannerService;
import org.jeecg.modules.webCase.entity.WebCase;
import org.jeecg.modules.webCase.service.IWebCaseService;
import org.jeecg.modules.webObject.service.IWebObjectService;
import org.jeecg.modules.webTeam.service.IWebTeamService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class WebApiServiceImpl implements WebApiService {

    @Resource
    private IWebBannerService webBannerService;
    //服务项目类型
    @Resource
    private IWebObjectService webObjectService;
    //项目案例
    @Resource
    private IWebCaseService webCaseService;

    @Resource
    private IWebTeamService webTeamService;



    //获取首页基础信息
    @Override
    public Result<?> getIndexInfo(){
        Map<String,Object> map=new HashMap<>();
        map.put("title","高端网站定制");

        List list=new ArrayList();
        list.add("企业官网");
        list.add("电商官网");
        list.add("H5官网");
        list.add("小程序");
        map.put("list",list);
        map.put("details","网站定制介绍");
        //获取banner
        List<WebBanner> bannerList = webBannerService.list();
        map.put("bannerList",bannerList);

        return Result.OK(map);
    }


    //获取首页服务类型
    @Override
    public Result<?> getIndexMiddleInfo(){
        Map<String,Object> map=new HashMap<>();
        map.put("title","定制软件开发");
        map.put("details","定制软件开发介绍");
        map.put("list",webObjectService.list());
        return Result.OK(map);
    }


    //获取首页项目案例
    @Override
    public Result<?> getIndexProjectInfo(){
        Map<String,Object> map=new HashMap<>();
        map.put("title","软件开发产品");
        map.put("details","标准软件开发案例展示");
        map.put("list",webCaseService.list());
        return Result.OK(map);
    }


    //获取首页底部电话有限地址
    @Override
    public Result<?> getIndexPhoneInfo(){
        Map<String,Object> map=new HashMap<>();
        map.put("phone","17674618290");
        map.put("emil","2602107437@qq.com");
        map.put("address","湖南省长沙市天心区天心路19号");
        map.put("wxImage","https://dianpin-img.xzaiyp.top/upload/bg_1728634973432.png");
        map.put("qqImage","https://dianpin-img.xzaiyp.top/upload/bg_1728634973432.png");
        return Result.OK(map);
    }



    //关于我们
    @Override
    public Result<?> getAboutUsInfo(){
        Map<String,Object> map=new HashMap<>();
        map.put("title","定制软件开发");
        map.put("details","定制软件开发介绍");
        map.put("image",webBannerService.list());
        map.put("list",webObjectService.list());
        map.put("teamList",webTeamService.list());
        return Result.OK(map);
    }



    //案例展示
    @Override
    public Result<?> getCaseShowInfo(CaseBean caseBean){
        Page<WebCase> page = new Page<WebCase>(caseBean.getPageNo(), caseBean.getPageSize());
        Page<WebCase> page1 = webCaseService.lambdaQuery()
                .page(page);
        return Result.OK(page1);
    }


    //我的团队
    @Override
    public Result<?> getMyTeamInfo(){
        return Result.OK(webTeamService.list());
    }



    //留下您的姓名电话
    @Override
    public Result<?> leaveYourNamePhone(String name,String phone){
        return Result.OK("我们已收到您的联系方式");
    }









}
