package com.leromro.core.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.leromro.common.core.domain.R;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.leromro.common.annotation.Log;
import com.leromro.common.core.controller.BaseController;
import com.leromro.common.core.domain.AjaxResult;
import com.leromro.common.enums.BusinessType;
import com.leromro.core.domain.VolunteerAccount;
import com.leromro.core.service.IVolunteerAccountService;
import com.leromro.common.utils.poi.ExcelUtil;
import com.leromro.common.core.page.TableDataInfo;

/**
 * 志愿者账户Controller
 * 
 * @author ruoyi
 * @date 2025-04-11
 */
@RestController
@Api(tags = "志愿者账户")
@RequestMapping("/core/volunteer/account")
public class VolunteerAccountController extends BaseController
{
    @Autowired
    private IVolunteerAccountService volunteerAccountService;

    /**
     * 查询志愿者账户列表
     */
    @ApiOperation("查询志愿者账户列表")
    @GetMapping("/list")
    public TableDataInfo<VolunteerAccount> list(VolunteerAccount volunteerAccount)
    {
        startPage();
        List<VolunteerAccount> list = volunteerAccountService.selectVolunteerAccountList(volunteerAccount);
        return getDataTable(list);
    }


    /**
     * 获取志愿者账户详细信息
     */
    @ApiOperation("获取志愿者账户详细信息")
    @GetMapping(value = "/{volunteerAccountId}")
    public R<VolunteerAccount> getInfo(@PathVariable("volunteerAccountId") Long volunteerAccountId)
    {
        return R.ok(volunteerAccountService.selectVolunteerAccountByVolunteerAccountId(volunteerAccountId));
    }



}
