package com.diagbot.web;


import com.diagbot.dto.ModuleInfoDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.ModuleFacade;
import com.diagbot.vo.ModuleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 模型表 前端控制器
 * </p>
 *
 * @author zhoutg
 * @since 2018-11-15
 */
@RestController
@RequestMapping("/moduleInfo")
@Api(value = "模型相关API", tags = { "模型相关API" })
@SuppressWarnings("unchecked")
public class ModuleInfoController {

    @Autowired
    ModuleFacade moduleFacade;

    @ApiOperation(value = "返回所有的模型数据[by:zhoutg]",
            notes = "")
    @PostMapping("/getAll")
    public RespDTO<List<ModuleInfoDTO>> getAll(@RequestBody ModuleVO moduleVO) {
        List<ModuleInfoDTO> data = moduleFacade.getAll(moduleVO);
        return RespDTO.onSuc(data);
    }
}
