TASK:新增订阅计划概念

This commit is contained in:
2025-12-11 09:44:25 +08:00
parent 22bc8750c8
commit 7f094265da
14 changed files with 1062 additions and 15 deletions

View File

@@ -0,0 +1,7 @@
package com.ai.da.mapper.primary;
import com.ai.da.mapper.primary.entity.SubscriptionPlan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface SubscriptionPlanMapper extends BaseMapper<SubscriptionPlan> {
}

View File

@@ -140,4 +140,6 @@ public class Account implements Serializable {
@ApiModelProperty("givenName")
private String givenName;
private Long subscriptionPlanId;
}

View File

@@ -0,0 +1,87 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("t_subscription_plan")
public class SubscriptionPlan extends BaseEntity{
/**
* 组织id
*/
private Long organizationId;
/**
* 订阅命名
*/
private String name;
/**
* 当前订阅开始时间
*/
private Long currentPeriodStart;
/**
* 当前订阅结束时间
*/
private Long currentPeriodEnd;
/**
* 当前订阅总的子账号数量
*/
private Integer accountNum;
/**
* 当前订阅可用积分上限
*/
private BigDecimal creditLimit;
/**
* 当前订阅已使用积分
*/
private BigDecimal creditUsage;
/**
* 管理员账户id
*/
private Long adminAccId;
@TableLogic(value = "0", delval = "1")
private Integer isDeleted;
/**
* 删除人的用户id
*/
private Long deleteBy;
/**
* 状态
*/
private String status;
// 在类内部定义的枚举
@Getter
public enum SubscriptionStatus {
PENDING("待激活", 0),
ACTIVE("已激活", 1),
EXPIRED("已过期", 2),
CANCELLED("已取消", 3);
private final String desc;
private final int code;
SubscriptionStatus(String desc, int code) {
this.desc = desc;
this.code = code;
}
}
}