package com.mvc.controller.taizhang;

import com.mvc.model.CorrectMap;
import com.mvc.model.ErrorMap;
import com.mvc.model.FileUploadTypeModel;
import com.mvc.service.taizhang.FileUploadTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Api(tags = "文件上传类型接口")
@RequestMapping("/FileUploadTypeAction")
@Controller
public class FileUploadTypeAction {


        @Autowired
        private FileUploadTypeService FileUploadTypeService;

        @ApiOperation("查询所有文件上传类型")
        @RequestMapping(value = "/list",method = RequestMethod.GET)
        @ResponseBody
        public Map<String,Object> findAllFileUploadType(){

        try {
            List<FileUploadTypeModel> resList = FileUploadTypeService.findAllFileUploadType();
            Map<String,Object> resMap=new CorrectMap();
            resMap.put("res",resList);
            return resMap;
        } catch (Exception e) {
            e.printStackTrace();
            Map<String,Object> resMap=new ErrorMap();
            resMap.put("error",e.getMessage());
            return resMap;
         }
        }






}
