koishi-plugin-tmp-application-change 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +4 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -32,8 +32,8 @@ var Config = import_koishi.Schema.object({
32
32
  token: import_koishi.Schema.string().description("API访问令牌").required(),
33
33
  allowedGroups: import_koishi.Schema.array(import_koishi.Schema.string()).description("允许使用指令的群号列表").required(),
34
34
  checkApiUrl: import_koishi.Schema.string().description("查询申请状态的API地址").required(),
35
- approveApiUrl: import_koishi.Schema.string().description("同意申请的API地址模板,支持{recruitment_id}、{token}占位符").required(),
36
- declineApiUrl: import_koishi.Schema.string().description("拒绝申请的API地址模板,支持{recruitment_id}、{reason}、{token}占位符").required()
35
+ approveApiUrl: import_koishi.Schema.string().description("同意申请的API地址模板,支持{recruitment_id}、{action}、{token}占位符").required(),
36
+ declineApiUrl: import_koishi.Schema.string().description("拒绝申请的API地址模板,支持{recruitment_id}、{action}、{reason}、{token}占位符").required()
37
37
  });
38
38
  var logger = new import_koishi2.Logger("tmp-application-change");
39
39
  function apply(ctx, config) {
@@ -71,7 +71,7 @@ function apply(ctx, config) {
71
71
  return `该申请已经审核过了,当前状态: ${application.status}`;
72
72
  }
73
73
  if (statusLower === "同意") {
74
- let approveUrl = config.approveApiUrl.replace("{recruitment_id}", recruitmentId).replace("{token}", config.token);
74
+ let approveUrl = config.approveApiUrl.replace("{recruitment_id}", recruitmentId).replace("{action}", "hire").replace("{token}", config.token);
75
75
  logger.info(`执行同意审批: ${approveUrl}`);
76
76
  const approveResponse = await ctx.http.get(approveUrl);
77
77
  logger.info(`同意审批响应: ${JSON.stringify(approveResponse)}`);
@@ -81,7 +81,7 @@ function apply(ctx, config) {
81
81
  return `同意失败: ${approveResponse.msg || "未知错误"}`;
82
82
  }
83
83
  } else {
84
- let declineUrl = config.declineApiUrl.replace("{recruitment_id}", recruitmentId).replace("{reason}", encodeURIComponent(reason)).replace("{token}", config.token);
84
+ let declineUrl = config.declineApiUrl.replace("{recruitment_id}", recruitmentId).replace("{action}", "decline").replace("{reason}", encodeURIComponent(reason)).replace("{token}", config.token);
85
85
  logger.info(`执行拒绝审批: ${declineUrl}`);
86
86
  const declineResponse = await ctx.http.get(declineUrl);
87
87
  logger.info(`拒绝审批响应: ${JSON.stringify(declineResponse)}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-tmp-application-change",
3
3
  "description": "truckersmp中vtc申请审批",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "contributors": [
6
6
  "opwop <slhp1013@qq.com>"
7
7
  ],