package fcb.project.manager.core.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import fcb.project.manager.base.entity.TmUsedEstate;
import fcb.project.manager.base.entity.TmUsedHouse;
import fcb.project.manager.base.param.usedEstate.QueryUsedEstate;
import fcb.project.manager.base.param.usedEstate.QueryUsedHouse;
import fcb.project.manager.base.service.ITmUsedEstateService;
import fcb.project.manager.base.utils.DataUtils;
import fdage.back.sdk.base.entity.Result;
import fdage.back.sdk.base.entity.ViewResult;
import io.swagger.annotations.*;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 2 * @Author: Abner
 * 3 * @Date: 2021/1/7 17:38
 * 4
 */
@Api(tags = "二手房房源相关接口")
@RestController
@RequestMapping("fcb/project/usedhouse")
@Log4j2
@Validated
public class UsedHouseManagerController extends BaseController{

    @Autowired
    private ITmUsedEstateService tmUsedEstateService;

    public static String IMAGE_PATH = ".+(.JPEG|.jpeg|.JPG|.jpg|.GIF|.gif|.BMP|.bmp|.PNG|.png)";

    @PostMapping("/queryOrSearchList")
    @ApiOperation(value = "根据条件拉取所有房源 , 支持分页")
    @ApiResponse(code = 0,message = "成功",response = TmUsedHouse.class)
    public ViewResult<TmUsedEstate> getHouseList(@RequestBody QueryUsedHouse queryUsedHouse) {
        return null;
    }

    @PostMapping("/usedHouseDetailWithoutAuth")
    @ApiOperation(value = "根据二手房房源ID获取房源详情-无需授权，给H5使用")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "roomId", value = "房源ID", paramType = "query", required = true, dataType = "String"),
    })
    @ApiResponses({
            @ApiResponse(code = 0,message = "成功",response = TmUsedHouse.class)
    })
    public Result<Object> usedHouseDetailWithoutAuth(@RequestBody QueryUsedHouse queryUsedHouse){

        return Result.success();

    }

    @PostMapping("/updatevrlink")
    @ApiOperation(value = "编辑vrlink")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "roomId", value = "房源ID", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "vrLink", value = "vr link", paramType = "query", required = true, dataType = "String"),
    })
    @ApiResponses({
            @ApiResponse(code = 0,message = "成功",response = TmUsedHouse.class)
    })
    public Result<Object> updatevrlink(@RequestBody QueryUsedHouse queryUsedHouse) {

        return Result.success();
    }


    @PostMapping("/submitAudit")
    @ApiOperation(value = "提交审核记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "roomId", value = "房源ID", paramType = "query", required = true, dataType = "String"),
    })
    @Transactional(rollbackFor = Exception.class)
    @ApiResponses({
            @ApiResponse(code = 0,message = "成功",reference = "auditId")
    })
    public Result<Object> addNewAudit(@RequestBody QueryUsedHouse queryUsedHouse){

        return Result.success();

    }

    @PostMapping("/dismissAudit")
    @ApiOperation(value = "撤销审核记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "roomId", value = "房源ID", paramType = "query", required = true, dataType = "String"),
    })
    @Transactional(rollbackFor = Exception.class)
    public Result<Object> dismissAudit(@RequestBody QueryUsedHouse queryUsedHouse){

        return Result.success();
    }

    @PostMapping("/getShareLinks")
    @ApiOperation(value = "根据房源ID获取房源所有分享链接")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "roomId", value = "房源ID", paramType = "query", required = true, dataType = "String"),
    })
    public Result<Object> getShareLinks(@RequestBody QueryUsedHouse queryUsedHouse){
        return Result.success();
    }

}
