| | |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZfPet; |
| | | import com.ruoyi.domain.excel.ZfEconomyExcelBean; |
| | | import com.ruoyi.service.ZfPetService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zfPetService.selectPetList(zfPet, pageNum, pageSize); |
| | | } |
| | | |
| | | /** |
| | | * 获取导入模板 |
| | | */ |
| | | @GetMapping("/model") |
| | | public void getExportModel(HttpServletResponse response){ |
| | | List<ZfPet> list = Collections.singletonList(new ZfPet()); |
| | | ExcelUtil<ZfPet> util = new ExcelUtil<>(ZfPet.class); |
| | | util.exportExcel(response,list,"魅宠记录数据"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ZfPet zfPet) |
| | | { |
| | | return toAjax(zfPetService.save(zfPet)); |
| | | return zfPetService.mySave(zfPet); |
| | | } |
| | | |
| | | /** |