package com.muyu.server.controller;

import com.muyu.common.core.domain.Result;
import com.muyu.common.domain.DataType;
import com.muyu.server.service.DataTypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 数据类型管理
 * @author liuxinyue
 * @Package：com.sheep.controller
 * @Project：cloud-server-c
 * @name：DataTypeController
 * @Date：2024/9/20 9:15
 */
@RestController
@RequestMapping("/dataType")
@AllArgsConstructor
@Tag(name = "数据类型管理",description = "数据类型管理")
@Log4j2
public class DataTypeController {


    @Autowired
    private DataTypeService dataTypeService;


    /**
     * 数据类型列表
     * @return
     */
    @PostMapping("/dataTypeList")
    @Operation(summary = "数据类型列表",description = "数据类型列表")
    public Result<List<DataType>> dataTypeList() {
        return Result.success(dataTypeService.list());
    }

}
