Compare commits

...

19 Commits

Author SHA1 Message Date
snowflakes 9fe7eefff6 finally
1 year ago
snowflakes 25db7b2fb3 final_04
1 year ago
snowflakes 4e01c68a6e final_03
1 year ago
snowflakes eb229eaa0e final_2
1 year ago
snowflakes aeb1783d13 final_01
1 year ago
snowflakes 0a7f8a2b35 分析模型,设计模型v2.0
1 year ago
snowflakes b527cf3ae3 设计模型
1 year ago
snowflakes a189c7250b 提示
1 year ago
snowflakes b0d1978814 设计模型
1 year ago
snowflakes db0281b6bd 设计模型
1 year ago
snowflakes b29025e14d 设计模型
1 year ago
snowflakes f8e870dbe6 设计模型修改
1 year ago
snowflakes 4414095a22 设计模型(未完成)
1 year ago
snowflakes 5cc1d028de 需求模型
1 year ago
snowflakes ee204dec47 逻辑视图
1 year ago
snowflakes 3a943d6b9e 分析类图
1 year ago
snowflakes c4c554c6c8 需求模型
1 year ago
snowflakes 9341449a2b 需求模型
1 year ago
snowflakes dfce0b9436 需求构思
2 years ago

@ -1,2 +1,3 @@
# git_project # git_project
# doc中部分文件要下载其同文件夹PDF一同阅读

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 494 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 725 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 MiB

@ -0,0 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,31 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E302" />
<option value="E261" />
<option value="E262" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N803" />
<option value="N813" />
<option value="N802" />
<option value="N806" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyStubPackagesAdvertiser" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<list>
<option value="PyQt5-stubs==5.15.6.0" />
</list>
</option>
</inspection_tool>
</profile>
</component>

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/HTML.iml" filepath="$PROJECT_DIR$/.idea/HTML.iml" />
</modules>
</component>
</project>

@ -0,0 +1,39 @@
module GO
go 1.21.3
require gorm.io/gorm v1.25.5
require (
github.com/bytedance/sonic v1.10.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/cors v1.4.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.15.5 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/jinzhu/gorm v1.9.16 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.5.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

@ -0,0 +1,154 @@
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE=
github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo=
github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g=
github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24=
github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y=
golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/gorm v1.25.5 h1:zR9lOiiYf09VNh5Q1gphfyia1JpiClIWG9hQaxB/mls=
gorm.io/gorm v1.25.5/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

@ -0,0 +1,66 @@
package main
import (
admin "GO/pkg/AdminPackage" // 导入 admin 包
merchant "GO/pkg/MerchantPackage" // 导入 merchant 包
order "GO/pkg/OrderPackage" // 导入 user 包
rider "GO/pkg/RiderPackage" // 导入 rider 包
user "GO/pkg/UserPackage" // 导入 user 包
"fmt"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
)
func main() {
db := InitDB()
defer db.Close()
r := gin.Default()
// 使用CORS中间件
config := cors.DefaultConfig()
config.AllowOrigins = []string{"*"}
r.Use(cors.New(config))
// 初始化 Rider 路由
rider.InitializeRouter(r, db)
// 初始化 admin 路由
admin.InitializeRouter(r, db)
// 初始化 merchant 路由
merchant.InitializeRouter(r, db)
// 初始化 user 路由
user.InitializeRouter(r, db)
// 初始化 order 路由
order.InitializeRouter(r, db)
panic(r.Run(":8080"))
}
func InitDB() *gorm.DB {
driverName := "mysql"
host := "localhost"
port := "3306"
database := "elm"
username := "root"
password := "12345"
args := fmt.Sprintf("%s:%s@(%s:%s)/%s?charset=utf8mb4&parseTime=true",
username,
password,
host,
port,
database)
db, err := gorm.Open(driverName, args)
if err != nil {
panic("failed to connect database, err:" + err.Error())
}
return db
}

@ -0,0 +1,52 @@
package admin
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
)
// Rider 结构体定义
type Admin struct {
gorm.Model
Account string `gorm:"varchar(6)"`
Password string `gorm:"varchar(6)"`
}
// InitializeRouter 初始化 admin 相关的路由
func InitializeRouter(r *gin.Engine, db *gorm.DB) {
r.POST("/admin/login", adminLogin(db))
}
// adminLogin 处理管理员登录请求
func adminLogin(db *gorm.DB) gin.HandlerFunc {
return func(c *gin.Context) {
var admin Admin
if err := c.ShouldBindJSON(&admin); err != nil {
c.JSON(http.StatusBadRequest, gin.H{
"error": "无效的请求数据",
})
return
}
var storedAdmin Admin
if err := db.Where("account = ?", admin.Account).First(&storedAdmin).Error; err != nil {
c.JSON(http.StatusUnauthorized, gin.H{
"error": "用户不存在",
})
return
}
if admin.Password != storedAdmin.Password {
c.JSON(http.StatusUnauthorized, gin.H{
"error": "密码不正确",
})
return
}
c.JSON(http.StatusOK, gin.H{
"message": "登录成功",
})
}
}

@ -0,0 +1,136 @@
package merchant
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
)
// Rider 结构体定义
type merchants struct {
gorm.Model
Name string `gorm:"varchar(100)"`
Owner string `gorm:"varchar(3)"`
Phone string `gorm:"varchar(20)"`
Account string `gorm:"varchar(6)"`
Password string `gorm:"varchar(6)"`
Address string `gorm:"varchar(100)"`
AddressLon string `gorm:"varchar(20)"`
AddressLat string `gorm:"varchar(20)"`
}
// InitializeRouter 初始化 merchant 相关的路由
func InitializeRouter(r *gin.Engine, db *gorm.DB) {
r.GET("/merchant/get", GetMerchant(db)) // 获取骑手信息
r.POST("/merchant/create", CreateMerchant(db)) // 新增骑手信息
r.PUT("/merchant/update/:id", UpdateMerchant(db)) // 修改骑手信息
r.DELETE("/merchant/delete/:id", DeleteMerchant(db)) // 删除骑手信息
}
// 获取信息
func GetMerchant(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var GetMerchant []merchants
if err := db.Find(&GetMerchant).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法获取",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": 200,
"message": "获取成功",
"info": GetMerchant,
})
}
}
// 更新信息
func UpdateMerchant(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
merchantID := ctx.Param("id")
var UpdataMerchant merchants
if err := db.First(&UpdataMerchant, merchantID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "商家信息不存在",
})
return
}
if err := ctx.ShouldBindJSON(&UpdataMerchant); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Model(&UpdataMerchant).Updates(UpdataMerchant).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法更新商家信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "商家信息已更新",
})
}
}
// 新增信息
func CreateMerchant(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var CreateMerchant merchants
if err := ctx.ShouldBindJSON(&CreateMerchant); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Create(&CreateMerchant).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法创建商家信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "商家信息已创建",
})
}
}
// 删除信息
func DeleteMerchant(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
merchantID := ctx.Param("id")
var DeleteMerchant merchants
if err := db.First(&DeleteMerchant, merchantID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "商家信息不存在",
})
return
}
if err := db.Delete(&DeleteMerchant).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法删除商家信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "商家信息已删除",
})
}
}

@ -0,0 +1,157 @@
package order
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
)
// order 结构体定义
type orders struct {
gorm.Model
Name string `gorm:"varchar(10)"`
Rider string `gorm:"varchar(3)"`
Merchant string `gorm:"varchar(3)"`
OrderStatus string `gorm:"varchar(10)"`
MerchantStatus string `gorm:"varchar(10)"`
RiderStatus string `gorm:"varchar(10)"`
PickupLoc string `gorm:"varchar(20)"`
DeliveryLoc string `gorm:"varchar(20)"`
}
// InitializeRouter 初始化 order 相关的路由
func InitializeRouter(r *gin.Engine, db *gorm.DB) {
r.GET("/order/get", GetOrder(db)) // 获取信息
r.GET("/order/getdel", GetDeletedOrder(db)) // 获取信息
r.POST("/order/create", CreateOrder(db)) // 新增信息
r.PUT("/order/update/:id", UpdateOrder(db)) // 修改信息
r.DELETE("/order/delete/:id", DeleteOrder(db)) // 删除信息
}
// 获取信息
func GetOrder(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var GetOrder []orders
if err := db.Find(&GetOrder).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法获取",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": 200,
"message": "获取成功",
"info": GetOrder,
})
}
}
// 获取软删除的记录
func GetDeletedOrder(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var GetDeletedOrder []orders
if err := db.Unscoped().Where("deleted_at IS NOT NULL").Find(&GetDeletedOrder).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法获取",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": 200,
"message": "获取成功",
"info": GetDeletedOrder,
})
}
}
// 更新信息
func UpdateOrder(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
orderID := ctx.Param("id")
var UpdataOrder orders
if err := db.First(&UpdataOrder, orderID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "信息不存在",
})
return
}
if err := ctx.ShouldBindJSON(&UpdataOrder); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Model(&UpdataOrder).Updates(UpdataOrder).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法更新信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "信息已更新",
})
}
}
// 新增信息
func CreateOrder(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var CreateOrder orders
if err := ctx.ShouldBindJSON(&CreateOrder); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Create(&CreateOrder).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法创建信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "信息已创建",
})
}
}
// 删除信息
func DeleteOrder(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
orderID := ctx.Param("id")
var DeleteOrder orders
if err := db.First(&DeleteOrder, orderID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "信息不存在",
})
return
}
if err := db.Delete(&DeleteOrder).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法删除信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "信息已删除",
})
}
}

@ -0,0 +1,135 @@
package rider
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
)
// Rider 结构体定义
type riders struct {
gorm.Model
Name string `gorm:"varchar(4)"`
Phone string `gorm:"varchar(11)"`
Account string `gorm:"varchar(6)"`
Password string `gorm:"varchar(6)"`
Address string `gorm:"varchar(100)"`
AddressLon string `gorm:"varchar(100)"`
AddressLat string `gorm:"varchar(100)"`
}
// InitializeRouter 初始化 Rider 相关的路由
func InitializeRouter(r *gin.Engine, db *gorm.DB) {
r.GET("/rider/getinfo", GetRiderInfo(db)) // 获取骑手信息
r.POST("/rider/create", CreateRider(db)) // 新增骑手信息
r.PUT("/rider/update/:id", UpdateRiderInfo(db)) // 修改骑手信息
r.DELETE("/rider/delete/:id", DeleteRider(db)) // 删除骑手信息
}
// 获取骑手信息
func GetRiderInfo(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var Rider []riders
if err := db.Find(&Rider).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法获取",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": 200,
"message": "获取成功",
"info": Rider,
})
}
}
// 更新骑手信息
func UpdateRiderInfo(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
riderID := ctx.Param("id")
var Rider riders
if err := db.First(&Rider, riderID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "骑手信息不存在",
})
return
}
if err := ctx.ShouldBindJSON(&Rider); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Model(&Rider).Updates(Rider).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法更新骑手信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "骑手信息已更新",
})
}
}
// 新增骑手信息
func CreateRider(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var newRider riders
if err := ctx.ShouldBindJSON(&newRider); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Create(&newRider).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法创建骑手信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "骑手信息已创建",
})
}
}
// 删除骑手信息
func DeleteRider(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
riderID := ctx.Param("id")
var Rider riders
if err := db.First(&Rider, riderID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "骑手信息不存在",
})
return
}
if err := db.Delete(&Rider).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法删除骑手信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "骑手信息已删除",
})
}
}

@ -0,0 +1,133 @@
package user
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
)
// Rider 结构体定义
type users struct {
gorm.Model
Name string `gorm:"varchar(4)"`
NickName string `gorm:"varchar(10)"`
Phone string `gorm:"varchar(11)"`
Account string `gorm:"varchar(6)"`
Password string `gorm:"varchar(6)"`
}
// InitializeRouter 初始化 user 相关的路由
func InitializeRouter(r *gin.Engine, db *gorm.DB) {
r.GET("/user/get", GetUser(db)) // 获取信息
r.PUT("/user/update/:id", UpdateUser(db)) // 修改信息
r.POST("/user/create", CreateUser(db)) // 新增信息
r.DELETE("/usert/delete/:id", DeleteUser(db)) // 删除信息
}
// 获取信息
func GetUser(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var GetUser []users
if err := db.Find(&GetUser).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法获取",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": 200,
"message": "获取成功",
"info": GetUser,
})
}
}
// 修改信息
func UpdateUser(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
userID := ctx.Param("id")
var UpdataUser users
if err := db.First(&UpdataUser, userID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "商家信息不存在",
})
return
}
if err := ctx.ShouldBindJSON(&UpdataUser); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Model(&UpdataUser).Updates(UpdataUser).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法更新商家信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "商家信息已更新",
})
}
}
// 新增信息
func CreateUser(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
var CreateUser users
if err := ctx.ShouldBindJSON(&CreateUser); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{
"code": http.StatusBadRequest,
"message": "无效的请求数据",
})
return
}
if err := db.Create(&CreateUser).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法创建商家信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "商家信息已创建",
})
}
}
// 删除信息
func DeleteUser(db *gorm.DB) gin.HandlerFunc {
return func(ctx *gin.Context) {
userID := ctx.Param("id")
var DeleteUser users
if err := db.First(&DeleteUser, userID).Error; err != nil {
ctx.JSON(http.StatusNotFound, gin.H{
"code": http.StatusNotFound,
"message": "信息不存在",
})
return
}
if err := db.Delete(&DeleteUser).Error; err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{
"code": http.StatusInternalServerError,
"message": "无法删除信息",
})
return
}
ctx.JSON(http.StatusOK, gin.H{
"code": http.StatusOK,
"message": "信息已删除",
})
}
}

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
frame{
height: 2000px;
}
</style>
</head>
<frameset frameborder="0" rows="60,*">
<frame src="AdministrateTop.html" noresize="noresize" scrolling="no" />
<frameset frameborder="0" cols="150,*">
<frame src="AdministrateLeft.html" noresize="noresize" scrolling="no" />
<frame src="MainScreen.html" noresize="noresize" scrolling="yes" name="main" />
</frameset>
</frameset>
</html>

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/StudentLeft.css">
<script src="js/jquery-1.9.1.min.js"></script>
</head>
<body>
<div class="nav">
<div class="nav-list">
<div class="nav-tit" id="personal">
<a href="MainScreen.html" target="main">
<img src="images/personal-msg.png" style="height: 30px" alt="">
<span>主页面</span>
</a>
</div>
<div class="nav-tit" id="personal">
<a href="OrderDistributionScreen.html" target="main">
<img src="images/personal-msg.png" style="height: 30px" alt="">
<span>订单分配</span>
</a>
</div>
<div class="nav-tit">
<a href="ManageWorkingTimeScreen.html" target="main">
<img src="images/archives-msg.png" alt="">
<span>排班管理</span>
</a>
</div>
<div class="nav-tit">
<a href="RiderMessageScreen.html" target="main">
<img src="images/job-change.png" alt="">
<span>骑手信息</span>
</a>
</div>
<div class="nav-tit">
<a href="MerchantMessageScreen.html" target="main">
<img src="images/job-change.png" alt="">
<span>商家信息</span>
</a>
</div>
<div class="nav-tit">
<a href="CommodityMessageScreen.html" target="main">
<img src="images/job-change.png" alt="">
<span>商品信息</span>
</a>
</div>
<div class="nav-tit">
<a href="OrderMessageScreen.html" target="main">
<img src="images/job-change.png" alt="">
<span>订单汇总</span>
</a>
</div>
<!-- <div class="nav-tit">
<a href="Login.html" target="main">
<img src="images/job-msg.png" alt="">
<span>退出登录</span>
</a>
</div> -->
</div>
</div>
<script>
$(document).ready(function(){
$('#personal').on('click',function(){
$('#personal-child').fadeToggle(300);
});
let aLi = $('#personal-child li');
aLi.on('click',function(){
$(this).addClass('active').siblings('li').removeClass('active');
})
});
</script>
</body>
</html>

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.bx{
height: 60px;
width: 100%;
background: #177ec1;
}
.bx .container{
margin: 0 60px;
overflow: hidden;
}
.bx .container .left{
width: 300px;
height: 43px;
padding-top: 19px;
color: #FFFFFF;
font-size: 24px;
float: left;
}
.bx .container .right{
overflow: hidden;
width: 124px;
padding-top: 19px;
float: right;
}
.bx .container .right span{
font-size: 16px;
color: #fff;
}
.bx .container .right .l{
float: left;
}
.bx .container .right .r{
float: right;
}
</style>
</head>
<body>
<div class="bx">
<div class="container">
<h2 class="left">“饿了美”外卖管理系统</h2>
<div class="right">
<span class="l">XX管理员</span>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/MessageScreen.css">
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: #4CAF50;
color: white;
}
</style>
</head>
<body>
<div class="EmInformation container">
<div class="information-content content">
<div class="information-title">
<span>当前位置>商品信息</span>
</div>
<div class="unit-information">
<div class="unit">
<p class="unit-content">商品信息</p>
</div>
<div class="unit-list clearfix">
<table>
<thead>
<tr>
<th>商家ID</td>
<th>商家名称</th>
<th>商品ID</th>
<th>商品名称</th>
<th>商品价格/元</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张亮麻辣烫</td>
<td>1</td>
<td>新品小酥肉欢享套餐</td>
<td>22</td>
</tr>
<tr>
<td></td>
<td></td>
<td>2</td>
<td>张亮经典套餐</td>
<td>20</td>
</tr>
<tr>
<td></td>
<td></td>
<td>3</td>
<td>元气满满套餐套餐</td>
<td>28</td>
</tr>
<tr>
<td></td>
<td></td>
<td>4</td>
<td>⑦荤⑧素套餐</td>
<td>25</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/login.css"/>
<script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="login">
<div class="content clearfix">
<div class="content-left">
<div class="logo">
<img src="images/logo.png" alt=""/>
<p>“饿了美”外卖管理系统</p>
</div>
</div>
<div class="shu"></div>
<div class="content-right">
<div class="login-form">
<h2>管理员登录/LOGIN</h2>
<div class="account clearfix">
<span>账 号:</span>
<input type="text" name="username" value="ELM1"/>
</div>
<div class="password clearfix">
<span>密 码:</span>
<input type="text" name="password" value="12345"/>
</div>
<div class="btn">
<span id="login" onclick="verifyLogin()">登录</span>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
function verifyLogin() {
var username = document.getElementsByName('username')[0].value;
var password = document.getElementsByName('password')[0].value;
var requestData = {
"Account": username,
"Password": password
};
$.ajax({
url: "http://localhost:8080/admin/login", // 后端登录接口的URL
type: "POST",
dataType: "json",
data: JSON.stringify(requestData),
contentType: "application/json",
success: function(response) {
// 登录成功,跳转到管理员首页
window.location.href = 'AdministrateIndex.html';
},
error: function(jqXHR, textStatus, errorThrown) {
// 登录失败,弹出错误提示
alert('账号或密码错误');
}
});
}
</script>
</html>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save