package com.retdata.yaoyibi.web;

import com.retdata.yaoyibi.domain.CsoSysRole;
import com.retdata.yaoyibi.service.CsoSysRoleService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cso-sys-roles")
public class CsoSysRoleController {

    private final CsoSysRoleService csoSysRoleService;

    public CsoSysRoleController(CsoSysRoleService csoSysRoleService) {
        this.csoSysRoleService = csoSysRoleService;
    }

    @GetMapping
    @DataSource(DataSourceType.CSO)
    public List<CsoSysRole> list() {
        return csoSysRoleService.list();
    }
}
