package com.hzs.system.base.controller.manage;


import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.system.config.BdAwardsRegionConfig;
import com.hzs.system.base.service.IBdAwardsRegionConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 奖衔区域配置 前端控制器
 * </p>
 *
 * @author bd
 * @since 2025-07-23
 */
@RestController
@RequestMapping("/manage/bd-awards-region-config")
public class BdAwardsRegionConfigController extends BaseController {

    @Autowired
    private IBdAwardsRegionConfigService bdAwardsRegionConfigService;

    @GetMapping("/list")
    public TableDataInfo list(BdAwardsRegionConfig param) {
        startPage();
        List<BdAwardsRegionConfig> list = bdAwardsRegionConfigService.getList();
        TableDataInfo rspData = getDataTable(list);
        rspData.setRows(list);
        return rspData;
    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody List<BdAwardsRegionConfig> param) {
        bdAwardsRegionConfigService.saveOrUpdateBatch(param);
        return AjaxResult.success();
    }
}
