Initial commit

This commit is contained in:
jackyu66git
2026-03-23 11:52:51 +08:00
commit ea8d889fbe
1114 changed files with 92438 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.oneone.cloud</groupId>
<artifactId>oneone-pms</artifactId>
<version>${revision}</version>
</parent>
<artifactId>oneone-pms-api</artifactId>
<dependencies>
<dependency>
<groupId>com.oneone.cloud</groupId>
<artifactId>common-core</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<scope>provided</scope> <!-- 设置为 provided,主要是 PageParam 使用到 -->
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<optional>true</optional>
</dependency>
<!-- RPC 远程调用相关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,17 @@
package com.oneone.pms;
import com.oneone.common.constant.GlobalConstants;
/**
* @author JH-Rent
*/
public class ApiConstants {
public static final String NAME = "pms-server";
public static final String PREFIX = GlobalConstants.INNER_RPC +"/pms";
public static final String VERSION = "1.0.0";
public static final String GO_SERVER_NAME = "monitor";
}
@@ -0,0 +1,51 @@
package com.oneone.pms.api.account;
import com.oneone.common.result.Result;
import com.oneone.pms.ApiConstants;
import com.oneone.pms.api.account.dto.PlatformUserInfoDTO;
import com.oneone.pms.api.account.dto.UserLoginAccountInfoDTO;
import com.oneone.pms.api.account.vo.RegisterParam;
import com.oneone.pms.api.account.vo.UserLoginAccountParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = ApiConstants.NAME , contextId = "account" ) // TODO fallbackFactory =
@Tag(name = "RPC 服务 - 字典数据")
public interface IPlatformAccountApi {
String PREFIX = ApiConstants.PREFIX + "/account";
@GetMapping(PREFIX + "/platform-user/{id}")
@Operation(summary = "根据id获取平台用户信息")
@Parameters({
@Parameter(name = "id", description = "platformUserId", example = "1", required = true)
})
Result<PlatformUserInfoDTO> getPlatformUserInfo(@PathVariable(value="id") Long id);
@PostMapping(PREFIX + "/platform-user/getAccountInfo")
Result<UserLoginAccountInfoDTO> getUserLoginAccountInfo(@RequestBody UserLoginAccountParam userLoginAccountParam);
@PostMapping("/platform-user/register-account")
Result<UserLoginAccountInfoDTO> register(@RequestBody RegisterParam param);
@PostMapping("/platform-user/bind-account")
Result<Boolean> bindAccount(@RequestBody RegisterParam param);
@PostMapping("/platform-user/checkUserHasBindGrantType")
Result<Boolean> checkUserHasBindGrantType(@RequestParam(name = "platformUserId") Long platformUserId,
@RequestParam(name = "grantType") String grantType);
@PostMapping("/platform-user/getAccountByPlatformUserId")
Result<UserLoginAccountInfoDTO> getAccountByPlatformUserId(@RequestParam(name = "platformUserId") Long platformUserId,
@RequestParam(name = "grantType") String grantType);
}
@@ -0,0 +1,27 @@
package com.oneone.pms.api.account.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
public class PlatformUserInfoDTO implements Serializable {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27599")
private Long id;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status;
@Schema(description = "身份证", requiredMode = Schema.RequiredMode.REQUIRED)
private String idCard;
@Schema(description = "真实姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
private String realName;
@Schema(description = "最近登录区id", example = "32358")
private Integer lastRegionId;
}
@@ -0,0 +1,49 @@
package com.oneone.pms.api.account.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class UserLoginAccountInfoDTO {
/**
* 用户id
*/
// @Schema(description ="用户id")
// private Long memberId;
@Schema(description = "平台用户id")
private Long platformUserId;
@Schema(description = "1新用户 0老用户")
private Integer isNewUser=0;
/**
* 账号类型
*/
@Schema(description = "账号类型")
private String accountType;
/**
* 账号
*/
@Schema(description = "账号")
private String account;
/**
* 密码
*/
// @Schema(description = "密码")
// private String password;
/**
* 1:启用 0:禁用
*/
@Schema(description = "1:启用 0:禁用")
private Integer status;
@Schema(description = "区id")
private Integer regionId;
}
@@ -0,0 +1,74 @@
package com.oneone.pms.api.account.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author mice
* @version 1.0
* @date 2022-09-21 10:48
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RegisterParam {
/**
* 账号类型
*/
@Schema(description="账号类型")
private String accountType;
/**
* 账号
*/
@Schema(description="账号")
private String account;
/**
* 密码
*/
@Schema(description="密码")
private String password;
@Schema(description="全局唯一id")
private String unionId;
@Schema(description="手机号")
private String phone;
@Schema(description="绑定的UserId")
private Long platformUserId;
private String nickName;
private String avatarUrl;
public RegisterParam(String accountType, String account, String password) {
this.accountType = accountType;
this.account = account;
this.password = password;
}
public RegisterParam(String accountType, String account) {
this.accountType = accountType;
this.account = account;
}
public RegisterParam(Long platformUserId,String accountType, String account, String password) {
this.platformUserId = platformUserId;
this.accountType = accountType;
this.account = account;
this.password = password;
}
public RegisterParam(String accountType, String account, String password, String unionId, String phone, String nickName, String avatar) {
this.accountType = accountType;
this.account = account;
this.password = password;
this.unionId = unionId;
this.phone = phone;
this.nickName = nickName;
this.avatarUrl = avatar;
}
}
@@ -0,0 +1,29 @@
package com.oneone.pms.api.account.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author mice
* @version 1.0
* @date 2022-09-21 10:41
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserLoginAccountParam {
/**
* 账号类型
*/
@Schema(description="账号类型")
private String accountType;
/**
* 账号
*/
@Schema(description="账号")
private String account;
}
@@ -0,0 +1,25 @@
package com.oneone.pms.api.loginconfig;
import com.oneone.common.result.Result;
import com.oneone.pms.ApiConstants;
import com.oneone.pms.api.account.dto.PlatformUserInfoDTO;
import com.oneone.pms.api.account.dto.UserLoginAccountInfoDTO;
import com.oneone.pms.api.account.vo.UserLoginAccountParam;
import com.oneone.pms.api.loginconfig.dto.AppThirdLoginDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = ApiConstants.NAME , contextId = "third-login-config") // TODO fallbackFactory =
@Tag(name = "RPC 服务 - 字典数据")
public interface IThirdLoginConfigApi {
String PREFIX = ApiConstants.PREFIX + "/login-config";
@GetMapping("/get-config")
Result<AppThirdLoginDTO> thirdLoginConfig(@RequestParam(value="type",required = true) String type);
}
@@ -0,0 +1,46 @@
package com.oneone.pms.api.loginconfig.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@Data
public class AppThirdLoginDTO implements Serializable {
@Schema(description="")
private Integer id;
/**
* 三方登录类型
*/
@Schema(description="三方登录类型")
private String type;
/**
* 应用id
*/
@Schema(description="应用id")
private String thirdAppId;
/**
* privateKey
*/
@Schema(description="privateKey")
private String privateKey;
/**
* publicKey
*/
@Schema(description="publicKey")
private String publicKey;
/**
* 0未启用 1已启用
*/
@Schema(description="0未启用 1已启用")
private Boolean status;
@Schema(description="0未启用 1已启用")
private Long lastUpdateTime;
}
@@ -0,0 +1,58 @@
package com.oneone.pms.enums;
import com.oneone.common.exception.ErrorCode;
public interface ErrorCodeConstants{
ErrorCode PLATFORM_REGION_NOT_EXISTS = new ErrorCode(1_004_000_001, "游戏大区不存在");
ErrorCode PLATFORM_SERVER_NOT_EXISTS = new ErrorCode(1_004_000_002, "区服务器不存在");
ErrorCode PLATFORM_THIRD_LOGIN_CONFIG_NOT_EXISTS = new ErrorCode(1_004_000_003, "三方登录配置不存在");
ErrorCode PLATFORM_USER_NOT_EXISTS = new ErrorCode(1_004_000_004, "用户账户不存在");
ErrorCode PLATFORM_USER_ACCOUNT_NOT_EXISTS = new ErrorCode(1_004_000_005, "玩家登录账号不存在");
ErrorCode USER_EXIST = new ErrorCode(1_004_000_006, "账号已存在");
ErrorCode REQ_PARAM_ERROR = new ErrorCode(1_000_000_001, "请求参数不正确");
ErrorCode NOT_EXISTS = new ErrorCode(1_000_000_002, "数据未找到");
ErrorCode NO_AUTHORITY = new ErrorCode(1_000_000_003, "没有操作权限");
ErrorCode QUESTION_INFO_NOT_EXISTS = new ErrorCode(1_004_000_007, "问卷信息不存在");
ErrorCode QUESTION_OPTION_NOT_EXISTS = new ErrorCode(1_004_000_008, "问卷选项不存在");
ErrorCode TEST_INFO_NOT_EXISTS = new ErrorCode(1_004_000_009, "问卷信息不存在");
ErrorCode TEST_RESULT_NOT_EXISTS= new ErrorCode(1_004_000_010, "问卷结果不存在");
ErrorCode USER_CHOICE_NOT_EXISTS = new ErrorCode(1_004_000_011, "用户选择不存在");
ErrorCode BANNER_INFO_NOT_EXISTS = new ErrorCode(1_004_000_012, "banner信息不存在");
ErrorCode ORDER_EXPIRE = new ErrorCode(1_004_100_001, "订单过期");
ErrorCode PAY_ORDER_HAS_PAYED = new ErrorCode(1_004_100_002, "订单已支付");
ErrorCode PAY_AMOUNT_ERROR = new ErrorCode(1_004_100_003, "支付金额与订单金额不一致");
ErrorCode PAY_ORDER_CREATE_FAILED = new ErrorCode(1_004_100_004, "支付订单创建失败");
ErrorCode CREATE_FAILED = new ErrorCode(1_004_100_005, "订单创建失败");
ErrorCode PLEASE_WAITE = new ErrorCode(1_004_100_006, "请稍后再试");
ErrorCode PAGE_HAS_EXPIRED = new ErrorCode(1_004_100_007, "当前页面已过期,请重新刷新页面再提交");
ErrorCode PAY_WAY_NOT_SUPPORT = new ErrorCode(1_004_100_008, "支付方式不支持");
ErrorCode MAX_BUY_LIMIT = new ErrorCode(1_004_100_009, "已达限购次数");
ErrorCode PAY_CHANNEL_CLOSED = new ErrorCode(1_004_100_010, "支付渠道已关闭");
ErrorCode PAY_TIMEOUT = new ErrorCode(1_004_100_011, "支付超时");
ErrorCode ORDER_STATUS_ERROR = new ErrorCode(1_004_100_012, "订单状态不正确");
ErrorCode SOLD_OUT = new ErrorCode(1_004_100_011, "所选时间已被预约");
}
@@ -0,0 +1,233 @@
package com.oneone.pms.enums;
import com.oneone.common.constant.CommonConstant;
import lombok.AllArgsConstructor;
import lombok.Getter;
public class PlatformConstant extends CommonConstant {
/**
* 秒杀售罄
*/
public final static String SEC_KILL_SELL_OUT = "sec_kill_sell_out:";
/**
* 预购秒杀售罄
*/
public final static String PRE_SEC_KILL_SELL_OUT = "pre_sec_kill_sell_out:";
/**
* 秒杀大闸
*/
public final static String SEC_KILL_DOOR_COUNT = "sec_kill_door_count:";
/**
* 秒杀token
*/
public final static String SEC_KILL_TOKEN = "sec_kill_token:";
/**
* 订单锁
*/
public final static String ORDER_LOCK = "order_lock:";
public enum AuditConst
{
REVIEWED("REVIEWED","待审核"),
REJECT("REJECT","拒绝"),
PASS("PASS","通过"),
PLATE_PASS("PLATE_PASS","平台通过"),
UPDATE("UPDATE","更新中"),
NEW("NEW","待申请"),
TRILATERAL_ENTRY_FAILED("TRILATERAL_ENTRY_FAILED","三方入驻失败"),
BUSINESS_ACTIVATION_FAILED("BUSINESS_ACTIVATION_FAILED","三方业务开通失败"),
UNDER_ENTRY_REVIEW("UNDER_ENTRY_REVIEW","入住审核中"),
BUSINESS_ACTIVATION_REVIEW("BUSINESS_ACTIVATION_REVIEW","业务激活审查");
AuditConst(String value, String name) {
this.value = value;
this.name=name;
}
private String value;
private String name;
public String getValue() {
return value;
}
public String getName() {
return name;
}
}
public enum LikeTypeConstant
{
VIDEO(0,"视频"),
JOB(1,"工作");
LikeTypeConstant(Integer value, String name) {
this.value = value;
this.name=name;
}
private int value;
private String name;
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
public enum TestStatusConstant
{
NORMAL(1,"启用"),
ABNORMAL(2,"禁用");
TestStatusConstant(Integer value, String name) {
this.value = value;
this.name=name;
}
private int value;
private String name;
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
public enum EmergencyContactTypeConstant
{
// 父母 夫妻 子女 朋友
FRIEND(1,"朋友"),
CHILDREN(2,"子女"),
COUPLE(3,"夫妻"),
PARENTS (4,"父母");
EmergencyContactTypeConstant(Integer value, String name) {
this.value = value;
this.name=name;
}
private int value;
private String name;
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
public enum OrderStatusConstant
{
// 0锁定(待支付) 1已支付(待使用) 3待使用(暂时不用)
// 4已使用(待用户确认) 5已完成 6申请退款中(待退款审核) 7退款中 8已退款 9取消
LOCK(0,"锁定(待支付)"),
PAID(1,"已支付(待使用)"),
TO_USE(3,"待使用(暂时不用)"),
USED (4,"已使用(待用户确认)"),
FINISHED (5,"已完成"),
TO_REFUND (6,"申请退款中(待退款审核)"),
REFUNDING (7,"退款中"),
REFUND (8,"已退款"),
CANCEL (9,"取消"),
REFUND_FAILED (10,"退款失败"),
;
OrderStatusConstant(Integer value, String name) {
this.value = value;
this.name=name;
}
private int value;
private String name;
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
public enum RedisDelayQueueEnum
{
ORDER_PAYMENT_TIMEOUT("ORDER_PAYMENT_TIMEOUT","订单支付超时,自动取消订单"),
;
RedisDelayQueueEnum(String value, String name) {
this.value = value;
this.name=name;
}
private String value;
private String name;
public String getValue() {
return value;
}
public String getName() {
return name;
}
}
@AllArgsConstructor
public enum PayStatusEnum {
PENDING_PAYMENT(1, "待支付"),
PAYING(5, "支付中"),
PAY_FAILED(10, "支付失败"),
AUTO_CANCEL(15, "系统取消"),
USER_CANCEL(20, "用户取消"),
PAY_FINISHED(25, "支付完成"),
;
@Getter
private Integer code;
@Getter
private String text;
public static PayStatusEnum getValue(Integer code) {
for (PayStatusEnum value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
}
@AllArgsConstructor
public enum RefundStatusEnum {
REFUND(1, "退款中"),
FINISHED(5, "退款完成"),
FAILED(10, "退款失败"),
;
@Getter
private int code;
@Getter
private String text;
public static RefundStatusEnum getValue(int code) {
for (RefundStatusEnum value : values()) {
if (value.getCode()==code) {
return value;
}
}
return null;
}
}
}