package cn.teammodel.common;

import com.azure.cosmos.models.PartitionKey;

/**
 * 分区键常量
 * @author winter
 * @create 2023-11-22 15:31
 */
public interface PK {
    /**
    * 评价树
    */
    String PK_APPRAISE = "Appraise";
    /**
     * 学生的评价记录
    * 参数数量: 1 , 拼接: SchoolId
    */
    String PK_APPRAISE_RECORD = "AppraiseRecord-%s";
    String COMMON_BASE = "Base";
    String PK_LESSON_RECORD = "LessonRecord-%s";
    /**
    * 学生,拼接学校 id
    */
    String STUDENT = "Base-%s";
    String CLASS = "Class-%s";
    String CHAT_SESSION = "ChatSession";
    /**
     * DeepSeek问答会话
     */
    String DEEPSEEK_SESSION  ="DeepSeekSession";
    String WEEK_DUTY = "Duty";
    String WEEK_DUTY_RECORD = "DutyRecord-%s";
    String CHAT_APP = "ChatApp";
    String NEWS = "News-%s";
    String CLASS_RESULT = "ExamClassResult-%s";
    String EXAM = "Exam-%s";
    String PTTEACHER = "PtTeacher-%s";
    String TEACHER = "Teacher-%s";

    /**
    * 构建分区键
    */
    static PartitionKey of(String pk) {
        return new PartitionKey(pk);
    }

    /**
    * 需要传参构建分区键<br/>
     * 注意: 参数的个数不会在编译时被校验,需自己注意
    */
    static PartitionKey buildOf(String pk, String... args) {
        String pkStr = String.format(pk, args);
        return new PartitionKey(pkStr);
    }

}
