package com.yd.csf.api.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yd.common.result.Result;
import com.yd.csf.api.service.ApiSalaryService;
import com.yd.csf.feign.client.salary.ApiSalaryFeignClient;
import com.yd.csf.feign.request.salary.ApiSalaryAddRequest;
import com.yd.csf.feign.request.salary.ApiSalaryBatchAddRequest;
import com.yd.csf.feign.request.salary.ApiSalaryEditRequest;
import com.yd.csf.feign.request.salary.ApiSalaryPageRequest;
import com.yd.csf.feign.response.salary.ApiSalaryDetailResponse;
import com.yd.csf.feign.response.salary.ApiSalaryPageResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;

/**
 * 薪资单信息
 *
 * @author zxm
 * @since 2026-05-08
 */
@RestController
@RequestMapping("/salary")
@Validated
public class ApiSalaryController implements ApiSalaryFeignClient {

    @Autowired
    private ApiSalaryService apiSalaryService;

    /**
     * 分页查询-薪资单信息
     * @param request
     * @return
     */
    @Override
    public Result<IPage<ApiSalaryPageResponse>> page(ApiSalaryPageRequest request) {
        return apiSalaryService.page(request);
    }

    /**
     * 详情-薪资单信息
     * @param salaryBizId
     * @return
     */
    @Override
    public Result<ApiSalaryDetailResponse> detail(String salaryBizId) {
        return apiSalaryService.detail(salaryBizId);
    }

    /**
     * 新增-薪资单信息
     * @param request
     * @return
     */
    @Override
    public Result add(ApiSalaryAddRequest request) {
        return apiSalaryService.add(request);
    }

    /**
     * 修改-薪资单信息
     * @param request
     * @return
     */
    @Override
    public Result edit(ApiSalaryEditRequest request) {
        return apiSalaryService.edit(request);
    }

    /**
     * 批量新增-薪资单信息
     * @param request
     * @return
     */
    @Override
    public Result batchAdd(ApiSalaryBatchAddRequest request) {
        return apiSalaryService.batchAdd(request);
    }


}
