package com.yc.ship.module.trade.api.insurance;

import com.yc.ship.framework.common.pojo.CommonResult;
import com.yc.ship.module.trade.api.insurance.dto.InsuranceApplyReqDTO;
import com.yc.ship.module.trade.api.insurance.dto.InsuredRespDTO;
import com.yc.ship.module.trade.service.insurance.InsuranceService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * @author le'yang
 */
@RestController
@Validated
public class InsuranceApiImpl implements InsuranceApi {

    @Resource
    private InsuranceService insuranceService;

    @Override
    public CommonResult<InsuredRespDTO> applyInsurance(InsuranceApplyReqDTO reqDTO) {
        //TODO: 待实现
        return null;
//        return insuranceService.applyInsurance(reqDTO);
    }

    @Override
    public CommonResult<Boolean> cancelInsurance(List<Long> ticketIdList) {
        insuranceService.applyCancelInsurance(ticketIdList);
        return CommonResult.success(true);
    }
}
