feiyu02
2025-09-18 baf2cc2ce3dfd1235c012a3750132769fcd9ad2f
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/UserMapController.kt
@@ -2,8 +2,10 @@
import cn.flightfeather.supervision.lightshare.service.UserMapService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
@Api(tags = ["UserMapController"], description = "用户id对应API接口")
@@ -21,5 +23,32 @@
    @ApiOperation(value = "获取区域用户的监测设备和飞羽监管系统、飞羽环境系统的匹配记录")
    @PostMapping("/device")
    fun fetchDeviceMap(@RequestBody areaVo: AreaVo) = resPack { userMapService.fetchDeviceMap(areaVo) }
    fun fetchDeviceMap(
        @ApiParam("查询页码", defaultValue = "1", required = false) @RequestParam("page", required = false)
        page: Int?,
        @ApiParam("单页数据量", defaultValue = "30", required = false) @RequestParam("per_page", required = false)
        perPage: Int?,
        @ApiParam("区域条件信息") @RequestBody
        areaVo: AreaVo
    ) = resPack { userMapService.fetchDeviceMap(page, perPage, areaVo) }
    @ApiOperation(value = "新增或更新用户监测设备映射关系")
    @PostMapping("/insertOrUpdate")
    fun insertOrUpdate(
        @ApiParam("用户监测设备映射关系") @RequestBody
        param: Pair<AreaVo, DeviceMapVo>,
    ) = resPack { userMapService.insertOrUpdate(param) }
    @ApiOperation(value = "搜索第三方设备")
    @PostMapping("/searchThirdPartyDevice")
    fun searchThirdPartyDevice(
        @ApiParam("区域条件信息") @RequestBody
        areaVo: AreaVo,
        @ApiParam("搜索关键字,匹配设备名") @RequestParam
        keyword: String,
        @ApiParam("查询页码", defaultValue = "1", required = false) @RequestParam("page", required = false)
        page: Int?,
        @ApiParam("单页数据量", defaultValue = "30", required = false) @RequestParam("per_page", required = false)
        perPage: Int?,
    ) = resPack { userMapService.searchThirdPartyDevice(areaVo, keyword, page, perPage) }
}