package com.diagbot.web;


import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.RespDTO;
import com.diagbot.dto.TranFieldInfoDTO;
import com.diagbot.facade.TranFieldInfoFacade;
import com.diagbot.vo.TranFieldInfoVO;
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 javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 字段对应表 前端控制器
 * </p>
 *
 * @author wangyu
 * @since 2018-11-21
 */
@RestController
@RequestMapping(value = "/tranFieldInfo")
@Api(value = "字段对应信息API", tags = { "字段对应信息API" })
@SuppressWarnings("unchecked")
public class TranFieldInfoController {
    @Autowired
    TranFieldInfoFacade tranFieldInfoFacade;

    @ApiOperation(value = "字段对应信息——查询[by:wangyu]",
            notes = "uuid:医院编号，必填<br>")
    @PostMapping("/getInfoByUuid")
    @SysLogger("getInfoByUuid")
    public RespDTO<List<TranFieldInfoDTO>> getInfoByUuid(@Valid @RequestBody TranFieldInfoVO tranFieldInfoVO) {
        List<TranFieldInfoDTO> data = tranFieldInfoFacade.getInfoByUuid(tranFieldInfoVO);
        return RespDTO.onSuc(data);
    }
}
