wechat yoga miniprogram
1.0.0
A WeChat applet developed using Rust for scheduling yoga classes.
This program, including back-end server, database, browser administrator front-end, WeChat applet, plus related setup and configuration, has a certain degree of complexity. But it is also a good project for training and developing abilities.
All code including the database has been made public except for some sensitive information.
You can use the following command to start the backend server in the PowerShell terminal of Windows system:
# 使用恰当的参数替换中文描述的内容
$ENV:DATA_SOURCE_NAME="host=数据库公网IP port=数据库侦听端口 user=数据库用户名 password=数据库密码 dbname=数据库名称 sslmode=disable";$ENV:AUTH_URL="https: //api.weixin.qq.com /sns/jscode2session?appid=小程序Id&secret=小程序密钥&grant_type=authorization_code&js_code=";$ENV:SECRET="长度32的字符串"; go run main.go
Some PowerShell commands used in development to simplify file operations.
将当前目录切换为 Rust 模块所在的目录,然后创建单独的 Rust 源代码文件,最后获取该目录下的所有 Rust 源代码文件,进行过滤后,将其全部写入 mod.rs,以便在其他位置的代码可以使用该模块内的所有代码
$dir="C:UsersAdministratorDesktopfileygserversrc";$name="models";$filename="settings.rs";Set-Location $dir;New-Item -Type "directory" $name;Set-Location $name; New-Item mod.rs;New-Item $filename;Get-ChildItem | Where-Object { $_.Name -ne "mod.rs" } | Split-Path -LeafBase | Join-String -FormatString "pub mod { 0 } ;`r`n" | Set-Content -Path .mod.rs;`
用于创建微信小程序页面文件夹,和其包含的 4 个同名文件
$name="adminLesson";$dir="C:UsersAdministratorDesktopfileygminiprogrampages";Set-Location $dir;New-Item -Type "directory" $name;Set-Location $name;New-Item $name".js";New-Item $name".wxml";New-Item $name".wxss";New-Item $name".json";