package com.moral.api.controller;
|
|
import com.moral.api.entity.Version;
|
import com.moral.api.mapper.VersionMapper;
|
import com.moral.api.pojo.dto.version.VersionQueryDTO;
|
import com.moral.api.pojo.form.version.VersionQueryForm;
|
import com.moral.api.pojo.vo.Version.VersionQueryVO;
|
import com.moral.api.pojo.vo.Version.VersionVO;
|
import com.moral.api.service.VersionService;
|
import com.moral.constant.ResponseCodeEnum;
|
import com.moral.constant.ResultMessage;
|
import io.swagger.annotations.Api;
|
import lombok.extern.slf4j.Slf4j;
|
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.RestController;
|
|
import java.util.Arrays;
|
import java.util.List;
|
|
/**
|
* @ClassName VersionController
|
* @Description TODO
|
* @Author 陈凯裕
|
* @Date 2021/5/14 15:25
|
* @Version TODO
|
**/
|
@Slf4j
|
@Api(tags = {"版本管理模块"})
|
@RestController
|
@RequestMapping("/version")
|
public class VersionController {
|
|
@Autowired
|
VersionService versionService;
|
|
@GetMapping("query")
|
public ResultMessage query(VersionQueryForm form){
|
//判断是否缺少参数
|
if (!form.valid())
|
return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
|
ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
|
//处理查询业务
|
VersionQueryDTO dto = versionService.query(form);
|
|
//转换前端所需参数
|
VersionQueryVO vo = VersionQueryVO.convert(dto);
|
|
return new ResultMessage(dto.getCode(), dto.getMsg(), vo);
|
|
}
|
}
|