{"id":15672174,"url":"https://github.com/cssxsh/mirai-economy-core","last_synced_at":"2025-05-06T20:41:56.727Z","repository":{"id":37032137,"uuid":"501981048","full_name":"cssxsh/mirai-economy-core","owner":"cssxsh","description":"Mirai Console 经济服务前置插件","archived":false,"fork":false,"pushed_at":"2024-09-12T09:31:49.000Z","size":241,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-25T18:01:40.490Z","etag":null,"topics":["mirai","mirai-console","mirai-plugin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cssxsh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-10T09:26:24.000Z","updated_at":"2024-09-12T09:31:53.000Z","dependencies_parsed_at":"2024-09-12T19:18:28.952Z","dependency_job_id":"cf1019a8-fefd-407a-bb22-7386a1fd0d66","html_url":"https://github.com/cssxsh/mirai-economy-core","commit_stats":{"total_commits":61,"total_committers":3,"mean_commits":"20.333333333333332","dds":0.09836065573770492,"last_synced_commit":"b5ebdff788f4f8d16cec9f6c4222fd46e085e2df"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-economy-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-economy-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-economy-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Fmirai-economy-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssxsh","download_url":"https://codeload.github.com/cssxsh/mirai-economy-core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242833097,"owners_count":20192683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mirai","mirai-console","mirai-plugin"],"created_at":"2024-10-03T15:22:14.057Z","updated_at":"2025-03-10T10:30:36.685Z","avatar_url":"https://github.com/cssxsh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mirai Economy Core\n\n\u003e Mirai 经济服务前置插件\n\n[![maven-central](https://img.shields.io/maven-central/v/xyz.cssxsh.mirai/mirai-economy-core)](https://search.maven.org/artifact/xyz.cssxsh.mirai/mirai-economy-core)\n[![Jpa Economy Service Test](https://github.com/cssxsh/mirai-economy-core/actions/workflows/Test.yml/badge.svg)](https://github.com/cssxsh/mirai-economy-core/actions/workflows/Test.yml)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/18191e26563d47eaa3354d43cfa57ff6)](https://www.codacy.com/gh/cssxsh/mirai-economy-core/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=cssxsh/mirai-economy-core\u0026amp;utm_campaign=Badge_Grade)\n\n**目前需要 [Mirai Hibernate Plugin](https://github.com/cssxsh/mirai-hibernate-plugin) 前置才能使用**\n\n默认的经济货币为 `mirai-coin`  \n已对接 `Mirai 币` 的插件有：  \n* [壶言经济@Moyuyanli](https://github.com/Moyuyanli/HuYanEconomy)  \n* [LoliYouWant@MrXiaoM](https://github.com/MrXiaoM/LoliYouWant)\n* [MiraiDailySign@MrXiaoM](https://github.com/MrXiaoM/MiraiDailySign)\n\n## 在 Mirai Console Plugin 项目中引用\n\n```kotlin\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    compileOnly(\"xyz.cssxsh.mirai:mirai-economy-core:${version}\")\n}\n\n// hibernate 6 和 HikariCP 5 需要 jdk11\nmirai {\n    jvmTarget = JavaVersion.VERSION_11\n}\n```\n\n### 示例代码\n\n*   [kotlin](src/test/kotlin/xyz/cssxsh/mirai/economy/EconomyServiceTest.kt)\n*   [java](src/test/java/xyz/cssxsh/mirai/economy/EconomyUtilsTest.java)\n\n### 自定义货币\n\n自定义货币 提供以下两种方式\n\n1.  实现 `xyz.cssxsh.mirai.economy.service.EconomyCurrency` 接口  \n    然后使用 `EconomyService.register` 注册货币\n\n2.  脚本文件夹, 例如 [Lua](example/currencies/Lua) 或 [TXT](example/currencies/Him188), 文件夹名称将是 货币ID  \n    也支持打包为 Zip 压缩包, 此时压缩包名称将是 货币ID  \n    可以使用 `EconomyScriptCurrency.fromFolder`  或者 `EconomyScriptCurrency.fromZip` 手动加载, 然后手动注册  \n    也可以放到 `data/xyz.cssxsh.mirai.plugin.mirai-economy-core/currencies` 中，在经济系统初始化时自动加载并注册\n\n## [爱发电](https://afdian.net/@cssxsh)\n\n![afdian](.github/afdian.jpg)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssxsh%2Fmirai-economy-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssxsh%2Fmirai-economy-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssxsh%2Fmirai-economy-core/lists"}