feat: 添加客户平台-AP/设备管理接口
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
package org.wfc.system.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wfc.common.core.web.controller.BaseController;
|
||||
import org.wfc.common.core.web.domain.AjaxResult;
|
||||
import org.wfc.common.core.web.page.TableDataInfo;
|
||||
import org.wfc.system.domain.UClient;
|
||||
import org.wfc.system.service.IUClientService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_用户设备表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/client")
|
||||
public class UClientController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IUClientService uClientService;
|
||||
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page(UClient uClient) {
|
||||
startPage();
|
||||
List<UClient> list = uClientService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(UClient uClient) {
|
||||
List<UClient> list = uClientService.list();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||
return success(uClientService.getById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UClient uClient) {
|
||||
return toAjax(uClientService.save(uClient));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UClient uClient) {
|
||||
return toAjax(uClientService.updateById(uClient));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(uClientService.removeByIds(CollUtil.newArrayList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.wfc.system.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wfc.common.core.web.controller.BaseController;
|
||||
import org.wfc.common.core.web.domain.AjaxResult;
|
||||
import org.wfc.common.core.web.page.TableDataInfo;
|
||||
import org.wfc.system.domain.UDevice;
|
||||
import org.wfc.system.service.IUDeviceService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_AP设备表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device")
|
||||
public class UDeviceController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IUDeviceService uDeviceService;
|
||||
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page(UDevice uDevice) {
|
||||
startPage();
|
||||
List<UDevice> list = uDeviceService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(UDevice uDevice) {
|
||||
List<UDevice> list = uDeviceService.list();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||
return success(uDeviceService.getById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UDevice uDevice) {
|
||||
return toAjax(uDeviceService.save(uDevice));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UDevice uDevice) {
|
||||
return toAjax(uDeviceService.updateById(uDevice));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(uDeviceService.removeByIds(CollUtil.newArrayList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.wfc.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import org.wfc.common.mybatis.domain.BaseData;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_用户设备表
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("u_client")
|
||||
@Schema(name = "UClient", description = "用户平台_用户设备表")
|
||||
public class UClient extends BaseData {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "User ID link to u_user")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "Site ID")
|
||||
private String siteId;
|
||||
|
||||
@Schema(description = "Client Name")
|
||||
private String clientName;
|
||||
|
||||
@Schema(description = "Client device type")
|
||||
private String clientDeviceType;
|
||||
|
||||
@Schema(description = "Client mac address")
|
||||
private String clientMac;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.wfc.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import org.wfc.common.mybatis.domain.BaseData;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_AP设备表
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("u_device")
|
||||
@Schema(name = "UDevice", description = "用户平台_AP设备表")
|
||||
public class UDevice extends BaseData {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "User ID link to u_user")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "Device Name")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "Device ip")
|
||||
private String deviceIp;
|
||||
|
||||
@Schema(description = "Device mac")
|
||||
private String deviceMac;
|
||||
|
||||
@Schema(description = "Device model")
|
||||
private String deviceModel;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.wfc.system.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.wfc.system.domain.UClient;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_用户设备表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@DS("user")
|
||||
public interface UClientMapper extends BaseMapper<UClient> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.wfc.system.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.wfc.system.domain.UDevice;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_AP设备表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@DS("user")
|
||||
public interface UDeviceMapper extends BaseMapper<UDevice> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.wfc.system.service;
|
||||
|
||||
import org.wfc.system.domain.UClient;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_用户设备表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
public interface IUClientService extends IService<UClient> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.wfc.system.service;
|
||||
|
||||
import org.wfc.system.domain.UDevice;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_AP设备表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
public interface IUDeviceService extends IService<UDevice> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.wfc.system.service.impl;
|
||||
|
||||
import org.wfc.system.domain.UClient;
|
||||
import org.wfc.system.mapper.UClientMapper;
|
||||
import org.wfc.system.service.IUClientService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_用户设备表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@Service
|
||||
public class UClientServiceImpl extends ServiceImpl<UClientMapper, UClient> implements IUClientService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.wfc.system.service.impl;
|
||||
|
||||
import org.wfc.system.domain.UDevice;
|
||||
import org.wfc.system.mapper.UDeviceMapper;
|
||||
import org.wfc.system.service.IUDeviceService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台_AP设备表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-03
|
||||
*/
|
||||
@Service
|
||||
public class UDeviceServiceImpl extends ServiceImpl<UDeviceMapper, UDevice> implements IUDeviceService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.wfc.system.mapper.UClientMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.wfc.system.mapper.UDeviceMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user