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.PageBean;
import org.jeecg.modules.api.service.YaoDuApiService;
import org.jeecg.modules.citiyClass.entity.CitiyClass;
import org.jeecg.modules.citiyClass.service.ICitiyClassService;
import org.jeecg.modules.citiyShopAuthentication.entity.CitiyShopAuthentication;
import org.jeecg.modules.citiyShopAuthentication.service.ICitiyShopAuthenticationService;
import org.jeecg.modules.citiyUserAuthentication.entity.CitiyUserAuthentication;
import org.jeecg.modules.citiyUserAuthentication.service.ICitiyUserAuthenticationService;
import org.jeecg.modules.cityActivity.entity.CityActivity;
import org.jeecg.modules.cityActivity.service.ICityActivityService;
import org.jeecg.modules.cityAddr.entity.CityAddr;
import org.jeecg.modules.cityAddr.service.ICityAddrService;
import org.jeecg.modules.cityAddressLog.service.ICityAddressLogService;
import org.jeecg.modules.cityBanner.entity.CityBanner;
import org.jeecg.modules.cityBanner.service.ICityBannerService;
import org.jeecg.modules.cityComment.service.ICityCommentService;
import org.jeecg.modules.cityHome.entity.CityHome;
import org.jeecg.modules.cityHome.service.ICityHomeService;
import org.jeecg.modules.cityIcon.entity.CityIcon;
import org.jeecg.modules.cityIcon.service.ICityIconService;
import org.jeecg.modules.cityJob.entity.CityJob;
import org.jeecg.modules.cityJob.service.ICityJobService;
import org.jeecg.modules.cityPhoneLog.service.ICityPhoneLogService;
import org.jeecg.modules.cityShop.entity.CityShop;
import org.jeecg.modules.cityShop.service.ICityShopService;
import org.jeecg.modules.cityTrends.entity.CityTrends;
import org.jeecg.modules.cityTrends.service.ICityTrendsService;
import org.jeecg.modules.webCase.entity.WebCase;
import org.springframework.stereotype.Service;

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

@Service
public class YaoDuApiServiceImpl implements YaoDuApiService {



    //获取开通区域相关地址
    @Resource
    private ICityAddrService cityService;
    //获取banner相关接口信息
    @Resource
    private ICityBannerService cityBannerService;
    //获取金刚区图标配置
    @Resource
    private ICityIconService cityIconService;
    //获取分类信息
    @Resource
    private ICitiyClassService cityClassService;
    //获取动态帖子列表
    @Resource
    private ICityTrendsService cityTrendsService;
    //获取租房信息列表
    @Resource
    private ICityHomeService cityHomeService;
    //获取兼职信息列表
    @Resource
    private ICityJobService cityJobService;
    //获取门店信息列表
    @Resource
    private ICityShopService cityShopService;
    //获取活动信息列表
    @Resource
    private ICityActivityService cityActivityService;
    //评论信息表
    @Resource
    private ICityCommentService cityCommentService;
    //电话点击日志
    @Resource
    private ICityPhoneLogService cityPhoneLogService;
    //地址点击日志
    @Resource
    private ICityAddressLogService cityAddressLogService;
    //个人认证
    @Resource
    private ICitiyUserAuthenticationService cityUserAuthenticationService;
    //店铺认证
    @Resource
    private ICitiyShopAuthenticationService cityShopAuthenticationService;


    //获取城市列表服务区域
    @Override
    public Result<?> getCityList(){
        List<CityAddr> list = cityService.lambdaQuery()
                .select(CityAddr::getName)
                .orderByDesc(CityAddr::getSort)
                .list();
        return Result.OK(list);
    }


    //获取banner列表
    @Override
    public Result<?> getBannerList(){
        List<CityBanner> list = cityBannerService.lambdaQuery()
                .select(CityBanner::getImage)
                .list();
        return Result.OK(list);
    }


    //获取首页头部信息
    @Override
    public Result<?> getIndexHeaderInfo(){
        Map<String,Object> map=new HashMap<>();
        map.put("headImage","https://dianpin-img.xzaiyp.top/upload/bg_1728634973432.png");
        map.put("name","铝材交易");
        map.put("userNum","16888");
        map.put("num","1888");
        return Result.OK(map);
    }


    //获取分类类型列表
    @Override
    public Result<?> getClassifyList(){
        List<CityIcon> list = cityIconService
                .lambdaQuery()
                .list();
        return Result.OK(list);
    }


    //获取分类
    @Override
    public Result<?> getClassInfo(){
        List<CitiyClass> list = cityClassService
                .lambdaQuery()
                .list();
        return Result.OK(list);
    }


    //根据分类获取动态帖子列表带分页
    @Override
    public Result<?> getPostPage(PageBean pageBean){
        Page<CityTrends> page = new Page<CityTrends>(pageBean.getPageNo(), pageBean.getPageSize());
        Page<CityTrends> page1 = cityTrendsService
                .page(page);
        return Result.OK(page1);
    }

    //根据帖子标识获取帖子详情
    @Override
    public Result<?> getPostDetail(String id){
        CityTrends cityTrends = cityTrendsService.getById(id);
        return Result.OK(cityTrends);
    }


    //根据分类获取租房信息列表带分页带搜
    @Override
    public Result<?> getRentPage(PageBean pageBean){
        Page<CityHome> page = new Page<CityHome>(pageBean.getPageNo(), pageBean.getPageSize());
        Page<CityHome> page1 = cityHomeService
                .page(page);
        return Result.OK(page1);
    }


    //根据租房标识获取租房详情
    @Override
    public Result<?> getRentDetail(String id){
        CityHome cityHome = cityHomeService.getById(id);
        return Result.OK(cityHome);
    }



    //根据分类获取工作信息列表带分页带搜索
    @Override
    public Result<?> getJobPage(PageBean pageBean){
        Page<CityJob> page = new Page<CityJob>(pageBean.getPageNo(), pageBean.getPageSize());
        Page<CityJob> page1 = cityJobService
                .page(page);
        return Result.OK(page1);
    }


    //根据分类获取工作信息列表带分页带搜索
    @Override
    public Result<?> getJobDetail(String id){
        CityJob cityJob = cityJobService.getById(id);
        return Result.OK(cityJob);
    }


    //根据分类获取门店信息列表带分页带搜索
    @Override
    public Result<?> getStorePage(PageBean pageBean){
        Page<CityShop> page = new Page<CityShop>(pageBean.getPageNo(), pageBean.getPageSize());
        Page<CityShop> page1 = cityShopService
                .page(page);
        return Result.OK(page1);
    }


    //根据门店标识获取门店详情
    @Override
    public Result<?> getStoreDetail(String id){
        CityShop cityShop = cityShopService.getById(id);
        return Result.OK(cityShop);
    }

    //获取活动列表信息
    @Override
    public Result<?> getActivityPage(PageBean pageBean){
        Page<CityActivity> page = new Page<CityActivity>(pageBean.getPageNo(), pageBean.getPageSize());
        Page<CityActivity> page1 = cityActivityService
                .page(page);
        return Result.OK(page1);
    }


    //根据活动标识获取活动详情
    @Override
    public Result<?> getActivityDetail(String id){
        CityActivity cityActivity = cityActivityService.getById(id);
        return Result.OK(cityActivity);
    }



    //获取评论信息列表
    @Override
    public Result<?> getCommentPage(PageBean pageBean){
        return Result.OK();
    }


    //点击查看联系方式 类型 0帖子 1租房 2工作 3门店
    @Override
    public Result<?> checkGivePhone(String token,String type, String id){
        return Result.OK();
    }


    //点击查看地图  类型 0帖子 1租房 2工作 3门店
    @Override
    public Result<?> checkMap(String token,String type, String id){
        return Result.OK();
    }



    //申请职位
    @Override
    public Result<?> applyJob(String token,String jobId,String name,String phone){
        return Result.OK();
    }

    //发布帖子
    @Override
    public Result<?> publishPost(String token, CityTrends cityTrends){
        return Result.OK();
    }


    //评论
    @Override
    public Result<?> comment(String token,String postId,String content){
        return Result.OK();
    }


    //个人认证
    @Override
    public Result<?> personalAuthentication(String token, CitiyUserAuthentication object){
        return Result.OK();
    }

    //企业认证
    @Override
    public Result<?> companyAuthentication(String token, CitiyShopAuthentication object){
        return Result.OK();
    }




}
