package com.loan.system.controller.wechat;

import com.loan.system.domain.dto.CollateralDTO;
import com.loan.system.domain.pojo.Result;
import com.loan.system.domain.vo.CollateralVO;
import com.loan.system.service.CollateralService;
import com.loan.system.utils.ResultUtil;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/wechat/collateral")
@Api(tags = "抵押物接口")
public class CollateralController {

    @Autowired
    private CollateralService collateralService;
    //显示业务相关抵押物状态
    @RequestMapping("/{id}")
    public Result findCollateral(@PathVariable("id") Long id){
        List<CollateralVO> collaterals = collateralService.findByCaseId(id);
        return ResultUtil.success("success",collaterals);
    }
    /**确认抵押物入库
     *
     */
    @RequestMapping("/warehouse/{id}")
    public Result warehouseCollateral(@PathVariable("id") Long id){


        return null;
    }
    /**确认抵押物出库
     *
     */
    @RequestMapping("/outbound/{id}")
    public Result outboundCollateral(@PathVariable("id") Long id){


        return null;
    }
    /**删除抵押物
     *
     */
    @RequestMapping("/delete/{id}")
    public Result deleteCollateral(@PathVariable("id") Long id){
        collateralService.logic_delete(id);
        return ResultUtil.success("success","抵押物删除成功");
    }
//    @RequestMapping("/add")
//    public Result addCollateral(CollateralDTO collateralDTO){
//
//        return null;
//    }

}
