初始化天卡开放平台后端项目
包含完整功能模块: - 设备激活(直销激活码模式 + 代销免激活码模式) - 微信支付 + 天卡订单 - 天卡池管理 + 异步橘视厅SDK激活 - 第三方合作伙伴接口(代销模式) - 签名鉴权(appKey/appSecret + nonce防重放) - 天卡消耗(事务 + 幂等 + 并发控制) - 媒资接口(三级授权过滤) - 审计日志 - 定价策略(3层:门店 > 渠道 > 平台) - 分账(微信分账 + 分润规则) - Docker部署(含Redis容器)
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
package io.as.modules.device.controller;
|
||||
|
||||
import io.as.common.annotation.AuditAction;
|
||||
import io.as.common.utils.PageUtils;
|
||||
import io.as.common.utils.R;
|
||||
import io.as.modules.device.entity.DeviceEntity;
|
||||
import io.as.modules.device.service.DeviceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 终端管理
|
||||
*/
|
||||
@Api(tags = "终端管理")
|
||||
@RestController
|
||||
@RequestMapping("/manage/device")
|
||||
public class DeviceController {
|
||||
|
||||
@Autowired
|
||||
private DeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 分页查询设备列表
|
||||
*/
|
||||
@ApiOperation("分页查询设备列表")
|
||||
@GetMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
PageUtils page = deviceService.queryPage(params);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("page", page);
|
||||
return R.dataSuccess(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备详情
|
||||
*/
|
||||
@ApiOperation("设备详情")
|
||||
@GetMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id) {
|
||||
DeviceEntity device = deviceService.getById(id);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("device", device);
|
||||
return R.dataSuccess(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
@ApiOperation("新增设备")
|
||||
@AuditAction(value = "DEVICE_SAVE", description = "新增设备")
|
||||
@PostMapping("/save")
|
||||
public R save(@RequestBody DeviceEntity device) {
|
||||
deviceService.saveDevice(device);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
@ApiOperation("修改设备")
|
||||
@AuditAction(value = "DEVICE_UPDATE", description = "修改设备")
|
||||
@PostMapping("/update")
|
||||
public R update(@RequestBody DeviceEntity device) {
|
||||
deviceService.updateDevice(device);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备(软删除)
|
||||
*/
|
||||
@ApiOperation("删除设备")
|
||||
@AuditAction(value = "DEVICE_DELETE", description = "删除设备")
|
||||
@PostMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids) {
|
||||
deviceService.delete(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定门店
|
||||
*/
|
||||
@ApiOperation("绑定门店")
|
||||
@AuditAction(value = "DEVICE_BIND_STORE", description = "设备绑定门店")
|
||||
@PostMapping("/bindStore")
|
||||
public R bindStore(@RequestParam("deviceId") Long deviceId, @RequestParam("storeOrgId") Long storeOrgId) {
|
||||
deviceService.bindStore(deviceId, storeOrgId);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user