增加一些字段
This commit is contained in:
2
.idea/dataSources.xml
generated
2
.idea/dataSources.xml
generated
@@ -5,7 +5,7 @@
|
||||
<driver-ref>postgresql</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:postgresql://home.hzer.xyz:5432/postgres</jdbc-url>
|
||||
<jdbc-url>jdbc:postgresql://home.hzer.xyz:65500/postgres</jdbc-url>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
<data-source source="LOCAL" name="gotify" uuid="bf0d9667-0cf1-4470-bd69-6a15c4a18b78">
|
||||
|
||||
1
.idea/serv.iml
generated
1
.idea/serv.iml
generated
@@ -10,6 +10,7 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/packages/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/packages/docker-watcher/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/packages/hutils/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/packages/message-pusher/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
||||
@@ -21,3 +21,4 @@ futures = "0.3.31"
|
||||
log = "0.4.27"
|
||||
actix-web = "4.11.0"
|
||||
hutils = { path = "./packages/hutils"}
|
||||
model = { path = "./packages/model"}
|
||||
|
||||
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(DeriveEntityModel, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "id_card")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
#[sea_orm(primary_key, unique)]
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub gender: Gender,
|
||||
@@ -13,6 +13,7 @@ pub struct Model {
|
||||
pub address: Option<String>,
|
||||
pub nation: String,
|
||||
pub create_at: DateTime,
|
||||
pub update_at: DateTime,
|
||||
}
|
||||
pub type IDCardModel = Model;
|
||||
|
||||
|
||||
@@ -10,3 +10,5 @@ log.workspace = true
|
||||
sea-orm.workspace = true
|
||||
regex.workspace = true
|
||||
actix-web.workspace = true
|
||||
model.workspace = true
|
||||
hutils.workspace = true
|
||||
7
packages/serv/http/frps/dashboard/dashboard.http
Normal file
7
packages/serv/http/frps/dashboard/dashboard.http
Normal file
@@ -0,0 +1,7 @@
|
||||
### TCP代理请求
|
||||
GET http://home.hzer.xyz:7500/api/proxy/tcp
|
||||
Authorization: Basic {{token}}
|
||||
|
||||
### UDP代理请求
|
||||
GET http://home.hzer.xyz:7500/api/proxy/udp
|
||||
Authorization: Basic {{token}}
|
||||
7
packages/serv/http/frps/dashboard/http-client.env.json
Normal file
7
packages/serv/http/frps/dashboard/http-client.env.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"dev": {
|
||||
"user": "hz",
|
||||
"password": "hzer0428",
|
||||
"token": "aHo6aHplcjA0Mjg="
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
use actix_web::rt::Runtime;
|
||||
use log::info;
|
||||
use regex::Regex;
|
||||
use sea_orm::{ActiveModelTrait, Database, DatabaseConnection, Set};
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::iter::once;
|
||||
use std::path::Path;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
@@ -11,7 +15,7 @@ fn test_split() {
|
||||
let str = "朱春艳----320681197904304224";
|
||||
if let Some((name, id)) = split_str(str) {
|
||||
println!("name: {}, id: {}", name, id);
|
||||
get_id_info(id)
|
||||
get_id_info(id, name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +30,7 @@ fn split_str(str: &str) -> Option<(&str, &str)> {
|
||||
value
|
||||
}
|
||||
|
||||
fn get_id_info(id: &str) {
|
||||
fn get_id_info(id: &str, name: &str) {
|
||||
let location = &id[0..6];
|
||||
println!("location: {}", location);
|
||||
let born = &id[6..14];
|
||||
@@ -49,18 +53,37 @@ fn test_get_file() {
|
||||
}
|
||||
|
||||
fn get_id_file() {
|
||||
use hutils;
|
||||
use model::id_card;
|
||||
hutils::logger::init_logger();
|
||||
let db: OnceLock<DatabaseConnection> = OnceLock::new();
|
||||
|
||||
let rt = Runtime::new().expect("创建 Runtime 失败");
|
||||
|
||||
db.get_or_init(|| rt.block_on(async { Database::connect("sqlite://id-card.sqlite?mode=rwc").await.unwrap() }));
|
||||
let _ = env::current_dir().unwrap();
|
||||
println!("当前的路径 {:#?}", env::current_dir().unwrap());
|
||||
let path = Path::new("resources/ID/id.txt");
|
||||
// let path = Path::new("resources/id.txt");
|
||||
// let path = Path::new("resources/id.txt");x`
|
||||
let file = File::open(path).expect("打开文件失败");
|
||||
let buffer = BufReader::new(file);
|
||||
|
||||
for line in buffer.lines() {
|
||||
// println!("line {}", line.unwrap());
|
||||
if let Some((_, id)) = split_str(line.unwrap().as_str()) {
|
||||
if let Some((name, id)) = split_str(line.unwrap().as_str()) {
|
||||
// println!("name: {}, id: {}", name, id);
|
||||
let person = id_card::ActiveModel {
|
||||
id: Set(id.to_string()),
|
||||
name: Set(name.to_string()),
|
||||
gender: Default::default(),
|
||||
birth: Default::default(),
|
||||
address: Default::default(),
|
||||
nation: Default::default(),
|
||||
create_at: Default::default(),
|
||||
update_at: Default::default(),
|
||||
};
|
||||
|
||||
info!("{:#?}", person);
|
||||
if id.len() != 18 {
|
||||
// println!("name: {}, id: {}", name, id);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user