package com.fs.company.controller.company;

import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.R;
import com.fs.common.utils.ServletUtils;
import com.fs.company.domain.Company;
import com.fs.framework.security.LoginUser;
import com.fs.framework.service.TokenService;
import com.fs.his.domain.FsRedPacket;
import com.fs.his.service.IFsRedPacketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 红包信息
 * @author: Xgb
 * @createDate: 2025/11/4
 * @version: 1.0
 */
@RestController
@RequestMapping("/his/redPacket")
public class FsRedPacketController extends BaseController {

    @Autowired
    private IFsRedPacketService fsRedPacketService;

    @Autowired
    private TokenService tokenService;

    @GetMapping("/info")
    public R info() {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());

        Company company = loginUser.getCompany();
        FsRedPacket redPacket=fsRedPacketService.getInfo(company.getCompanyId());
        return  R.ok().put("data",redPacket);
    }



}
