package cn.iocoder.yudao.module.base.controller.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.jx.domain.DriveSchoolContract;
import cn.iocoder.yudao.module.jx.service.IDriveContractTestService;
import cn.iocoder.yudao.module.jx.service.IDriveSchoolContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/small/driveSchool/obtainContract")
public class ObtainDriveContractController {

    @Autowired
    private IDriveContractTestService driveContractTestService;

    @Autowired
    private IDriveSchoolContractService driveSchoolContractService;


    /**
     * 获取合同模板详细信息
     */
    @GetMapping(value = "/tenantId/{tenantId}")
    @TenantIgnore
    public CommonResult getInfoByTenantId(@PathVariable("tenantId") String  tenantId)
    {
        return CommonResult.success(driveContractTestService.selectDriveContractTestByTenantId(tenantId));
    }

    /**
     * 新增驾校合同
     */
    @PostMapping("/add")
    @TenantIgnore
    public CommonResult add(@RequestBody DriveSchoolContract driveSchoolContract)
    {
        return CommonResult.success(driveSchoolContractService.insertDriveSchoolContractNew(driveSchoolContract));
    }
}
