¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.PvolumeInfo; |
| | | import com.vci.dto.*; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.OsActionServiceI; |
| | | import com.vci.web.service.OsPvolumesServiceI; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä»¶æç®¡ççæ§å¶å¨ |
| | | * @author yuxc |
| | | * @date 2024-10-14 |
| | | */ |
| | | @RequestMapping("/pvolumesController") |
| | | @RestController |
| | | public class OsPvolumesController { |
| | | |
| | | /** |
| | | * Actionæå¡ |
| | | */ |
| | | @Autowired |
| | | private OsPvolumesServiceI osPvolumesServiceI; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å· |
| | | * @param pageSize é¡µæ° |
| | | * @param pageIndex 第å 页 |
| | | * @return åé¡µæ°æ® |
| | | */ |
| | | @GetMapping("/getPvolumesPage") |
| | | public BaseResult getPvolumesPage(short pageSize, short pageIndex){ |
| | | try { |
| | | return osPvolumesServiceI.getPvolumesPage(pageSize, pageIndex); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¢å å· |
| | | * @param dto å·çä¼ è¾ä¿¡æ¯ |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @GetMapping("/savePvolume") |
| | | public BaseResult savePvolume(@RequestBody OsPvolumeDTO dto){ |
| | | try { |
| | | return osPvolumesServiceI.savePvolume(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å· |
| | | * @param dto å·çä¼ è¾ä¿¡æ¯ |
| | | * @return ä¿®æ¹ç»æ |
| | | */ |
| | | @GetMapping("/updatePvolume") |
| | | public BaseResult updatePvolume(@RequestBody OsPvolumeDTO dto){ |
| | | try { |
| | | return osPvolumesServiceI.updatePvolume(dto); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤å· |
| | | * @param ids 主é®éå |
| | | * @return å é¤ç»æ |
| | | */ |
| | | @DeleteMapping("/deletePvolume") |
| | | public BaseResult deletePvolume(String[] ids){ |
| | | try { |
| | | return osPvolumesServiceI.deletePvolume(ids); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | } |