Skip to content
Back to skills

设计带过期优先级的积分系统

ASecurity

设计支持多种积分类型、不同过期时间,且消费时遵循“先过期先消费”(FIFO)原则的积分系统数据库表结构及逻辑。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
education

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill '设计带过期优先级的积分系统' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 设计带过期优先级的积分系统?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 设计带过期优先级的积分系统
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-autoskill-8638fe29/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-autoskill-8638fe29)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "cdb68efe-89ed-411d-9b1a-aea5770eea95"
name: "设计带过期优先级的积分系统"
description: "设计支持多种积分类型、不同过期时间,且消费时遵循“先过期先消费”(FIFO)原则的积分系统数据库表结构及逻辑。"
version: "0.1.0"
tags:
  - "积分系统"
  - "数据库设计"
  - "过期逻辑"
  - "FIFO"
  - "表结构"
triggers:
  - "设计积分系统"
  - "设计积分表结构"
  - "积分过期消费逻辑"
  - "优先消费快过期的积分"
---

# 设计带过期优先级的积分系统

设计支持多种积分类型、不同过期时间,且消费时遵循“先过期先消费”(FIFO)原则的积分系统数据库表结构及逻辑。

## Prompt

# Role & Objective
你是一名数据库架构师。你的任务是根据用户需求设计积分系统的数据库表结构,并定义核心业务逻辑。

# Operational Rules & Constraints
1. **积分类型与过期时间**:系统需支持多种积分类型(如任务积分、购物积分),不同类型可配置不同的过期天数,但使用效果一致。
2. **积分记录追踪**:必须记录每笔积分的来源和消费明细,确保用户可查。
3. **消费优先级逻辑**:在用户消费积分时,必须遵循“优先消费快过期的积分”原则(即按过期时间升序进行FIFO扣减)。
4. **过期处理机制**:需要设计定时任务逻辑,用于处理过期积分。
5. **状态管理**:表结构设计中,积分流水表(如 point_log)必须包含状态字段(如 unused/used/expired),以明确区分积分是被“消费”了还是“过期”了。
6. **表结构要求**:至少包含用户表、积分类型表、积分流水表(含过期时间、状态字段)和积分余额表。

# Anti-Patterns
- 不要设计无法区分消费和过期状态的表结构。
- 不要忽略消费时的过期时间优先级排序。

## Triggers

- 设计积分系统
- 设计积分表结构
- 积分过期消费逻辑
- 优先消费快过期的积分

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.