From b146d1a002c4e3b323810f95bea28a1e47e0d680 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期一, 02 十月 2023 11:05:01 +0800 Subject: [PATCH] 接口 --- ycl-platform/src/main/java/com/ycl/controller/smoke/SmokeController.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 55 insertions(+), 3 deletions(-) diff --git a/ycl-platform/src/main/java/com/ycl/controller/smoke/SmokeController.java b/ycl-platform/src/main/java/com/ycl/controller/smoke/SmokeController.java index 114bc27..3f5641d 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/smoke/SmokeController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/smoke/SmokeController.java @@ -1,22 +1,74 @@ package com.ycl.controller.smoke; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ycl.annotation.LogSave; +import com.ycl.api.CommonPage; +import com.ycl.api.CommonResult; import com.ycl.controller.BaseController; +import com.ycl.dto.smoker.InTimeCountDto; +import com.ycl.entity.smoke.OdsCustomer; +import com.ycl.entity.smoke.OdsInTime; +import com.ycl.service.smoke.IOdsCustomerService; import com.ycl.service.smoke.IOdsInTimeService; +import com.ycl.vo.store.StoreInfoVO; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/smoker") -@Api(tags = "瑙嗛璧勬簮绠$悊") +@Api(tags = "娌圭儫绠$悊绠$悊") public class SmokeController extends BaseController { IOdsInTimeService inTimeService; + IOdsCustomerService customerService; + @Autowired public void setInTimeService(IOdsInTimeService inTimeService) { this.inTimeService = inTimeService; } + + @Autowired + public void setCustomerService(IOdsCustomerService customerService) { + this.customerService = customerService; + } + + @ApiOperation("鑾峰彇鎵�灞炲崟浣�") + @RequestMapping(value = "/customer/list", method = RequestMethod.GET) + @ResponseBody + @LogSave(operationType = "娌圭儫妯″潡", contain = "鑾峰彇鎵�灞炲崟浣�") + public CommonResult<CommonPage<OdsCustomer>> findCustomerList(@RequestParam(value = "keyword", required = false) String keyword, + @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize, + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { + Page<OdsCustomer> customerPage = customerService.findList(keyword, pageSize, pageNum); + return CommonResult.success(CommonPage.restPage(customerPage)); + } + + @ApiOperation("鏌ヨ瀹炴椂鏁版嵁") + @RequestMapping(value = "/inTime/list", method = RequestMethod.GET) + @ResponseBody + @LogSave(operationType = "娌圭儫妯″潡", contain = "鏌ヨ瀹炴椂鏁版嵁") + public CommonResult<CommonPage<OdsInTime>> findInTimeList(@RequestParam(value = "owner", required = false) String owner, + @RequestParam(value = "onlineStatus", required = false) String onlineStatus, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "startTime", required = false) String startTime, + @RequestParam(value = "endTime", required = false) String endTime, + @RequestParam(value = "type", required = false) String type, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { + Page<OdsInTime> inTimePage = inTimeService.findList(owner, onlineStatus, startTime, endTime, type, status, pageSize, pageNum); + return CommonResult.success(CommonPage.restPage(inTimePage)); + } + + @ApiOperation("鑾峰彇璁惧鍦ㄧ嚎鎯呭喌") + @RequestMapping(value = "/inTime/count", method = RequestMethod.GET) + @ResponseBody + @LogSave(operationType = "娌圭儫妯″潡", contain = "鑾峰彇璁惧鍦ㄧ嚎鎯呭喌") + public CommonResult<InTimeCountDto> getInTimeCount() { + InTimeCountDto dto = inTimeService.getInTimeCount(); + return CommonResult.success(dto); + } } -- Gitblit v1.8.0