|
@@ -0,0 +1,50 @@
|
|
|
+package com.xy.open;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.xy.annotate.RestMappingController;
|
|
|
+import com.xy.annotation.Open;
|
|
|
+import com.xy.entity.DeviceInfo;
|
|
|
+import com.xy.open.dto.DeviceOpenApiDTO;
|
|
|
+import com.xy.open.vo.DeviceOpenApiVO;
|
|
|
+import com.xy.service.DeviceInfoServiceImpl;
|
|
|
+import com.xy.utils.PageBean;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
+import static com.xy.utils.PlusBeans.toIPage;
|
|
|
+import static com.xy.utils.PlusBeans.toPageBean;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 开放api
|
|
|
+ */
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+@Api(tags = "设备API")
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestMappingController("/openApi")
|
|
|
+public class DeviceOpenApiService {
|
|
|
+
|
|
|
+ private final DeviceInfoServiceImpl deviceInfoService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取商户设备列表", notes = "获取商户设备列表")
|
|
|
+ @Open(value = "device.page.get", version = "1.0", permission = true)
|
|
|
+ @RequestMapping("/device/page/get")
|
|
|
+ public PageBean<DeviceOpenApiVO.DeviceList> devicePageGet(DeviceOpenApiDTO.DeviceListGet dto, HttpServletRequest request) {
|
|
|
+ PageBean pageBean = dto.getPage();
|
|
|
+ LambdaQueryWrapper<DeviceInfo> lqw = Wrappers.<DeviceInfo>lambdaQuery()
|
|
|
+ .in(DeviceInfo::getMercCode, dto.getMercCodes()
|
|
|
+ );
|
|
|
+ IPage<DeviceInfo> iPage = deviceInfoService.page(toIPage(pageBean), lqw);
|
|
|
+ return toPageBean(DeviceOpenApiVO.DeviceList.class, iPage);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|