Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Lzw_Fight
auction-shell
提交
19850694
A
auction-shell
项目概览
Lzw_Fight
/
auction-shell
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
auction-shell
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
19850694
编写于
10月 15, 2023
作者:
Lzw_Fight
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature: user repository function
上级
9c60fbfe
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
79 addition
and
7 deletion
+79
-7
config/application_files.properties
config/application_files.properties
+0
-2
config/database.properties
config/database.properties
+2
-0
domain/user_domain_service.sh
domain/user_domain_service.sh
+16
-1
main.sh
main.sh
+4
-3
repository/user_data_repository.sh
repository/user_data_repository.sh
+57
-1
未找到文件。
config/application_files.properties
已删除
100644 → 0
浏览文件 @
9c60fbfe
table.user
=
storage/user.csv=#Id,userName,password,birthday,crateDate,modifiedDate
table.goods
=
storage/goods.csv=#Id,goodsName,goodsDescription,autionStartTime,crateDate,modifiedDate
\ No newline at end of file
config/database.properties
0 → 100644
浏览文件 @
19850694
user_base_info
:
storage/user.csv:#userName,password,birthday,crateDate,modifiedDate
goods_base_info
:
storage/goods.csv:#Id,goodsName,goodsDescription,autionStartTime,crateDate,modifiedDate
\ No newline at end of file
domain/user_domain_service.sh
浏览文件 @
19850694
#!/bin/bash
echo
"this is for user domain service."
\ No newline at end of file
#@author Jovan Li
echo
"this is for user domain service."
#parameter username,password,againPassword,birthday
function
register
{
#check parameter
if
[
$#
-ne
5]
then
echo
-1
else
#verify if the same username have been already registered
#input the data to table
fi
}
\ No newline at end of file
main.sh
浏览文件 @
19850694
#!/bin/bash
#@author Jovan Li
#主启动程序,居中显示
echo
"main menu to satrt"
...
...
@@ -20,7 +21,7 @@ do
done
#verify if the storage file are existing
cat
config/
application_files
.properties |
while
read
line
||
[[
-n
${
line
}
]]
cat
config/
database
.properties |
while
read
line
||
[[
-n
${
line
}
]]
do
echo
$line
#avoid the comment
...
...
@@ -30,10 +31,10 @@ do
fi
#if the file is not existing, will initialize it
storage_file
=
$(
echo
"
$line
"
|
awk
-F
"
=
"
'{print $2}'
)
storage_file
=
$(
echo
"
$line
"
|
awk
-F
"
:
"
'{print $2}'
)
if
!
[
-f
$storage_file
]
then
echo
"
$line
"
|
awk
-F
"
=
"
'{print $3}'
>
$storage_file
echo
"
$line
"
|
awk
-F
"
:
"
'{print $3}'
>
$storage_file
fi
done
...
...
repository/user_data_repository.sh
浏览文件 @
19850694
#!/bin/bash
echo
" this file is for read data of user"
\ No newline at end of file
#@author Jovan Li
#UserData operation repository
#Properties
userTable
=
$(
grep
-w
"user_base_info"
/config/database.properties |
awk
-F
":"
'{print $2}'
)
userName
=
1
password
=
2
birthda
=
3
crateDate
=
4
modifiedDate
=
5
now
=
$(
date
+%Y-%m-%d
)
#parameter username,password,birthday
function
addUser
{
#check parameter
if
[
$#
-ne
5]
then
echo false
else
echo
"
$1
,
$2
,
$3
,
$4
,
$now
,
$now
"
>>
userTable
echo
ture
fi
}
#parameter username
function
verifySameUser
{
username
=
$(
awk
-F
","
'{print $1}'
usertable |
grep
-w
$1
)
#find the same name
if
[
-n
$username
]
exit
1
else
exit
0
fi
done
}
#parameter username,password,birthday
function
modifyUser
{
#get the line number of the user
lineNumber
=
$(
awk
-F
","
'{print $1}'
usertable |
grep
-wc
$1
)
createDate
=
$(
sed
-n
"
${
lineNumber
}
p"
|
awk
-F
","
'print $4'
)
#user sed command change it
sed
"
${
lineNumber
}
c/
$1
,
$2
,
$3
,
$createDate
,
$now
"
}
#username
function
deleteUser
{
#get the line number of the user
lineNumber
=
$(
awk
-F
","
'{print $1}'
usertable |
grep
-wc
$1
)
#delete the user
sed
"
${
lineNumber
}
d"
usertable
>
usertable
echo
1
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录