
package com.yifu.cloud.plus.v1.yifu.insurances.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancesChangeLog;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancesChangeLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 商险信息变更日志表管理
 *
 * @author huych
 * @date 2025-12-12 15:35:05
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/tInsurancesChangeLog")
@Tag(name = "商险信息变更日志表管理")
public class TInsurancesChangeLogController {

	private final TInsurancesChangeLogService insurancesChangeLogService;

	/**
	 * 分页查询
	 *
	 * @return {@link R< IPage < TInsurancesChangeLog >>}
	 */
	@Operation(summary = "分页查询", description = "分页查询")
	@PostMapping("/getInsuranceListPage")
	public R<IPage<TInsurancesChangeLog>> getInsuranceListPage(Page<TInsurancesChangeLog> page, @RequestBody TInsurancesChangeLog param) {
		return R.ok(insurancesChangeLogService.getInsuranceListPage(page, param));
	}

	/**
	 * 通过id查询入职确认信息变更日志表
	 *
	 * @param id id
	 * @return R
	 */
	@Operation(summary = "通过id查询", description = "通过id查询")
	@GetMapping("/{id}")
	public R<List<TInsurancesChangeLog>> getById(@PathVariable("id") String id) {
		return R.ok(insurancesChangeLogService.getTInsurancesChangeLoglList(id));
	}

}
