package com.mortals.xhx.module.site.service;

import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.SiteTreeSelect;

import java.util.List;

/**
 * SiteService
 * <p>
 * 站点 service接口
 *
 * @author zxfei
 * @date 2022-01-12
 */
public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {

    /**
     * 区域站点树
     *
     * @param context
     * @return
     */
    List<SiteTreeSelect> siteTree(Context context);

    /**
     * 根据站点列表获取区域站点树
     *
     * @param context
     * @return
     */
    List<SiteTreeSelect> getSiteTree(Context context);

    /**
     * 根据区域code获取子站点
     *
     * @param context
     * @return
     */
    List<SiteEntity> getFlatSitesByAreaCode(String areaCode,Context context);


    /**
     * 根据Site获取子站点
     *
     * @param context
     * @return
     */
    List<SiteEntity> getFlatSitesBySiteId(Long siteId,Context context);


    void setSiteTree(List<SiteTreeSelect> list, Context context);

    void removeSiteTree(List<SiteTreeSelect> list, Context context);

    List<SiteEntity> getListAllInfoByQuery(SiteQuery query,Context context) throws AppException;


    void changeUrlPath(SiteEntity siteEntity);
}