From 3b3bf34bb4b46c06646dbc41d063c7bd270c3ebd Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Fri, 18 Apr 2025 01:37:59 +0800 Subject: [PATCH] 1 --- .../.vscode/fileheader.template.js | 87 +++++++++++++++++++ .../data/config/HuixiabaoConfig.java | 19 ++-- 2 files changed, 95 insertions(+), 11 deletions(-) create mode 100644 code/cpicxim-XMNHSA-repeater/.vscode/fileheader.template.js diff --git a/code/cpicxim-XMNHSA-repeater/.vscode/fileheader.template.js b/code/cpicxim-XMNHSA-repeater/.vscode/fileheader.template.js new file mode 100644 index 0000000..aa2379f --- /dev/null +++ b/code/cpicxim-XMNHSA-repeater/.vscode/fileheader.template.js @@ -0,0 +1,87 @@ +/* + * @Author: Kane + * @Date: 2025-03-16 00:35:09 + * @LastEditors: Kane + * @FilePath: /cpicxim-huixiabao/.vscode/fileheader.template.js + * @Description: + * + * Copyright (c) ${2023} by Kane, All Rights Reserved. + */ +/** + * This file is generated by VSCode extension: Fileheader Pro + */ + +/** + * These comments can help you write your own template with type hint + * @typedef {Object} FileheaderVariable Fileheader variables + * @property {string} birthtime file birth time. will get it from VCS or fallback to filesystem when it is not available + * @property {string} mtime file modification time. will get it from VCS or fallback to filesystem when it is not available + * @property {string} authorName if the file is tracked by VCS, it will get the author name from VCS. else it will get it from current user name + * @property {string} authorEmail if the file is tracked by VCS, it will get the author email from VCS. else it will get it from current user email + * @property {string} userName else it will get it from current user name + * @property {string} userEmail user email is from VSCode config, and fallback to VCS config + * @property {string} companyName + * @property {string} projectName name of current project + * @property {string} filePath the file path, relative to project root with POSIX path separator + * @property {string} dirPath the directory path, relative to project root with POSIX path separator + * @property {string} fileName filename with extension + */ + + /** + * @typedef {string | number | null | undefined | Template | boolean} TemplateInterpolation NOTE: boolean or falsy value will render empty string + * + * @typedef {{ strings: TemplateStringsArray; interpolations: TemplateInterpolation[]; }} Template + * @typedef {(strings: TemplateStringsArray, ...values: any[]) => string} ITemplateFunction + * + */ + +/** + * Please confirm your provider extends from globalThis.FileheaderLanguageProvider + */ +class CustomLanguageProvider extends globalThis.FileheaderLanguageProvider { + /** + * @type {string[]} + */ + languages = [ + "java", + "javascript", + "typescript", + "javascriptreact", + "typescriptreact", + ]; + + /** + * @type {string=} the language block comment start string. + * this is for future feature: support detect old custom template when custom template changes + */ + blockCommentStart = "/**"; + + /** + * @type {string=} + */ + blockCommentEnd = "*/"; + + /** + * get your template when document language matched + * @param {ITemplateFunction} tpl template function, it is a tagged function, support nested interpolation + * @param {FileheaderVariable} variables template variables + * @returns {Template} + */ + getTemplate(tpl, variables) { + // prettier-ignore + return tpl +`/** + * @Author: ${variables.authorName} <${variables.authorEmail}> + * @Date: ${variables.birthtime} + * @LastEditors: ${variables.userName} + * @LastModified: ${variables.mtime} + * @FilePath: ${variables.filePath} + * @Description: + * + * Copyright (c) ${2025} by Kane All rights reserved + */`; + } +} + +// export your provider classes +module.exports = [CustomLanguageProvider]; diff --git a/code/cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java b/code/cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java index ac6f160..562fdc8 100644 --- a/code/cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java +++ b/code/cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java @@ -1,15 +1,12 @@ -/* - * @Author: Kane +/** + * @Author: Kane Wang + * @Date: 2025-03-11 15:08:37 + * @LastEditors: Kane Wang + * @LastModified: 2025-04-18 00:52:16 + * @FilePath: src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java + * @Description: * - * @Date: 2025-03-11 09:30:38 - * - * @LastEditors: Kane - * - * @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java - * - * @Description: 存放惠厦保相关的配置文件,以后要改成json文件存放。 - * - * Copyright (c) ${2023} by Kane, All Rights Reserved. + * Copyright (c) 2025 by Kane All rights reserved */ package com.cpic.xim.huixiabao.data.config;