#机器人的二维码模块
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.core.business.sys_robot_qrcode.SysQrCode;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.service.ISysQrCodeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "二维码管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/qrcode")
|
||||
public class SysQrCodeController {
|
||||
|
||||
@Autowired
|
||||
private ISysQrCodeService qrCodeService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:list')")
|
||||
@ApiOperation("分页查询二维码")
|
||||
@GetMapping("/page")
|
||||
public AjaxResult page(Page<SysQrCode> page, SysQrCode qrCode) {
|
||||
IPage<SysQrCode> result = qrCodeService.selectQrCodePage(page, qrCode);
|
||||
return AjaxResult.success(result.getRecords(), (int) result.getTotal());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:list')")
|
||||
@ApiOperation("查询二维码列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysQrCode qrCode) {
|
||||
List<SysQrCode> list = qrCodeService.selectQrCodeList(qrCode);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:query')")
|
||||
@ApiOperation("查询二维码详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return AjaxResult.success(qrCodeService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:query')")
|
||||
@ApiOperation("根据序列号查询二维码")
|
||||
@GetMapping("/serial/{serialNumber}")
|
||||
public AjaxResult getBySerialNumber(@PathVariable String serialNumber) {
|
||||
return AjaxResult.success(qrCodeService.selectBySerialNumber(serialNumber));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:generate')")
|
||||
@ApiOperation("生成二维码并保存记录")
|
||||
@PostMapping("/generate")
|
||||
public AjaxResult generate(@RequestParam Long modelId,
|
||||
@RequestParam Long configId,
|
||||
@RequestParam Long typeId,
|
||||
@RequestParam Long countryId,
|
||||
@RequestParam Long provinceId) {
|
||||
SysQrCode qrCode = qrCodeService.generateQrCodeWithImage(
|
||||
modelId, configId, typeId, countryId, provinceId);
|
||||
return AjaxResult.success(qrCode);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:bind')")
|
||||
@ApiOperation("绑定设备")
|
||||
@PostMapping("/bind/{qrCodeId}/{deviceId}")
|
||||
public AjaxResult bindDevice(@PathVariable Long qrCodeId,
|
||||
@PathVariable Long deviceId) {
|
||||
return toAjax(qrCodeService.bindDevice(qrCodeId, deviceId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:unbind')")
|
||||
@ApiOperation("解绑设备")
|
||||
@PostMapping("/unbind/{qrCodeId}")
|
||||
public AjaxResult unbindDevice(@PathVariable Long qrCodeId) {
|
||||
return toAjax(qrCodeService.unbindDevice(qrCodeId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qrcode:remove')")
|
||||
@ApiOperation("删除二维码")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(qrCodeService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
protected AjaxResult toAjax(boolean result) {
|
||||
return result ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.core.business.sys_robot_qrcode.SysRobotConfig;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.service.ISysRobotConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "机器人配置管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/robot/config")
|
||||
public class SysRobotConfigController {
|
||||
|
||||
@Autowired
|
||||
private ISysRobotConfigService configService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:config:list')")
|
||||
@ApiOperation("分页查询机器人配置")
|
||||
@GetMapping("/page")
|
||||
public AjaxResult page(Page<SysRobotConfig> page, SysRobotConfig config) {
|
||||
IPage<SysRobotConfig> result = configService.selectPage(page, config);
|
||||
return AjaxResult.success(result.getRecords(), (int) result.getTotal());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:config:list')")
|
||||
@ApiOperation("查询机器人配置列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysRobotConfig config) {
|
||||
List<SysRobotConfig> list = configService.selectList(config);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:config:query')")
|
||||
@ApiOperation("查询机器人配置详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return AjaxResult.success(configService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:config:add')")
|
||||
@ApiOperation("新增机器人配置")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysRobotConfig config) {
|
||||
if (!configService.checkStoreValueUnique(config)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(configService.save(config));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:config:edit')")
|
||||
@ApiOperation("修改机器人配置")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysRobotConfig config) {
|
||||
if (!configService.checkStoreValueUnique(config)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(configService.updateById(config));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:config:remove')")
|
||||
@ApiOperation("删除机器人配置")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(configService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
protected AjaxResult toAjax(boolean result) {
|
||||
return result ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.core.business.sys_robot_qrcode.SysRobotCountry;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.service.ISysRobotCountryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "国家管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/robot/country")
|
||||
public class SysRobotCountryController {
|
||||
|
||||
@Autowired
|
||||
private ISysRobotCountryService countryService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:country:list')")
|
||||
@ApiOperation("分页查询国家")
|
||||
@GetMapping("/page")
|
||||
public AjaxResult page(Page<SysRobotCountry> page, SysRobotCountry country) {
|
||||
IPage<SysRobotCountry> result = countryService.selectPage(page, country);
|
||||
return AjaxResult.success(result.getRecords(), (int) result.getTotal());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:country:list')")
|
||||
@ApiOperation("查询国家列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysRobotCountry country) {
|
||||
List<SysRobotCountry> list = countryService.selectList(country);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:country:query')")
|
||||
@ApiOperation("查询国家详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return AjaxResult.success(countryService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:country:add')")
|
||||
@ApiOperation("新增国家")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysRobotCountry country) {
|
||||
if (!countryService.checkStoreValueUnique(country)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(countryService.save(country));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:country:edit')")
|
||||
@ApiOperation("修改国家")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysRobotCountry country) {
|
||||
if (!countryService.checkStoreValueUnique(country)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(countryService.updateById(country));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:country:remove')")
|
||||
@ApiOperation("删除国家")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(countryService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
protected AjaxResult toAjax(boolean result) {
|
||||
return result ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.core.business.sys_robot_qrcode.SysRobotModel;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.service.ISysRobotModelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "机器人型号管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/robot/model")
|
||||
public class SysRobotModelController {
|
||||
|
||||
@Autowired
|
||||
private ISysRobotModelService modelService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:model:list')")
|
||||
@ApiOperation("分页查询机器人型号")
|
||||
@GetMapping("/page")
|
||||
public AjaxResult page(Page<SysRobotModel> page, SysRobotModel model) {
|
||||
IPage<SysRobotModel> result = modelService.selectPage(page, model);
|
||||
return AjaxResult.success(result.getRecords(), (int) result.getTotal());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:model:list')")
|
||||
@ApiOperation("查询机器人型号列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysRobotModel model) {
|
||||
List<SysRobotModel> list = modelService.selectList(model);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:model:query')")
|
||||
@ApiOperation("查询机器人型号详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return AjaxResult.success(modelService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:model:add')")
|
||||
@ApiOperation("新增机器人型号")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysRobotModel model) {
|
||||
if (!modelService.checkStoreValueUnique(model)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(modelService.save(model));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:model:edit')")
|
||||
@ApiOperation("修改机器人型号")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysRobotModel model) {
|
||||
if (!modelService.checkStoreValueUnique(model)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(modelService.updateById(model));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:model:remove')")
|
||||
@ApiOperation("删除机器人型号")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(modelService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
protected AjaxResult toAjax(boolean result) {
|
||||
return result ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.core.business.sys_robot_qrcode.SysRobotProvince;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.service.ISysRobotProvinceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "省份管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/robot/province")
|
||||
public class SysRobotProvinceController {
|
||||
|
||||
@Autowired
|
||||
private ISysRobotProvinceService provinceService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:province:list')")
|
||||
@ApiOperation("分页查询省份")
|
||||
@GetMapping("/page")
|
||||
public AjaxResult page(Page<SysRobotProvince> page, SysRobotProvince province) {
|
||||
IPage<SysRobotProvince> result = provinceService.selectPage(page, province);
|
||||
return AjaxResult.success(result.getRecords(), (int) result.getTotal());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:province:list')")
|
||||
@ApiOperation("查询省份列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysRobotProvince province) {
|
||||
List<SysRobotProvince> list = provinceService.selectList(province);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:province:query')")
|
||||
@ApiOperation("查询省份详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return AjaxResult.success(provinceService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:province:add')")
|
||||
@ApiOperation("新增省份")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysRobotProvince province) {
|
||||
if (!provinceService.checkStoreValueUnique(province)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(provinceService.save(province));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:province:edit')")
|
||||
@ApiOperation("修改省份")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysRobotProvince province) {
|
||||
if (!provinceService.checkStoreValueUnique(province)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(provinceService.updateById(province));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:province:remove')")
|
||||
@ApiOperation("删除省份")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(provinceService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
protected AjaxResult toAjax(boolean result) {
|
||||
return result ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.core.business.sys_robot_qrcode.SysRobotType;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.service.ISysRobotTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "机器人类型管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/robot/type")
|
||||
public class SysRobotTypeController {
|
||||
|
||||
@Autowired
|
||||
private ISysRobotTypeService typeService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:type:list')")
|
||||
@ApiOperation("分页查询机器人类型")
|
||||
@GetMapping("/page")
|
||||
public AjaxResult page(Page<SysRobotType> page, SysRobotType type) {
|
||||
IPage<SysRobotType> result = typeService.selectPage(page, type);
|
||||
return AjaxResult.success(result.getRecords(), (int) result.getTotal());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:type:list')")
|
||||
@ApiOperation("查询机器人类型列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysRobotType type) {
|
||||
List<SysRobotType> list = typeService.selectList(type);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:type:query')")
|
||||
@ApiOperation("查询机器人类型详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return AjaxResult.success(typeService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:type:add')")
|
||||
@ApiOperation("新增机器人类型")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysRobotType type) {
|
||||
if (!typeService.checkStoreValueUnique(type)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(typeService.save(type));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:type:edit')")
|
||||
@ApiOperation("修改机器人类型")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysRobotType type) {
|
||||
if (!typeService.checkStoreValueUnique(type)) {
|
||||
return AjaxResult.error("存储值已存在");
|
||||
}
|
||||
return toAjax(typeService.updateById(type));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:robot:type:remove')")
|
||||
@ApiOperation("删除机器人类型")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(typeService.removeByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
protected AjaxResult toAjax(boolean result) {
|
||||
return result ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user