package com.hotwj.platform.resourceManagement.companyChangeHistory.controller;

import com.hotwj.platform.resourceManagement.companyChangeHistory.domain.bo.HotCompanyChangeHistoryBo;
import com.hotwj.platform.resourceManagement.companyChangeHistory.domain.vo.HotCompanyChangeHistoryVo;
import com.hotwj.platform.resourceManagement.companyChangeHistory.service.IHotCompanyChangeHistoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 企业人员信息变更历史
 *
 * @author shihongwei
 * @date 2025-12-10
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/resourceManagement/companyChangeHistory")
@Tag(name = "企业人员信息变更历史", description = "人员信息变更历史查询")
public class HotCompanyChangeHistoryController extends BaseController {

    private final IHotCompanyChangeHistoryService changeHistoryService;

    /**
     * 查询安全管理人员列表
     */
    //@SaCheckPermission("resourceManagement:changeHistory:list")
    @GetMapping("/list")
    @Operation(summary = "分页查询安全管理人员变更历史列表")
    public TableDataInfo<HotCompanyChangeHistoryVo> list(HotCompanyChangeHistoryBo bo, PageQuery pageQuery) {
        return changeHistoryService.queryPageList(bo, pageQuery);
    }

    /**
     * 获取安全管理人员详细信息
     *
     * @param id 主键
     */
    //@SaCheckPermission("resourceManagement:changeHistory:query")
    @GetMapping("/{id}")
    @Operation(summary = "查询安全管理人员变更历史详情")
    public R<HotCompanyChangeHistoryVo> getInfo(@NotNull(message = "主键不能为空")
                                                @PathVariable Long id) {
        return R.ok(changeHistoryService.queryById(id));
    }
}
