package com.engine.salary.web;

import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.salaryBill.dto.MySalaryShowSetDTO;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.wrapper.MySalaryShowSetWrapper;
import lombok.extern.slf4j.Slf4j;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

/**
 * @Description: 我的薪资福利显示设置
 * @Author: wangxiangzhong
 * @Date: 2021-12-08 14:44
 */
@Slf4j
public class MySalaryShowSetController {

    private MySalaryShowSetWrapper getMySalaryShowSetWrapper(User user) {
        return ServiceUtil.getService(MySalaryShowSetWrapper.class, user);
    }

    /**
     * 我的薪资福利页签显隐控制
     *
     * @return
     */
    @GET
    @Path("/get")
    @Produces(MediaType.APPLICATION_JSON)
    public String mySalaryShowSet(@Context HttpServletRequest request, @Context HttpServletResponse response) {
        User user = HrmUserVarify.getUser(request, response);
        return new ResponseResult<Void, MySalaryShowSetDTO>(user).run(getMySalaryShowSetWrapper(user)::mySalaryShowSet);
    }

    /******** 工资单 end ***********************************************************************************************/
}
