2
0

fix: migrate package

This commit is contained in:
caiyuchao
2024-12-20 11:13:54 +08:00
parent a54834473d
commit aaeb672b5d
21 changed files with 202 additions and 193 deletions

View File

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

View File

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

View File

@@ -10,17 +10,17 @@ import lombok.Setter;
/**
* <p>
* 户平台-套餐表
* 户平台-套餐表
* </p>
*
* @author cyc
* @since 2024-12-19
* @author sys
* @since 2024-12-20
*/
@Getter
@Setter
@TableName("sys_package")
@Schema(name = "SysPackage", description = "户平台-套餐表")
public class SysPackage extends BaseData {
@TableName("u_package")
@Schema(name = "UPackage", description = "户平台-套餐表")
public class UPackage extends BaseData {
private static final long serialVersionUID = 1L;

View File

@@ -9,17 +9,17 @@ import lombok.Setter;
/**
* <p>
* 户平台-带宽限速表
* 户平台-带宽限速表
* </p>
*
* @author cyc
* @since 2024-12-19
* @author sys
* @since 2024-12-20
*/
@Getter
@Setter
@TableName("sys_rate_limit")
@Schema(name = "SysRateLimit", description = "户平台-带宽限速表")
public class SysRateLimit extends BaseData {
@TableName("u_rate_limit")
@Schema(name = "URateLimit", description = "户平台-带宽限速表")
public class URateLimit extends BaseData {
private static final long serialVersionUID = 1L;

View File

@@ -1,16 +0,0 @@
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

@@ -1,16 +0,0 @@
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,18 @@
package org.wfc.system.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.wfc.system.domain.UPackage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 用户平台-套餐表 Mapper 接口
* </p>
*
* @author sys
* @since 2024-12-20
*/
@DS("user")
public interface UPackageMapper extends BaseMapper<UPackage> {
}

View File

@@ -0,0 +1,18 @@
package org.wfc.system.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.wfc.system.domain.URateLimit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 用户平台-带宽限速表 Mapper 接口
* </p>
*
* @author sys
* @since 2024-12-20
*/
@DS("user")
public interface URateLimitMapper extends BaseMapper<URateLimit> {
}

View File

@@ -1,16 +0,0 @@
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

@@ -1,16 +0,0 @@
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,16 @@
package org.wfc.system.service;
import org.wfc.system.domain.UPackage;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 用户平台-套餐表 服务类
* </p>
*
* @author sys
* @since 2024-12-20
*/
public interface IUPackageService extends IService<UPackage> {
}

View File

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

View File

@@ -1,20 +0,0 @@
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

@@ -1,20 +0,0 @@
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,20 @@
package org.wfc.system.service.impl;
import org.wfc.system.domain.UPackage;
import org.wfc.system.mapper.UPackageMapper;
import org.wfc.system.service.IUPackageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 用户平台-套餐表 服务实现类
* </p>
*
* @author sys
* @since 2024-12-20
*/
@Service
public class UPackageServiceImpl extends ServiceImpl<UPackageMapper, UPackage> implements IUPackageService {
}

View File

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

View File

@@ -35,6 +35,11 @@ spring:
url: jdbc:mysql://wfc-mysql:3306/wfc_system_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
user:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://wfc-mysql:3306/wfc_user_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# 从库数据源
# slave:
# username:

View File

@@ -1,5 +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 namespace="org.wfc.system.mapper.UPackageMapper">
</mapper>

View File

@@ -1,5 +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 namespace="org.wfc.system.mapper.URateLimitMapper">
</mapper>