2
0

feat: add package interface

This commit is contained in:
caiyuchao
2024-12-19 17:47:57 +08:00
parent cfbdb84261
commit 76b53a7c8d
13 changed files with 361 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ public class BaseData implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
@TableLogic

View File

@@ -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.SysPackage;
import org.wfc.system.service.ISysPackageService;
import java.util.List;
/**
* <p>
* 客户平台-套餐表 前端控制器
* </p>
*
* @author sys
* @since 2024-12-19
*/
@RestController
@RequestMapping("/system/sysPackage")
public class SysPackageController extends BaseController {
@Autowired
public ISysPackageService sysPackageService;
@GetMapping("/page")
public TableDataInfo page(SysPackage sysPackage) {
startPage();
List<SysPackage> list = sysPackageService.list();
return getDataTable(list);
}
@GetMapping("/list")
public AjaxResult list(SysPackage sysPackage) {
List<SysPackage> list = sysPackageService.list();
return success(list);
}
@GetMapping(value = "/{id}")
public AjaxResult getById(@PathVariable("id") Long id) {
return success(sysPackageService.getById(id));
}
@PostMapping
public AjaxResult add(@RequestBody SysPackage sysPackage) {
return toAjax(sysPackageService.save(sysPackage));
}
@PutMapping
public AjaxResult edit(@RequestBody SysPackage sysPackage) {
return toAjax(sysPackageService.updateById(sysPackage));
}
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(sysPackageService.removeByIds(CollUtil.newArrayList(ids)));
}
}

View File

@@ -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.SysRateLimit;
import org.wfc.system.service.ISysRateLimitService;
import java.util.List;
/**
* <p>
* 客户平台-带宽限速表 前端控制器
* </p>
*
* @author sys
* @since 2024-12-19
*/
@RestController
@RequestMapping("/system/sysRateLimit")
public class SysRateLimitController extends BaseController {
@Autowired
public ISysRateLimitService sysRateLimitService;
@GetMapping("/page")
public TableDataInfo page(SysRateLimit sysRateLimit) {
startPage();
List<SysRateLimit> list = sysRateLimitService.list();
return getDataTable(list);
}
@GetMapping("/list")
public AjaxResult list(SysRateLimit sysRateLimit) {
List<SysRateLimit> list = sysRateLimitService.list();
return success(list);
}
@GetMapping(value = "/{id}")
public AjaxResult getById(@PathVariable("id") Long id) {
return success(sysRateLimitService.getById(id));
}
@PostMapping
public AjaxResult add(@RequestBody SysRateLimit sysRateLimit) {
return toAjax(sysRateLimitService.save(sysRateLimit));
}
@PutMapping
public AjaxResult edit(@RequestBody SysRateLimit sysRateLimit) {
return toAjax(sysRateLimitService.updateById(sysRateLimit));
}
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(sysRateLimitService.removeByIds(CollUtil.newArrayList(ids)));
}
}

View File

@@ -0,0 +1,68 @@
package org.wfc.system.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import org.wfc.common.mybatis.domain.BaseData;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 客户平台-套餐表
* </p>
*
* @author cyc
* @since 2024-12-19
*/
@Getter
@Setter
@TableName("sys_package")
@Schema(name = "SysPackage", description = "客户平台-套餐表")
public class SysPackage extends BaseData {
private static final long serialVersionUID = 1L;
@Schema(description = "带宽限速ID")
private Long rateLimitId;
@Schema(description = "套餐名称")
private String packageName;
@Schema(description = "有效期数")
private Integer periodNum;
@Schema(description = "有效期类型")
private String periodType;
@Schema(description = "价格")
private BigDecimal price;
@Schema(description = "流量")
private Long traffic;
@Schema(description = "时长")
private Long duration;
@Schema(description = "在线设备数")
private Integer clientNum;
@Schema(description = "备注")
private String remark;
@Schema(description = "带宽是否限制")
private Boolean rateLimitEnable;
@Schema(description = "流量是否限制")
private Boolean trafficEnable;
@Schema(description = "时长是否限制")
private Boolean durationEnable;
@Schema(description = "在线设备数是否限制")
private Boolean clientNumEnable;
@Schema(description = "套餐是否启用")
private Boolean packageEnable;
}

View File

@@ -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 cyc
* @since 2024-12-19
*/
@Getter
@Setter
@TableName("sys_rate_limit")
@Schema(name = "SysRateLimit", description = "客户平台-带宽限速表")
public class SysRateLimit extends BaseData {
private static final long serialVersionUID = 1L;
@Schema(description = "限速名称")
private String rateLimitName;
@Schema(description = "下行限速")
private Long downLimit;
@Schema(description = "下行限速启用")
private Boolean downLimitEnable;
@Schema(description = "上行限速")
private Long upLimit;
@Schema(description = "上行限速启用")
private Boolean upLimitEnable;
}

View File

@@ -0,0 +1,16 @@
package org.wfc.system.mapper;
import org.wfc.system.domain.SysPackage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 客户平台-套餐表 Mapper 接口
* </p>
*
* @author cyc
* @since 2024-12-19
*/
public interface SysPackageMapper extends BaseMapper<SysPackage> {
}

View File

@@ -0,0 +1,16 @@
package org.wfc.system.mapper;
import org.wfc.system.domain.SysRateLimit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 客户平台-带宽限速表 Mapper 接口
* </p>
*
* @author cyc
* @since 2024-12-19
*/
public interface SysRateLimitMapper extends BaseMapper<SysRateLimit> {
}

View File

@@ -0,0 +1,16 @@
package org.wfc.system.service;
import org.wfc.system.domain.SysPackage;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 客户平台-套餐表 服务类
* </p>
*
* @author cyc
* @since 2024-12-19
*/
public interface ISysPackageService extends IService<SysPackage> {
}

View File

@@ -0,0 +1,16 @@
package org.wfc.system.service;
import org.wfc.system.domain.SysRateLimit;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 客户平台-带宽限速表 服务类
* </p>
*
* @author cyc
* @since 2024-12-19
*/
public interface ISysRateLimitService extends IService<SysRateLimit> {
}

View File

@@ -0,0 +1,20 @@
package org.wfc.system.service.impl;
import org.wfc.system.domain.SysPackage;
import org.wfc.system.mapper.SysPackageMapper;
import org.wfc.system.service.ISysPackageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 客户平台-套餐表 服务实现类
* </p>
*
* @author cyc
* @since 2024-12-19
*/
@Service
public class SysPackageServiceImpl extends ServiceImpl<SysPackageMapper, SysPackage> implements ISysPackageService {
}

View File

@@ -0,0 +1,20 @@
package org.wfc.system.service.impl;
import org.wfc.system.domain.SysRateLimit;
import org.wfc.system.mapper.SysRateLimitMapper;
import org.wfc.system.service.ISysRateLimitService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 客户平台-带宽限速表 服务实现类
* </p>
*
* @author cyc
* @since 2024-12-19
*/
@Service
public class SysRateLimitServiceImpl extends ServiceImpl<SysRateLimitMapper, SysRateLimit> implements ISysRateLimitService {
}

View File

@@ -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.SysPackageMapper">
</mapper>

View File

@@ -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.SysRateLimitMapper">
</mapper>