|  |  |  | 
|---|
|  |  |  | import com.moral.api.service.VersionService; | 
|---|
|  |  |  | import com.moral.constant.ResponseCodeEnum; | 
|---|
|  |  |  | import com.moral.constant.ResultMessage; | 
|---|
|  |  |  | import com.moral.util.TokenUtils; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("queryById") | 
|---|
|  |  |  | public ResultMessage queryById(VersionQueryByIdForm form){ | 
|---|
|  |  |  | //判断是否缺少参数 | 
|---|
|  |  |  | if (!form.valid()) | 
|---|
|  |  |  | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), | 
|---|
|  |  |  | ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | VersionQueryDTO dto = versionService.queryVersionById(form); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | VersionQueryVO vo = VersionQueryVO.convert(dto); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return new ResultMessage(dto.getCode(), dto.getMsg(), vo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("queryByOrgId") | 
|---|
|  |  |  | public ResultMessage queryByOrganizationId(Integer organizationId){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | VersionQueryDTO dto = versionService.queryByOrganizationId(organizationId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | VersionQueryVO vo = VersionQueryVO.convert(dto); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return new ResultMessage(dto.getCode(), dto.getMsg(), vo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|