package thyyxxk.webserver.controller.dictionary;

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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.dictionary.CodeName;
import thyyxxk.webserver.service.dictionary.SelectionOptionsService;

import java.util.List;

/**
 * @ClassName SelectionOptionsController
 * @Author hsh
 * @Date 2024/8/21 9:14
 * @Version 1.0
 * @Description 字典下拉选
 **/
@RestController
@RequestMapping("/selectionOptions")
public class SelectionOptionsController {

    private final SelectionOptionsService service;

    @Autowired
    public SelectionOptionsController(SelectionOptionsService service) {
        this.service = service;
    }

    @GetMapping("/selectDictByCode")
    public ResultVo<List<CodeName>> selectDictByCode(@RequestParam("code") String code){
        return service.selectDictByCode(code);
    }


}
