Compare commits
64 Commits
bcecb8b3e9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ba86ac45f4 | |||
| d1f1e72732 | |||
| ab09d0ee74 | |||
| 407438fb99 | |||
| d0f4ad25c0 | |||
| da7bfbc9ce | |||
| 8cf9ad4436 | |||
| efc97b3584 | |||
| 980364efc1 | |||
| 08ec6cd010 | |||
| 7c1b515e6a | |||
| 9da3f3c0c5 | |||
| 331bba16c0 | |||
| 3a0d2b9c01 | |||
| abfcf7bfc8 | |||
| 0d3a2cfd9f | |||
| 5c191740e9 | |||
| 6eec62ca83 | |||
| 134469536b | |||
| d62c39996b | |||
| afa2c47c89 | |||
| a99f05d029 | |||
| bd315fcbd9 | |||
| 716cde6ea0 | |||
| 04755188d6 | |||
| b12f232f56 | |||
| d75a3e0212 | |||
| 299bc5e28b | |||
| d7ed10f45d | |||
| ca6e3d20f6 | |||
| 6fad3b45fe | |||
| a8da54c130 | |||
| d105bd4fa6 | |||
| be54601cdd | |||
| 2207add193 | |||
| 98e427c65a | |||
| baf38df6c3 | |||
| eb4b615ed6 | |||
| 2ed121926b | |||
| c07367ea53 | |||
| 7c72e60a32 | |||
| 0cab423604 | |||
| 2eaf9a37d5 | |||
| c3b18774e0 | |||
| 2e8a5db5fc | |||
| 553feba55d | |||
| 128f840f7e | |||
| cfa2c89600 | |||
| 0c5a038595 | |||
| d517682c62 | |||
| 419d9a930c | |||
| 1694603465 | |||
| e2269e1ff4 | |||
| ccbbcbff53 | |||
| 16f1d653c3 | |||
| 5c95baf336 | |||
| 6c7cc367b5 | |||
| 6328a5531d | |||
| bb1b1af3ea | |||
| a5d2125d90 | |||
| 4c81ebac23 | |||
| 4255b9ee05 | |||
| c7b31de1b1 | |||
| 8e551f6bb2 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -52,3 +52,5 @@ application-my.yaml
|
||||
|
||||
/yolo-ui-app/unpackage/
|
||||
**/.DS_Store
|
||||
/.omc/
|
||||
/AGENTS.md
|
||||
|
||||
34
CLAUDE.md
34
CLAUDE.md
@@ -67,6 +67,7 @@ The project uses a **modular monolith** architecture with the following key modu
|
||||
- `yolo-spring-boot-starter-biz-*`: Business-specific components (tenant, data permission, IP)
|
||||
- **yolo-module-system**: System management module (users, roles, permissions, dictionaries)
|
||||
- **yolo-module-infra**: Infrastructure module (jobs, file storage, code generator, monitoring)
|
||||
- **keyboard-server**: Business module for keyboard-specific features (custom controllers, services, DAL)
|
||||
- **yolo-server**: Main application container (empty shell that aggregates modules)
|
||||
|
||||
### Layered Architecture
|
||||
@@ -104,30 +105,17 @@ enums/ # Module-specific enums
|
||||
- Connection: `jdbc:postgresql://localhost:5432/keyborad_db`
|
||||
- Default credentials: root/123asd
|
||||
|
||||
### Database Scripts
|
||||
SQL scripts are located in `sql/` directory with support for multiple databases:
|
||||
- `sql/postgresql/` - PostgreSQL scripts
|
||||
- `sql/mysql/` - MySQL scripts
|
||||
- `sql/oracle/`, `sql/sqlserver/`, `sql/dm/`, `sql/kingbase/`, `sql/opengauss/` - Other DB support
|
||||
|
||||
### Database Conversion
|
||||
Use `sql/tools/convertor.py` to convert MySQL scripts to other databases:
|
||||
```bash
|
||||
cd sql/tools
|
||||
python3 convertor.py postgres > output.sql
|
||||
```
|
||||
|
||||
### Quick Database Setup with Docker
|
||||
```bash
|
||||
cd sql/tools
|
||||
docker compose up -d postgres
|
||||
cd script/docker
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Application Profiles
|
||||
- `application.yaml` - Base configuration
|
||||
- `application-local.yaml` - Local development (port 48080)
|
||||
- `application-local.yaml` - Local development (port 48081)
|
||||
- `application-dev.yaml` - Development environment
|
||||
|
||||
### Key Configuration Properties
|
||||
@@ -174,15 +162,15 @@ Configured via `spring.datasource.dynamic.datasource`:
|
||||
|
||||
## API Documentation
|
||||
|
||||
- **Swagger UI**: http://localhost:48080/swagger-ui
|
||||
- **Knife4j UI**: http://localhost:48080/doc.html (enhanced Swagger UI)
|
||||
- **OpenAPI JSON**: http://localhost:48080/v3/api-docs
|
||||
- **Swagger UI**: http://localhost:48081/swagger-ui
|
||||
- **Knife4j UI**: http://localhost:48081/doc.html (enhanced Swagger UI)
|
||||
- **OpenAPI JSON**: http://localhost:48081/v3/api-docs
|
||||
|
||||
## Monitoring & Admin
|
||||
|
||||
- **Spring Boot Admin**: http://localhost:48080/admin
|
||||
- **Actuator**: http://localhost:48080/actuator
|
||||
- **Druid Monitor**: http://localhost:48080/druid (database connection pool)
|
||||
- **Spring Boot Admin**: http://localhost:48081/admin
|
||||
- **Actuator**: http://localhost:48081/actuator
|
||||
- **Druid Monitor**: http://localhost:48081/druid (database connection pool)
|
||||
|
||||
## Common Issues
|
||||
|
||||
@@ -193,7 +181,7 @@ If you encounter startup issues, refer to: https://doc.iocoder.cn/quick-start/
|
||||
Ensure PostgreSQL is running and credentials in `application-local.yaml` are correct.
|
||||
|
||||
### Port Conflicts
|
||||
Default port is 48080. Change via `server.port` in configuration files.
|
||||
Default port is 48081. Change via `server.port` in configuration files.
|
||||
|
||||
## Dependencies & Versions
|
||||
|
||||
|
||||
@@ -52,5 +52,11 @@
|
||||
<version>2025.11-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yolo</groupId>
|
||||
<artifactId>yolo-module-system</artifactId>
|
||||
<version>2025.11-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.yolo.keyboard.api.invitecode;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.yolo.keyboard.dal.dataobject.userinvitecodes.KeyboardUserInviteCodesDO;
|
||||
import com.yolo.keyboard.dal.mysql.userinvitecodes.KeyboardUserInviteCodesMapper;
|
||||
import com.yolo.keyboard.module.system.api.invitecode.UserInviteCodeApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户邀请码 API 实现类
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@Service
|
||||
public class UserInviteCodeApiImpl implements UserInviteCodeApi {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserInviteCodesMapper userInviteCodesMapper;
|
||||
|
||||
@Override
|
||||
public String createInviteCodeForAgent(Long userId, Long tenantId) {
|
||||
String inviteCode = generateUniqueInviteCode();
|
||||
KeyboardUserInviteCodesDO inviteCodeDO = KeyboardUserInviteCodesDO.builder()
|
||||
.code(inviteCode)
|
||||
.ownerSystemUserId(userId)
|
||||
.ownerTenantId(tenantId)
|
||||
.status((short) 1)
|
||||
.createdAt(LocalDateTime.now())
|
||||
.usedCount(0)
|
||||
.inviteType("AGENT")
|
||||
.build();
|
||||
userInviteCodesMapper.insert(inviteCodeDO);
|
||||
return inviteCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成唯一的6位邀请码(字母和数字混合)
|
||||
*/
|
||||
private String generateUniqueInviteCode() {
|
||||
String code;
|
||||
int maxAttempts = 100;
|
||||
int attempt = 0;
|
||||
do {
|
||||
code = RandomUtil.randomString("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 6);
|
||||
attempt++;
|
||||
if (attempt >= maxAttempts) {
|
||||
throw new RuntimeException("无法生成唯一的邀请码,请稍后重试");
|
||||
}
|
||||
} while (userInviteCodesMapper.selectOne(KeyboardUserInviteCodesDO::getCode, code) != null);
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yolo.keyboard.api.tenantbalance;
|
||||
|
||||
import com.yolo.keyboard.dal.dataobject.tenantbalance.TenantBalanceDO;
|
||||
import com.yolo.keyboard.dal.mysql.tenantbalance.TenantBalanceMapper;
|
||||
import com.yolo.keyboard.module.system.api.tenantbalance.TenantBalanceApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 租户余额 API 实现类
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TenantBalanceApiImpl implements TenantBalanceApi {
|
||||
|
||||
@Resource
|
||||
private TenantBalanceMapper tenantBalanceMapper;
|
||||
|
||||
@Override
|
||||
public void initTenantBalance(Long tenantId) {
|
||||
// 检查是否已存在
|
||||
TenantBalanceDO existingBalance = tenantBalanceMapper.selectById(tenantId);
|
||||
if (existingBalance != null) {
|
||||
log.info("[initTenantBalance] 租户 {} 钱包已存在,跳过初始化", tenantId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化租户钱包
|
||||
TenantBalanceDO balance = new TenantBalanceDO();
|
||||
balance.setId(tenantId);
|
||||
balance.setBalance(BigDecimal.ZERO);
|
||||
balance.setWithdrawableBalance(BigDecimal.ZERO);
|
||||
balance.setFrozenAmt(BigDecimal.ZERO);
|
||||
balance.setVersion(0);
|
||||
tenantBalanceMapper.insert(balance);
|
||||
|
||||
log.info("[initTenantBalance] 租户 {} 钱包初始化成功", tenantId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.yolo.keyboard.controller.admin.aicompanion;
|
||||
|
||||
import com.yolo.keyboard.dal.dataobject.aicompanion.AiCompanionI18nDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.aicompanion.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.aicompanion.KeyboardAiCompanionDO;
|
||||
import com.yolo.keyboard.service.aicompanion.KeyboardAiCompanionService;
|
||||
|
||||
@Tag(name = "管理后台 - AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/ai-companion")
|
||||
@Validated
|
||||
public class KeyboardAiCompanionController {
|
||||
|
||||
@Resource
|
||||
private KeyboardAiCompanionService aiCompanionService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:create')")
|
||||
public CommonResult<Long> createAiCompanion(@Valid @RequestBody KeyboardAiCompanionSaveReqVO createReqVO) {
|
||||
return success(aiCompanionService.createAiCompanion(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:update')")
|
||||
public CommonResult<Boolean> updateAiCompanion(@Valid @RequestBody KeyboardAiCompanionSaveReqVO updateReqVO) {
|
||||
aiCompanionService.updateAiCompanion(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:delete')")
|
||||
public CommonResult<Boolean> deleteAiCompanion(@RequestParam("id") Long id) {
|
||||
aiCompanionService.deleteAiCompanion(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:delete')")
|
||||
public CommonResult<Boolean> deleteAiCompanionList(@RequestParam("ids") List<Long> ids) {
|
||||
aiCompanionService.deleteAiCompanionListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:query')")
|
||||
public CommonResult<KeyboardAiCompanionRespVO> getAiCompanion(@RequestParam("id") Long id) {
|
||||
KeyboardAiCompanionDO aiCompanion = aiCompanionService.getAiCompanion(id);
|
||||
return success(BeanUtils.toBean(aiCompanion, KeyboardAiCompanionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:query')")
|
||||
public CommonResult<PageResult<KeyboardAiCompanionRespVO>> getAiCompanionPage(@Valid KeyboardAiCompanionPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardAiCompanionDO> pageResult = aiCompanionService.getAiCompanionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardAiCompanionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAiCompanionExcel(@Valid KeyboardAiCompanionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardAiCompanionDO> list = aiCompanionService.getAiCompanionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设.xls", "数据", KeyboardAiCompanionRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardAiCompanionRespVO.class));
|
||||
}
|
||||
|
||||
// ==================== 子表(AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍) ====================
|
||||
|
||||
@GetMapping("/ai-companion-i18n/page")
|
||||
@Operation(summary = "获得AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍分页")
|
||||
@Parameter(name = "id", description = "主键ID")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:query')")
|
||||
public CommonResult<PageResult<AiCompanionI18nDO>> getAiCompanionI18nPage(PageParam pageReqVO,
|
||||
@RequestParam("id") Long id) {
|
||||
return success(aiCompanionService.getAiCompanionI18nPage(pageReqVO, id));
|
||||
}
|
||||
|
||||
@PostMapping("/ai-companion-i18n/create")
|
||||
@Operation(summary = "创建AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:create')")
|
||||
public CommonResult<Long> createAiCompanionI18n(@Valid @RequestBody AiCompanionI18nDO aiCompanionI18n) {
|
||||
return success(aiCompanionService.createAiCompanionI18n(aiCompanionI18n));
|
||||
}
|
||||
|
||||
@PutMapping("/ai-companion-i18n/update")
|
||||
@Operation(summary = "更新AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:update')")
|
||||
public CommonResult<Boolean> updateAiCompanionI18n(@Valid @RequestBody AiCompanionI18nDO aiCompanionI18n) {
|
||||
aiCompanionService.updateAiCompanionI18n(aiCompanionI18n);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/ai-companion-i18n/delete")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:delete')")
|
||||
public CommonResult<Boolean> deleteAiCompanionI18n(@RequestParam("id") Long id) {
|
||||
aiCompanionService.deleteAiCompanionI18n(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/ai-companion-i18n/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:delete')")
|
||||
public CommonResult<Boolean> deleteAiCompanionI18nList(@RequestParam("ids") List<Long> ids) {
|
||||
aiCompanionService.deleteAiCompanionI18nListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/ai-companion-i18n/get")
|
||||
@Operation(summary = "获得AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:ai-companion:query')")
|
||||
public CommonResult<AiCompanionI18nDO> getAiCompanionI18n(@RequestParam("id") Long id) {
|
||||
return success(aiCompanionService.getAiCompanionI18n(id));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.yolo.keyboard.controller.admin.aicompanion.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardAiCompanionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "角色头像URL,用于列表页和聊天页", example = "https://www.iocoder.cn")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "角色封面图URL,用于角色详情页", example = "https://www.iocoder.cn")
|
||||
private String coverImageUrl;
|
||||
|
||||
@Schema(description = "角色性别(male / female / other)")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "角色年龄段描述(如:20s、25-30)")
|
||||
private String ageRange;
|
||||
|
||||
@Schema(description = "角色性格标签数组(如:温柔、黏人、治愈)")
|
||||
private Object personalityTags;
|
||||
|
||||
@Schema(description = "角色说话风格(如:撒娇型、理性型、活泼型)")
|
||||
private String speakingStyle;
|
||||
|
||||
@Schema(description = "AI系统Prompt,定义角色核心人设,仅供模型使用")
|
||||
private String systemPrompt;
|
||||
|
||||
@Schema(description = "角色状态:1=上线,0=下线", example = "2")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "角色可见性:1=公开,2=内测,3=隐藏")
|
||||
private Short visibility;
|
||||
|
||||
@Schema(description = "排序权重,数值越大排序越靠前")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "角色热度评分,用于推荐排序")
|
||||
private Integer popularityScore;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "开场白")
|
||||
private String prologue;
|
||||
|
||||
@Schema(description = "开场白音频")
|
||||
private String prologueAudio;
|
||||
|
||||
@Schema(description = "音频Id", example = "4155")
|
||||
private String voiceId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.yolo.keyboard.controller.admin.aicompanion.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardAiCompanionRespVO {
|
||||
|
||||
@Schema(description = "陪聊角色唯一ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28180")
|
||||
@ExcelProperty("陪聊角色唯一ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "角色头像URL,用于列表页和聊天页", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("角色头像URL,用于列表页和聊天页")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "角色封面图URL,用于角色详情页", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("角色封面图URL,用于角色详情页")
|
||||
private String coverImageUrl;
|
||||
|
||||
@Schema(description = "角色性别(male / female / other)")
|
||||
@ExcelProperty("角色性别(male / female / other)")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "角色年龄段描述(如:20s、25-30)")
|
||||
@ExcelProperty("角色年龄段描述(如:20s、25-30)")
|
||||
private String ageRange;
|
||||
|
||||
@Schema(description = "角色性格标签数组(如:温柔、黏人、治愈)")
|
||||
@ExcelProperty("角色性格标签数组(如:温柔、黏人、治愈)")
|
||||
private Object personalityTags;
|
||||
|
||||
@Schema(description = "角色说话风格(如:撒娇型、理性型、活泼型)")
|
||||
@ExcelProperty("角色说话风格(如:撒娇型、理性型、活泼型)")
|
||||
private String speakingStyle;
|
||||
|
||||
@Schema(description = "AI系统Prompt,定义角色核心人设,仅供模型使用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("AI系统Prompt,定义角色核心人设,仅供模型使用")
|
||||
private String systemPrompt;
|
||||
|
||||
@Schema(description = "角色状态:1=上线,0=下线", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("角色状态:1=上线,0=下线")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "角色可见性:1=公开,2=内测,3=隐藏", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("角色可见性:1=公开,2=内测,3=隐藏")
|
||||
private Short visibility;
|
||||
|
||||
@Schema(description = "排序权重,数值越大排序越靠前")
|
||||
@ExcelProperty("排序权重,数值越大排序越靠前")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "角色热度评分,用于推荐排序")
|
||||
@ExcelProperty("角色热度评分,用于推荐排序")
|
||||
private Integer popularityScore;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "开场白")
|
||||
@ExcelProperty("开场白")
|
||||
private String prologue;
|
||||
|
||||
@Schema(description = "开场白音频")
|
||||
@ExcelProperty("开场白音频")
|
||||
private String prologueAudio;
|
||||
|
||||
@Schema(description = "音频Id", example = "4155")
|
||||
@ExcelProperty("音频Id")
|
||||
private String voiceId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.yolo.keyboard.controller.admin.aicompanion.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardAiCompanionSaveReqVO {
|
||||
|
||||
@Schema(description = "陪聊角色唯一ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28180")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "角色头像URL,用于列表页和聊天页", example = "https://www.iocoder.cn")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "角色封面图URL,用于角色详情页", example = "https://www.iocoder.cn")
|
||||
private String coverImageUrl;
|
||||
|
||||
@Schema(description = "角色性别(male / female / other)")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "角色年龄段描述(如:20s、25-30)")
|
||||
private String ageRange;
|
||||
|
||||
@Schema(description = "角色性格标签数组(如:温柔、黏人、治愈)")
|
||||
private Object personalityTags;
|
||||
|
||||
@Schema(description = "角色说话风格(如:撒娇型、理性型、活泼型)")
|
||||
private String speakingStyle;
|
||||
|
||||
@Schema(description = "AI系统Prompt,定义角色核心人设,仅供模型使用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "AI系统Prompt,定义角色核心人设,仅供模型使用不能为空")
|
||||
private String systemPrompt;
|
||||
|
||||
@Schema(description = "角色状态:1=上线,0=下线", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "角色状态:1=上线,0=下线不能为空")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "角色可见性:1=公开,2=内测,3=隐藏", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "角色可见性:1=公开,2=内测,3=隐藏不能为空")
|
||||
private Short visibility;
|
||||
|
||||
@Schema(description = "排序权重,数值越大排序越靠前")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "角色热度评分,用于推荐排序")
|
||||
private Integer popularityScore;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "开场白")
|
||||
private String prologue;
|
||||
|
||||
@Schema(description = "开场白音频")
|
||||
private String prologueAudio;
|
||||
|
||||
@Schema(description = "音频Id", example = "4155")
|
||||
private String voiceId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.appversions;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.appversions.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.appversions.AppVersionsDO;
|
||||
import com.yolo.keyboard.service.appversions.AppVersionsService;
|
||||
|
||||
@Tag(name = "管理后台 - App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/app-versions")
|
||||
@Validated
|
||||
public class AppVersionsController {
|
||||
|
||||
@Resource
|
||||
private AppVersionsService appVersionsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:app-versions:create')")
|
||||
public CommonResult<Long> createAppVersions(@RequestBody AppVersionsSaveReqVO createReqVO) {
|
||||
return success(appVersionsService.createAppVersions(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:app-versions:update')")
|
||||
public CommonResult<Boolean> updateAppVersions(@RequestBody AppVersionsSaveReqVO updateReqVO) {
|
||||
appVersionsService.updateAppVersions(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:app-versions:delete')")
|
||||
public CommonResult<Boolean> deleteAppVersions(@RequestParam("id") Long id) {
|
||||
appVersionsService.deleteAppVersions(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:app-versions:delete')")
|
||||
public CommonResult<Boolean> deleteAppVersionsList(@RequestParam("ids") List<Long> ids) {
|
||||
appVersionsService.deleteAppVersionsListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:app-versions:query')")
|
||||
public CommonResult<AppVersionsRespVO> getAppVersions(@RequestParam("id") Long id) {
|
||||
AppVersionsDO appVersions = appVersionsService.getAppVersions(id);
|
||||
return success(BeanUtils.toBean(appVersions, AppVersionsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:app-versions:query')")
|
||||
public CommonResult<PageResult<AppVersionsRespVO>> getAppVersionsPage(@Valid AppVersionsPageReqVO pageReqVO) {
|
||||
PageResult<AppVersionsDO> pageResult = appVersionsService.getAppVersionsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AppVersionsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:app-versions:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAppVersionsExcel(@Valid AppVersionsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AppVersionsDO> list = appVersionsService.getAppVersionsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。.xls", "数据", AppVersionsRespVO.class,
|
||||
BeanUtils.toBean(list, AppVersionsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yolo.keyboard.controller.admin.appversions.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。分页 Request VO")
|
||||
@Data
|
||||
public class AppVersionsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "应用标识(支持多App/多包名场景);单App可固定为 main。", example = "10064")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "平台:android 或 ios(用 CHECK 约束限制取值)。")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "渠道标识:如 official / huawei / xiaomi / testflight 等,用于区分不同分发包。")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "展示用版本号(语义版本字符串),如 1.2.3。", example = "芋艿")
|
||||
private String versionName;
|
||||
|
||||
@Schema(description = "比较用版本号(整数递增):Android 对应 versionCode;iOS 建议维护同样的递增值以便比较。")
|
||||
private Long versionCode;
|
||||
|
||||
@Schema(description = "iOS 可选构建号(例如 CFBundleVersion),通常为字符串;用于追溯构建或与CI编号对齐。")
|
||||
private String buildNumber;
|
||||
|
||||
@Schema(description = "最低支持版本号(整数):客户端 version_code 低于该值必须更新/可拒绝继续使用。")
|
||||
private Long minSupportedCode;
|
||||
|
||||
@Schema(description = "是否强制更新:当客户端未达到最新版本且此字段为 true,可要求强更(即使 >= min_supported_code)。")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Boolean[] isForceUpdate;
|
||||
|
||||
@Schema(description = "是否生效:true 表示该版本记录可用于对外更新检查;false 用于下架/撤回。")
|
||||
private Boolean isActive;
|
||||
|
||||
@Schema(description = "更新说明(展示给用户的版本更新内容)。")
|
||||
private String releaseNotes;
|
||||
|
||||
@Schema(description = "下载链接:Android 可为 apk 直链/市场 scheme;iOS 通常为 App Store 链接或统一跳转页。", example = "https://www.iocoder.cn")
|
||||
private String downloadUrl;
|
||||
|
||||
@Schema(description = "应用市场/商店页面链接(可选,若 download_url 已覆盖可不填)。", example = "https://www.iocoder.cn")
|
||||
private String storeUrl;
|
||||
|
||||
@Schema(description = "扩展元数据(JSON):如包大小、md5、签名信息、最低系统版本等。")
|
||||
private Object metadata;
|
||||
|
||||
@Schema(description = "发布时间(对外宣布/上线时间),用于展示与排序。")
|
||||
private LocalDateTime releasedAt;
|
||||
|
||||
@Schema(description = "记录创建时间。")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "记录更新时间(建议配合触发器自动维护)。")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.yolo.keyboard.controller.admin.appversions.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AppVersionsRespVO {
|
||||
|
||||
@Schema(description = "主键,自增版本记录ID。", requiredMode = Schema.RequiredMode.REQUIRED, example = "25012")
|
||||
@ExcelProperty("主键,自增版本记录ID。")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "应用标识(支持多App/多包名场景);单App可固定为 main。", requiredMode = Schema.RequiredMode.REQUIRED, example = "10064")
|
||||
@ExcelProperty("应用标识(支持多App/多包名场景);单App可固定为 main。")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "平台:android 或 ios(用 CHECK 约束限制取值)。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("平台:android 或 ios(用 CHECK 约束限制取值)。")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "渠道标识:如 official / huawei / xiaomi / testflight 等,用于区分不同分发包。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("渠道标识:如 official / huawei / xiaomi / testflight 等,用于区分不同分发包。")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "展示用版本号(语义版本字符串),如 1.2.3。", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("展示用版本号(语义版本字符串),如 1.2.3。")
|
||||
private String versionName;
|
||||
|
||||
@Schema(description = "比较用版本号(整数递增):Android 对应 versionCode;iOS 建议维护同样的递增值以便比较。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("比较用版本号(整数递增):Android 对应 versionCode;iOS 建议维护同样的递增值以便比较。")
|
||||
private Long versionCode;
|
||||
|
||||
@Schema(description = "iOS 可选构建号(例如 CFBundleVersion),通常为字符串;用于追溯构建或与CI编号对齐。")
|
||||
@ExcelProperty("iOS 可选构建号(例如 CFBundleVersion),通常为字符串;用于追溯构建或与CI编号对齐。")
|
||||
private String buildNumber;
|
||||
|
||||
@Schema(description = "最低支持版本号(整数):客户端 version_code 低于该值必须更新/可拒绝继续使用。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("最低支持版本号(整数):客户端 version_code 低于该值必须更新/可拒绝继续使用。")
|
||||
private Long minSupportedCode;
|
||||
|
||||
@Schema(description = "是否强制更新:当客户端未达到最新版本且此字段为 true,可要求强更(即使 >= min_supported_code)。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否强制更新:当客户端未达到最新版本且此字段为 true,可要求强更(即使 >= min_supported_code)。")
|
||||
private Boolean isForceUpdate;
|
||||
|
||||
@Schema(description = "是否生效:true 表示该版本记录可用于对外更新检查;false 用于下架/撤回。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否生效:true 表示该版本记录可用于对外更新检查;false 用于下架/撤回。")
|
||||
private Boolean isActive;
|
||||
|
||||
@Schema(description = "更新说明(展示给用户的版本更新内容)。")
|
||||
@ExcelProperty("更新说明(展示给用户的版本更新内容)。")
|
||||
private String releaseNotes;
|
||||
|
||||
@Schema(description = "下载链接:Android 可为 apk 直链/市场 scheme;iOS 通常为 App Store 链接或统一跳转页。", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("下载链接:Android 可为 apk 直链/市场 scheme;iOS 通常为 App Store 链接或统一跳转页。")
|
||||
private String downloadUrl;
|
||||
|
||||
@Schema(description = "应用市场/商店页面链接(可选,若 download_url 已覆盖可不填)。", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("应用市场/商店页面链接(可选,若 download_url 已覆盖可不填)。")
|
||||
private String storeUrl;
|
||||
|
||||
@Schema(description = "扩展元数据(JSON):如包大小、md5、签名信息、最低系统版本等。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("扩展元数据(JSON):如包大小、md5、签名信息、最低系统版本等。")
|
||||
private Object metadata;
|
||||
|
||||
@Schema(description = "发布时间(对外宣布/上线时间),用于展示与排序。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("发布时间(对外宣布/上线时间),用于展示与排序。")
|
||||
private LocalDateTime releasedAt;
|
||||
|
||||
@Schema(description = "记录创建时间。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("记录创建时间。")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "记录更新时间(建议配合触发器自动维护)。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("记录更新时间(建议配合触发器自动维护)。")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.yolo.keyboard.controller.admin.appversions.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppVersionsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键,自增版本记录ID。", requiredMode = Schema.RequiredMode.REQUIRED, example = "25012")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "应用标识(支持多App/多包名场景);单App可固定为 main。", requiredMode = Schema.RequiredMode.REQUIRED, example = "10064")
|
||||
@NotEmpty(message = "应用标识(支持多App/多包名场景);单App可固定为 main。不能为空")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "平台:android 或 ios(用 CHECK 约束限制取值)。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "平台:android 或 ios(用 CHECK 约束限制取值)。不能为空")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "渠道标识:如 official / huawei / xiaomi / testflight 等,用于区分不同分发包。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "渠道标识:如 official / huawei / xiaomi / testflight 等,用于区分不同分发包。不能为空")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "展示用版本号(语义版本字符串),如 1.2.3。", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "展示用版本号(语义版本字符串),如 1.2.3。不能为空")
|
||||
private String versionName;
|
||||
|
||||
@Schema(description = "比较用版本号(整数递增):Android 对应 versionCode;iOS 建议维护同样的递增值以便比较。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "比较用版本号(整数递增):Android 对应 versionCode;iOS 建议维护同样的递增值以便比较。不能为空")
|
||||
private Long versionCode;
|
||||
|
||||
@Schema(description = "iOS 可选构建号(例如 CFBundleVersion),通常为字符串;用于追溯构建或与CI编号对齐。")
|
||||
private String buildNumber;
|
||||
|
||||
@Schema(description = "最低支持版本号(整数):客户端 version_code 低于该值必须更新/可拒绝继续使用。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "最低支持版本号(整数):客户端 version_code 低于该值必须更新/可拒绝继续使用。不能为空")
|
||||
private Long minSupportedCode;
|
||||
|
||||
@Schema(description = "是否强制更新:当客户端未达到最新版本且此字段为 true,可要求强更(即使 >= min_supported_code)。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否强制更新:当客户端未达到最新版本且此字段为 true,可要求强更(即使 >= min_supported_code)。不能为空")
|
||||
private Boolean isForceUpdate;
|
||||
|
||||
@Schema(description = "是否生效:true 表示该版本记录可用于对外更新检查;false 用于下架/撤回。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否生效:true 表示该版本记录可用于对外更新检查;false 用于下架/撤回。不能为空")
|
||||
private Boolean isActive;
|
||||
|
||||
@Schema(description = "更新说明(展示给用户的版本更新内容)。")
|
||||
private String releaseNotes;
|
||||
|
||||
@Schema(description = "下载链接:Android 可为 apk 直链/市场 scheme;iOS 通常为 App Store 链接或统一跳转页。", example = "https://www.iocoder.cn")
|
||||
private String downloadUrl;
|
||||
|
||||
@Schema(description = "应用市场/商店页面链接(可选,若 download_url 已覆盖可不填)。", example = "https://www.iocoder.cn")
|
||||
private String storeUrl;
|
||||
|
||||
@Schema(description = "扩展元数据(JSON):如包大小、md5、签名信息、最低系统版本等。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Object metadata;
|
||||
|
||||
@Schema(description = "发布时间(对外宣布/上线时间),用于展示与排序。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "发布时间(对外宣布/上线时间),用于展示与排序。不能为空")
|
||||
private LocalDateTime releasedAt;
|
||||
|
||||
@Schema(description = "记录创建时间。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "记录更新时间(建议配合触发器自动维护)。", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yolo.keyboard.controller.admin.character;
|
||||
|
||||
import com.yolo.keyboard.dal.dataobject.character.CharacterI18nDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -100,5 +101,56 @@ public class KeyboardCharacterController {
|
||||
ExcelUtils.write(response, "键盘人设.xls", "数据", KeyboardCharacterRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardCharacterRespVO.class));
|
||||
}
|
||||
// ==================== 子表(键盘人设国际化内容) ====================
|
||||
|
||||
@GetMapping("/character-i18n/page")
|
||||
@Operation(summary = "获得键盘人设国际化内容分页")
|
||||
@Parameter(name = "characterId", description = "角色主表id")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:character:query')")
|
||||
public CommonResult<PageResult<CharacterI18nDO>> getCharacterI18nPage(PageParam pageReqVO,
|
||||
@RequestParam("characterId") Long characterId) {
|
||||
return success(characterService.getCharacterI18nPage(pageReqVO, characterId));
|
||||
}
|
||||
|
||||
@PostMapping("/character-i18n/create")
|
||||
@Operation(summary = "创建键盘人设国际化内容")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:character:create')")
|
||||
public CommonResult<Long> createCharacterI18n(@Valid @RequestBody CharacterI18nDO characterI18n) {
|
||||
return success(characterService.createCharacterI18n(characterI18n));
|
||||
}
|
||||
|
||||
@PutMapping("/character-i18n/update")
|
||||
@Operation(summary = "更新键盘人设国际化内容")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:character:update')")
|
||||
public CommonResult<Boolean> updateCharacterI18n(@Valid @RequestBody CharacterI18nDO characterI18n) {
|
||||
characterService.updateCharacterI18n(characterI18n);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/character-i18n/delete")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除键盘人设国际化内容")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:character:delete')")
|
||||
public CommonResult<Boolean> deleteCharacterI18n(@RequestParam("id") Long id) {
|
||||
characterService.deleteCharacterI18n(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/character-i18n/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除键盘人设国际化内容")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:character:delete')")
|
||||
public CommonResult<Boolean> deleteCharacterI18nList(@RequestParam("ids") List<Long> ids) {
|
||||
characterService.deleteCharacterI18nListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/character-i18n/get")
|
||||
@Operation(summary = "获得键盘人设国际化内容")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:character:query')")
|
||||
public CommonResult<CharacterI18nDO> getCharacterI18n(@RequestParam("id") Long id) {
|
||||
return success(characterService.getCharacterI18n(id));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,12 +13,6 @@ import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR
|
||||
@Data
|
||||
public class KeyboardCharacterPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "标题", example = "王五")
|
||||
private String characterName;
|
||||
|
||||
@Schema(description = "背景描述")
|
||||
private String characterBackground;
|
||||
|
||||
@Schema(description = "角色头像", example = "https://www.iocoder.cn")
|
||||
private String avatarUrl;
|
||||
|
||||
|
||||
@@ -16,14 +16,6 @@ public class KeyboardCharacterRespVO {
|
||||
@ExcelProperty("主键 Id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标题", example = "王五")
|
||||
@ExcelProperty("标题")
|
||||
private String characterName;
|
||||
|
||||
@Schema(description = "背景描述")
|
||||
@ExcelProperty("背景描述")
|
||||
private String characterBackground;
|
||||
|
||||
@Schema(description = "角色头像", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("角色头像")
|
||||
private String avatarUrl;
|
||||
|
||||
@@ -14,12 +14,6 @@ public class KeyboardCharacterSaveReqVO {
|
||||
@Schema(description = "主键 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7592")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标题", example = "王五")
|
||||
private String characterName;
|
||||
|
||||
@Schema(description = "背景描述")
|
||||
private String characterBackground;
|
||||
|
||||
@Schema(description = "角色头像", example = "https://www.iocoder.cn")
|
||||
private String avatarUrl;
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.i18nmessage;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.i18nmessage.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.i18nmessage.KeyboardI18nMessageDO;
|
||||
import com.yolo.keyboard.service.i18nmessage.KeyboardI18nMessageService;
|
||||
|
||||
@Tag(name = "管理后台 - 国际化错误提醒配置")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/I18n-message")
|
||||
@Validated
|
||||
public class KeyboardI18nMessageController {
|
||||
|
||||
@Resource
|
||||
private KeyboardI18nMessageService i18nMessageService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建国际化错误提醒配置")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:I18n-message:create')")
|
||||
public CommonResult<Long> createI18nMessage(@Valid @RequestBody KeyboardI18nMessageSaveReqVO createReqVO) {
|
||||
return success(i18nMessageService.createI18nMessage(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新国际化错误提醒配置")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:I18n-message:update')")
|
||||
public CommonResult<Boolean> updateI18nMessage(@Valid @RequestBody KeyboardI18nMessageSaveReqVO updateReqVO) {
|
||||
i18nMessageService.updateI18nMessage(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除国际化错误提醒配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:I18n-message:delete')")
|
||||
public CommonResult<Boolean> deleteI18nMessage(@RequestParam("id") Long id) {
|
||||
i18nMessageService.deleteI18nMessage(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除国际化错误提醒配置")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:I18n-message:delete')")
|
||||
public CommonResult<Boolean> deleteI18nMessageList(@RequestParam("ids") List<Long> ids) {
|
||||
i18nMessageService.deleteI18nMessageListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得国际化错误提醒配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:I18n-message:query')")
|
||||
public CommonResult<KeyboardI18nMessageRespVO> getI18nMessage(@RequestParam("id") Long id) {
|
||||
KeyboardI18nMessageDO i18nMessage = i18nMessageService.getI18nMessage(id);
|
||||
return success(BeanUtils.toBean(i18nMessage, KeyboardI18nMessageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得国际化错误提醒配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:I18n-message:query')")
|
||||
public CommonResult<PageResult<KeyboardI18nMessageRespVO>> getI18nMessagePage(@Valid KeyboardI18nMessagePageReqVO pageReqVO) {
|
||||
PageResult<KeyboardI18nMessageDO> pageResult = i18nMessageService.getI18nMessagePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardI18nMessageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出国际化错误提醒配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:I18n-message:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportI18nMessageExcel(@Valid KeyboardI18nMessagePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardI18nMessageDO> list = i18nMessageService.getI18nMessagePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "国际化错误提醒配置.xls", "数据", KeyboardI18nMessageRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardI18nMessageRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yolo.keyboard.controller.admin.i18nmessage.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 国际化错误提醒配置分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardI18nMessagePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "错误代码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "地区")
|
||||
private String locale;
|
||||
|
||||
@Schema(description = "错误提醒")
|
||||
private String message;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yolo.keyboard.controller.admin.i18nmessage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 国际化错误提醒配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardI18nMessageRespVO {
|
||||
|
||||
@Schema(description = "主键 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18823")
|
||||
@ExcelProperty("主键 id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "错误代码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("错误代码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "地区", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("地区")
|
||||
private String locale;
|
||||
|
||||
@Schema(description = "错误提醒", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("错误提醒")
|
||||
private String message;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yolo.keyboard.controller.admin.i18nmessage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 国际化错误提醒配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardI18nMessageSaveReqVO {
|
||||
|
||||
@Schema(description = "主键 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18823")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "错误代码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "错误代码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "地区", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "地区不能为空")
|
||||
private String locale;
|
||||
|
||||
@Schema(description = "错误提醒", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "错误提醒不能为空")
|
||||
private String message;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.productitems;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.productitems.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.productitems.KeyboardProductItemsDO;
|
||||
import com.yolo.keyboard.service.productitems.KeyboardProductItemsService;
|
||||
|
||||
@Tag(name = "管理后台 - 内购商品")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/product-items")
|
||||
@Validated
|
||||
public class KeyboardProductItemsController {
|
||||
|
||||
@Resource
|
||||
private KeyboardProductItemsService productItemsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建内购商品")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:product-items:create')")
|
||||
public CommonResult<Long> createProductItems(@Valid @RequestBody KeyboardProductItemsSaveReqVO createReqVO) {
|
||||
return success(productItemsService.createProductItems(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新内购商品")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:product-items:update')")
|
||||
public CommonResult<Boolean> updateProductItems(@Valid @RequestBody KeyboardProductItemsSaveReqVO updateReqVO) {
|
||||
productItemsService.updateProductItems(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除内购商品")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:product-items:delete')")
|
||||
public CommonResult<Boolean> deleteProductItems(@RequestParam("id") Long id) {
|
||||
productItemsService.deleteProductItems(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除内购商品")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:product-items:delete')")
|
||||
public CommonResult<Boolean> deleteProductItemsList(@RequestParam("ids") List<Long> ids) {
|
||||
productItemsService.deleteProductItemsListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得内购商品")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:product-items:query')")
|
||||
public CommonResult<KeyboardProductItemsRespVO> getProductItems(@RequestParam("id") Long id) {
|
||||
KeyboardProductItemsDO productItems = productItemsService.getProductItems(id);
|
||||
return success(BeanUtils.toBean(productItems, KeyboardProductItemsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得内购商品分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:product-items:query')")
|
||||
public CommonResult<PageResult<KeyboardProductItemsRespVO>> getProductItemsPage(@Valid KeyboardProductItemsPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardProductItemsDO> pageResult = productItemsService.getProductItemsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardProductItemsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出内购商品 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:product-items:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProductItemsExcel(@Valid KeyboardProductItemsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardProductItemsDO> list = productItemsService.getProductItemsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "内购商品.xls", "数据", KeyboardProductItemsRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardProductItemsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.yolo.keyboard.controller.admin.productitems.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 内购商品分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardProductItemsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "产品标识符,唯一标识每个产品(如 com.loveKey.nyx.2month)", example = "15153")
|
||||
private String productId;
|
||||
|
||||
@Schema(description = "产品类型,区分订阅(subscription)和内购(in-app-purchase)", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "产品名称(如 100, 2)", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "产品单位(如 金币,个月)")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "订阅时长的数值部分(如 2)")
|
||||
private Integer durationValue;
|
||||
|
||||
@Schema(description = "订阅时长的单位部分(如 月,天)")
|
||||
private String durationUnit;
|
||||
|
||||
@Schema(description = "产品价格", example = "25376")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "产品的货币单位,如美元($)")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "产品的描述,提供更多细节信息", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "产品项的创建时间,默认当前时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "产品项的最后更新时间,更新时自动设置为当前时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "订阅时长的具体天数")
|
||||
private Integer durationDays;
|
||||
|
||||
@Schema(description = "订阅等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "平台")
|
||||
private String platform;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.yolo.keyboard.controller.admin.productitems.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 内购商品 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardProductItemsRespVO {
|
||||
|
||||
@Schema(description = "主键,自增,唯一标识每个产品项", requiredMode = Schema.RequiredMode.REQUIRED, example = "7855")
|
||||
@ExcelProperty("主键,自增,唯一标识每个产品项")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品标识符,唯一标识每个产品(如 com.loveKey.nyx.2month)", requiredMode = Schema.RequiredMode.REQUIRED, example = "15153")
|
||||
@ExcelProperty("产品标识符,唯一标识每个产品(如 com.loveKey.nyx.2month)")
|
||||
private String productId;
|
||||
|
||||
@Schema(description = "产品类型,区分订阅(subscription)和内购(in-app-purchase)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("产品类型,区分订阅(subscription)和内购(in-app-purchase)")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "产品名称(如 100, 2)", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("产品名称(如 100, 2)")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "产品单位(如 金币,个月)")
|
||||
@ExcelProperty("产品单位(如 金币,个月)")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "订阅时长的数值部分(如 2)")
|
||||
@ExcelProperty("订阅时长的数值部分(如 2)")
|
||||
private Integer durationValue;
|
||||
|
||||
@Schema(description = "订阅时长的单位部分(如 月,天)")
|
||||
@ExcelProperty("订阅时长的单位部分(如 月,天)")
|
||||
private String durationUnit;
|
||||
|
||||
@Schema(description = "产品价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "25376")
|
||||
@ExcelProperty("产品价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "产品的货币单位,如美元($)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品的货币单位,如美元($)")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "产品的描述,提供更多细节信息", example = "你说的对")
|
||||
@ExcelProperty("产品的描述,提供更多细节信息")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "产品项的创建时间,默认当前时间")
|
||||
@ExcelProperty("产品项的创建时间,默认当前时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "产品项的最后更新时间,更新时自动设置为当前时间")
|
||||
@ExcelProperty("产品项的最后更新时间,更新时自动设置为当前时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "订阅时长的具体天数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("订阅时长的具体天数")
|
||||
private Integer durationDays;
|
||||
|
||||
@Schema(description = "订阅等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "平台")
|
||||
private String platform;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yolo.keyboard.controller.admin.productitems.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 内购商品新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardProductItemsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键,自增,唯一标识每个产品项", requiredMode = Schema.RequiredMode.REQUIRED, example = "7855")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品标识符,唯一标识每个产品(如 com.loveKey.nyx.2month)", requiredMode = Schema.RequiredMode.REQUIRED, example = "15153")
|
||||
@NotEmpty(message = "产品标识符,唯一标识每个产品(如 com.loveKey.nyx.2month)不能为空")
|
||||
private String productId;
|
||||
|
||||
@Schema(description = "产品类型,区分订阅(subscription)和内购(in-app-purchase)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "产品类型,区分订阅(subscription)和内购(in-app-purchase)不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "产品名称(如 100, 2)", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "产品名称(如 100, 2)不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "产品单位(如 金币,个月)")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "订阅时长的数值部分(如 2)")
|
||||
private Integer durationValue;
|
||||
|
||||
@Schema(description = "订阅时长的单位部分(如 月,天)")
|
||||
private String durationUnit;
|
||||
|
||||
@Schema(description = "产品价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "25376")
|
||||
@NotNull(message = "产品价格不能为空")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "产品的货币单位,如美元($)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "产品的货币单位,如美元($)不能为空")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "产品的描述,提供更多细节信息", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "产品项的创建时间,默认当前时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "产品项的最后更新时间,更新时自动设置为当前时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "订阅时长的具体天数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "订阅时长的具体天数不能为空")
|
||||
private Integer durationDays;
|
||||
|
||||
@Schema(description = "订阅等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "平台")
|
||||
private String platform;
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.yolo.keyboard.controller.admin.tag;
|
||||
|
||||
import com.yolo.keyboard.dal.dataobject.tag.TagI18nDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.tag.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.tag.KeyboardTagDO;
|
||||
import com.yolo.keyboard.service.tag.KeyboardTagService;
|
||||
|
||||
@Tag(name = "管理后台 - 人设标签")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/tag")
|
||||
@Validated
|
||||
public class KeyboardTagController {
|
||||
|
||||
@Resource
|
||||
private KeyboardTagService tagService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建人设标签")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:create')")
|
||||
public CommonResult<Integer> createTag(@Valid @RequestBody KeyboardTagSaveReqVO createReqVO) {
|
||||
return success(tagService.createTag(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新人设标签")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:update')")
|
||||
public CommonResult<Boolean> updateTag(@Valid @RequestBody KeyboardTagSaveReqVO updateReqVO) {
|
||||
tagService.updateTag(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除人设标签")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:delete')")
|
||||
public CommonResult<Boolean> deleteTag(@RequestParam("id") Integer id) {
|
||||
tagService.deleteTag(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除人设标签")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:delete')")
|
||||
public CommonResult<Boolean> deleteTagList(@RequestParam("ids") List<Integer> ids) {
|
||||
tagService.deleteTagListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得人设标签")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:query')")
|
||||
public CommonResult<KeyboardTagRespVO> getTag(@RequestParam("id") Integer id) {
|
||||
KeyboardTagDO tag = tagService.getTag(id);
|
||||
return success(BeanUtils.toBean(tag, KeyboardTagRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得人设标签分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:query')")
|
||||
public CommonResult<PageResult<KeyboardTagRespVO>> getTagPage(@Valid KeyboardTagPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardTagDO> pageResult = tagService.getTagPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardTagRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出人设标签 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTagExcel(@Valid KeyboardTagPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardTagDO> list = tagService.getTagPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "人设标签.xls", "数据", KeyboardTagRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardTagRespVO.class));
|
||||
}
|
||||
// ==================== 子表(人设标签国际化) ====================
|
||||
|
||||
@GetMapping("/tag-i18n/page")
|
||||
@Operation(summary = "获得人设标签国际化分页")
|
||||
@Parameter(name = "tagId", description = "标签主表ID,对应 keyboard_tag.id")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:query')")
|
||||
public CommonResult<PageResult<TagI18nDO>> getTagI18nPage(PageParam pageReqVO,
|
||||
@RequestParam("tagId") Integer tagId) {
|
||||
return success(tagService.getTagI18nPage(pageReqVO, tagId));
|
||||
}
|
||||
|
||||
@PostMapping("/tag-i18n/create")
|
||||
@Operation(summary = "创建人设标签国际化")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:create')")
|
||||
public CommonResult<Long> createTagI18n(@Valid @RequestBody TagI18nDO tagI18n) {
|
||||
return success(tagService.createTagI18n(tagI18n));
|
||||
}
|
||||
|
||||
@PutMapping("/tag-i18n/update")
|
||||
@Operation(summary = "更新人设标签国际化")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:update')")
|
||||
public CommonResult<Boolean> updateTagI18n(@Valid @RequestBody TagI18nDO tagI18n) {
|
||||
tagService.updateTagI18n(tagI18n);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/tag-i18n/delete")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除人设标签国际化")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:delete')")
|
||||
public CommonResult<Boolean> deleteTagI18n(@RequestParam("id") Long id) {
|
||||
tagService.deleteTagI18n(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/tag-i18n/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除人设标签国际化")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:delete')")
|
||||
public CommonResult<Boolean> deleteTagI18nList(@RequestParam("ids") List<Long> ids) {
|
||||
tagService.deleteTagI18nListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/tag-i18n/get")
|
||||
@Operation(summary = "获得人设标签国际化")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tag:query')")
|
||||
public CommonResult<TagI18nDO> getTagI18n(@RequestParam("id") Long id) {
|
||||
return success(tagService.getTagI18n(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yolo.keyboard.controller.admin.tag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 人设标签分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardTagPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "标签名", example = "王五")
|
||||
private String tagName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yolo.keyboard.controller.admin.tag.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 人设标签 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardTagRespVO {
|
||||
|
||||
@Schema(description = "主键 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20413")
|
||||
@ExcelProperty("主键 Id")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "标签名", example = "王五")
|
||||
@ExcelProperty("标签名")
|
||||
private String tagName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yolo.keyboard.controller.admin.tag.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 人设标签新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardTagSaveReqVO {
|
||||
|
||||
@Schema(description = "主键 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20413")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "标签名", example = "王五")
|
||||
private String tagName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantbalance;
|
||||
|
||||
import com.yolo.keyboard.dal.dataobject.tenantbalancetransaction.TenantBalanceTransactionDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.tenantbalance.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.tenantbalance.TenantBalanceDO;
|
||||
import com.yolo.keyboard.service.tenantbalance.TenantBalanceService;
|
||||
|
||||
@Tag(name = "管理后台 - 租户余额")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/tenant-balance")
|
||||
@Validated
|
||||
public class TenantBalanceController {
|
||||
|
||||
@Resource
|
||||
private TenantBalanceService tenantBalanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:create')")
|
||||
public CommonResult<Long> createTenantBalance(@Valid @RequestBody TenantBalanceSaveReqVO createReqVO) {
|
||||
return success(tenantBalanceService.createTenantBalance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:update')")
|
||||
public CommonResult<Boolean> updateTenantBalance(@Valid @RequestBody TenantBalanceSaveReqVO updateReqVO) {
|
||||
tenantBalanceService.updateTenantBalance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除租户余额")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:delete')")
|
||||
public CommonResult<Boolean> deleteTenantBalance(@RequestParam("id") Long id) {
|
||||
tenantBalanceService.deleteTenantBalance(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:delete')")
|
||||
public CommonResult<Boolean> deleteTenantBalanceList(@RequestParam("ids") List<Long> ids) {
|
||||
tenantBalanceService.deleteTenantBalanceListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得租户余额")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:query')")
|
||||
public CommonResult<TenantBalanceRespVO> getTenantBalance(@RequestParam("id") Long id) {
|
||||
TenantBalanceDO tenantBalance = tenantBalanceService.getTenantBalance(id);
|
||||
return success(BeanUtils.toBean(tenantBalance, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得租户余额分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:query')")
|
||||
public CommonResult<PageResult<TenantBalanceRespVO>> getTenantBalancePage(@Valid TenantBalancePageReqVO pageReqVO) {
|
||||
PageResult<TenantBalanceDO> pageResult = tenantBalanceService.getTenantBalancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出租户余额 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTenantBalanceExcel(@Valid TenantBalancePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TenantBalanceDO> list = tenantBalanceService.getTenantBalancePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "租户余额.xls", "数据", TenantBalanceRespVO.class,
|
||||
BeanUtils.toBean(list, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/addAmount")
|
||||
@Operation(summary = "添加租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:add')")
|
||||
public CommonResult<Boolean> addTenantBalance(@Valid @RequestBody TenantBalanceAddReqVO addReqVO) {
|
||||
tenantBalanceService.addTenantBalance(addReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-self-amount")
|
||||
@Operation(summary = "获得自己的余额")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:self-amount')")
|
||||
public CommonResult<TenantBalanceRespVO> getTenantBalance() {
|
||||
TenantBalanceDO tenantBalance = tenantBalanceService.getSelfBalance();
|
||||
return success(BeanUtils.toBean(tenantBalance, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/get-self-subordinate-amount-page")
|
||||
@Operation(summary = "获得自己下级余额的分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:self-subordinate')")
|
||||
public CommonResult<PageResult<TenantBalanceRespVO>> getSelfSubordinate(@Valid TenantBalancePageReqVO pageReqVO) {
|
||||
PageResult<TenantBalanceRespVO> tenantBalancePage = tenantBalanceService.getSelfSubordinateTenantBalancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(tenantBalancePage, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/withdraw")
|
||||
@Operation(summary = "租户提现")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:withdraw')")
|
||||
public CommonResult<Boolean> withdraw(@Valid @RequestBody TenantBalanceWithdrawReqVO withdrawReqVO) {
|
||||
tenantBalanceService.withdraw(withdrawReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
// ==================== 子表(租户积分记录) ====================
|
||||
|
||||
@GetMapping("/tenant-balance-transaction/page")
|
||||
@Operation(summary = "获得租户积分记录分页")
|
||||
@Parameter(name = "tenantId", description = "租户 Id")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:query')")
|
||||
public CommonResult<PageResult<TenantBalanceTransactionRespVO>> getTenantBalanceTransactionPage(PageParam pageReqVO,
|
||||
@RequestParam("tenantId") Long tenantId) {
|
||||
PageResult<TenantBalanceTransactionDO> pageResult = tenantBalanceService.getTenantBalanceTransactionPage(pageReqVO, tenantId);
|
||||
return success(BeanUtils.toBean(pageResult, TenantBalanceTransactionRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/tenant-balance-transaction/create")
|
||||
@Operation(summary = "创建租户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:create')")
|
||||
public CommonResult<Long> createTenantBalanceTransaction(@Valid @RequestBody TenantBalanceTransactionDO tenantBalanceTransaction) {
|
||||
return success(tenantBalanceService.createTenantBalanceTransaction(tenantBalanceTransaction));
|
||||
}
|
||||
|
||||
@PutMapping("/tenant-balance-transaction/update")
|
||||
@Operation(summary = "更新租户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:update')")
|
||||
public CommonResult<Boolean> updateTenantBalanceTransaction(@Valid @RequestBody TenantBalanceTransactionDO tenantBalanceTransaction) {
|
||||
tenantBalanceService.updateTenantBalanceTransaction(tenantBalanceTransaction);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/tenant-balance-transaction/delete")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除租户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:delete')")
|
||||
public CommonResult<Boolean> deleteTenantBalanceTransaction(@RequestParam("id") Long id) {
|
||||
tenantBalanceService.deleteTenantBalanceTransaction(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/tenant-balance-transaction/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除租户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:delete')")
|
||||
public CommonResult<Boolean> deleteTenantBalanceTransactionList(@RequestParam("ids") List<Long> ids) {
|
||||
tenantBalanceService.deleteTenantBalanceTransactionListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/tenant-balance-transaction/get")
|
||||
@Operation(summary = "获得租户积分记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-balance:query')")
|
||||
public CommonResult<TenantBalanceTransactionRespVO> getTenantBalanceTransaction(@RequestParam("id") Long id) {
|
||||
TenantBalanceTransactionDO transaction = tenantBalanceService.getTenantBalanceTransaction(id);
|
||||
return success(BeanUtils.toBean(transaction, TenantBalanceTransactionRespVO.class));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/19 21:05
|
||||
*/
|
||||
@Schema(description = "管理后台 - 租户余额添加VO")
|
||||
@Data
|
||||
public class TenantBalanceAddReqVO {
|
||||
@Schema(description = "租户 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19954")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "增加的余额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000000")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "备注", example = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantbalance.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 租户余额分页 Request VO")
|
||||
@Data
|
||||
public class TenantBalancePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "当前积分余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "乐观锁版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
|
||||
@Schema(description = "冻结金额")
|
||||
private BigDecimal frozenAmt;
|
||||
|
||||
@Schema(description = "可提现金额")
|
||||
private BigDecimal withdrawableBalance;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 租户余额 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TenantBalanceRespVO {
|
||||
|
||||
@Schema(description = "租户 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13447")
|
||||
@ExcelProperty("租户 Id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "当前积分余额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("当前积分余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "乐观锁版本号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("乐观锁版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "冻结金额")
|
||||
private BigDecimal frozenAmt;
|
||||
|
||||
@Schema(description = "可提现金额")
|
||||
private BigDecimal withdrawableBalance;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户余额新增/修改 Request VO")
|
||||
@Data
|
||||
public class TenantBalanceSaveReqVO {
|
||||
|
||||
@Schema(description = "租户 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13447")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "当前积分余额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "当前积分余额不能为空")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "乐观锁版本号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "乐观锁版本号不能为空")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "更新时间不能为空")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "冻结金额")
|
||||
private BigDecimal frozenAmt;
|
||||
|
||||
@Schema(description = "可提现金额")
|
||||
private BigDecimal withdrawableBalance;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户积分记录 Response VO")
|
||||
@Data
|
||||
public class TenantBalanceTransactionRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "本次变动点数,正加负减", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal points;
|
||||
|
||||
@Schema(description = "变动后余额快照", example = "1000.00")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "变动后冻结金额快照", example = "200.00")
|
||||
private BigDecimal frozenAmt;
|
||||
|
||||
@Schema(description = "变动后可提现余额快照", example = "800.00")
|
||||
private BigDecimal withdrawableBalance;
|
||||
|
||||
@Schema(description = "变动类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "RECHARGE")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "变动描述", example = "余额充值")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "订单Id/业务单号", example = "ORD123456")
|
||||
private String orderId;
|
||||
|
||||
@Schema(description = "业务流水号", example = "BIZ123456")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "操作人Id", example = "1")
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "备注", example = "管理员充值")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "租户Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 管理后台 - 租户余额提现 Request VO
|
||||
*/
|
||||
@Schema(description = "管理后台 - 租户余额提现 Request VO")
|
||||
@Data
|
||||
public class TenantBalanceWithdrawReqVO {
|
||||
|
||||
@Schema(description = "提现金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
|
||||
@NotNull(message = "提现金额不能为空")
|
||||
@DecimalMin(value = "0.01", message = "提现金额必须大于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "打款渠道:BANK/ALIPAY/WECHAT", requiredMode = Schema.RequiredMode.REQUIRED, example = "BANK")
|
||||
@NotEmpty(message = "打款渠道不能为空")
|
||||
private String payChannel;
|
||||
|
||||
@Schema(description = "收款方类型:PERSON(个人)/COMPANY(企业)", requiredMode = Schema.RequiredMode.REQUIRED, example = "PERSON")
|
||||
@NotEmpty(message = "收款方类型不能为空")
|
||||
private String payeeType;
|
||||
|
||||
@Schema(description = "收款人姓名或公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "收款人姓名不能为空")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "收款账号(银行卡/支付宝等)", requiredMode = Schema.RequiredMode.REQUIRED, example = "6222021234567890123")
|
||||
@NotEmpty(message = "收款账号不能为空")
|
||||
private String payeeAccount;
|
||||
|
||||
@Schema(description = "收款银行名称(银行渠道必填)", example = "中国工商银行")
|
||||
private String payeeBankName;
|
||||
|
||||
@Schema(description = "银行编码", example = "ICBC")
|
||||
private String payeeBankCode;
|
||||
|
||||
@Schema(description = "银行支行名称", example = "北京分行朝阳支行")
|
||||
private String payeeBankBranch;
|
||||
|
||||
@Schema(description = "备注", example = "提现备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantcommission;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.tenantcommission.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.tenantcommission.KeyboardTenantCommissionDO;
|
||||
import com.yolo.keyboard.service.tenantcommission.KeyboardTenantCommissionService;
|
||||
|
||||
@Tag(name = "管理后台 - 租户内购分成记录")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/tenant-commission")
|
||||
@Validated
|
||||
public class KeyboardTenantCommissionController {
|
||||
|
||||
@Resource
|
||||
private KeyboardTenantCommissionService tenantCommissionService;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建租户内购分成记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-commission:create')")
|
||||
public CommonResult<Long> createTenantCommission(@Valid @RequestBody KeyboardTenantCommissionSaveReqVO createReqVO) {
|
||||
|
||||
return success(tenantCommissionService.createTenantCommission(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新租户内购分成记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-commission:update')")
|
||||
public CommonResult<Boolean> updateTenantCommission(@Valid @RequestBody KeyboardTenantCommissionSaveReqVO updateReqVO) {
|
||||
tenantCommissionService.updateTenantCommission(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除租户内购分成记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-commission:delete')")
|
||||
public CommonResult<Boolean> deleteTenantCommission(@RequestParam("id") Long id) {
|
||||
tenantCommissionService.deleteTenantCommission(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除租户内购分成记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-commission:delete')")
|
||||
public CommonResult<Boolean> deleteTenantCommissionList(@RequestParam("ids") List<Long> ids) {
|
||||
tenantCommissionService.deleteTenantCommissionListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得租户内购分成记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-commission:query')")
|
||||
public CommonResult<KeyboardTenantCommissionRespVO> getTenantCommission(@RequestParam("id") Long id) {
|
||||
KeyboardTenantCommissionDO tenantCommission = tenantCommissionService.getTenantCommission(id);
|
||||
return success(BeanUtils.toBean(tenantCommission, KeyboardTenantCommissionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得租户内购分成记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-commission:query')")
|
||||
public CommonResult<PageResult<KeyboardTenantCommissionRespVO>> getTenantCommissionPage(@Valid KeyboardTenantCommissionPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardTenantCommissionDO> pageResult = tenantCommissionService.getTenantCommissionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardTenantCommissionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出租户内购分成记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-commission:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTenantCommissionExcel(@Valid KeyboardTenantCommissionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardTenantCommissionDO> list = tenantCommissionService.getTenantCommissionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "租户内购分成记录.xls", "数据", KeyboardTenantCommissionRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardTenantCommissionRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantcommission.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 租户内购分成记录分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardTenantCommissionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "租户ID", example = "1", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "内购记录ID", example = "20900")
|
||||
private Integer purchaseRecordId;
|
||||
|
||||
@Schema(description = "内购交易ID", example = "30383")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "被邀请用户ID(购买用户)", example = "2447")
|
||||
private Integer inviteeUserId;
|
||||
|
||||
@Schema(description = "邀请人用户ID", example = "1012")
|
||||
private Long inviterUserId;
|
||||
|
||||
@Schema(description = "内购金额")
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
@Schema(description = "分成比例")
|
||||
private BigDecimal commissionRate;
|
||||
|
||||
@Schema(description = "分成金额")
|
||||
private BigDecimal commissionAmount;
|
||||
|
||||
@Schema(description = "状态:PENDING-待结算,SETTLED-已结算,REFUNDED-已退款", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "内购时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] purchaseTime;
|
||||
|
||||
@Schema(description = "结算时间")
|
||||
private LocalDateTime settledAt;
|
||||
|
||||
@Schema(description = "关联的余额交易记录ID", example = "29131")
|
||||
private Long balanceTransactionId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantcommission.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 租户内购分成记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardTenantCommissionRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3144")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "内购记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20900")
|
||||
@ExcelProperty("内购记录ID")
|
||||
private Integer purchaseRecordId;
|
||||
|
||||
@Schema(description = "内购交易ID", example = "30383")
|
||||
@ExcelProperty("内购交易ID")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "被邀请用户ID(购买用户)", example = "2447")
|
||||
@ExcelProperty("被邀请用户ID(购买用户)")
|
||||
private Integer inviteeUserId;
|
||||
|
||||
@Schema(description = "邀请人用户ID", example = "1012")
|
||||
@ExcelProperty("邀请人用户ID")
|
||||
private Long inviterUserId;
|
||||
|
||||
@Schema(description = "内购金额")
|
||||
@ExcelProperty("内购金额")
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
@Schema(description = "分成比例")
|
||||
@ExcelProperty("分成比例")
|
||||
private BigDecimal commissionRate;
|
||||
|
||||
@Schema(description = "分成金额")
|
||||
@ExcelProperty("分成金额")
|
||||
private BigDecimal commissionAmount;
|
||||
|
||||
@Schema(description = "状态:PENDING-待结算,SETTLED-已结算,REFUNDED-已退款", example = "2")
|
||||
@ExcelProperty("状态:PENDING-待结算,SETTLED-已结算,REFUNDED-已退款")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "内购时间")
|
||||
@ExcelProperty("内购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@Schema(description = "结算时间")
|
||||
@ExcelProperty("结算时间")
|
||||
private LocalDateTime settledAt;
|
||||
|
||||
@Schema(description = "关联的余额交易记录ID", example = "29131")
|
||||
@ExcelProperty("关联的余额交易记录ID")
|
||||
private Long balanceTransactionId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantcommission.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户内购分成记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardTenantCommissionSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3144")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "内购记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20900")
|
||||
@NotNull(message = "内购记录ID不能为空")
|
||||
private Integer purchaseRecordId;
|
||||
|
||||
@Schema(description = "内购交易ID", example = "30383")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "被邀请用户ID(购买用户)", example = "2447")
|
||||
private Integer inviteeUserId;
|
||||
|
||||
@Schema(description = "邀请人用户ID", example = "1012")
|
||||
private Long inviterUserId;
|
||||
|
||||
@Schema(description = "内购金额")
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
@Schema(description = "分成比例")
|
||||
private BigDecimal commissionRate;
|
||||
|
||||
@Schema(description = "分成金额")
|
||||
private BigDecimal commissionAmount;
|
||||
|
||||
@Schema(description = "状态:PENDING-待结算,SETTLED-已结算,REFUNDED-已退款", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "内购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@Schema(description = "结算时间")
|
||||
private LocalDateTime settledAt;
|
||||
|
||||
@Schema(description = "关联的余额交易记录ID", example = "29131")
|
||||
private Long balanceTransactionId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantwithdraworder;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.tenantwithdraworder.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.tenantwithdraworder.KeyboardTenantWithdrawOrderDO;
|
||||
import com.yolo.keyboard.service.tenantwithdraworder.KeyboardTenantWithdrawOrderService;
|
||||
|
||||
@Tag(name = "管理后台 - 租户提现订单表(申请-审核-打款-完成/失败)")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/tenant-withdraw-order")
|
||||
@Validated
|
||||
public class KeyboardTenantWithdrawOrderController {
|
||||
|
||||
@Resource
|
||||
private KeyboardTenantWithdrawOrderService tenantWithdrawOrderService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建租户提现订单表(申请-审核-打款-完成/失败)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-withdraw-order:create')")
|
||||
public CommonResult<Long> createTenantWithdrawOrder(@Valid @RequestBody KeyboardTenantWithdrawOrderSaveReqVO createReqVO) {
|
||||
return success(tenantWithdrawOrderService.createTenantWithdrawOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新租户提现订单表(申请-审核-打款-完成/失败)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-withdraw-order:update')")
|
||||
public CommonResult<Boolean> updateTenantWithdrawOrder(@Valid @RequestBody KeyboardTenantWithdrawOrderSaveReqVO updateReqVO) {
|
||||
tenantWithdrawOrderService.updateTenantWithdrawOrder(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除租户提现订单表(申请-审核-打款-完成/失败)")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-withdraw-order:delete')")
|
||||
public CommonResult<Boolean> deleteTenantWithdrawOrder(@RequestParam("id") Long id) {
|
||||
tenantWithdrawOrderService.deleteTenantWithdrawOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除租户提现订单表(申请-审核-打款-完成/失败)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-withdraw-order:delete')")
|
||||
public CommonResult<Boolean> deleteTenantWithdrawOrderList(@RequestParam("ids") List<Long> ids) {
|
||||
tenantWithdrawOrderService.deleteTenantWithdrawOrderListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得租户提现订单表(申请-审核-打款-完成/失败)")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-withdraw-order:query')")
|
||||
public CommonResult<KeyboardTenantWithdrawOrderRespVO> getTenantWithdrawOrder(@RequestParam("id") Long id) {
|
||||
KeyboardTenantWithdrawOrderDO tenantWithdrawOrder = tenantWithdrawOrderService.getTenantWithdrawOrder(id);
|
||||
return success(BeanUtils.toBean(tenantWithdrawOrder, KeyboardTenantWithdrawOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得租户提现订单表(申请-审核-打款-完成/失败)分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-withdraw-order:query')")
|
||||
public CommonResult<PageResult<KeyboardTenantWithdrawOrderRespVO>> getTenantWithdrawOrderPage(@Valid KeyboardTenantWithdrawOrderPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardTenantWithdrawOrderRespVO> pageResult = tenantWithdrawOrderService.getTenantWithdrawOrderPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出租户提现订单表(申请-审核-打款-完成/失败) Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:tenant-withdraw-order:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTenantWithdrawOrderExcel(@Valid KeyboardTenantWithdrawOrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardTenantWithdrawOrderRespVO> list = tenantWithdrawOrderService.getTenantWithdrawOrderPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "租户提现订单表(申请-审核-打款-完成/失败).xls", "数据", KeyboardTenantWithdrawOrderRespVO.class, list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantwithdraworder.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 租户提现订单表(申请-审核-打款-完成/失败)分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardTenantWithdrawOrderPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "提现单号(业务唯一)")
|
||||
private String withdrawNo;
|
||||
|
||||
@Schema(description = "业务幂等号(防重复提交)")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "币种(默认 CNY)")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "提现申请金额(单位:分)")
|
||||
private Long amount;
|
||||
|
||||
@Schema(description = "手续费金额(单位:分)")
|
||||
private Long feeAmount;
|
||||
|
||||
@Schema(description = "实际到账金额(单位:分 = amount - fee_amount)")
|
||||
private Long actualAmount;
|
||||
|
||||
@Schema(description = "打款渠道:BANK/ALIPAY/WECHAT/PAYPAL 等")
|
||||
private String payChannel;
|
||||
|
||||
@Schema(description = "收款方类型:PERSON(个人)/COMPANY(企业)", example = "1")
|
||||
private String payeeType;
|
||||
|
||||
@Schema(description = "收款人姓名或公司名称(快照)", example = "张三")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "收款账号(银行卡/支付宝等,建议加密或脱敏)", example = "5425")
|
||||
private String payeeAccount;
|
||||
|
||||
@Schema(description = "收款银行名称", example = "芋艿")
|
||||
private String payeeBankName;
|
||||
|
||||
@Schema(description = "银行编码(可选)")
|
||||
private String payeeBankCode;
|
||||
|
||||
@Schema(description = "银行支行名称(可选)")
|
||||
private String payeeBankBranch;
|
||||
|
||||
@Schema(description = "提现状态:APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "审核状态:PENDING/PASSED/REJECTED", example = "1")
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "拒绝原因或打款失败原因", example = "不香")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "提现申请时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] applyTime;
|
||||
|
||||
@Schema(description = "审核完成时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] auditTime;
|
||||
|
||||
@Schema(description = "发起打款时间(请求第三方)")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] payTime;
|
||||
|
||||
@Schema(description = "打款成功时间(第三方确认)")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] paidTime;
|
||||
|
||||
@Schema(description = "业务终态时间(成功/失败/取消)")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] finishTime;
|
||||
|
||||
@Schema(description = "打款批次号(内部使用)")
|
||||
private String payerBatchNo;
|
||||
|
||||
@Schema(description = "第三方打款交易号/流水号(对账用)")
|
||||
private String channelTradeNo;
|
||||
|
||||
@Schema(description = "第三方返回的原始报文(用于排查)")
|
||||
private Object channelRaw;
|
||||
|
||||
@Schema(description = "关联余额流水ID(冻结/扣减/返还)", example = "30641")
|
||||
private Long balanceTxnId;
|
||||
|
||||
@Schema(description = "乐观锁版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "提现申请人ID", example = "6858")
|
||||
private Long creatorId;
|
||||
|
||||
@Schema(description = "审核人ID", example = "15039")
|
||||
private Long auditorId;
|
||||
|
||||
@Schema(description = "打款操作人ID", example = "8850")
|
||||
private Long payerId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "租户ID列表(用于下级租户过滤)", hidden = true)
|
||||
private List<Long> tenantIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantwithdraworder.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 租户提现订单表(申请-审核-打款-完成/失败) Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardTenantWithdrawOrderRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20442")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "提现单号(业务唯一)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("提现单号(业务唯一)")
|
||||
private String withdrawNo;
|
||||
|
||||
@Schema(description = "业务幂等号(防重复提交)")
|
||||
@ExcelProperty("业务幂等号(防重复提交)")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "币种(默认 CNY)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("币种(默认 CNY)")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "提现申请金额(单位:元)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("提现申请金额(单位:元)")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "手续费金额(单位:元)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("手续费金额(单位:元)")
|
||||
private BigDecimal feeAmount;
|
||||
|
||||
@Schema(description = "实际到账金额(单位:元 = amount - fee_amount)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("实际到账金额(单位:元 = amount - fee_amount)")
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
@Schema(description = "打款渠道:BANK/ALIPAY/WECHAT/PAYPAL 等", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("打款渠道:BANK/ALIPAY/WECHAT/PAYPAL 等")
|
||||
private String payChannel;
|
||||
|
||||
@Schema(description = "收款方类型:PERSON(个人)/COMPANY(企业)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("收款方类型:PERSON(个人)/COMPANY(企业)")
|
||||
private String payeeType;
|
||||
|
||||
@Schema(description = "收款人姓名或公司名称(快照)", example = "张三")
|
||||
@ExcelProperty("收款人姓名或公司名称(快照)")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "收款账号(银行卡/支付宝等,建议加密或脱敏)", example = "5425")
|
||||
@ExcelProperty("收款账号(银行卡/支付宝等,建议加密或脱敏)")
|
||||
private String payeeAccount;
|
||||
|
||||
@Schema(description = "收款银行名称", example = "芋艿")
|
||||
@ExcelProperty("收款银行名称")
|
||||
private String payeeBankName;
|
||||
|
||||
@Schema(description = "银行编码(可选)")
|
||||
@ExcelProperty("银行编码(可选)")
|
||||
private String payeeBankCode;
|
||||
|
||||
@Schema(description = "银行支行名称(可选)")
|
||||
@ExcelProperty("银行支行名称(可选)")
|
||||
private String payeeBankBranch;
|
||||
|
||||
@Schema(description = "提现状态:APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("提现状态:APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "审核状态:PENDING/PASSED/REJECTED", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("审核状态:PENDING/PASSED/REJECTED")
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "拒绝原因或打款失败原因", example = "不香")
|
||||
@ExcelProperty("拒绝原因或打款失败原因")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "提现申请时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("提现申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "审核完成时间")
|
||||
@ExcelProperty("审核完成时间")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Schema(description = "发起打款时间(请求第三方)")
|
||||
@ExcelProperty("发起打款时间(请求第三方)")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
@Schema(description = "打款成功时间(第三方确认)")
|
||||
@ExcelProperty("打款成功时间(第三方确认)")
|
||||
private LocalDateTime paidTime;
|
||||
|
||||
@Schema(description = "业务终态时间(成功/失败/取消)")
|
||||
@ExcelProperty("业务终态时间(成功/失败/取消)")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
@Schema(description = "打款批次号(内部使用)")
|
||||
@ExcelProperty("打款批次号(内部使用)")
|
||||
private String payerBatchNo;
|
||||
|
||||
@Schema(description = "第三方打款交易号/流水号(对账用)")
|
||||
@ExcelProperty("第三方打款交易号/流水号(对账用)")
|
||||
private String channelTradeNo;
|
||||
|
||||
@Schema(description = "第三方返回的原始报文(用于排查)")
|
||||
@ExcelProperty("第三方返回的原始报文(用于排查)")
|
||||
private Object channelRaw;
|
||||
|
||||
@Schema(description = "关联余额流水ID(冻结/扣减/返还)", example = "30641")
|
||||
@ExcelProperty("关联余额流水ID(冻结/扣减/返还)")
|
||||
private Long balanceTxnId;
|
||||
|
||||
@Schema(description = "乐观锁版本号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("乐观锁版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "提现申请人ID", example = "6858")
|
||||
@ExcelProperty("提现申请人ID")
|
||||
private Long creatorId;
|
||||
|
||||
@Schema(description = "审核人ID", example = "15039")
|
||||
@ExcelProperty("审核人ID")
|
||||
private Long auditorId;
|
||||
|
||||
@Schema(description = "打款操作人ID", example = "8850")
|
||||
@ExcelProperty("打款操作人ID")
|
||||
private Long payerId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "租户编号", example = "1")
|
||||
@ExcelProperty("租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "租户名称", example = "芋道源码")
|
||||
@ExcelProperty("租户名称")
|
||||
private String tenantName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.yolo.keyboard.controller.admin.tenantwithdraworder.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户提现订单表(申请-审核-打款-完成/失败)新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardTenantWithdrawOrderSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20442")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "提现单号(业务唯一)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "提现单号(业务唯一)不能为空")
|
||||
private String withdrawNo;
|
||||
|
||||
@Schema(description = "业务幂等号(防重复提交)")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "币种(默认 CNY)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "币种(默认 CNY)不能为空")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "提现申请金额(单位:元)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "提现申请金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "手续费金额(单位:元)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "手续费金额不能为空")
|
||||
private BigDecimal feeAmount;
|
||||
|
||||
@Schema(description = "实际到账金额(单位:元 = amount - fee_amount)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "实际到账金额不能为空")
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
@Schema(description = "打款渠道:BANK/ALIPAY/WECHAT/PAYPAL 等", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "打款渠道:BANK/ALIPAY/WECHAT/PAYPAL 等不能为空")
|
||||
private String payChannel;
|
||||
|
||||
@Schema(description = "收款方类型:PERSON(个人)/COMPANY(企业)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "收款方类型:PERSON(个人)/COMPANY(企业)不能为空")
|
||||
private String payeeType;
|
||||
|
||||
@Schema(description = "收款人姓名或公司名称(快照)", example = "张三")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "收款账号(银行卡/支付宝等,建议加密或脱敏)", example = "5425")
|
||||
private String payeeAccount;
|
||||
|
||||
@Schema(description = "收款银行名称", example = "芋艿")
|
||||
private String payeeBankName;
|
||||
|
||||
@Schema(description = "银行编码(可选)")
|
||||
private String payeeBankCode;
|
||||
|
||||
@Schema(description = "银行支行名称(可选)")
|
||||
private String payeeBankBranch;
|
||||
|
||||
@Schema(description = "提现状态:APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "提现状态:APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED不能为空")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "审核状态:PENDING/PASSED/REJECTED", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "审核状态:PENDING/PASSED/REJECTED不能为空")
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "拒绝原因或打款失败原因", example = "不香")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "提现申请时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "提现申请时间不能为空")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "审核完成时间")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Schema(description = "发起打款时间(请求第三方)")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
@Schema(description = "打款成功时间(第三方确认)")
|
||||
private LocalDateTime paidTime;
|
||||
|
||||
@Schema(description = "业务终态时间(成功/失败/取消)")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
@Schema(description = "打款批次号(内部使用)")
|
||||
private String payerBatchNo;
|
||||
|
||||
@Schema(description = "第三方打款交易号/流水号(对账用)")
|
||||
private String channelTradeNo;
|
||||
|
||||
@Schema(description = "第三方返回的原始报文(用于排查)")
|
||||
private Object channelRaw;
|
||||
|
||||
@Schema(description = "关联余额流水ID(冻结/扣减/返还)", example = "30641")
|
||||
private Long balanceTxnId;
|
||||
|
||||
@Schema(description = "乐观锁版本号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "乐观锁版本号不能为空")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "提现申请人ID", example = "6858")
|
||||
private Long creatorId;
|
||||
|
||||
@Schema(description = "审核人ID", example = "15039")
|
||||
private Long auditorId;
|
||||
|
||||
@Schema(description = "打款操作人ID", example = "8850")
|
||||
private Long payerId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建时间不能为空")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "更新时间不能为空")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -56,4 +56,5 @@ public class KeyboardThemesPageReqVO extends PageParam {
|
||||
@Schema(description = "真实下载数量", example = "3353")
|
||||
private Long realDownloadCount;
|
||||
|
||||
}
|
||||
@Schema(description = "所属国家")
|
||||
private String local;}
|
||||
@@ -73,4 +73,7 @@ public class KeyboardThemesRespVO {
|
||||
@ExcelProperty("真实下载数量")
|
||||
private Long realDownloadCount;
|
||||
|
||||
@Schema(description = "所属国家")
|
||||
@ExcelProperty("所属国家")
|
||||
private String local;
|
||||
}
|
||||
@@ -57,4 +57,6 @@ public class KeyboardThemesSaveReqVO {
|
||||
@Schema(description = "真实下载数量", example = "3353")
|
||||
private Long realDownloadCount;
|
||||
|
||||
@Schema(description = "所属国家")
|
||||
private String local;
|
||||
}
|
||||
@@ -18,4 +18,6 @@ public class KeyboardThemeStylesPageReqVO extends PageParam {
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "所属国家地区")
|
||||
private String local;
|
||||
}
|
||||
@@ -27,4 +27,6 @@ public class KeyboardThemeStylesRespVO {
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "所属国家地区")
|
||||
private String local;
|
||||
}
|
||||
@@ -19,4 +19,6 @@ public class KeyboardThemeStylesSaveReqVO {
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "所属国家地区")
|
||||
private String local;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.usercalllog;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.usercalllog.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.usercalllog.KeyboardUserCallLogDO;
|
||||
import com.yolo.keyboard.service.usercalllog.KeyboardUserCallLogService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户每次调用日志(用于记录token、模型、耗时、成功率等)")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/user-call-log")
|
||||
@Validated
|
||||
public class KeyboardUserCallLogController {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserCallLogService userCallLogService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户每次调用日志(用于记录token、模型、耗时、成功率等)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-call-log:create')")
|
||||
public CommonResult<Long> createUserCallLog(@Valid @RequestBody KeyboardUserCallLogSaveReqVO createReqVO) {
|
||||
return success(userCallLogService.createUserCallLog(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户每次调用日志(用于记录token、模型、耗时、成功率等)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-call-log:update')")
|
||||
public CommonResult<Boolean> updateUserCallLog(@Valid @RequestBody KeyboardUserCallLogSaveReqVO updateReqVO) {
|
||||
userCallLogService.updateUserCallLog(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户每次调用日志(用于记录token、模型、耗时、成功率等)")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-call-log:delete')")
|
||||
public CommonResult<Boolean> deleteUserCallLog(@RequestParam("id") Long id) {
|
||||
userCallLogService.deleteUserCallLog(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户每次调用日志(用于记录token、模型、耗时、成功率等)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-call-log:delete')")
|
||||
public CommonResult<Boolean> deleteUserCallLogList(@RequestParam("ids") List<Long> ids) {
|
||||
userCallLogService.deleteUserCallLogListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户每次调用日志(用于记录token、模型、耗时、成功率等)")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-call-log:query')")
|
||||
public CommonResult<KeyboardUserCallLogRespVO> getUserCallLog(@RequestParam("id") Long id) {
|
||||
KeyboardUserCallLogDO userCallLog = userCallLogService.getUserCallLog(id);
|
||||
return success(BeanUtils.toBean(userCallLog, KeyboardUserCallLogRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户每次调用日志(用于记录token、模型、耗时、成功率等)分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-call-log:query')")
|
||||
public CommonResult<PageResult<KeyboardUserCallLogRespVO>> getUserCallLogPage(@Valid KeyboardUserCallLogPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardUserCallLogDO> pageResult = userCallLogService.getUserCallLogPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardUserCallLogRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户每次调用日志(用于记录token、模型、耗时、成功率等) Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-call-log:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserCallLogExcel(@Valid KeyboardUserCallLogPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardUserCallLogDO> list = userCallLogService.getUserCallLogPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户每次调用日志(用于记录token、模型、耗时、成功率等).xls", "数据", KeyboardUserCallLogRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardUserCallLogRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.yolo.keyboard.controller.admin.usercalllog.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户每次调用日志(用于记录token、模型、耗时、成功率等)分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserCallLogPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户ID", example = "22552")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "幂等请求ID,避免重试导致重复记录", example = "12645")
|
||||
private String requestId;
|
||||
|
||||
@Schema(description = "调用功能来源")
|
||||
private String feature;
|
||||
|
||||
@Schema(description = "调用的模型名称")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "输入token数")
|
||||
private Integer inputTokens;
|
||||
|
||||
@Schema(description = "输出token数")
|
||||
private Integer outputTokens;
|
||||
|
||||
@Schema(description = "总token数(input+output)")
|
||||
private Integer totalTokens;
|
||||
|
||||
@Schema(description = "调用是否成功")
|
||||
private Boolean success;
|
||||
|
||||
@Schema(description = "调用耗时(毫秒)")
|
||||
private Integer latencyMs;
|
||||
|
||||
@Schema(description = "失败错误码(可空)")
|
||||
private String errorCode;
|
||||
|
||||
@Schema(description = "调用记录创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "生成 id", example = "2813")
|
||||
private String genId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.yolo.keyboard.controller.admin.usercalllog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户每次调用日志(用于记录token、模型、耗时、成功率等) Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardUserCallLogRespVO {
|
||||
|
||||
@Schema(description = "主键 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32537")
|
||||
@ExcelProperty("主键 id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22552")
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "幂等请求ID,避免重试导致重复记录", requiredMode = Schema.RequiredMode.REQUIRED, example = "12645")
|
||||
@ExcelProperty("幂等请求ID,避免重试导致重复记录")
|
||||
private String requestId;
|
||||
|
||||
@Schema(description = "调用功能来源", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("调用功能来源")
|
||||
private String feature;
|
||||
|
||||
@Schema(description = "调用的模型名称")
|
||||
@ExcelProperty("调用的模型名称")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "输入token数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("输入token数")
|
||||
private Integer inputTokens;
|
||||
|
||||
@Schema(description = "输出token数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("输出token数")
|
||||
private Integer outputTokens;
|
||||
|
||||
@Schema(description = "总token数(input+output)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("总token数(input+output)")
|
||||
private Integer totalTokens;
|
||||
|
||||
@Schema(description = "调用是否成功", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("调用是否成功")
|
||||
private Boolean success;
|
||||
|
||||
@Schema(description = "调用耗时(毫秒)")
|
||||
@ExcelProperty("调用耗时(毫秒)")
|
||||
private Integer latencyMs;
|
||||
|
||||
@Schema(description = "失败错误码(可空)")
|
||||
@ExcelProperty("失败错误码(可空)")
|
||||
private String errorCode;
|
||||
|
||||
@Schema(description = "调用记录创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("调用记录创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "生成 id", example = "2813")
|
||||
@ExcelProperty("生成 id")
|
||||
private String genId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.yolo.keyboard.controller.admin.usercalllog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户每次调用日志(用于记录token、模型、耗时、成功率等)新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserCallLogSaveReqVO {
|
||||
|
||||
@Schema(description = "主键 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32537")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22552")
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "幂等请求ID,避免重试导致重复记录", requiredMode = Schema.RequiredMode.REQUIRED, example = "12645")
|
||||
@NotEmpty(message = "幂等请求ID,避免重试导致重复记录不能为空")
|
||||
private String requestId;
|
||||
|
||||
@Schema(description = "调用功能来源", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "调用功能来源不能为空")
|
||||
private String feature;
|
||||
|
||||
@Schema(description = "调用的模型名称")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "输入token数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "输入token数不能为空")
|
||||
private Integer inputTokens;
|
||||
|
||||
@Schema(description = "输出token数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "输出token数不能为空")
|
||||
private Integer outputTokens;
|
||||
|
||||
@Schema(description = "总token数(input+output)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "总token数(input+output)不能为空")
|
||||
private Integer totalTokens;
|
||||
|
||||
@Schema(description = "调用是否成功", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "调用是否成功不能为空")
|
||||
private Boolean success;
|
||||
|
||||
@Schema(description = "调用耗时(毫秒)")
|
||||
private Integer latencyMs;
|
||||
|
||||
@Schema(description = "失败错误码(可空)")
|
||||
private String errorCode;
|
||||
|
||||
@Schema(description = "调用记录创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "调用记录创建时间不能为空")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "生成 id", example = "2813")
|
||||
private String genId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.usercharacter;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.usercharacter.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.usercharacter.KeyboardUserCharacterDO;
|
||||
import com.yolo.keyboard.service.usercharacter.KeyboardUserCharacterService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户人设管理")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/user-character")
|
||||
@Validated
|
||||
public class KeyboardUserCharacterController {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserCharacterService userCharacterService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户人设管理")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-character:create')")
|
||||
public CommonResult<Long> createUserCharacter(@Valid @RequestBody KeyboardUserCharacterSaveReqVO createReqVO) {
|
||||
return success(userCharacterService.createUserCharacter(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户人设管理")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-character:update')")
|
||||
public CommonResult<Boolean> updateUserCharacter(@Valid @RequestBody KeyboardUserCharacterSaveReqVO updateReqVO) {
|
||||
userCharacterService.updateUserCharacter(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户人设管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-character:delete')")
|
||||
public CommonResult<Boolean> deleteUserCharacter(@RequestParam("id") Long id) {
|
||||
userCharacterService.deleteUserCharacter(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户人设管理")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-character:delete')")
|
||||
public CommonResult<Boolean> deleteUserCharacterList(@RequestParam("ids") List<Long> ids) {
|
||||
userCharacterService.deleteUserCharacterListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户人设管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-character:query')")
|
||||
public CommonResult<KeyboardUserCharacterRespVO> getUserCharacter(@RequestParam("id") Long id) {
|
||||
KeyboardUserCharacterDO userCharacter = userCharacterService.getUserCharacter(id);
|
||||
return success(BeanUtils.toBean(userCharacter, KeyboardUserCharacterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户人设管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-character:query')")
|
||||
public CommonResult<PageResult<KeyboardUserCharacterRespVO>> getUserCharacterPage(@Valid KeyboardUserCharacterPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardUserCharacterDO> pageResult = userCharacterService.getUserCharacterPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardUserCharacterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户人设管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-character:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserCharacterExcel(@Valid KeyboardUserCharacterPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardUserCharacterDO> list = userCharacterService.getUserCharacterPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户人设管理.xls", "数据", KeyboardUserCharacterRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardUserCharacterRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yolo.keyboard.controller.admin.usercharacter.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户人设管理分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserCharacterPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "键盘人设 id", example = "7333")
|
||||
private Long characterId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "用户 Id", example = "31348")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "emoji 标签")
|
||||
private String emoji;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yolo.keyboard.controller.admin.usercharacter.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户人设管理 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardUserCharacterRespVO {
|
||||
|
||||
@Schema(description = "主键 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32344")
|
||||
@ExcelProperty("主键 Id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "键盘人设 id", example = "7333")
|
||||
@ExcelProperty("键盘人设 id")
|
||||
private Long characterId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "用户 Id", example = "31348")
|
||||
@ExcelProperty("用户 Id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "emoji 标签")
|
||||
@ExcelProperty("emoji 标签")
|
||||
private String emoji;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yolo.keyboard.controller.admin.usercharacter.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户人设管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserCharacterSaveReqVO {
|
||||
|
||||
@Schema(description = "主键 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32344")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "键盘人设 id", example = "7333")
|
||||
private Long characterId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "用户 Id", example = "31348")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "emoji 标签")
|
||||
private String emoji;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvitecodes;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.userinvitecodes.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.userinvitecodes.KeyboardUserInviteCodesDO;
|
||||
import com.yolo.keyboard.service.userinvitecodes.KeyboardUserInviteCodesService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/user-invite-codes")
|
||||
@Validated
|
||||
public class KeyboardUserInviteCodesController {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserInviteCodesService userInviteCodesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invite-codes:create')")
|
||||
public CommonResult<Long> createUserInviteCodes(@Valid @RequestBody KeyboardUserInviteCodesSaveReqVO createReqVO) {
|
||||
return success(userInviteCodesService.createUserInviteCodes(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invite-codes:update')")
|
||||
public CommonResult<Boolean> updateUserInviteCodes(@Valid @RequestBody KeyboardUserInviteCodesSaveReqVO updateReqVO) {
|
||||
userInviteCodesService.updateUserInviteCodes(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invite-codes:delete')")
|
||||
public CommonResult<Boolean> deleteUserInviteCodes(@RequestParam("id") Long id) {
|
||||
userInviteCodesService.deleteUserInviteCodes(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invite-codes:delete')")
|
||||
public CommonResult<Boolean> deleteUserInviteCodesList(@RequestParam("ids") List<Long> ids) {
|
||||
userInviteCodesService.deleteUserInviteCodesListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invite-codes:query')")
|
||||
public CommonResult<KeyboardUserInviteCodesRespVO> getUserInviteCodes(@RequestParam("id") Long id) {
|
||||
KeyboardUserInviteCodesDO userInviteCodes = userInviteCodesService.getUserInviteCodes(id);
|
||||
return success(BeanUtils.toBean(userInviteCodes, KeyboardUserInviteCodesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invite-codes:query')")
|
||||
public CommonResult<PageResult<KeyboardUserInviteCodesRespVO>> getUserInviteCodesPage(@Valid KeyboardUserInviteCodesPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardUserInviteCodesDO> pageResult = userInviteCodesService.getUserInviteCodesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardUserInviteCodesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invite-codes:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserInviteCodesExcel(@Valid KeyboardUserInviteCodesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardUserInviteCodesDO> list = userInviteCodesService.getUserInviteCodesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系.xls", "数据", KeyboardUserInviteCodesRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardUserInviteCodesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvitecodes.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserInviteCodesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "邀请码字符串,对外展示,唯一")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "邀请码所属用户ID(邀请人)", example = "14170")
|
||||
private Long ownerUserId;
|
||||
|
||||
@Schema(description = "邀请码状态:1=启用,0=停用", example = "2")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "邀请码创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "邀请码过期时间,NULL表示永久有效")
|
||||
private LocalDateTime expiresAt;
|
||||
|
||||
@Schema(description = "邀请码最大可使用次数,NULL表示不限次数")
|
||||
private Integer maxUses;
|
||||
|
||||
@Schema(description = "邀请码已使用次数", example = "25037")
|
||||
private Integer usedCount;
|
||||
|
||||
@Schema(description = "邀请码所属租户", example = "17355")
|
||||
private Long ownerTenantId;
|
||||
|
||||
@Schema(description = "邀请码所属系统用户", example = "772")
|
||||
private Long ownerSystemUserId;
|
||||
|
||||
@Schema(description = "邀请码类型", example = "1")
|
||||
private String inviteType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvitecodes.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardUserInviteCodesRespVO {
|
||||
|
||||
@Schema(description = "邀请码主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3053")
|
||||
@ExcelProperty("邀请码主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "邀请码字符串,对外展示,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("邀请码字符串,对外展示,唯一")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "邀请码所属用户ID(邀请人)", requiredMode = Schema.RequiredMode.REQUIRED, example = "14170")
|
||||
@ExcelProperty("邀请码所属用户ID(邀请人)")
|
||||
private Long ownerUserId;
|
||||
|
||||
@Schema(description = "邀请码状态:1=启用,0=停用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("邀请码状态:1=启用,0=停用")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "邀请码创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("邀请码创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "邀请码过期时间,NULL表示永久有效")
|
||||
@ExcelProperty("邀请码过期时间,NULL表示永久有效")
|
||||
private LocalDateTime expiresAt;
|
||||
|
||||
@Schema(description = "邀请码最大可使用次数,NULL表示不限次数")
|
||||
@ExcelProperty("邀请码最大可使用次数,NULL表示不限次数")
|
||||
private Integer maxUses;
|
||||
|
||||
@Schema(description = "邀请码已使用次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "25037")
|
||||
@ExcelProperty("邀请码已使用次数")
|
||||
private Integer usedCount;
|
||||
|
||||
@Schema(description = "邀请码所属租户", example = "17355")
|
||||
@ExcelProperty("邀请码所属租户")
|
||||
private Long ownerTenantId;
|
||||
|
||||
@Schema(description = "邀请码所属系统用户ID(邀请人)", example = "772")
|
||||
@ExcelProperty("邀请码所属系统用户")
|
||||
private Long ownerSystemUserId;
|
||||
|
||||
@Schema(description = "邀请码类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("邀请码类型")
|
||||
private String inviteType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvitecodes.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserInviteCodesSaveReqVO {
|
||||
|
||||
@Schema(description = "邀请码主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3053")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "邀请码字符串,对外展示,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "邀请码字符串,对外展示,唯一不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "邀请码所属用户ID(邀请人)", requiredMode = Schema.RequiredMode.REQUIRED, example = "14170")
|
||||
@NotNull(message = "邀请码所属用户ID(邀请人)不能为空")
|
||||
private Long ownerUserId;
|
||||
|
||||
@Schema(description = "邀请码状态:1=启用,0=停用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "邀请码状态:1=启用,0=停用不能为空")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "邀请码创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "邀请码创建时间不能为空")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "邀请码过期时间,NULL表示永久有效")
|
||||
private LocalDateTime expiresAt;
|
||||
|
||||
@Schema(description = "邀请码最大可使用次数,NULL表示不限次数")
|
||||
private Integer maxUses;
|
||||
|
||||
@Schema(description = "邀请码已使用次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "25037")
|
||||
@NotNull(message = "邀请码已使用次数不能为空")
|
||||
private Integer usedCount;
|
||||
|
||||
@Schema(description = "邀请码所属租户", example = "17355")
|
||||
private Long ownerTenantId;
|
||||
|
||||
@Schema(description = "邀请码所属系统用户", example = "772")
|
||||
private Long ownerSystemUserId;
|
||||
|
||||
@Schema(description = "邀请码类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "邀请码类型不能为空")
|
||||
private String inviteType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvites;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.userinvites.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.userinvites.KeyboardUserInvitesDO;
|
||||
import com.yolo.keyboard.service.userinvites.KeyboardUserInvitesService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户邀请关系绑定台账表,记录新用户最终归属的邀请人")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/user-invites")
|
||||
@Validated
|
||||
public class KeyboardUserInvitesController {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserInvitesService userInvitesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户邀请关系绑定台账表,记录新用户最终归属的邀请人")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invites:create')")
|
||||
public CommonResult<Long> createUserInvites(@Valid @RequestBody KeyboardUserInvitesSaveReqVO createReqVO) {
|
||||
return success(userInvitesService.createUserInvites(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户邀请关系绑定台账表,记录新用户最终归属的邀请人")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invites:update')")
|
||||
public CommonResult<Boolean> updateUserInvites(@Valid @RequestBody KeyboardUserInvitesSaveReqVO updateReqVO) {
|
||||
userInvitesService.updateUserInvites(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户邀请关系绑定台账表,记录新用户最终归属的邀请人")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invites:delete')")
|
||||
public CommonResult<Boolean> deleteUserInvites(@RequestParam("id") Long id) {
|
||||
userInvitesService.deleteUserInvites(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户邀请关系绑定台账表,记录新用户最终归属的邀请人")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invites:delete')")
|
||||
public CommonResult<Boolean> deleteUserInvitesList(@RequestParam("ids") List<Long> ids) {
|
||||
userInvitesService.deleteUserInvitesListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户邀请关系绑定台账表,记录新用户最终归属的邀请人")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invites:query')")
|
||||
public CommonResult<KeyboardUserInvitesRespVO> getUserInvites(@RequestParam("id") Long id) {
|
||||
KeyboardUserInvitesDO userInvites = userInvitesService.getUserInvites(id);
|
||||
return success(BeanUtils.toBean(userInvites, KeyboardUserInvitesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户邀请关系绑定台账表,记录新用户最终归属的邀请人分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invites:query')")
|
||||
public CommonResult<PageResult<KeyboardUserInvitesRespVO>> getUserInvitesPage(@Valid KeyboardUserInvitesPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardUserInvitesDO> pageResult = userInvitesService.getUserInvitesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardUserInvitesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户邀请关系绑定台账表,记录新用户最终归属的邀请人 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-invites:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserInvitesExcel(@Valid KeyboardUserInvitesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardUserInvitesDO> list = userInvitesService.getUserInvitesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户邀请关系绑定台账表,记录新用户最终归属的邀请人.xls", "数据", KeyboardUserInvitesRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardUserInvitesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvites.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户邀请关系绑定台账表,记录新用户最终归属的邀请人分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserInvitesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "邀请人用户ID", example = "11992")
|
||||
private Long inviterUserId;
|
||||
|
||||
@Schema(description = "被邀请人用户ID(新注册用户)", example = "28499")
|
||||
private Long inviteeUserId;
|
||||
|
||||
@Schema(description = "使用的邀请码ID", example = "30340")
|
||||
private Long inviteCodeId;
|
||||
|
||||
@Schema(description = "绑定时关联的点击Token(通过邀请链接自动绑定时使用)")
|
||||
private String clickToken;
|
||||
|
||||
@Schema(description = "绑定方式:1=手动填写邀请码,2=邀请链接自动绑定,3=其他方式", example = "2")
|
||||
private Short bindType;
|
||||
|
||||
@Schema(description = "邀请关系绑定完成时间")
|
||||
private LocalDateTime boundAt;
|
||||
|
||||
@Schema(description = "绑定 iP")
|
||||
private String bindIp;
|
||||
|
||||
@Schema(description = "userAgent")
|
||||
private String bindUserAgent;
|
||||
|
||||
@Schema(description = "邀请码类型快照:USER=普通用户邀请,AGENT=代理邀请", example = "2")
|
||||
private String inviteType;
|
||||
|
||||
@Schema(description = "收益结算归属租户ID(代理结算用,绑定时固化)", example = "25223")
|
||||
private Long profitTenantId;
|
||||
|
||||
@Schema(description = "收益归因员工ID(用于区分租户员工/渠道,绑定时固化)", example = "31236")
|
||||
private Long profitEmployeeId;
|
||||
|
||||
@Schema(description = "邀请人所属租户ID快照(便于审计/对账,可选)", example = "17028")
|
||||
private Long inviterTenantId;
|
||||
|
||||
@Schema(description = "邀请码字符串快照(便于排查,可选)")
|
||||
private String inviteCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvites.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户邀请关系绑定台账表,记录新用户最终归属的邀请人 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardUserInvitesRespVO {
|
||||
|
||||
@Schema(description = "邀请绑定记录主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7254")
|
||||
@ExcelProperty("邀请绑定记录主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "邀请人用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11992")
|
||||
@ExcelProperty("邀请人用户ID")
|
||||
private Long inviterUserId;
|
||||
|
||||
@Schema(description = "被邀请人用户ID(新注册用户)", requiredMode = Schema.RequiredMode.REQUIRED, example = "28499")
|
||||
@ExcelProperty("被邀请人用户ID(新注册用户)")
|
||||
private Long inviteeUserId;
|
||||
|
||||
@Schema(description = "使用的邀请码ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30340")
|
||||
@ExcelProperty("使用的邀请码ID")
|
||||
private Long inviteCodeId;
|
||||
|
||||
@Schema(description = "绑定时关联的点击Token(通过邀请链接自动绑定时使用)")
|
||||
@ExcelProperty("绑定时关联的点击Token(通过邀请链接自动绑定时使用)")
|
||||
private String clickToken;
|
||||
|
||||
@Schema(description = "绑定方式:1=手动填写邀请码,2=邀请链接自动绑定,3=其他方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("绑定方式:1=手动填写邀请码,2=邀请链接自动绑定,3=其他方式")
|
||||
private Short bindType;
|
||||
|
||||
@Schema(description = "邀请关系绑定完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("邀请关系绑定完成时间")
|
||||
private LocalDateTime boundAt;
|
||||
|
||||
@Schema(description = "绑定 iP")
|
||||
@ExcelProperty("绑定 iP")
|
||||
private String bindIp;
|
||||
|
||||
@Schema(description = "userAgent")
|
||||
@ExcelProperty("userAgent")
|
||||
private String bindUserAgent;
|
||||
|
||||
@Schema(description = "邀请码类型快照:USER=普通用户邀请,AGENT=代理邀请", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("邀请码类型快照:USER=普通用户邀请,AGENT=代理邀请")
|
||||
private String inviteType;
|
||||
|
||||
@Schema(description = "收益结算归属租户ID(代理结算用,绑定时固化)", example = "25223")
|
||||
@ExcelProperty("收益结算归属租户ID(代理结算用,绑定时固化)")
|
||||
private Long profitTenantId;
|
||||
|
||||
@Schema(description = "收益归因员工ID(用于区分租户员工/渠道,绑定时固化)", example = "31236")
|
||||
@ExcelProperty("收益归因员工ID(用于区分租户员工/渠道,绑定时固化)")
|
||||
private Long profitEmployeeId;
|
||||
|
||||
@Schema(description = "邀请人所属租户ID快照(便于审计/对账,可选)", example = "17028")
|
||||
@ExcelProperty("邀请人所属租户ID快照(便于审计/对账,可选)")
|
||||
private Long inviterTenantId;
|
||||
|
||||
@Schema(description = "邀请码字符串快照(便于排查,可选)")
|
||||
@ExcelProperty("邀请码字符串快照(便于排查,可选)")
|
||||
private String inviteCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.yolo.keyboard.controller.admin.userinvites.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户邀请关系绑定台账表,记录新用户最终归属的邀请人新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserInvitesSaveReqVO {
|
||||
|
||||
@Schema(description = "邀请绑定记录主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7254")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "邀请人用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11992")
|
||||
@NotNull(message = "邀请人用户ID不能为空")
|
||||
private Long inviterUserId;
|
||||
|
||||
@Schema(description = "被邀请人用户ID(新注册用户)", requiredMode = Schema.RequiredMode.REQUIRED, example = "28499")
|
||||
@NotNull(message = "被邀请人用户ID(新注册用户)不能为空")
|
||||
private Long inviteeUserId;
|
||||
|
||||
@Schema(description = "使用的邀请码ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30340")
|
||||
@NotNull(message = "使用的邀请码ID不能为空")
|
||||
private Long inviteCodeId;
|
||||
|
||||
@Schema(description = "绑定时关联的点击Token(通过邀请链接自动绑定时使用)")
|
||||
private String clickToken;
|
||||
|
||||
@Schema(description = "绑定方式:1=手动填写邀请码,2=邀请链接自动绑定,3=其他方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "绑定方式:1=手动填写邀请码,2=邀请链接自动绑定,3=其他方式不能为空")
|
||||
private Short bindType;
|
||||
|
||||
@Schema(description = "邀请关系绑定完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "邀请关系绑定完成时间不能为空")
|
||||
private LocalDateTime boundAt;
|
||||
|
||||
@Schema(description = "绑定 iP")
|
||||
private String bindIp;
|
||||
|
||||
@Schema(description = "userAgent")
|
||||
private String bindUserAgent;
|
||||
|
||||
@Schema(description = "邀请码类型快照:USER=普通用户邀请,AGENT=代理邀请", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "邀请码类型快照:USER=普通用户邀请,AGENT=代理邀请不能为空")
|
||||
private String inviteType;
|
||||
|
||||
@Schema(description = "收益结算归属租户ID(代理结算用,绑定时固化)", example = "25223")
|
||||
private Long profitTenantId;
|
||||
|
||||
@Schema(description = "收益归因员工ID(用于区分租户员工/渠道,绑定时固化)", example = "31236")
|
||||
private Long profitEmployeeId;
|
||||
|
||||
@Schema(description = "邀请人所属租户ID快照(便于审计/对账,可选)", example = "17028")
|
||||
private Long inviterTenantId;
|
||||
|
||||
@Schema(description = "邀请码字符串快照(便于排查,可选)")
|
||||
private String inviteCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.userpurchaserecords;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.userpurchaserecords.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.userpurchaserecords.KeyboardUserPurchaseRecordsDO;
|
||||
import com.yolo.keyboard.service.userpurchaserecords.KeyboardUserPurchaseRecordsService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户内购记录")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/user-purchase-records")
|
||||
@Validated
|
||||
public class KeyboardUserPurchaseRecordsController {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserPurchaseRecordsService userPurchaseRecordsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户内购记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-purchase-records:create')")
|
||||
public CommonResult<Integer> createUserPurchaseRecords(@Valid @RequestBody KeyboardUserPurchaseRecordsSaveReqVO createReqVO) {
|
||||
return success(userPurchaseRecordsService.createUserPurchaseRecords(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户内购记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-purchase-records:update')")
|
||||
public CommonResult<Boolean> updateUserPurchaseRecords(@Valid @RequestBody KeyboardUserPurchaseRecordsSaveReqVO updateReqVO) {
|
||||
userPurchaseRecordsService.updateUserPurchaseRecords(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户内购记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-purchase-records:delete')")
|
||||
public CommonResult<Boolean> deleteUserPurchaseRecords(@RequestParam("id") Integer id) {
|
||||
userPurchaseRecordsService.deleteUserPurchaseRecords(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户内购记录")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-purchase-records:delete')")
|
||||
public CommonResult<Boolean> deleteUserPurchaseRecordsList(@RequestParam("ids") List<Integer> ids) {
|
||||
userPurchaseRecordsService.deleteUserPurchaseRecordsListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户内购记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-purchase-records:query')")
|
||||
public CommonResult<KeyboardUserPurchaseRecordsRespVO> getUserPurchaseRecords(@RequestParam("id") Integer id) {
|
||||
KeyboardUserPurchaseRecordsDO userPurchaseRecords = userPurchaseRecordsService.getUserPurchaseRecords(id);
|
||||
return success(BeanUtils.toBean(userPurchaseRecords, KeyboardUserPurchaseRecordsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户内购记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-purchase-records:query')")
|
||||
public CommonResult<PageResult<KeyboardUserPurchaseRecordsRespVO>> getUserPurchaseRecordsPage(@Valid KeyboardUserPurchaseRecordsPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardUserPurchaseRecordsDO> pageResult = userPurchaseRecordsService.getUserPurchaseRecordsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardUserPurchaseRecordsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户内购记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-purchase-records:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserPurchaseRecordsExcel(@Valid KeyboardUserPurchaseRecordsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardUserPurchaseRecordsDO> list = userPurchaseRecordsService.getUserPurchaseRecordsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户内购记录.xls", "数据", KeyboardUserPurchaseRecordsRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardUserPurchaseRecordsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yolo.keyboard.controller.admin.userpurchaserecords.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户内购记录分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserPurchaseRecordsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户 ID,关联到用户表,表示是哪位用户购买了产品", example = "21782")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "购买的产品 ID,关联到产品表", example = "10744")
|
||||
private String productId;
|
||||
|
||||
@Schema(description = "购买数量(如内购的金币数量,订阅的时长)")
|
||||
private Integer purchaseQuantity;
|
||||
|
||||
@Schema(description = "实际支付价格", example = "17601")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "货币类型(如美元 $)")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "购买时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] purchaseTime;
|
||||
|
||||
@Schema(description = "购买类型(如内购,订阅)", example = "1")
|
||||
private String purchaseType;
|
||||
|
||||
@Schema(description = "购买状态(如已支付,待支付,退款)", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "支付方式(如信用卡,支付宝等)")
|
||||
private String paymentMethod;
|
||||
|
||||
@Schema(description = "唯一的交易 ID,用于标识该购买操作", example = "14496")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "苹果的原始交易 ID", example = "3666")
|
||||
private String originalTransactionId;
|
||||
|
||||
@Schema(description = "购买的产品 ID 列表(JSON 格式或数组)")
|
||||
private Object productIds;
|
||||
|
||||
@Schema(description = "苹果返回的购买时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] purchaseDate;
|
||||
|
||||
@Schema(description = "苹果返回的过期时间(如果有)")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] expiresDate;
|
||||
|
||||
@Schema(description = "苹果的环境(如 Sandbox 或 Production)")
|
||||
private String environment;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.yolo.keyboard.controller.admin.userpurchaserecords.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户内购记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardUserPurchaseRecordsRespVO {
|
||||
|
||||
@Schema(description = "主键,自增,唯一标识每条购买记录", requiredMode = Schema.RequiredMode.REQUIRED, example = "1239")
|
||||
@ExcelProperty("主键,自增,唯一标识每条购买记录")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "用户 ID,关联到用户表,表示是哪位用户购买了产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "21782")
|
||||
@ExcelProperty("用户 ID,关联到用户表,表示是哪位用户购买了产品")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "购买的产品 ID,关联到产品表", requiredMode = Schema.RequiredMode.REQUIRED, example = "10744")
|
||||
@ExcelProperty("购买的产品 ID,关联到产品表")
|
||||
private String productId;
|
||||
|
||||
@Schema(description = "购买数量(如内购的金币数量,订阅的时长)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("购买数量(如内购的金币数量,订阅的时长)")
|
||||
private Integer purchaseQuantity;
|
||||
|
||||
@Schema(description = "实际支付价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "17601")
|
||||
@ExcelProperty("实际支付价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "货币类型(如美元 $)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("货币类型(如美元 $)")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "购买时间")
|
||||
@ExcelProperty("购买时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@Schema(description = "购买类型(如内购,订阅)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("购买类型(如内购,订阅)")
|
||||
private String purchaseType;
|
||||
|
||||
@Schema(description = "购买状态(如已支付,待支付,退款)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("购买状态(如已支付,待支付,退款)")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "支付方式(如信用卡,支付宝等)")
|
||||
@ExcelProperty("支付方式(如信用卡,支付宝等)")
|
||||
private String paymentMethod;
|
||||
|
||||
@Schema(description = "唯一的交易 ID,用于标识该购买操作", requiredMode = Schema.RequiredMode.REQUIRED, example = "14496")
|
||||
@ExcelProperty("唯一的交易 ID,用于标识该购买操作")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "苹果的原始交易 ID", example = "3666")
|
||||
@ExcelProperty("苹果的原始交易 ID")
|
||||
private String originalTransactionId;
|
||||
|
||||
@Schema(description = "购买的产品 ID 列表(JSON 格式或数组)")
|
||||
@ExcelProperty("购买的产品 ID 列表(JSON 格式或数组)")
|
||||
private Object productIds;
|
||||
|
||||
@Schema(description = "苹果返回的购买时间")
|
||||
@ExcelProperty("苹果返回的购买时间")
|
||||
private LocalDateTime purchaseDate;
|
||||
|
||||
@Schema(description = "苹果返回的过期时间(如果有)")
|
||||
@ExcelProperty("苹果返回的过期时间(如果有)")
|
||||
private LocalDateTime expiresDate;
|
||||
|
||||
@Schema(description = "苹果的环境(如 Sandbox 或 Production)")
|
||||
@ExcelProperty("苹果的环境(如 Sandbox 或 Production)")
|
||||
private String environment;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.yolo.keyboard.controller.admin.userpurchaserecords.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户内购记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserPurchaseRecordsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键,自增,唯一标识每条购买记录", requiredMode = Schema.RequiredMode.REQUIRED, example = "1239")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "用户 ID,关联到用户表,表示是哪位用户购买了产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "21782")
|
||||
@NotNull(message = "用户 ID,关联到用户表,表示是哪位用户购买了产品不能为空")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "购买的产品 ID,关联到产品表", requiredMode = Schema.RequiredMode.REQUIRED, example = "10744")
|
||||
@NotEmpty(message = "购买的产品 ID,关联到产品表不能为空")
|
||||
private String productId;
|
||||
|
||||
@Schema(description = "购买数量(如内购的金币数量,订阅的时长)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "购买数量(如内购的金币数量,订阅的时长)不能为空")
|
||||
private Integer purchaseQuantity;
|
||||
|
||||
@Schema(description = "实际支付价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "17601")
|
||||
@NotNull(message = "实际支付价格不能为空")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "货币类型(如美元 $)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "货币类型(如美元 $)不能为空")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "购买时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@Schema(description = "购买类型(如内购,订阅)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "购买类型(如内购,订阅)不能为空")
|
||||
private String purchaseType;
|
||||
|
||||
@Schema(description = "购买状态(如已支付,待支付,退款)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "购买状态(如已支付,待支付,退款)不能为空")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "支付方式(如信用卡,支付宝等)")
|
||||
private String paymentMethod;
|
||||
|
||||
@Schema(description = "唯一的交易 ID,用于标识该购买操作", requiredMode = Schema.RequiredMode.REQUIRED, example = "14496")
|
||||
@NotEmpty(message = "唯一的交易 ID,用于标识该购买操作不能为空")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "苹果的原始交易 ID", example = "3666")
|
||||
private String originalTransactionId;
|
||||
|
||||
@Schema(description = "购买的产品 ID 列表(JSON 格式或数组)")
|
||||
private Object productIds;
|
||||
|
||||
@Schema(description = "苹果返回的购买时间")
|
||||
private LocalDateTime purchaseDate;
|
||||
|
||||
@Schema(description = "苹果返回的过期时间(如果有)")
|
||||
private LocalDateTime expiresDate;
|
||||
|
||||
@Schema(description = "苹果的环境(如 Sandbox 或 Production)")
|
||||
private String environment;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.userquotatotal;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.userquotatotal.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.userquotatotal.KeyboardUserQuotaTotalDO;
|
||||
import com.yolo.keyboard.service.userquotatotal.KeyboardUserQuotaTotalService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户免费功能永久总次数额度表(所有功能共用)")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/user-quota-total")
|
||||
@Validated
|
||||
public class KeyboardUserQuotaTotalController {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserQuotaTotalService userQuotaTotalService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户免费功能永久总次数额度表(所有功能共用)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-quota-total:create')")
|
||||
public CommonResult<Long> createUserQuotaTotal(@Valid @RequestBody KeyboardUserQuotaTotalSaveReqVO createReqVO) {
|
||||
return success(userQuotaTotalService.createUserQuotaTotal(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户免费功能永久总次数额度表(所有功能共用)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-quota-total:update')")
|
||||
public CommonResult<Boolean> updateUserQuotaTotal(@Valid @RequestBody KeyboardUserQuotaTotalSaveReqVO updateReqVO) {
|
||||
userQuotaTotalService.updateUserQuotaTotal(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户免费功能永久总次数额度表(所有功能共用)")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-quota-total:delete')")
|
||||
public CommonResult<Boolean> deleteUserQuotaTotal(@RequestParam("id") Long id) {
|
||||
userQuotaTotalService.deleteUserQuotaTotal(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户免费功能永久总次数额度表(所有功能共用)")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-quota-total:delete')")
|
||||
public CommonResult<Boolean> deleteUserQuotaTotalList(@RequestParam("ids") List<Long> ids) {
|
||||
userQuotaTotalService.deleteUserQuotaTotalListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户免费功能永久总次数额度表(所有功能共用)")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-quota-total:query')")
|
||||
public CommonResult<KeyboardUserQuotaTotalRespVO> getUserQuotaTotal(@RequestParam("id") Long id) {
|
||||
KeyboardUserQuotaTotalDO userQuotaTotal = userQuotaTotalService.getUserQuotaTotal(id);
|
||||
return success(BeanUtils.toBean(userQuotaTotal, KeyboardUserQuotaTotalRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户免费功能永久总次数额度表(所有功能共用)分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-quota-total:query')")
|
||||
public CommonResult<PageResult<KeyboardUserQuotaTotalRespVO>> getUserQuotaTotalPage(@Valid KeyboardUserQuotaTotalPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardUserQuotaTotalDO> pageResult = userQuotaTotalService.getUserQuotaTotalPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardUserQuotaTotalRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户免费功能永久总次数额度表(所有功能共用) Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-quota-total:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserQuotaTotalExcel(@Valid KeyboardUserQuotaTotalPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardUserQuotaTotalDO> list = userQuotaTotalService.getUserQuotaTotalPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户免费功能永久总次数额度表(所有功能共用).xls", "数据", KeyboardUserQuotaTotalRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardUserQuotaTotalRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yolo.keyboard.controller.admin.userquotatotal.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户免费功能永久总次数额度表(所有功能共用)分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserQuotaTotalPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "免费体验的永久总次数上限(可通过运营活动增加)")
|
||||
private Integer totalQuota;
|
||||
|
||||
@Schema(description = "已消耗的免费次数")
|
||||
private Integer usedQuota;
|
||||
|
||||
@Schema(description = "乐观锁版本号(并发控制预留字段)")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "首次创建额度记录的时间(通常为注册时间)")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最近一次额度发生变化的时间(消耗或赠送)")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yolo.keyboard.controller.admin.userquotatotal.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户免费功能永久总次数额度表(所有功能共用) Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardUserQuotaTotalRespVO {
|
||||
|
||||
@Schema(description = "用户唯一ID,对应系统用户", requiredMode = Schema.RequiredMode.REQUIRED, example = "19113")
|
||||
@ExcelProperty("用户唯一ID,对应系统用户")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "免费体验的永久总次数上限(可通过运营活动增加)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("免费体验的永久总次数上限(可通过运营活动增加)")
|
||||
private Integer totalQuota;
|
||||
|
||||
@Schema(description = "已消耗的免费次数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("已消耗的免费次数")
|
||||
private Integer usedQuota;
|
||||
|
||||
@Schema(description = "乐观锁版本号(并发控制预留字段)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("乐观锁版本号(并发控制预留字段)")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "首次创建额度记录的时间(通常为注册时间)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("首次创建额度记录的时间(通常为注册时间)")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最近一次额度发生变化的时间(消耗或赠送)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("最近一次额度发生变化的时间(消耗或赠送)")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yolo.keyboard.controller.admin.userquotatotal.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户免费功能永久总次数额度表(所有功能共用)新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserQuotaTotalSaveReqVO {
|
||||
|
||||
@Schema(description = "用户唯一ID,对应系统用户", requiredMode = Schema.RequiredMode.REQUIRED, example = "19113")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "免费体验的永久总次数上限(可通过运营活动增加)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "免费体验的永久总次数上限(可通过运营活动增加)不能为空")
|
||||
private Integer totalQuota;
|
||||
|
||||
@Schema(description = "已消耗的免费次数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "已消耗的免费次数不能为空")
|
||||
private Integer usedQuota;
|
||||
|
||||
@Schema(description = "乐观锁版本号(并发控制预留字段)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "乐观锁版本号(并发控制预留字段)不能为空")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "首次创建额度记录的时间(通常为注册时间)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "首次创建额度记录的时间(通常为注册时间)不能为空")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最近一次额度发生变化的时间(消耗或赠送)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "最近一次额度发生变化的时间(消耗或赠送)不能为空")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.userthemes;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.userthemes.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.userthemes.KeyboardUserThemesDO;
|
||||
import com.yolo.keyboard.service.userthemes.KeyboardUserThemesService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户主题")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/user-themes")
|
||||
@Validated
|
||||
public class KeyboardUserThemesController {
|
||||
|
||||
@Resource
|
||||
private KeyboardUserThemesService userThemesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户主题")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-themes:create')")
|
||||
public CommonResult<Long> createUserThemes(@Valid @RequestBody KeyboardUserThemesSaveReqVO createReqVO) {
|
||||
return success(userThemesService.createUserThemes(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户主题")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-themes:update')")
|
||||
public CommonResult<Boolean> updateUserThemes(@Valid @RequestBody KeyboardUserThemesSaveReqVO updateReqVO) {
|
||||
userThemesService.updateUserThemes(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户主题")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-themes:delete')")
|
||||
public CommonResult<Boolean> deleteUserThemes(@RequestParam("id") Long id) {
|
||||
userThemesService.deleteUserThemes(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户主题")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-themes:delete')")
|
||||
public CommonResult<Boolean> deleteUserThemesList(@RequestParam("ids") List<Long> ids) {
|
||||
userThemesService.deleteUserThemesListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户主题")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-themes:query')")
|
||||
public CommonResult<KeyboardUserThemesRespVO> getUserThemes(@RequestParam("id") Long id) {
|
||||
KeyboardUserThemesDO userThemes = userThemesService.getUserThemes(id);
|
||||
return success(BeanUtils.toBean(userThemes, KeyboardUserThemesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户主题分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-themes:query')")
|
||||
public CommonResult<PageResult<KeyboardUserThemesRespVO>> getUserThemesPage(@Valid KeyboardUserThemesPageReqVO pageReqVO) {
|
||||
PageResult<KeyboardUserThemesDO> pageResult = userThemesService.getUserThemesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardUserThemesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户主题 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:user-themes:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserThemesExcel(@Valid KeyboardUserThemesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardUserThemesDO> list = userThemesService.getUserThemesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户主题.xls", "数据", KeyboardUserThemesRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardUserThemesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yolo.keyboard.controller.admin.userthemes.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户主题分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserThemesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "主题主键", example = "21647")
|
||||
private Long themeId;
|
||||
|
||||
@Schema(description = "用户 Id", example = "9884")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "是否从显示移除")
|
||||
private Boolean viewDeleted;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private Boolean updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yolo.keyboard.controller.admin.userthemes.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户主题 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardUserThemesRespVO {
|
||||
|
||||
@Schema(description = "主键 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "746")
|
||||
@ExcelProperty("主键 id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主题主键", example = "21647")
|
||||
@ExcelProperty("主题主键")
|
||||
private Long themeId;
|
||||
|
||||
@Schema(description = "用户 Id", example = "9884")
|
||||
@ExcelProperty("用户 Id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "是否从显示移除")
|
||||
@ExcelProperty("是否从显示移除")
|
||||
private Boolean viewDeleted;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private Boolean updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yolo.keyboard.controller.admin.userthemes.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户主题新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardUserThemesSaveReqVO {
|
||||
|
||||
@Schema(description = "主键 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "746")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主题主键", example = "21647")
|
||||
private Long themeId;
|
||||
|
||||
@Schema(description = "用户 Id", example = "9884")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "是否从显示移除")
|
||||
private Boolean viewDeleted;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private Boolean updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yolo.keyboard.controller.admin.warningmessage;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||
import com.yolo.keyboard.framework.common.pojo.CommonResult;
|
||||
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||
import static com.yolo.keyboard.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yolo.keyboard.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yolo.keyboard.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.yolo.keyboard.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yolo.keyboard.controller.admin.warningmessage.vo.*;
|
||||
import com.yolo.keyboard.dal.dataobject.warningmessage.KeyboardWarningMessageDO;
|
||||
import com.yolo.keyboard.service.warningmessage.KeyboardWarningMessageService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户注销提示信息")
|
||||
@RestController
|
||||
@RequestMapping("/keyboard/warning-message")
|
||||
@Validated
|
||||
public class KeyboardWarningMessageController {
|
||||
|
||||
@Resource
|
||||
private KeyboardWarningMessageService warningMessageService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户注销提示信息")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:warning-message:create')")
|
||||
public CommonResult<Long> createWarningMessage(@Valid @RequestBody KeyboardWarningMessageSaveReqVO createReqVO) {
|
||||
return success(warningMessageService.createWarningMessage(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户注销提示信息")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:warning-message:update')")
|
||||
public CommonResult<Boolean> updateWarningMessage(@Valid @RequestBody KeyboardWarningMessageSaveReqVO updateReqVO) {
|
||||
warningMessageService.updateWarningMessage(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户注销提示信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:warning-message:delete')")
|
||||
public CommonResult<Boolean> deleteWarningMessage(@RequestParam("id") Long id) {
|
||||
warningMessageService.deleteWarningMessage(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除用户注销提示信息")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:warning-message:delete')")
|
||||
public CommonResult<Boolean> deleteWarningMessageList(@RequestParam("ids") List<Long> ids) {
|
||||
warningMessageService.deleteWarningMessageListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户注销提示信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:warning-message:query')")
|
||||
public CommonResult<KeyboardWarningMessageRespVO> getWarningMessage(@RequestParam("id") Long id) {
|
||||
KeyboardWarningMessageDO warningMessage = warningMessageService.getWarningMessage(id);
|
||||
return success(BeanUtils.toBean(warningMessage, KeyboardWarningMessageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户注销提示信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:warning-message:query')")
|
||||
public CommonResult<PageResult<KeyboardWarningMessageRespVO>> getWarningMessagePage(@Valid KeyboardWarningMessagePageReqVO pageReqVO) {
|
||||
PageResult<KeyboardWarningMessageDO> pageResult = warningMessageService.getWarningMessagePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KeyboardWarningMessageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户注销提示信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('keyboard:warning-message:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportWarningMessageExcel(@Valid KeyboardWarningMessagePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<KeyboardWarningMessageDO> list = warningMessageService.getWarningMessagePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户注销提示信息.xls", "数据", KeyboardWarningMessageRespVO.class,
|
||||
BeanUtils.toBean(list, KeyboardWarningMessageRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yolo.keyboard.controller.admin.warningmessage.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户注销提示信息分页 Request VO")
|
||||
@Data
|
||||
public class KeyboardWarningMessagePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "地区")
|
||||
private String locale;
|
||||
|
||||
@Schema(description = "正文")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime created;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.yolo.keyboard.controller.admin.warningmessage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户注销提示信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class KeyboardWarningMessageRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7770")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "地区")
|
||||
@ExcelProperty("地区")
|
||||
private String locale;
|
||||
|
||||
@Schema(description = "正文")
|
||||
@ExcelProperty("正文")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime created;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yolo.keyboard.controller.admin.warningmessage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户注销提示信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class KeyboardWarningMessageSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7770")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "地区")
|
||||
private String locale;
|
||||
|
||||
@Schema(description = "正文")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime created;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.yolo.keyboard.dal.dataobject.aicompanion;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* AI陪聊角色国际化表,用于存储不同语言下的角色名称、一句话描述和详细介绍 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_ai_companion_i18n")
|
||||
@KeySequence("keyboard_ai_companion_i18n_id_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class AiCompanionI18nDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 陪聊角色主表ID,对应 keyboard_ai_companion.id
|
||||
*/
|
||||
private Long companionId;
|
||||
/**
|
||||
* 语言标识,如 zh-CN、en-US、ja-JP
|
||||
*/
|
||||
private String locale;
|
||||
/**
|
||||
* 角色名称(多语言)
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 一句话人设描述(多语言)
|
||||
*/
|
||||
private String shortDesc;
|
||||
/**
|
||||
* 角色详细介绍文案(多语言)
|
||||
*/
|
||||
private String introText;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
private String prologue;
|
||||
|
||||
private String prologueAudio;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.yolo.keyboard.dal.dataobject.aicompanion;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.type.TextArrayTypeHandler;
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* AI陪聊角色表,用于定义恋爱/陪伴型虚拟角色的基础信息与人设 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName(value = "keyboard_ai_companion", autoResultMap = true)
|
||||
@KeySequence("keyboard_ai_companion_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardAiCompanionDO {
|
||||
|
||||
/**
|
||||
* 陪聊角色唯一ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色头像URL,用于列表页和聊天页
|
||||
*/
|
||||
private String avatarUrl;
|
||||
/**
|
||||
* 角色封面图URL,用于角色详情页
|
||||
*/
|
||||
private String coverImageUrl;
|
||||
/**
|
||||
* 角色性别(male / female / other)
|
||||
*/
|
||||
private String gender;
|
||||
/**
|
||||
* 角色年龄段描述(如:20s、25-30)
|
||||
*/
|
||||
private String ageRange;
|
||||
/**
|
||||
* 角色性格标签数组(如:温柔、黏人、治愈)
|
||||
*/
|
||||
@TableField(typeHandler = TextArrayTypeHandler.class)
|
||||
private List<String> personalityTags;
|
||||
/**
|
||||
* 角色说话风格(如:撒娇型、理性型、活泼型)
|
||||
*/
|
||||
private String speakingStyle;
|
||||
/**
|
||||
* AI系统Prompt,定义角色核心人设,仅供模型使用
|
||||
*/
|
||||
private String systemPrompt;
|
||||
/**
|
||||
* 角色状态:1=上线,0=下线
|
||||
*/
|
||||
private Short status;
|
||||
/**
|
||||
* 角色可见性:1=公开,2=内测,3=隐藏
|
||||
*/
|
||||
private Short visibility;
|
||||
/**
|
||||
* 排序权重,数值越大排序越靠前
|
||||
*/
|
||||
private Integer sortOrder;
|
||||
/**
|
||||
* 角色热度评分,用于推荐排序
|
||||
*/
|
||||
private Integer popularityScore;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
/**
|
||||
* 音频Id
|
||||
*/
|
||||
private String voiceId;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Byte deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.yolo.keyboard.dal.dataobject.appversions;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yolo.keyboard.framework.mybatis.core.type.JsonbTypeHandler;
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* App 版本发布与更新检查表:区分 Android/iOS、渠道,支持最低支持版本与强更策略。 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName(value = "keyboard_app_versions", autoResultMap = true)
|
||||
@KeySequence("keyboard_app_versions_id_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class AppVersionsDO {
|
||||
|
||||
/**
|
||||
* 主键,自增版本记录ID。
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 应用标识(支持多App/多包名场景);单App可固定为 main。
|
||||
*/
|
||||
private String appId;
|
||||
/**
|
||||
* 平台:android 或 ios(用 CHECK 约束限制取值)。
|
||||
*/
|
||||
private String platform;
|
||||
/**
|
||||
* 渠道标识:如 official / huawei / xiaomi / testflight 等,用于区分不同分发包。
|
||||
*/
|
||||
private String channel;
|
||||
/**
|
||||
* 展示用版本号(语义版本字符串),如 1.2.3。
|
||||
*/
|
||||
private String versionName;
|
||||
/**
|
||||
* 比较用版本号(整数递增):Android 对应 versionCode;iOS 建议维护同样的递增值以便比较。
|
||||
*/
|
||||
private Long versionCode;
|
||||
/**
|
||||
* iOS 可选构建号(例如 CFBundleVersion),通常为字符串;用于追溯构建或与CI编号对齐。
|
||||
*/
|
||||
private String buildNumber;
|
||||
/**
|
||||
* 最低支持版本号(整数):客户端 version_code 低于该值必须更新/可拒绝继续使用。
|
||||
*/
|
||||
private Long minSupportedCode;
|
||||
/**
|
||||
* 是否强制更新:当客户端未达到最新版本且此字段为 true,可要求强更(即使 >= min_supported_code)。
|
||||
*/
|
||||
private Boolean isForceUpdate;
|
||||
/**
|
||||
* 是否生效:true 表示该版本记录可用于对外更新检查;false 用于下架/撤回。
|
||||
*/
|
||||
private Boolean isActive;
|
||||
/**
|
||||
* 更新说明(展示给用户的版本更新内容)。
|
||||
*/
|
||||
private String releaseNotes;
|
||||
/**
|
||||
* 下载链接:Android 可为 apk 直链/市场 scheme;iOS 通常为 App Store 链接或统一跳转页。
|
||||
*/
|
||||
private String downloadUrl;
|
||||
/**
|
||||
* 应用市场/商店页面链接(可选,若 download_url 已覆盖可不填)。
|
||||
*/
|
||||
private String storeUrl;
|
||||
/**
|
||||
* 扩展元数据(JSON):如包大小、md5、签名信息、最低系统版本等。
|
||||
*/
|
||||
@TableField(typeHandler = JsonbTypeHandler.class)
|
||||
private Object metadata;
|
||||
/**
|
||||
* 发布时间(对外宣布/上线时间),用于展示与排序。
|
||||
*/
|
||||
private LocalDateTime releasedAt;
|
||||
/**
|
||||
* 记录创建时间。
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 记录更新时间(建议配合触发器自动维护)。
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.yolo.keyboard.dal.dataobject.character;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 键盘人设国际化内容 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_character_i18n")
|
||||
@KeySequence("keyboard_character_i18n_id_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class CharacterI18nDO {
|
||||
|
||||
/**
|
||||
* 主键 Id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 角色主表id
|
||||
*/
|
||||
private Long characterId;
|
||||
/**
|
||||
* 语言标识,如 zh-CN/en-US/ja-JP
|
||||
*/
|
||||
private String locale;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String characterName;
|
||||
/**
|
||||
* 背景描述
|
||||
*/
|
||||
private String characterBackground;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -28,14 +28,6 @@ public class KeyboardCharacterDO {
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String characterName;
|
||||
/**
|
||||
* 背景描述
|
||||
*/
|
||||
private String characterBackground;
|
||||
/**
|
||||
* 角色头像
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.yolo.keyboard.dal.dataobject.i18nmessage;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 国际化错误提醒配置 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_i18n_message")
|
||||
@KeySequence("keyboard_i18n_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardI18nMessageDO {
|
||||
|
||||
/**
|
||||
* 主键 id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 地区
|
||||
*/
|
||||
private String locale;
|
||||
/**
|
||||
* 错误提醒
|
||||
*/
|
||||
private String message;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.yolo.keyboard.dal.dataobject.productitems;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 内购商品 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_product_items")
|
||||
@KeySequence("keyboard_product_items_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardProductItemsDO{
|
||||
|
||||
/**
|
||||
* 主键,自增,唯一标识每个产品项
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 产品标识符,唯一标识每个产品(如 com.loveKey.nyx.2month)
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 产品类型,区分订阅(subscription)和内购(in-app-purchase)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 产品名称(如 100, 2)
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 产品单位(如 金币,个月)
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 订阅时长的数值部分(如 2)
|
||||
*/
|
||||
private Integer durationValue;
|
||||
/**
|
||||
* 订阅时长的单位部分(如 月,天)
|
||||
*/
|
||||
private String durationUnit;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 产品的货币单位,如美元($)
|
||||
*/
|
||||
private String currency;
|
||||
/**
|
||||
* 产品的描述,提供更多细节信息
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 产品项的创建时间,默认当前时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 产品项的最后更新时间,更新时自动设置为当前时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
/**
|
||||
* 订阅时长的具体天数
|
||||
*/
|
||||
private Integer durationDays;
|
||||
/**
|
||||
* 订阅等级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
private String platform;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yolo.keyboard.dal.dataobject.tag;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 人设标签 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_tag")
|
||||
@KeySequence("keyboard_tag_id_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardTagDO{
|
||||
|
||||
/**
|
||||
* 主键 Id
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.yolo.keyboard.dal.dataobject.tag;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 人设标签国际化 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("keyboard_tag_i18n")
|
||||
@KeySequence("keyboard_tag_i18n_id_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class TagI18nDO {
|
||||
|
||||
/**
|
||||
* 主键 Id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 标签主表ID,对应 keyboard_tag.id
|
||||
*/
|
||||
private Integer tagId;
|
||||
/**
|
||||
* 语言标识,如 zh-CN、en-US、ja-JP
|
||||
*/
|
||||
private String locale;
|
||||
/**
|
||||
* 标签名称(多语言)
|
||||
*/
|
||||
private String tagName;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.yolo.keyboard.dal.dataobject.tenantbalance;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 租户余额 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("system_tenant_balance")
|
||||
//@KeySequence("system_tenant_balance_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class TenantBalanceDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 租户 Id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 当前积分余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 乐观锁版本号
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
/**
|
||||
* 冻结金额
|
||||
*/
|
||||
private BigDecimal frozenAmt;
|
||||
|
||||
private BigDecimal withdrawableBalance;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.yolo.keyboard.dal.dataobject.tenantbalancetransaction;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 租户积分记录 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("system_tenant_balance_transaction")
|
||||
@KeySequence("system_tenant_balance_transaction_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class TenantBalanceTransactionDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 本次变动点数,正加负减
|
||||
*/
|
||||
private BigDecimal points;
|
||||
/**
|
||||
* 变动后余额快照(冗余)
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 变动类型,如 TRANSFER_IN, WITHDRAW,REFUND_COMMISSION ,RECHARGE_COMMISSION
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 变动描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 订单 Id/业务单号
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 业务流水号(转账、订单等唯一标识)
|
||||
*/
|
||||
private String bizNo;
|
||||
/**
|
||||
* 操作人 Id
|
||||
*/
|
||||
private Long operatorId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private BigDecimal frozenAmt;
|
||||
|
||||
private BigDecimal withdrawableBalance;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.yolo.keyboard.dal.dataobject.tenantcommission;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 租户分成记录 DO
|
||||
* 记录每笔内购订单的分成计算结果
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_tenant_commission")
|
||||
@KeySequence("keyboard_tenant_commission_seq")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardTenantCommissionDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 内购记录ID
|
||||
*/
|
||||
private Integer purchaseRecordId;
|
||||
|
||||
/**
|
||||
* 内购交易ID(唯一标识)
|
||||
*/
|
||||
private String transactionId;
|
||||
|
||||
/**
|
||||
* 被邀请用户ID(购买用户)
|
||||
*/
|
||||
private Integer inviteeUserId;
|
||||
|
||||
/**
|
||||
* 邀请人用户ID
|
||||
*/
|
||||
private Long inviterUserId;
|
||||
|
||||
/**
|
||||
* 收益归属租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 内购金额
|
||||
*/
|
||||
private BigDecimal purchaseAmount;
|
||||
|
||||
/**
|
||||
* 分成比例
|
||||
*/
|
||||
private BigDecimal commissionRate;
|
||||
|
||||
/**
|
||||
* 分成金额
|
||||
*/
|
||||
private BigDecimal commissionAmount;
|
||||
|
||||
/**
|
||||
* 状态:PENDING-待结算,SETTLED-已结算,REFUNDED-已退款
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 内购时间
|
||||
*/
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
/**
|
||||
* 结算时间
|
||||
*/
|
||||
private LocalDateTime settledAt;
|
||||
|
||||
/**
|
||||
* 关联的余额交易记录ID
|
||||
*/
|
||||
private Long balanceTransactionId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
/**
|
||||
* 可提现时间(结算时间 + 30天)
|
||||
*/
|
||||
private LocalDateTime withdrawableAt;
|
||||
|
||||
/**
|
||||
* 是否已处理转可提现:false-未处理,true-已处理
|
||||
*/
|
||||
private Boolean withdrawableProcessed;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.yolo.keyboard.dal.dataobject.tenantwithdraworder;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 租户提现订单表(申请-审核-打款-完成/失败) DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("system_tenant_withdraw_order")
|
||||
@KeySequence("system_tenant_withdraw_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardTenantWithdrawOrderDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 提现单号(业务唯一)
|
||||
*/
|
||||
private String withdrawNo;
|
||||
/**
|
||||
* 业务幂等号(防重复提交)
|
||||
*/
|
||||
private String bizNo;
|
||||
/**
|
||||
* 币种(默认 CNY)
|
||||
*/
|
||||
private String currency;
|
||||
/**
|
||||
* 提现申请金额(单位:元)
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 手续费金额(单位:元)
|
||||
*/
|
||||
private BigDecimal feeAmount;
|
||||
/**
|
||||
* 实际到账金额(单位:元 = amount - fee_amount)
|
||||
*/
|
||||
private BigDecimal actualAmount;
|
||||
/**
|
||||
* 打款渠道:BANK/ALIPAY/WECHAT/PAYPAL 等
|
||||
*/
|
||||
private String payChannel;
|
||||
/**
|
||||
* 收款方类型:PERSON(个人)/COMPANY(企业)
|
||||
*/
|
||||
private String payeeType;
|
||||
/**
|
||||
* 收款人姓名或公司名称(快照)
|
||||
*/
|
||||
private String payeeName;
|
||||
/**
|
||||
* 收款账号(银行卡/支付宝等,建议加密或脱敏)
|
||||
*/
|
||||
private String payeeAccount;
|
||||
/**
|
||||
* 收款银行名称
|
||||
*/
|
||||
private String payeeBankName;
|
||||
/**
|
||||
* 银行编码(可选)
|
||||
*/
|
||||
private String payeeBankCode;
|
||||
/**
|
||||
* 银行支行名称(可选)
|
||||
*/
|
||||
private String payeeBankBranch;
|
||||
/**
|
||||
* 提现状态:APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 审核状态:PENDING/PASSED/REJECTED
|
||||
*/
|
||||
private String auditStatus;
|
||||
/**
|
||||
* 拒绝原因或打款失败原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 提现申请时间
|
||||
*/
|
||||
private LocalDateTime applyTime;
|
||||
/**
|
||||
* 审核完成时间
|
||||
*/
|
||||
private LocalDateTime auditTime;
|
||||
/**
|
||||
* 发起打款时间(请求第三方)
|
||||
*/
|
||||
private LocalDateTime payTime;
|
||||
/**
|
||||
* 打款成功时间(第三方确认)
|
||||
*/
|
||||
private LocalDateTime paidTime;
|
||||
/**
|
||||
* 业务终态时间(成功/失败/取消)
|
||||
*/
|
||||
private LocalDateTime finishTime;
|
||||
/**
|
||||
* 打款批次号(内部使用)
|
||||
*/
|
||||
private String payerBatchNo;
|
||||
/**
|
||||
* 第三方打款交易号/流水号(对账用)
|
||||
*/
|
||||
private String channelTradeNo;
|
||||
/**
|
||||
* 第三方返回的原始报文(用于排查)
|
||||
*/
|
||||
private Object channelRaw;
|
||||
/**
|
||||
* 关联余额流水ID(冻结/扣减/返还)
|
||||
*/
|
||||
private Long balanceTxnId;
|
||||
/**
|
||||
* 乐观锁版本号
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
/**
|
||||
* 提现申请人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
/**
|
||||
* 审核人ID
|
||||
*/
|
||||
private Long auditorId;
|
||||
/**
|
||||
* 打款操作人ID
|
||||
*/
|
||||
private Long payerId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
private Long tenantId;
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.yolo.keyboard.dal.dataobject.themes;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.type.JsonbTypeHandler;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
@@ -14,7 +16,7 @@ import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_themes")
|
||||
@TableName(value = "keyboard_themes", autoResultMap = true)
|
||||
@KeySequence("keyboard_themes_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@@ -40,6 +42,7 @@ public class KeyboardThemesDO {
|
||||
/**
|
||||
* 主题标签
|
||||
*/
|
||||
@TableField(typeHandler = JsonbTypeHandler.class)
|
||||
private Object themeTag;
|
||||
/**
|
||||
* 主题下载次数
|
||||
@@ -86,5 +89,5 @@ public class KeyboardThemesDO {
|
||||
*/
|
||||
private Long realDownloadCount;
|
||||
|
||||
|
||||
private String local;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yolo.keyboard.dal.dataobject.themestyles;
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -38,5 +39,5 @@ public class KeyboardThemeStylesDO {
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
|
||||
private String local;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.yolo.keyboard.dal.dataobject.usercalllog;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 用户每次调用日志(用于记录token、模型、耗时、成功率等) DO
|
||||
*
|
||||
* @author Ziin
|
||||
*/
|
||||
@TableName("keyboard_user_call_log")
|
||||
@KeySequence("keyboard_user_call_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardUserCallLogDO{
|
||||
|
||||
/**
|
||||
* 主键 id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 幂等请求ID,避免重试导致重复记录
|
||||
*/
|
||||
private String requestId;
|
||||
/**
|
||||
* 调用功能来源
|
||||
*/
|
||||
private String feature;
|
||||
/**
|
||||
* 调用的模型名称
|
||||
*/
|
||||
private String model;
|
||||
/**
|
||||
* 输入token数
|
||||
*/
|
||||
private Integer inputTokens;
|
||||
/**
|
||||
* 输出token数
|
||||
*/
|
||||
private Integer outputTokens;
|
||||
/**
|
||||
* 总token数(input+output)
|
||||
*/
|
||||
private Integer totalTokens;
|
||||
/**
|
||||
* 调用是否成功
|
||||
*/
|
||||
private Boolean success;
|
||||
/**
|
||||
* 调用耗时(毫秒)
|
||||
*/
|
||||
private Integer latencyMs;
|
||||
/**
|
||||
* 失败错误码(可空)
|
||||
*/
|
||||
private String errorCode;
|
||||
/**
|
||||
* 调用记录创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 生成 id
|
||||
*/
|
||||
private String genId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.yolo.keyboard.dal.dataobject.usercharacter;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 用户人设管理 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_user_character")
|
||||
@KeySequence("keyboard_user_character_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardUserCharacterDO{
|
||||
|
||||
/**
|
||||
* 主键 Id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 键盘人设 id
|
||||
*/
|
||||
private Long characterId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
/**
|
||||
* 用户 Id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* emoji 标签
|
||||
*/
|
||||
private String emoji;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.yolo.keyboard.dal.dataobject.userinvitecodes;
|
||||
|
||||
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.yolo.keyboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 用户生成的邀请码表,用于邀请新用户注册/安装并建立邀请关系 DO
|
||||
*
|
||||
* @author ziin
|
||||
*/
|
||||
@TableName("keyboard_user_invite_codes")
|
||||
@KeySequence("invite_codes_id_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class KeyboardUserInviteCodesDO {
|
||||
|
||||
/**
|
||||
* 邀请码主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 邀请码字符串,对外展示,唯一
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 邀请码所属用户ID(邀请人)
|
||||
*/
|
||||
private Long ownerUserId;
|
||||
/**
|
||||
* 邀请码状态:1=启用,0=停用
|
||||
*/
|
||||
private Short status;
|
||||
/**
|
||||
* 邀请码创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 邀请码过期时间,NULL表示永久有效
|
||||
*/
|
||||
private LocalDateTime expiresAt;
|
||||
/**
|
||||
* 邀请码最大可使用次数,NULL表示不限次数
|
||||
*/
|
||||
private Integer maxUses;
|
||||
/**
|
||||
* 邀请码已使用次数
|
||||
*/
|
||||
private Integer usedCount;
|
||||
/**
|
||||
* 邀请码所属租户
|
||||
*/
|
||||
private Long ownerTenantId;
|
||||
/**
|
||||
* 邀请码所属系统用户
|
||||
*/
|
||||
private Long ownerSystemUserId;
|
||||
/**
|
||||
* 邀请码类型
|
||||
*/
|
||||
private String inviteType;
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user