Giter VIP home page Giter VIP logo

chouqian's Introduction

🔄 抽签

此为我为班级白板编写的一款抽签程序,后端使用 Golang,客户端使用 Visual Basic。

😋 功能

其功能看似很简单,点击浮窗即可抽取一名随机学生。

长按(或右键)悬浮窗即可退出。

但是,其拥有一些「有趣的功能」,详见 配置文件 这节。

比如,给某名学生设置别名,或者是给某名幸运儿设置保底次数。

除了这些功能之外,把窗口的底边向下拉,长按学号就可以看见一个隐藏「黑幕」按钮,点击按钮,就可以用手机扫码设置幸运观众。

🗄️ 后端

后端位于 Backend 文件夹,基于 Golang 的 Gin 框架,可以使用 math/rand 生成伪随机数,也可以使用 crypto/rand 生成真随机数,保证绝对公平。

使用如下命令编译:

cd Backend
GOOS=windows go build -o ChouQianBackend.exe

🖊️ 配置文件

可以在 Backend/chouqian_backend_example.json 获取到示例配置文件。

.chouqian.students 字段为学生列表,采用 ["学号", "姓名"] 的方式填写。

.chouqian.special_config 字段为有趣小功能的配置。baodi 中可以给某名学生设置保底,replacements 字段可以给学生设置别名或别号。

.chouqian.api_cooldown 为扫码遥控功能冷却的分钟数。

.chouqian.random_mode 为随机数模式(math / crypto)。

.qr 字段是二维码 IP 相关的设置,因为校园网环境复杂,因此一台电子白板可能有不止一个 IP。此字段用于确保获取到正确的 IP,而不是每次整活时,都去网络适配器选项里禁用网卡。

📝 前端

前端位于 Frontend 文件夹中。

💻 客户端

客户端位于 Client 文件夹中,使用 Visual Basic 编写。

依赖 VBJSONstdPicEx2 库。

编译时可以使用 Make-My-Manifest 附加 manifest 以启用现代控件和高 DPI 支持。

config.json 中更改 BackgroundPath 项可以更改抽签签筒的图片。需要是白色背景。

🔧 配置工具

配置工具位于 Configure 文件夹中,可以图形化更改后端的配置。

依赖 VBJSON 库和 .NET Framework 4.0.30319(仅用于 UTF-8 编码解码)。

chouqian's People

Contributors

chiyuki0325 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

xxdoc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.