package org.security.common.business;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.security.trans.projectBudgetManagement.service.IBudgetItemService;
import org.security.trans.projectBudgetManagement.vo.DictDataVO;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author Create by wzf
 * @date 2022/3/15 15:55
 * 公共业务接口
 */
@RestController
@AllArgsConstructor
@RequestMapping("/business")
public class BusinessController {

	private final IBudgetItemService budgetItemService;

	/**
	 * 根据字典主键获取字典信息
	 */

	@GetMapping("/dict")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "获取相关字典信息", notes = "传入字典编码keyName")
	public R<List<DictDataVO>> getDictData (@RequestParam String keyName){
		return R.data(budgetItemService.getDictData(keyName));
	}
}
