package com.hrs.service;

import com.hrs.model.entity.House;
import java.util.List;

/**   
* Copyright: Copyright (c) 2026 chinasofti
* 
* @ClassName: HouseService.java
* @Description: 房源业务逻辑接口
*
* @version: v1.0.0
* @author: 黄红
* @date: 2026年4月13日 上午10:01:06 
*
* Modification History:
* Date         Author          Version            Description
*---------------------------------------------------------*
* 2026年4月13日     黄红           v1.0.0               新建文件
*/
public interface HouseService {

    /**
     * 获取已上架房源（租客端）
     */
    List<House> getPublishedHouses();

    /**
     * 按区域筛选房源
     */
    List<House> searchByArea(String area);

    /**
     * 按价格区间筛选房源
     */
    List<House> searchByPrice(int minPrice, int maxPrice);

    /**
     * 获取房源详情
     */
    House getHouseDetail(Long houseId);

    /**
     * 获取房东的房源列表
     */
    List<House> getLandlordHouses(Long landlordId);

    /**
     * 添加房源
     * @return 添加结果
     */
    AddHouseResult addHouse(House house);

    /**
     * 更新房源
     */
    UpdateHouseResult updateHouse(House house, Long landlordId);

    /**
     * 删除房源
     */
    boolean deleteHouse(Long houseId, Long landlordId);

    /**
     * 审核房源（管理员）
     */
    boolean auditHouse(Long houseId, boolean approved);

    /**
     * 添加房源结果类
     */
    class AddHouseResult {
        private boolean success;
        private String message;

        public boolean isSuccess() { return success; }
        public void setSuccess(boolean success) { this.success = success; }
        public String getMessage() { return message; }
        public void setMessage(String message) { this.message = message; }
    }

    /**
     * 更新房源结果类
     */
    class UpdateHouseResult {
        private boolean success;
        private String message;

        public boolean isSuccess() { return success; }
        public void setSuccess(boolean success) { this.success = success; }
        public String getMessage() { return message; }
        public void setMessage(String message) { this.message = message; }
    }
}
