Compare commits
4 Commits
bcecb8b3e9
...
4c81ebac23
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c81ebac23 | |||
| 4255b9ee05 | |||
| c7b31de1b1 | |||
| 8e551f6bb2 |
@@ -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,53 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.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,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,82 @@
|
|||||||
|
package com.yolo.keyboard.dal.dataobject.productitems;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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,95 @@
|
|||||||
|
package com.yolo.keyboard.dal.dataobject.userpurchaserecords;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
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("keyboard_user_purchase_records")
|
||||||
|
@KeySequence("keyboard_user_purchase_records_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TenantIgnore
|
||||||
|
public class KeyboardUserPurchaseRecordsDO{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键,自增,唯一标识每条购买记录
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 用户 ID,关联到用户表,表示是哪位用户购买了产品
|
||||||
|
*/
|
||||||
|
private Integer userId;
|
||||||
|
/**
|
||||||
|
* 购买的产品 ID,关联到产品表
|
||||||
|
*/
|
||||||
|
private String productId;
|
||||||
|
/**
|
||||||
|
* 购买数量(如内购的金币数量,订阅的时长)
|
||||||
|
*/
|
||||||
|
private Integer purchaseQuantity;
|
||||||
|
/**
|
||||||
|
* 实际支付价格
|
||||||
|
*/
|
||||||
|
private BigDecimal price;
|
||||||
|
/**
|
||||||
|
* 货币类型(如美元 $)
|
||||||
|
*/
|
||||||
|
private String currency;
|
||||||
|
/**
|
||||||
|
* 购买时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime purchaseTime;
|
||||||
|
/**
|
||||||
|
* 购买类型(如内购,订阅)
|
||||||
|
*/
|
||||||
|
private String purchaseType;
|
||||||
|
/**
|
||||||
|
* 购买状态(如已支付,待支付,退款)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 支付方式(如信用卡,支付宝等)
|
||||||
|
*/
|
||||||
|
private String paymentMethod;
|
||||||
|
/**
|
||||||
|
* 唯一的交易 ID,用于标识该购买操作
|
||||||
|
*/
|
||||||
|
private String transactionId;
|
||||||
|
/**
|
||||||
|
* 苹果的原始交易 ID
|
||||||
|
*/
|
||||||
|
private String originalTransactionId;
|
||||||
|
/**
|
||||||
|
* 购买的产品 ID 列表(JSON 格式或数组)
|
||||||
|
*/
|
||||||
|
private Object productIds;
|
||||||
|
/**
|
||||||
|
* 苹果返回的购买时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime purchaseDate;
|
||||||
|
/**
|
||||||
|
* 苹果返回的过期时间(如果有)
|
||||||
|
*/
|
||||||
|
private LocalDateTime expiresDate;
|
||||||
|
/**
|
||||||
|
* 苹果的环境(如 Sandbox 或 Production)
|
||||||
|
*/
|
||||||
|
private String environment;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.yolo.keyboard.dal.mysql.i18nmessage;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.i18nmessage.KeyboardI18nMessageDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.yolo.keyboard.controller.admin.i18nmessage.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化错误提醒配置 Mapper
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface KeyboardI18nMessageMapper extends BaseMapperX<KeyboardI18nMessageDO> {
|
||||||
|
|
||||||
|
default PageResult<KeyboardI18nMessageDO> selectPage(KeyboardI18nMessagePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardI18nMessageDO>()
|
||||||
|
.eqIfPresent(KeyboardI18nMessageDO::getCode, reqVO.getCode())
|
||||||
|
.eqIfPresent(KeyboardI18nMessageDO::getLocale, reqVO.getLocale())
|
||||||
|
.eqIfPresent(KeyboardI18nMessageDO::getMessage, reqVO.getMessage())
|
||||||
|
.orderByDesc(KeyboardI18nMessageDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.yolo.keyboard.dal.mysql.productitems;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.productitems.KeyboardProductItemsDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.yolo.keyboard.controller.admin.productitems.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内购商品 Mapper
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface KeyboardProductItemsMapper extends BaseMapperX<KeyboardProductItemsDO> {
|
||||||
|
|
||||||
|
default PageResult<KeyboardProductItemsDO> selectPage(KeyboardProductItemsPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardProductItemsDO>()
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getProductId, reqVO.getProductId())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getType, reqVO.getType())
|
||||||
|
.likeIfPresent(KeyboardProductItemsDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getUnit, reqVO.getUnit())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getDurationValue, reqVO.getDurationValue())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getDurationUnit, reqVO.getDurationUnit())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getPrice, reqVO.getPrice())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getCurrency, reqVO.getCurrency())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getDescription, reqVO.getDescription())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getCreatedAt, reqVO.getCreatedAt())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getUpdatedAt, reqVO.getUpdatedAt())
|
||||||
|
.eqIfPresent(KeyboardProductItemsDO::getDurationDays, reqVO.getDurationDays())
|
||||||
|
.orderByDesc(KeyboardProductItemsDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.yolo.keyboard.dal.mysql.usercalllog;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.usercalllog.KeyboardUserCallLogDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.yolo.keyboard.controller.admin.usercalllog.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户每次调用日志(用于记录token、模型、耗时、成功率等) Mapper
|
||||||
|
*
|
||||||
|
* @author Ziin
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface KeyboardUserCallLogMapper extends BaseMapperX<KeyboardUserCallLogDO> {
|
||||||
|
|
||||||
|
default PageResult<KeyboardUserCallLogDO> selectPage(KeyboardUserCallLogPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardUserCallLogDO>()
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getUserId, reqVO.getUserId())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getRequestId, reqVO.getRequestId())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getFeature, reqVO.getFeature())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getModel, reqVO.getModel())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getInputTokens, reqVO.getInputTokens())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getOutputTokens, reqVO.getOutputTokens())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getTotalTokens, reqVO.getTotalTokens())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getSuccess, reqVO.getSuccess())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getLatencyMs, reqVO.getLatencyMs())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getErrorCode, reqVO.getErrorCode())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getCreatedAt, reqVO.getCreatedAt())
|
||||||
|
.eqIfPresent(KeyboardUserCallLogDO::getGenId, reqVO.getGenId())
|
||||||
|
.orderByDesc(KeyboardUserCallLogDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.yolo.keyboard.dal.mysql.userpurchaserecords;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.userpurchaserecords.KeyboardUserPurchaseRecordsDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.yolo.keyboard.controller.admin.userpurchaserecords.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户内购记录 Mapper
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface KeyboardUserPurchaseRecordsMapper extends BaseMapperX<KeyboardUserPurchaseRecordsDO> {
|
||||||
|
|
||||||
|
default PageResult<KeyboardUserPurchaseRecordsDO> selectPage(KeyboardUserPurchaseRecordsPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardUserPurchaseRecordsDO>()
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getUserId, reqVO.getUserId())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getProductId, reqVO.getProductId())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getPurchaseQuantity, reqVO.getPurchaseQuantity())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getPrice, reqVO.getPrice())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getCurrency, reqVO.getCurrency())
|
||||||
|
.betweenIfPresent(KeyboardUserPurchaseRecordsDO::getPurchaseTime, reqVO.getPurchaseTime())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getPurchaseType, reqVO.getPurchaseType())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getPaymentMethod, reqVO.getPaymentMethod())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getTransactionId, reqVO.getTransactionId())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getOriginalTransactionId, reqVO.getOriginalTransactionId())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getProductIds, reqVO.getProductIds())
|
||||||
|
.betweenIfPresent(KeyboardUserPurchaseRecordsDO::getPurchaseDate, reqVO.getPurchaseDate())
|
||||||
|
.betweenIfPresent(KeyboardUserPurchaseRecordsDO::getExpiresDate, reqVO.getExpiresDate())
|
||||||
|
.eqIfPresent(KeyboardUserPurchaseRecordsDO::getEnvironment, reqVO.getEnvironment())
|
||||||
|
.orderByDesc(KeyboardUserPurchaseRecordsDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.yolo.keyboard.service.i18nmessage;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.i18nmessage.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.i18nmessage.KeyboardI18nMessageDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化错误提醒配置 Service 接口
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
public interface KeyboardI18nMessageService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建国际化错误提醒配置
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createI18nMessage(@Valid KeyboardI18nMessageSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新国际化错误提醒配置
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateI18nMessage(@Valid KeyboardI18nMessageSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除国际化错误提醒配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteI18nMessage(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除国际化错误提醒配置
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteI18nMessageListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得国际化错误提醒配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 国际化错误提醒配置
|
||||||
|
*/
|
||||||
|
KeyboardI18nMessageDO getI18nMessage(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得国际化错误提醒配置分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 国际化错误提醒配置分页
|
||||||
|
*/
|
||||||
|
PageResult<KeyboardI18nMessageDO> getI18nMessagePage(KeyboardI18nMessagePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.yolo.keyboard.service.i18nmessage;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.i18nmessage.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.i18nmessage.KeyboardI18nMessageDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.dal.mysql.i18nmessage.KeyboardI18nMessageMapper;
|
||||||
|
|
||||||
|
import static com.yolo.keyboard.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.yolo.keyboard.module.infra.enums.ErrorCodeConstants.I18N_MESSAGE_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化错误提醒配置 Service 实现类
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class KeyboardI18nMessageServiceImpl implements KeyboardI18nMessageService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private KeyboardI18nMessageMapper i18nMessageMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createI18nMessage(KeyboardI18nMessageSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
KeyboardI18nMessageDO i18nMessage = BeanUtils.toBean(createReqVO, KeyboardI18nMessageDO.class);
|
||||||
|
i18nMessageMapper.insert(i18nMessage);
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
return i18nMessage.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateI18nMessage(KeyboardI18nMessageSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateI18nMessageExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
KeyboardI18nMessageDO updateObj = BeanUtils.toBean(updateReqVO, KeyboardI18nMessageDO.class);
|
||||||
|
i18nMessageMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteI18nMessage(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateI18nMessageExists(id);
|
||||||
|
// 删除
|
||||||
|
i18nMessageMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteI18nMessageListByIds(List<Long> ids) {
|
||||||
|
// 删除
|
||||||
|
i18nMessageMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void validateI18nMessageExists(Long id) {
|
||||||
|
if (i18nMessageMapper.selectById(id) == null) {
|
||||||
|
throw exception(I18N_MESSAGE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KeyboardI18nMessageDO getI18nMessage(Long id) {
|
||||||
|
return i18nMessageMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<KeyboardI18nMessageDO> getI18nMessagePage(KeyboardI18nMessagePageReqVO pageReqVO) {
|
||||||
|
return i18nMessageMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.yolo.keyboard.service.productitems;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.productitems.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.productitems.KeyboardProductItemsDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内购商品 Service 接口
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
public interface KeyboardProductItemsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建内购商品
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createProductItems(@Valid KeyboardProductItemsSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新内购商品
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateProductItems(@Valid KeyboardProductItemsSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除内购商品
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteProductItems(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除内购商品
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteProductItemsListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得内购商品
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 内购商品
|
||||||
|
*/
|
||||||
|
KeyboardProductItemsDO getProductItems(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得内购商品分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 内购商品分页
|
||||||
|
*/
|
||||||
|
PageResult<KeyboardProductItemsDO> getProductItemsPage(KeyboardProductItemsPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.yolo.keyboard.service.productitems;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.productitems.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.productitems.KeyboardProductItemsDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.dal.mysql.productitems.KeyboardProductItemsMapper;
|
||||||
|
|
||||||
|
import static com.yolo.keyboard.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.yolo.keyboard.module.infra.enums.ErrorCodeConstants.PRODUCT_ITEMS_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内购商品 Service 实现类
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class KeyboardProductItemsServiceImpl implements KeyboardProductItemsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private KeyboardProductItemsMapper productItemsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createProductItems(KeyboardProductItemsSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
KeyboardProductItemsDO productItems = BeanUtils.toBean(createReqVO, KeyboardProductItemsDO.class);
|
||||||
|
productItemsMapper.insert(productItems);
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
return productItems.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProductItems(KeyboardProductItemsSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateProductItemsExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
KeyboardProductItemsDO updateObj = BeanUtils.toBean(updateReqVO, KeyboardProductItemsDO.class);
|
||||||
|
productItemsMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProductItems(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateProductItemsExists(id);
|
||||||
|
// 删除
|
||||||
|
productItemsMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProductItemsListByIds(List<Long> ids) {
|
||||||
|
// 删除
|
||||||
|
productItemsMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void validateProductItemsExists(Long id) {
|
||||||
|
if (productItemsMapper.selectById(id) == null) {
|
||||||
|
throw exception(PRODUCT_ITEMS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KeyboardProductItemsDO getProductItems(Long id) {
|
||||||
|
return productItemsMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<KeyboardProductItemsDO> getProductItemsPage(KeyboardProductItemsPageReqVO pageReqVO) {
|
||||||
|
return productItemsMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.yolo.keyboard.service.usercalllog;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.usercalllog.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.usercalllog.KeyboardUserCallLogDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户每次调用日志(用于记录token、模型、耗时、成功率等) Service 接口
|
||||||
|
*
|
||||||
|
* @author Ziin
|
||||||
|
*/
|
||||||
|
public interface KeyboardUserCallLogService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户每次调用日志(用于记录token、模型、耗时、成功率等)
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createUserCallLog(@Valid KeyboardUserCallLogSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户每次调用日志(用于记录token、模型、耗时、成功率等)
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateUserCallLog(@Valid KeyboardUserCallLogSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户每次调用日志(用于记录token、模型、耗时、成功率等)
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteUserCallLog(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户每次调用日志(用于记录token、模型、耗时、成功率等)
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteUserCallLogListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户每次调用日志(用于记录token、模型、耗时、成功率等)
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 用户每次调用日志(用于记录token、模型、耗时、成功率等)
|
||||||
|
*/
|
||||||
|
KeyboardUserCallLogDO getUserCallLog(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户每次调用日志(用于记录token、模型、耗时、成功率等)分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 用户每次调用日志(用于记录token、模型、耗时、成功率等)分页
|
||||||
|
*/
|
||||||
|
PageResult<KeyboardUserCallLogDO> getUserCallLogPage(KeyboardUserCallLogPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.yolo.keyboard.service.usercalllog;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.usercalllog.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.usercalllog.KeyboardUserCallLogDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.dal.mysql.usercalllog.KeyboardUserCallLogMapper;
|
||||||
|
|
||||||
|
import static com.yolo.keyboard.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.yolo.keyboard.module.infra.enums.ErrorCodeConstants.USER_CALL_LOG_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户每次调用日志(用于记录token、模型、耗时、成功率等) Service 实现类
|
||||||
|
*
|
||||||
|
* @author Ziin
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class KeyboardUserCallLogServiceImpl implements KeyboardUserCallLogService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private KeyboardUserCallLogMapper userCallLogMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createUserCallLog(KeyboardUserCallLogSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
KeyboardUserCallLogDO userCallLog = BeanUtils.toBean(createReqVO, KeyboardUserCallLogDO.class);
|
||||||
|
userCallLogMapper.insert(userCallLog);
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
return userCallLog.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUserCallLog(KeyboardUserCallLogSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateUserCallLogExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
KeyboardUserCallLogDO updateObj = BeanUtils.toBean(updateReqVO, KeyboardUserCallLogDO.class);
|
||||||
|
userCallLogMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUserCallLog(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateUserCallLogExists(id);
|
||||||
|
// 删除
|
||||||
|
userCallLogMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUserCallLogListByIds(List<Long> ids) {
|
||||||
|
// 删除
|
||||||
|
userCallLogMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void validateUserCallLogExists(Long id) {
|
||||||
|
if (userCallLogMapper.selectById(id) == null) {
|
||||||
|
throw exception(USER_CALL_LOG_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KeyboardUserCallLogDO getUserCallLog(Long id) {
|
||||||
|
return userCallLogMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<KeyboardUserCallLogDO> getUserCallLogPage(KeyboardUserCallLogPageReqVO pageReqVO) {
|
||||||
|
return userCallLogMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.yolo.keyboard.service.userpurchaserecords;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.userpurchaserecords.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.userpurchaserecords.KeyboardUserPurchaseRecordsDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户内购记录 Service 接口
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
public interface KeyboardUserPurchaseRecordsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户内购记录
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Integer createUserPurchaseRecords(@Valid KeyboardUserPurchaseRecordsSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户内购记录
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateUserPurchaseRecords(@Valid KeyboardUserPurchaseRecordsSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户内购记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteUserPurchaseRecords(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户内购记录
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteUserPurchaseRecordsListByIds(List<Integer> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户内购记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 用户内购记录
|
||||||
|
*/
|
||||||
|
KeyboardUserPurchaseRecordsDO getUserPurchaseRecords(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户内购记录分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 用户内购记录分页
|
||||||
|
*/
|
||||||
|
PageResult<KeyboardUserPurchaseRecordsDO> getUserPurchaseRecordsPage(KeyboardUserPurchaseRecordsPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.yolo.keyboard.service.userpurchaserecords;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.yolo.keyboard.controller.admin.userpurchaserecords.vo.*;
|
||||||
|
import com.yolo.keyboard.dal.dataobject.userpurchaserecords.KeyboardUserPurchaseRecordsDO;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageResult;
|
||||||
|
import com.yolo.keyboard.framework.common.pojo.PageParam;
|
||||||
|
import com.yolo.keyboard.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.yolo.keyboard.dal.mysql.userpurchaserecords.KeyboardUserPurchaseRecordsMapper;
|
||||||
|
|
||||||
|
import static com.yolo.keyboard.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.yolo.keyboard.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.yolo.keyboard.module.infra.enums.ErrorCodeConstants.USER_PURCHASE_RECORDS_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户内购记录 Service 实现类
|
||||||
|
*
|
||||||
|
* @author ziin
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class KeyboardUserPurchaseRecordsServiceImpl implements KeyboardUserPurchaseRecordsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private KeyboardUserPurchaseRecordsMapper userPurchaseRecordsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer createUserPurchaseRecords(KeyboardUserPurchaseRecordsSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
KeyboardUserPurchaseRecordsDO userPurchaseRecords = BeanUtils.toBean(createReqVO, KeyboardUserPurchaseRecordsDO.class);
|
||||||
|
userPurchaseRecordsMapper.insert(userPurchaseRecords);
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
return userPurchaseRecords.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUserPurchaseRecords(KeyboardUserPurchaseRecordsSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateUserPurchaseRecordsExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
KeyboardUserPurchaseRecordsDO updateObj = BeanUtils.toBean(updateReqVO, KeyboardUserPurchaseRecordsDO.class);
|
||||||
|
userPurchaseRecordsMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUserPurchaseRecords(Integer id) {
|
||||||
|
// 校验存在
|
||||||
|
validateUserPurchaseRecordsExists(id);
|
||||||
|
// 删除
|
||||||
|
userPurchaseRecordsMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUserPurchaseRecordsListByIds(List<Integer> ids) {
|
||||||
|
// 删除
|
||||||
|
userPurchaseRecordsMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void validateUserPurchaseRecordsExists(Integer id) {
|
||||||
|
if (userPurchaseRecordsMapper.selectById(id) == null) {
|
||||||
|
throw exception(USER_PURCHASE_RECORDS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KeyboardUserPurchaseRecordsDO getUserPurchaseRecords(Integer id) {
|
||||||
|
return userPurchaseRecordsMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<KeyboardUserPurchaseRecordsDO> getUserPurchaseRecordsPage(KeyboardUserPurchaseRecordsPageReqVO pageReqVO) {
|
||||||
|
return userPurchaseRecordsMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yolo.keyboard.dal.mysql.i18nmessage.KeyboardI18nMessageMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yolo.keyboard.dal.mysql.productitems.KeyboardProductItemsMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yolo.keyboard.dal.mysql.usercalllog.KeyboardUserCallLogMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yolo.keyboard.dal.mysql.userpurchaserecords.KeyboardUserPurchaseRecordsMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.yolo.keyboard.module.keyboard.dal.mysql.userwallet.KeyboardUserWalletMapper">
|
<mapper namespace="com.yolo.keyboard.dal.mysql.userwallet.KeyboardUserWalletMapper">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode THEME_PURCHASE_NOT_EXISTS = new ErrorCode(1_001_202_003, "皮肤购买记录表(积分支付)不存在");
|
ErrorCode THEME_PURCHASE_NOT_EXISTS = new ErrorCode(1_001_202_003, "皮肤购买记录表(积分支付)不存在");
|
||||||
ErrorCode CHARACTER_NOT_EXISTS = new ErrorCode(1_001_202_004, "键盘人设不存在");
|
ErrorCode CHARACTER_NOT_EXISTS = new ErrorCode(1_001_202_004, "键盘人设不存在");
|
||||||
ErrorCode USER_WALLET_NOT_EXISTS = new ErrorCode(1_001_202_005, "用户钱包不存在");
|
ErrorCode USER_WALLET_NOT_EXISTS = new ErrorCode(1_001_202_005, "用户钱包不存在");
|
||||||
|
ErrorCode USER_PURCHASE_RECORDS_NOT_EXISTS = new ErrorCode(1_001_202_006, "用户内购记录不存在");
|
||||||
|
ErrorCode PRODUCT_ITEMS_NOT_EXISTS = new ErrorCode(1_001_202_007, "内购商品不存在");
|
||||||
|
ErrorCode USER_CALL_LOG_NOT_EXISTS = new ErrorCode(1_001_202_008, "用户每次调用日志(用于记录token、模型、耗时、成功率等)不存在");
|
||||||
|
ErrorCode I18N_MESSAGE_NOT_EXISTS = new ErrorCode(1_001_202_009, "国际化错误提醒配置不存在");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user