commit 2a76608789d53c93b3911d4d4022e240abccff73 Author: lijikun Date: Tue Dec 10 20:09:48 2024 +0800 搭建项目并添加中间件,调整配置 diff --git a/link_homework/.gitattributes b/link_homework/.gitattributes new file mode 100644 index 0000000..1fbf887 --- /dev/null +++ b/link_homework/.gitattributes @@ -0,0 +1 @@ +* linguist-language=GO \ No newline at end of file diff --git a/link_homework/.gitignore b/link_homework/.gitignore new file mode 100644 index 0000000..0e6b38f --- /dev/null +++ b/link_homework/.gitignore @@ -0,0 +1,18 @@ +.buildpath +.hgignore.swp +.project +.orig +.swp +.idea/ +.settings/ +.vscode/ +bin/ +**/.DS_Store +gf +main +main.exe +output/ +manifest/output/ +temp/ +temp.yaml +bin \ No newline at end of file diff --git a/link_homework/Makefile b/link_homework/Makefile new file mode 100644 index 0000000..2a6e6e9 --- /dev/null +++ b/link_homework/Makefile @@ -0,0 +1,7 @@ +ROOT_DIR = $(shell pwd) +NAMESPACE = "default" +DEPLOY_NAME = "template-single" +DOCKER_NAME = "template-single" + +include ./hack/hack-cli.mk +include ./hack/hack.mk \ No newline at end of file diff --git a/link_homework/README.MD b/link_homework/README.MD new file mode 100644 index 0000000..d36cedd --- /dev/null +++ b/link_homework/README.MD @@ -0,0 +1,4 @@ +# GoFrame Template For SingleRepo + +Quick Start: +- https://goframe.org/quick \ No newline at end of file diff --git a/link_homework/api/v1/hello.go b/link_homework/api/v1/hello.go new file mode 100644 index 0000000..b7b1f99 --- /dev/null +++ b/link_homework/api/v1/hello.go @@ -0,0 +1 @@ +package v1 diff --git a/link_homework/go.mod b/link_homework/go.mod new file mode 100644 index 0000000..0535b7d --- /dev/null +++ b/link_homework/go.mod @@ -0,0 +1,36 @@ +module link_homework + +go 1.21.13 + +require ( + github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.1 + github.com/gogf/gf/v2 v2.8.1 +) + +require ( + github.com/BurntSushi/toml v1.4.0 // indirect + github.com/clbanning/mxj/v2 v2.7.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/fatih/color v1.17.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-sql-driver/mysql v1.7.1 // indirect + github.com/goflyfox/gtoken v1.5.10 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grokify/html-strip-tags-go v0.1.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/sdk v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/link_homework/go.sum b/link_homework/go.sum new file mode 100644 index 0000000..b7260ea --- /dev/null +++ b/link_homework/go.sum @@ -0,0 +1,134 @@ +github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +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/goflyfox/gtoken v1.5.10 h1:oj/v5r/1TjMMZvxpyEZYdsEvG2ZK/SGGnyjvsKi4uHk= +github.com/goflyfox/gtoken v1.5.10/go.mod h1:YpoSAn9tbfrSBoQnY7raQP0HaiRjQAE+4J179ecRH5I= +github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.1 h1:jbaPawkb8qmaYzrmBDbTa8Zkhzacq1RBOZw+qRJExI4= +github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.1/go.mod h1:s2aI1fV9AvKi4NtMpv3pV0EHtazkvfUNVQmzapr7UJQ= +github.com/gogf/gf/v2 v2.5.4/go.mod h1:7yf5qp0BznfsYx7Sw49m3mQvBsHpwAjJk3Q9ZnKoUEc= +github.com/gogf/gf/v2 v2.8.1 h1:1oVQg3G5OgCats4qWFTH3pHLe92nfUQeUDta05tUs1g= +github.com/gogf/gf/v2 v2.8.1/go.mod h1:6iYuZZ+A0ZcH8+4MDS/P0SvTPCvKzRvyAsY1kbkJYJc= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grokify/html-strip-tags-go v0.0.1/go.mod h1:2Su6romC5/1VXOQMaWL2yb618ARB8iVo6/DR99A6d78= +github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4= +github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +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.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.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +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.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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= diff --git a/link_homework/hack/config.yaml b/link_homework/hack/config.yaml new file mode 100644 index 0000000..db113b7 --- /dev/null +++ b/link_homework/hack/config.yaml @@ -0,0 +1,20 @@ + +# CLI tool, only in development environment. +# https://goframe.org/docs/cli +gfcli: + gen: + dao: + - link: "mysql:live:p4jMAMShNM8HTrbX@tcp(39.101.133.168:3306)/live?charset=utf8mb4&parseTime=True&loc=Local" + group: "live" + tables: "live, activity_interactive_form, activity_interactive_group, activity_interactive_record" + descriptionTag: true + - link: "mysql:cms:AF42R3ib6YkFaemm@tcp(39.101.133.168:3306)/cms?charset=utf8mb4&parseTime=True&loc=Local" + group: "cms" + tables: "member_info, fx_article" + descriptionTag: true + + + docker: + build: "-a amd64 -s linux -p temp -ew" + tagPrefixes: + - my.image.pub/my-app \ No newline at end of file diff --git a/link_homework/hack/hack-cli.mk b/link_homework/hack/hack-cli.mk new file mode 100644 index 0000000..f4e2ad2 --- /dev/null +++ b/link_homework/hack/hack-cli.mk @@ -0,0 +1,20 @@ + +# Install/Update to the latest CLI tool. +.PHONY: cli +cli: + @set -e; \ + wget -O gf \ + https://github.com/gogf/gf/releases/latest/download/gf_$(shell go env GOOS)_$(shell go env GOARCH) && \ + chmod +x gf && \ + ./gf install -y && \ + rm ./gf + + +# Check and install CLI tool. +.PHONY: cli.install +cli.install: + @set -e; \ + gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \ + echo "GoFame CLI is not installed, start proceeding auto installation..."; \ + make cli; \ + fi; \ No newline at end of file diff --git a/link_homework/hack/hack.mk b/link_homework/hack/hack.mk new file mode 100644 index 0000000..2f68179 --- /dev/null +++ b/link_homework/hack/hack.mk @@ -0,0 +1,75 @@ +.DEFAULT_GOAL := build + +# Update GoFrame and its CLI to latest stable version. +.PHONY: up +up: cli.install + @gf up -a + +# Build binary using configuration from hack/config.yaml. +.PHONY: build +build: cli.install + @gf build -ew + +# Parse api and generate controller/sdk. +.PHONY: ctrl +ctrl: cli.install + @gf gen ctrl + +# Generate Go files for DAO/DO/Entity. +.PHONY: dao +dao: cli.install + @gf gen dao + +# Parse current project go files and generate enums go file. +.PHONY: enums +enums: cli.install + @gf gen enums + +# Generate Go files for Service. +.PHONY: service +service: cli.install + @gf gen service + + +# Build docker image. +.PHONY: image +image: cli.install + $(eval _TAG = $(shell git rev-parse --short HEAD)) +ifneq (, $(shell git status --porcelain 2>/dev/null)) + $(eval _TAG = $(_TAG).dirty) +endif + $(eval _TAG = $(if ${TAG}, ${TAG}, $(_TAG))) + $(eval _PUSH = $(if ${PUSH}, ${PUSH}, )) + @gf docker ${_PUSH} -tn $(DOCKER_NAME):${_TAG}; + + +# Build docker image and automatically push to docker repo. +.PHONY: image.push +image.push: cli.install + @make image PUSH=-p; + + +# Deploy image and yaml to current kubectl environment. +.PHONY: deploy +deploy: cli.install + $(eval _TAG = $(if ${TAG}, ${TAG}, develop)) + + @set -e; \ + mkdir -p $(ROOT_DIR)/temp/kustomize;\ + cd $(ROOT_DIR)/manifest/deploy/kustomize/overlays/${_ENV};\ + kustomize build > $(ROOT_DIR)/temp/kustomize.yaml;\ + kubectl apply -f $(ROOT_DIR)/temp/kustomize.yaml; \ + if [ $(DEPLOY_NAME) != "" ]; then \ + kubectl patch -n $(NAMESPACE) deployment/$(DEPLOY_NAME) -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(shell date +%s)\"}}}}}"; \ + fi; + + +# Parsing protobuf files and generating go files. +.PHONY: pb +pb: cli.install + @gf gen pb + +# Generate protobuf files for database tables. +.PHONY: pbentity +pbentity: cli.install + @gf gen pbentity \ No newline at end of file diff --git a/link_homework/internal/cmd/cmd.go b/link_homework/internal/cmd/cmd.go new file mode 100644 index 0000000..4a0a6af --- /dev/null +++ b/link_homework/internal/cmd/cmd.go @@ -0,0 +1,52 @@ +package cmd + +import ( + "context" + "github.com/goflyfox/gtoken/gtoken" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/os/gcmd" +) + +var ( + Main = gcmd.Command{ + Name: "main", + Usage: "main", + Brief: "start http server", + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + s := g.Server() + //后台 + + //启动gtoken + // 创建一个GfToken对象,用于处理用户登录、登出、权限验证等操作 + gfToken := >oken.GfToken{ + // 设置登录路径,即用户登录接口登入成功后会获得一个Token + LoginPath: "/login", + //// 设置登录前执行的函数,在用户登录之前会调用这个函数进行一些预处理,比如验证用户名和密码等。 + //LoginBeforeFunc: loginFunc, //手动编写 没有同时配置登入路径,登入方法,登出路径启动时会报错 + // 设置登出路径,即用户登出接口登入成功后会删除Token + LogoutPath: "/user/logout", + //// 设置需要拦截的路径,按照前缀拦截,所有以/user或/system开头的路径都需要进行Token认证。 + //AuthPaths: g.SliceStr{"/user", "/system"}, + //// 设置不需要拦截的路径,所有以/user/info或/system/user/开头的路径都不需要进行Token认证。 + //AuthExcludePaths: g.SliceStr{"/user/info", "/system/user/*"}, + //// 开启全局拦截,默认关闭,如果设置为true,则所有请求都会经过Token认证中间件,如果设置为false,则只有指定路径的请求会经过Token认证中间件。 + //GlobalMiddleware: true, + } + s.Group("/api/homework_manage", func(group *ghttp.RouterGroup) { + //group.Middleware(middleware.MiddlewareIsLogin) + gfToken.Middleware(ctx, group) + //直接写接口,不用再分组 + }) + //客户端 + s.Group("/api/homework_client", func(group *ghttp.RouterGroup) { + //group.Middleware(middleware.MiddlewareIsLogin) + gfToken.Middleware(ctx, group) + //直接写接口,不用再分组 + }) + s.Run() + + return nil + }, + } +) diff --git a/link_homework/internal/consts/consts.go b/link_homework/internal/consts/consts.go new file mode 100644 index 0000000..d709a2b --- /dev/null +++ b/link_homework/internal/consts/consts.go @@ -0,0 +1 @@ +package consts diff --git a/link_homework/internal/controller/clientPage/clientPage.go b/link_homework/internal/controller/clientPage/clientPage.go new file mode 100644 index 0000000..b3d594f --- /dev/null +++ b/link_homework/internal/controller/clientPage/clientPage.go @@ -0,0 +1 @@ +package clientPage diff --git a/link_homework/internal/dao/.gitkeep b/link_homework/internal/dao/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/internal/dao/activity_interactive_form.go b/link_homework/internal/dao/activity_interactive_form.go new file mode 100644 index 0000000..e4ee465 --- /dev/null +++ b/link_homework/internal/dao/activity_interactive_form.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "link_homework/internal/dao/internal" +) + +// internalActivityInteractiveFormDao is an internal type for wrapping the internal DAO implementation. +type internalActivityInteractiveFormDao = *internal.ActivityInteractiveFormDao + +// activityInteractiveFormDao is the data access object for the table activity_interactive_form. +// You can define custom methods on it to extend its functionality as needed. +type activityInteractiveFormDao struct { + internalActivityInteractiveFormDao +} + +var ( + // ActivityInteractiveForm is a globally accessible object for table activity_interactive_form operations. + ActivityInteractiveForm = activityInteractiveFormDao{ + internal.NewActivityInteractiveFormDao(), + } +) + +// Add your custom methods and functionality below. diff --git a/link_homework/internal/dao/activity_interactive_group.go b/link_homework/internal/dao/activity_interactive_group.go new file mode 100644 index 0000000..abc054e --- /dev/null +++ b/link_homework/internal/dao/activity_interactive_group.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "link_homework/internal/dao/internal" +) + +// internalActivityInteractiveGroupDao is an internal type for wrapping the internal DAO implementation. +type internalActivityInteractiveGroupDao = *internal.ActivityInteractiveGroupDao + +// activityInteractiveGroupDao is the data access object for the table activity_interactive_group. +// You can define custom methods on it to extend its functionality as needed. +type activityInteractiveGroupDao struct { + internalActivityInteractiveGroupDao +} + +var ( + // ActivityInteractiveGroup is a globally accessible object for table activity_interactive_group operations. + ActivityInteractiveGroup = activityInteractiveGroupDao{ + internal.NewActivityInteractiveGroupDao(), + } +) + +// Add your custom methods and functionality below. diff --git a/link_homework/internal/dao/activity_interactive_record.go b/link_homework/internal/dao/activity_interactive_record.go new file mode 100644 index 0000000..8932d63 --- /dev/null +++ b/link_homework/internal/dao/activity_interactive_record.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "link_homework/internal/dao/internal" +) + +// internalActivityInteractiveRecordDao is an internal type for wrapping the internal DAO implementation. +type internalActivityInteractiveRecordDao = *internal.ActivityInteractiveRecordDao + +// activityInteractiveRecordDao is the data access object for the table activity_interactive_record. +// You can define custom methods on it to extend its functionality as needed. +type activityInteractiveRecordDao struct { + internalActivityInteractiveRecordDao +} + +var ( + // ActivityInteractiveRecord is a globally accessible object for table activity_interactive_record operations. + ActivityInteractiveRecord = activityInteractiveRecordDao{ + internal.NewActivityInteractiveRecordDao(), + } +) + +// Add your custom methods and functionality below. diff --git a/link_homework/internal/dao/fx_article.go b/link_homework/internal/dao/fx_article.go new file mode 100644 index 0000000..7c0efd9 --- /dev/null +++ b/link_homework/internal/dao/fx_article.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "link_homework/internal/dao/internal" +) + +// internalFxArticleDao is an internal type for wrapping the internal DAO implementation. +type internalFxArticleDao = *internal.FxArticleDao + +// fxArticleDao is the data access object for the table fx_article. +// You can define custom methods on it to extend its functionality as needed. +type fxArticleDao struct { + internalFxArticleDao +} + +var ( + // FxArticle is a globally accessible object for table fx_article operations. + FxArticle = fxArticleDao{ + internal.NewFxArticleDao(), + } +) + +// Add your custom methods and functionality below. diff --git a/link_homework/internal/dao/internal/activity_interactive_form.go b/link_homework/internal/dao/internal/activity_interactive_form.go new file mode 100644 index 0000000..c08c2ba --- /dev/null +++ b/link_homework/internal/dao/internal/activity_interactive_form.go @@ -0,0 +1,91 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ActivityInteractiveFormDao is the data access object for the table activity_interactive_form. +type ActivityInteractiveFormDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ActivityInteractiveFormColumns // columns contains all the column names of Table for convenient usage. +} + +// ActivityInteractiveFormColumns defines and stores column names for the table activity_interactive_form. +type ActivityInteractiveFormColumns struct { + Id string // + Name string // 名称 + Description string // 描述 + Content string // + Status string // 0:未发布 1:发布 2:下架 + Type string // 表单类型(待定) 1 单选 2 多选 3填空 + CreatedAt string // + UpdatedAt string // + Sort string // 问题排序 + GroupId string // 问题分组id +} + +// activityInteractiveFormColumns holds the columns for the table activity_interactive_form. +var activityInteractiveFormColumns = ActivityInteractiveFormColumns{ + Id: "id", + Name: "name", + Description: "description", + Content: "content", + Status: "status", + Type: "type", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + Sort: "sort", + GroupId: "group_id", +} + +// NewActivityInteractiveFormDao creates and returns a new DAO object for table data access. +func NewActivityInteractiveFormDao() *ActivityInteractiveFormDao { + return &ActivityInteractiveFormDao{ + group: "live", + table: "activity_interactive_form", + columns: activityInteractiveFormColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ActivityInteractiveFormDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ActivityInteractiveFormDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ActivityInteractiveFormDao) Columns() ActivityInteractiveFormColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ActivityInteractiveFormDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ActivityInteractiveFormDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ActivityInteractiveFormDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/link_homework/internal/dao/internal/activity_interactive_group.go b/link_homework/internal/dao/internal/activity_interactive_group.go new file mode 100644 index 0000000..dcb7cea --- /dev/null +++ b/link_homework/internal/dao/internal/activity_interactive_group.go @@ -0,0 +1,91 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ActivityInteractiveGroupDao is the data access object for the table activity_interactive_group. +type ActivityInteractiveGroupDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ActivityInteractiveGroupColumns // columns contains all the column names of Table for convenient usage. +} + +// ActivityInteractiveGroupColumns defines and stores column names for the table activity_interactive_group. +type ActivityInteractiveGroupColumns struct { + Id string // + Name string // 表单名称 + Status string // 表单状态 0 未发布 1 发布中 2 过期 + CreatedAt string // 创建时间 + UpdatedAt string // + ClubType string // 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理 9 财富的游戏 + ArticleId string // 关联文章id + LiveId string // 关联直播id + StartDate string // 作业开始时间 + EndDate string // 作业结束时间 +} + +// activityInteractiveGroupColumns holds the columns for the table activity_interactive_group. +var activityInteractiveGroupColumns = ActivityInteractiveGroupColumns{ + Id: "id", + Name: "name", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + ClubType: "club_type", + ArticleId: "article_id", + LiveId: "live_id", + StartDate: "start_date", + EndDate: "end_date", +} + +// NewActivityInteractiveGroupDao creates and returns a new DAO object for table data access. +func NewActivityInteractiveGroupDao() *ActivityInteractiveGroupDao { + return &ActivityInteractiveGroupDao{ + group: "live", + table: "activity_interactive_group", + columns: activityInteractiveGroupColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ActivityInteractiveGroupDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ActivityInteractiveGroupDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ActivityInteractiveGroupDao) Columns() ActivityInteractiveGroupColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ActivityInteractiveGroupDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ActivityInteractiveGroupDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ActivityInteractiveGroupDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/link_homework/internal/dao/internal/activity_interactive_record.go b/link_homework/internal/dao/internal/activity_interactive_record.go new file mode 100644 index 0000000..d63744e --- /dev/null +++ b/link_homework/internal/dao/internal/activity_interactive_record.go @@ -0,0 +1,87 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ActivityInteractiveRecordDao is the data access object for the table activity_interactive_record. +type ActivityInteractiveRecordDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ActivityInteractiveRecordColumns // columns contains all the column names of Table for convenient usage. +} + +// ActivityInteractiveRecordColumns defines and stores column names for the table activity_interactive_record. +type ActivityInteractiveRecordColumns struct { + Id string // + Jwcode string // + FormId string // 表单id + GroupId string // 分组ID + Content string // + CreatedAt string // + UpdatedAt string // + ContentTitle string // +} + +// activityInteractiveRecordColumns holds the columns for the table activity_interactive_record. +var activityInteractiveRecordColumns = ActivityInteractiveRecordColumns{ + Id: "id", + Jwcode: "jwcode", + FormId: "form_id", + GroupId: "group_id", + Content: "content", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + ContentTitle: "content_title", +} + +// NewActivityInteractiveRecordDao creates and returns a new DAO object for table data access. +func NewActivityInteractiveRecordDao() *ActivityInteractiveRecordDao { + return &ActivityInteractiveRecordDao{ + group: "live", + table: "activity_interactive_record", + columns: activityInteractiveRecordColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ActivityInteractiveRecordDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ActivityInteractiveRecordDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ActivityInteractiveRecordDao) Columns() ActivityInteractiveRecordColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ActivityInteractiveRecordDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ActivityInteractiveRecordDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ActivityInteractiveRecordDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/link_homework/internal/dao/internal/fx_article.go b/link_homework/internal/dao/internal/fx_article.go new file mode 100644 index 0000000..bfe703c --- /dev/null +++ b/link_homework/internal/dao/internal/fx_article.go @@ -0,0 +1,261 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// FxArticleDao is the data access object for the table fx_article. +type FxArticleDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns FxArticleColumns // columns contains all the column names of Table for convenient usage. +} + +// FxArticleColumns defines and stores column names for the table fx_article. +type FxArticleColumns struct { + Id string // + Title string // 标题 + Style string // 标题颜色 + Flags string // 属性 0 无 1 置顶 2 热点 + Des string // 排序 + Tags string // TAG标签 + Image string // 缩略图 + Typeid string // 栏目 + Click string // 观看次数 + Keywords string // 关键词 + Description string // 内容描述 + Arcrank string // 阅读权限 + Template string // 模板文件 + CreateTime string // 添加时间 + UpdateTime string // 更新时间 + Content string // + Hide string // -1转码中,0隐藏 1显示文章 2审核 3拒绝 4用户自己删除5定时发布的视频 + Url string // 跳转 + Source string // 来源 + Uid string // 会员UID 识别注明哪个会员投稿 + Writer string // 文章作者 + Mychannel string // 文章类型 1 文章 2 图文集 3 视频 4 小视频 + Images string // 图片集,如果mytype值是2,则是图片文章 + Video string // 视频 + Videodate string // 视频时间 + Zan string // 点赞数量 + Cai string // + PingNum string // 评论数量 + Weitoutiao string // 0显示文章 1微头条 + ToutiaoTiemId string // 今日头条原文章ID + QiniuVideo string // + QiniuVideoType string // 1转码中 0转码成功 + Dtitle string // 短标题 热点专用 + Rootid string // + Jwcode string // + Boardcode string // + ScoreBasic string // 用于提升文章排序分数的基础分数 + Cmsid string // 0 文章 1话题文章 + AId string // 转发文章的id + SourceType string // 转发内容的类型:0:没有转发;1:文章;2:快讯 + IsT string // 0 文章 1话题文章 + Flag string // + Share string // 是否允许分享,0:不允许,1:允许 + DeletedAt string // + VideoDuration string // 视频的播放时长 + VideoName string // + VideoMemory string // + Kan string // 观看人数(不重复) + KanFinish string // 看完人数(不重复) + Favorite string // + ShowTime string // 定时发布时间 + EmployeeExclusive string // 员工专属(1:专属,0:非专属) + Language string // + Market string // + UpdatedAt string // + CId string // 合集id + TargetUserRole string // 目标用户 1:网员 2:非网 3:网员和非网 + Weight string // 权重 + Herdsman string // 0非牧民1牧民专属 + CrossPlatform string // 0 仅精网 1 toujiao 2 homliylink + JwAid string // 精网文章id + ToujiaoPdid string // 分享至投教频道id + HomilylinkPdid string // 分享至homeLink频道id + TargetUserRoleHomilylink string // 目标用户 1:网员 2:非网 3:网员和非网 + Cost string // 需要消费的金豆 + Preview string // 预览内容 + CoverType string // 1:横屏,2:竖屏 + Reward string // 文章打赏功能 0 未开启 1开启 + Recommend string // 1:推荐 2:不推荐 + RecommendAble string // 1:可以被推荐 2:不可以被推荐 + RecommendDeadline string // 推荐截止时间 + QrcodeState string // 1:开启,0:关闭 + QrcodeJwcode string // 精网号 + QrcodeUserid string // crm用户id + QrcodeUrl string // 二维码地址 + LessonId string // 关联课程id + AudioUrl string // + AudioDuration string // 音频时常 + Note string // 1:笔记 2:剧场精选 3:铁粉专享(海外) 4:剧场栏目 5:铁粉专享 6:三体哲学 + NoteLabel string // 笔记标签 1:心得 + Term string // 到期时间 0 永久 大于0 到期时间 + NonClubMemberCost string // cost 付费文章 俱乐部成员价格 non_club_member_cost 非本俱乐部成员价格 + PowerType string // 权限类别 1 免费 2 会员专享 3 付费 + Total string // 点赞+评论+阅读量 + LockCost string // 解锁文章金豆数 + FeaturedVideo string // 是否精选视频 0 不是 1 是 + AdType string // 广告类型 1 直播 2 活动 + AdContent string // 广告内容 + AdClick string // 广告点击量 + AdImage string // 广告图片 + AdLiveId string // 广告直播id + IsPush string // 频道内容 0 未推送 1 已推送 + SyncMoment string // 是否同步到动态 0 不同步 1 同步 + MomentContent string // + VideoType string // 视频类型 1 横屏 2 竖屏 +} + +// fxArticleColumns holds the columns for the table fx_article. +var fxArticleColumns = FxArticleColumns{ + Id: "id", + Title: "title", + Style: "style", + Flags: "flags", + Des: "des", + Tags: "tags", + Image: "image", + Typeid: "typeid", + Click: "click", + Keywords: "keywords", + Description: "description", + Arcrank: "arcrank", + Template: "template", + CreateTime: "create_time", + UpdateTime: "update_time", + Content: "content", + Hide: "hide", + Url: "url", + Source: "source", + Uid: "uid", + Writer: "writer", + Mychannel: "mychannel", + Images: "images", + Video: "video", + Videodate: "videodate", + Zan: "zan", + Cai: "cai", + PingNum: "pingNum", + Weitoutiao: "weitoutiao", + ToutiaoTiemId: "toutiao_tiemId", + QiniuVideo: "qiniu_video", + QiniuVideoType: "qiniu_video_type", + Dtitle: "dtitle", + Rootid: "rootid", + Jwcode: "jwcode", + Boardcode: "boardcode", + ScoreBasic: "scoreBasic", + Cmsid: "cmsid", + AId: "a_id", + SourceType: "source_type", + IsT: "is_t", + Flag: "flag", + Share: "share", + DeletedAt: "deleted_at", + VideoDuration: "video_duration", + VideoName: "video_name", + VideoMemory: "video_memory", + Kan: "kan", + KanFinish: "kan_finish", + Favorite: "favorite", + ShowTime: "show_time", + EmployeeExclusive: "employee_exclusive", + Language: "language", + Market: "market", + UpdatedAt: "updated_at", + CId: "c_id", + TargetUserRole: "target_user_role", + Weight: "weight", + Herdsman: "herdsman", + CrossPlatform: "cross_platform", + JwAid: "jw_aid", + ToujiaoPdid: "toujiao_pdid", + HomilylinkPdid: "homilylink_pdid", + TargetUserRoleHomilylink: "target_user_role_homilylink", + Cost: "cost", + Preview: "preview", + CoverType: "cover_type", + Reward: "reward", + Recommend: "recommend", + RecommendAble: "recommend_able", + RecommendDeadline: "recommend_deadline", + QrcodeState: "qrcode_state", + QrcodeJwcode: "qrcode_jwcode", + QrcodeUserid: "qrcode_userid", + QrcodeUrl: "qrcode_url", + LessonId: "lesson_id", + AudioUrl: "audio_url", + AudioDuration: "audio_duration", + Note: "note", + NoteLabel: "note_label", + Term: "term", + NonClubMemberCost: "non_club_member_cost", + PowerType: "power_type", + Total: "total", + LockCost: "lock_cost", + FeaturedVideo: "featured_video", + AdType: "ad_type", + AdContent: "ad_content", + AdClick: "ad_click", + AdImage: "ad_image", + AdLiveId: "ad_live_id", + IsPush: "is_push", + SyncMoment: "sync_moment", + MomentContent: "moment_content", + VideoType: "video_type", +} + +// NewFxArticleDao creates and returns a new DAO object for table data access. +func NewFxArticleDao() *FxArticleDao { + return &FxArticleDao{ + group: "cms", + table: "fx_article", + columns: fxArticleColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *FxArticleDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *FxArticleDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *FxArticleDao) Columns() FxArticleColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *FxArticleDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *FxArticleDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *FxArticleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/link_homework/internal/dao/internal/live.go b/link_homework/internal/dao/internal/live.go new file mode 100644 index 0000000..733851d --- /dev/null +++ b/link_homework/internal/dao/internal/live.go @@ -0,0 +1,239 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// LiveDao is the data access object for the table live. +type LiveDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns LiveColumns // columns contains all the column names of Table for convenient usage. +} + +// LiveColumns defines and stores column names for the table live. +type LiveColumns struct { + Id string // + Jwcode string // + Type string // 直播类型 1:频道直播 2:课程直播 3:班级群直播 4:财富的游戏(课程) 5:财富的游戏(剧场) + ChannelId string // + ChannelType string // 频道类型 + ClassId string // 班级群id + ParentLiveId string // 父live_id + CourseType string // 直播课程类型 1:服务课 2:宣教课 3:知识课 + CourseLimitStartDate string // 课程类型限制 开始日期 + CourseLimitEndDate string // 课程类型限制 结束日期 + CourseLimitSwitch string // 1:屏蔽网员 + ShowQrcode string // 1:二维码 2:获客助手 3:手机号 + QrcodeJwcode string // 二维码下精网号 + QrcodeJwcodeIds string // 二维码下精网号下的ids(以,分隔) + RoomId string // + TName string // 主讲人姓名 + Name string // + Icon string // + State string // 0:未开播 1:直播中 2:直播结束 3:已删除 + Switch string // + Url string // + PlayUrl string // + PlayUrlM3U8 string // + PlayUrlLhd string // flv(高清) + PlayUrlM3U8Lhd string // m3u8(高清) + PlayUrlLsd string // flv(标清) + PlayUrlM3U8Lsd string // m3u8(标清) + Cover string // + Introduce string // + StartTime string // + Manager string // + Product string // + ProductId string // + Qx string // 直播观看权限 1:所有用户 2:部分客户 3 : 外地客户 4: 静态专区客户 5:大财神 6:终免 7:半年版 + Show string // 是否展示直播 0:不展示 1:展示 + Oaid string // 频道oa号 + Platform string // 直播平台 1是pc直播2是手机直播 + Sig string // 腾讯sig + Playback string // 有无回放 1:有 0:无 + PlaybackType string // 回放类型 1:永久 2: 有期限 + PlaybackExpire string // 回放过期时间 + ShowInApp string // 0:不在app展示 1:在app展示 + ClassName string // 班级名称 + CopyUrl string // 1:不允许客户复制链接 + LiveType string // 直播形式 1:obs 2:录播 3:连麦 4:重播 5:竖屏推流 + RepeatLiveId string // 重播对应的live_id + LiveVideoId string // 录播视频id + VideoUrl string // 录播视频地址 + MemberWatchLimit string // 网员观看权限(静态专区) 1:全部用户 2:终免用户 + RealStartTime string // 实际开始时间 + PopupQrcodeSwitch string // 弹窗二维码开关 0:关 1:开 + CreatedAt string // + UpdatedAt string // + SyncPlatform string // 同步的平台 海外(en), 投教(toujiao) + SyncToujiaoChannelId string // 同步投教频道id + SyncOverseaChannelId string // 同步海外频道id + SyncLiveId string // 从该live_id同步过来的 + PayNum string // 付费金豆数量 + IsHerdsman string // 1:牧民直播间 + HerdsmanLimit string // 1:限制只有牧民观看 + ClubType string // 俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理 + ClubTypeLimit string // 俱乐部权限 0:没有 1:有 + ExportPower string // 1:有导入名单权限 + InvestorSwitch string // 1: 开启合格投资者 + SignSwitch string // 1:开启签到 + OnlinePeopleSwitch string // 在线人数开关 1:实时在线人数 2:场观次数 + LessonId string // 课程id + LessonSectionId string // 课程章节id + Password string // 口令 + Sort string // 排序(大的优先) + ContentIntro string // 内容介绍 + RelatedClubType string // 关联俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 + Poster string // 海报 + Tabs string // 1:推荐课程 2:课程作业 3:邀约榜 + PreviewVideo string // 预告视频 + ReceiveKit string // 1: 领取锦囊指标 + OaMark string // oa_mark + OaMarkName string // oa_mark_name + Stage string // 销售阶段 1:课程销售阶段 2:软件销售阶段 + StageCourse string // 阶段课程类型 1:开班课 2:服务课 3:销售课 + TopTime string // 置顶时间 + PlaybackSort string // 直播回放排序, 越大越靠前 + RelateClassIds string // 关联班级ids + JoinClassButton string // 进群按钮 1:开启 +} + +// liveColumns holds the columns for the table live. +var liveColumns = LiveColumns{ + Id: "id", + Jwcode: "jwcode", + Type: "type", + ChannelId: "channel_id", + ChannelType: "channel_type", + ClassId: "class_id", + ParentLiveId: "parent_live_id", + CourseType: "course_type", + CourseLimitStartDate: "course_limit_start_date", + CourseLimitEndDate: "course_limit_end_date", + CourseLimitSwitch: "course_limit_switch", + ShowQrcode: "show_qrcode", + QrcodeJwcode: "qrcode_jwcode", + QrcodeJwcodeIds: "qrcode_jwcode_ids", + RoomId: "room_id", + TName: "t_name", + Name: "name", + Icon: "icon", + State: "state", + Switch: "switch", + Url: "url", + PlayUrl: "play_url", + PlayUrlM3U8: "play_url_m3u8", + PlayUrlLhd: "play_url_lhd", + PlayUrlM3U8Lhd: "play_url_m3u8_lhd", + PlayUrlLsd: "play_url_lsd", + PlayUrlM3U8Lsd: "play_url_m3u8_lsd", + Cover: "cover", + Introduce: "introduce", + StartTime: "start_time", + Manager: "manager", + Product: "product", + ProductId: "product_id", + Qx: "qx", + Show: "show", + Oaid: "oaid", + Platform: "platform", + Sig: "sig", + Playback: "playback", + PlaybackType: "playback_type", + PlaybackExpire: "playback_expire", + ShowInApp: "show_in_app", + ClassName: "class_name", + CopyUrl: "copy_url", + LiveType: "live_type", + RepeatLiveId: "repeat_live_id", + LiveVideoId: "live_video_id", + VideoUrl: "video_url", + MemberWatchLimit: "member_watch_limit", + RealStartTime: "real_start_time", + PopupQrcodeSwitch: "popup_qrcode_switch", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + SyncPlatform: "sync_platform", + SyncToujiaoChannelId: "sync_toujiao_channel_id", + SyncOverseaChannelId: "sync_oversea_channel_id", + SyncLiveId: "sync_live_id", + PayNum: "pay_num", + IsHerdsman: "is_herdsman", + HerdsmanLimit: "herdsman_limit", + ClubType: "club_type", + ClubTypeLimit: "club_type_limit", + ExportPower: "export_power", + InvestorSwitch: "investor_switch", + SignSwitch: "sign_switch", + OnlinePeopleSwitch: "online_people_switch", + LessonId: "lesson_id", + LessonSectionId: "lesson_section_id", + Password: "password", + Sort: "sort", + ContentIntro: "content_intro", + RelatedClubType: "related_club_type", + Poster: "poster", + Tabs: "tabs", + PreviewVideo: "preview_video", + ReceiveKit: "receive_kit", + OaMark: "oa_mark", + OaMarkName: "oa_mark_name", + Stage: "stage", + StageCourse: "stage_course", + TopTime: "top_time", + PlaybackSort: "playback_sort", + RelateClassIds: "relate_class_ids", + JoinClassButton: "join_class_button", +} + +// NewLiveDao creates and returns a new DAO object for table data access. +func NewLiveDao() *LiveDao { + return &LiveDao{ + group: "live", + table: "live", + columns: liveColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *LiveDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *LiveDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *LiveDao) Columns() LiveColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *LiveDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *LiveDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *LiveDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/link_homework/internal/dao/internal/member_info.go b/link_homework/internal/dao/internal/member_info.go new file mode 100644 index 0000000..7898588 --- /dev/null +++ b/link_homework/internal/dao/internal/member_info.go @@ -0,0 +1,147 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// MemberInfoDao is the data access object for the table member_info. +type MemberInfoDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns MemberInfoColumns // columns contains all the column names of Table for convenient usage. +} + +// MemberInfoColumns defines and stores column names for the table member_info. +type MemberInfoColumns struct { + Id string // + Jwcode string // + Name string // + Avatar string // + Sex string // 0:未知,1:男,2:女 + DeptId string // + DeptName string // + ShopId string // + ShopName string // + MembershipTime string // + LearningStatus string // 0:不进行新网员学习,1:正在进行新网员学习,2:已进行学习 + LiveLock string // 0 已解锁 1 未解锁 + Level string // 等级 + ClubRecommendation string // + GiftExchange string // 是否退化礼物 0 未兑换 1 已兑换 + Qianming string // 签名 + CreatedAt string // + UpdatedAt string // + BlackCard string // 黑卡会员 0 不是 1是 + BoguMember string // 是否为博股会员 0 不是 1 是 + AccountOwner string // 号主账号 + AccountOwnerText string // 号主姓名 + UserRole string // 用户身份(1: 网员 2:非网) + Widget string // + LearningLevel string // + LearningIcon string // + LearningMedal string // + UserIdentity string // 0 无认证 1 红V 2 蓝V 3 黄V + UserIdentityTitle string // 用户身份头衔 + IsBlacklist string // 0不是黑名单1是黑名单 + IsLecturer string // 1:讲师 + Mobile string // 手机号 + Herdsman string // + Shenqiangshou string // + Huanqiu string // + LocMarket string // 用户市场归属 + Fensi string // 粉丝 + CreateTime string // 账号注册时间 +} + +// memberInfoColumns holds the columns for the table member_info. +var memberInfoColumns = MemberInfoColumns{ + Id: "id", + Jwcode: "jwcode", + Name: "name", + Avatar: "avatar", + Sex: "sex", + DeptId: "deptId", + DeptName: "deptName", + ShopId: "shopId", + ShopName: "shopName", + MembershipTime: "membership_time", + LearningStatus: "learning_status", + LiveLock: "live_lock", + Level: "level", + ClubRecommendation: "club_recommendation", + GiftExchange: "gift_exchange", + Qianming: "qianming", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + BlackCard: "black_card", + BoguMember: "bogu_member", + AccountOwner: "account_owner", + AccountOwnerText: "account_owner_text", + UserRole: "user_role", + Widget: "widget", + LearningLevel: "learning_level", + LearningIcon: "learning_icon", + LearningMedal: "learning_medal", + UserIdentity: "user_identity", + UserIdentityTitle: "user_identity_title", + IsBlacklist: "is_blacklist", + IsLecturer: "is_lecturer", + Mobile: "mobile", + Herdsman: "herdsman", + Shenqiangshou: "shenqiangshou", + Huanqiu: "huanqiu", + LocMarket: "loc_market", + Fensi: "fensi", + CreateTime: "create_time", +} + +// NewMemberInfoDao creates and returns a new DAO object for table data access. +func NewMemberInfoDao() *MemberInfoDao { + return &MemberInfoDao{ + group: "cms", + table: "member_info", + columns: memberInfoColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *MemberInfoDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *MemberInfoDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *MemberInfoDao) Columns() MemberInfoColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *MemberInfoDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *MemberInfoDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *MemberInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/link_homework/internal/dao/live.go b/link_homework/internal/dao/live.go new file mode 100644 index 0000000..707abbf --- /dev/null +++ b/link_homework/internal/dao/live.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "link_homework/internal/dao/internal" +) + +// internalLiveDao is an internal type for wrapping the internal DAO implementation. +type internalLiveDao = *internal.LiveDao + +// liveDao is the data access object for the table live. +// You can define custom methods on it to extend its functionality as needed. +type liveDao struct { + internalLiveDao +} + +var ( + // Live is a globally accessible object for table live operations. + Live = liveDao{ + internal.NewLiveDao(), + } +) + +// Add your custom methods and functionality below. diff --git a/link_homework/internal/dao/member_info.go b/link_homework/internal/dao/member_info.go new file mode 100644 index 0000000..eeed4d6 --- /dev/null +++ b/link_homework/internal/dao/member_info.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "link_homework/internal/dao/internal" +) + +// internalMemberInfoDao is an internal type for wrapping the internal DAO implementation. +type internalMemberInfoDao = *internal.MemberInfoDao + +// memberInfoDao is the data access object for the table member_info. +// You can define custom methods on it to extend its functionality as needed. +type memberInfoDao struct { + internalMemberInfoDao +} + +var ( + // MemberInfo is a globally accessible object for table member_info operations. + MemberInfo = memberInfoDao{ + internal.NewMemberInfoDao(), + } +) + +// Add your custom methods and functionality below. diff --git a/link_homework/internal/logic/.gitkeep b/link_homework/internal/logic/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/internal/logic/logic.go b/link_homework/internal/logic/logic.go new file mode 100644 index 0000000..4c79103 --- /dev/null +++ b/link_homework/internal/logic/logic.go @@ -0,0 +1 @@ +package logic diff --git a/link_homework/internal/logic/middleware/interceptor.go b/link_homework/internal/logic/middleware/interceptor.go new file mode 100644 index 0000000..2401f5b --- /dev/null +++ b/link_homework/internal/logic/middleware/interceptor.go @@ -0,0 +1,23 @@ +package middleware + +import ( + "github.com/gogf/gf/v2/net/ghttp" + "link_homework/internal/model/dto" +) + +func MiddlewareCORS(r *ghttp.Request) { + r.Response.CORSDefault() + r.Middleware.Next() +} + +func MiddlewareIsLogin(r *ghttp.Request) { + token := r.GetHeader("Authorization") + if token == "" { + r.Response.WriteJsonExit(dto.Result{ + Code: 401, + Message: "未登录", + }) + } else { + r.Middleware.Next() + } +} diff --git a/link_homework/internal/model/.gitkeep b/link_homework/internal/model/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/internal/model/do/.gitkeep b/link_homework/internal/model/do/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/internal/model/do/activity_interactive_form.go b/link_homework/internal/model/do/activity_interactive_form.go new file mode 100644 index 0000000..cce0021 --- /dev/null +++ b/link_homework/internal/model/do/activity_interactive_form.go @@ -0,0 +1,25 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// ActivityInteractiveForm is the golang structure of table activity_interactive_form for DAO operations like Where/Data. +type ActivityInteractiveForm struct { + g.Meta `orm:"table:activity_interactive_form, do:true"` + Id interface{} // + Name interface{} // 名称 + Description interface{} // 描述 + Content interface{} // + Status interface{} // 0:未发布 1:发布 2:下架 + Type interface{} // 表单类型(待定) 1 单选 2 多选 3填空 + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // + Sort interface{} // 问题排序 + GroupId interface{} // 问题分组id +} diff --git a/link_homework/internal/model/do/activity_interactive_group.go b/link_homework/internal/model/do/activity_interactive_group.go new file mode 100644 index 0000000..4e18a59 --- /dev/null +++ b/link_homework/internal/model/do/activity_interactive_group.go @@ -0,0 +1,25 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// ActivityInteractiveGroup is the golang structure of table activity_interactive_group for DAO operations like Where/Data. +type ActivityInteractiveGroup struct { + g.Meta `orm:"table:activity_interactive_group, do:true"` + Id interface{} // + Name interface{} // 表单名称 + Status interface{} // 表单状态 0 未发布 1 发布中 2 过期 + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // + ClubType interface{} // 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理 9 财富的游戏 + ArticleId interface{} // 关联文章id + LiveId interface{} // 关联直播id + StartDate *gtime.Time // 作业开始时间 + EndDate *gtime.Time // 作业结束时间 +} diff --git a/link_homework/internal/model/do/activity_interactive_record.go b/link_homework/internal/model/do/activity_interactive_record.go new file mode 100644 index 0000000..8b3cbc7 --- /dev/null +++ b/link_homework/internal/model/do/activity_interactive_record.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// ActivityInteractiveRecord is the golang structure of table activity_interactive_record for DAO operations like Where/Data. +type ActivityInteractiveRecord struct { + g.Meta `orm:"table:activity_interactive_record, do:true"` + Id interface{} // + Jwcode interface{} // + FormId interface{} // 表单id + GroupId interface{} // 分组ID + Content interface{} // + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // + ContentTitle interface{} // +} diff --git a/link_homework/internal/model/do/fx_article.go b/link_homework/internal/model/do/fx_article.go new file mode 100644 index 0000000..cbec07b --- /dev/null +++ b/link_homework/internal/model/do/fx_article.go @@ -0,0 +1,110 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// FxArticle is the golang structure of table fx_article for DAO operations like Where/Data. +type FxArticle struct { + g.Meta `orm:"table:fx_article, do:true"` + Id interface{} // + Title interface{} // 标题 + Style interface{} // 标题颜色 + Flags interface{} // 属性 0 无 1 置顶 2 热点 + Des interface{} // 排序 + Tags interface{} // TAG标签 + Image interface{} // 缩略图 + Typeid interface{} // 栏目 + Click interface{} // 观看次数 + Keywords interface{} // 关键词 + Description interface{} // 内容描述 + Arcrank interface{} // 阅读权限 + Template interface{} // 模板文件 + CreateTime interface{} // 添加时间 + UpdateTime interface{} // 更新时间 + Content interface{} // + Hide interface{} // -1转码中,0隐藏 1显示文章 2审核 3拒绝 4用户自己删除5定时发布的视频 + Url interface{} // 跳转 + Source interface{} // 来源 + Uid interface{} // 会员UID 识别注明哪个会员投稿 + Writer interface{} // 文章作者 + Mychannel interface{} // 文章类型 1 文章 2 图文集 3 视频 4 小视频 + Images interface{} // 图片集,如果mytype值是2,则是图片文章 + Video interface{} // 视频 + Videodate interface{} // 视频时间 + Zan interface{} // 点赞数量 + Cai interface{} // + PingNum interface{} // 评论数量 + Weitoutiao interface{} // 0显示文章 1微头条 + ToutiaoTiemId interface{} // 今日头条原文章ID + QiniuVideo interface{} // + QiniuVideoType interface{} // 1转码中 0转码成功 + Dtitle interface{} // 短标题 热点专用 + Rootid interface{} // + Jwcode interface{} // + Boardcode interface{} // + ScoreBasic interface{} // 用于提升文章排序分数的基础分数 + Cmsid interface{} // 0 文章 1话题文章 + AId interface{} // 转发文章的id + SourceType interface{} // 转发内容的类型:0:没有转发;1:文章;2:快讯 + IsT interface{} // 0 文章 1话题文章 + Flag interface{} // + Share interface{} // 是否允许分享,0:不允许,1:允许 + DeletedAt *gtime.Time // + VideoDuration interface{} // 视频的播放时长 + VideoName interface{} // + VideoMemory interface{} // + Kan interface{} // 观看人数(不重复) + KanFinish interface{} // 看完人数(不重复) + Favorite interface{} // + ShowTime interface{} // 定时发布时间 + EmployeeExclusive interface{} // 员工专属(1:专属,0:非专属) + Language interface{} // + Market interface{} // + UpdatedAt *gtime.Time // + CId interface{} // 合集id + TargetUserRole interface{} // 目标用户 1:网员 2:非网 3:网员和非网 + Weight interface{} // 权重 + Herdsman interface{} // 0非牧民1牧民专属 + CrossPlatform interface{} // 0 仅精网 1 toujiao 2 homliylink + JwAid interface{} // 精网文章id + ToujiaoPdid interface{} // 分享至投教频道id + HomilylinkPdid interface{} // 分享至homeLink频道id + TargetUserRoleHomilylink interface{} // 目标用户 1:网员 2:非网 3:网员和非网 + Cost interface{} // 需要消费的金豆 + Preview interface{} // 预览内容 + CoverType interface{} // 1:横屏,2:竖屏 + Reward interface{} // 文章打赏功能 0 未开启 1开启 + Recommend interface{} // 1:推荐 2:不推荐 + RecommendAble interface{} // 1:可以被推荐 2:不可以被推荐 + RecommendDeadline interface{} // 推荐截止时间 + QrcodeState interface{} // 1:开启,0:关闭 + QrcodeJwcode interface{} // 精网号 + QrcodeUserid interface{} // crm用户id + QrcodeUrl interface{} // 二维码地址 + LessonId interface{} // 关联课程id + AudioUrl interface{} // + AudioDuration interface{} // 音频时常 + Note interface{} // 1:笔记 2:剧场精选 3:铁粉专享(海外) 4:剧场栏目 5:铁粉专享 6:三体哲学 + NoteLabel interface{} // 笔记标签 1:心得 + Term interface{} // 到期时间 0 永久 大于0 到期时间 + NonClubMemberCost interface{} // cost 付费文章 俱乐部成员价格 non_club_member_cost 非本俱乐部成员价格 + PowerType interface{} // 权限类别 1 免费 2 会员专享 3 付费 + Total interface{} // 点赞+评论+阅读量 + LockCost interface{} // 解锁文章金豆数 + FeaturedVideo interface{} // 是否精选视频 0 不是 1 是 + AdType interface{} // 广告类型 1 直播 2 活动 + AdContent interface{} // 广告内容 + AdClick interface{} // 广告点击量 + AdImage interface{} // 广告图片 + AdLiveId interface{} // 广告直播id + IsPush interface{} // 频道内容 0 未推送 1 已推送 + SyncMoment interface{} // 是否同步到动态 0 不同步 1 同步 + MomentContent interface{} // + VideoType interface{} // 视频类型 1 横屏 2 竖屏 +} diff --git a/link_homework/internal/model/do/live.go b/link_homework/internal/model/do/live.go new file mode 100644 index 0000000..a0954da --- /dev/null +++ b/link_homework/internal/model/do/live.go @@ -0,0 +1,99 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// Live is the golang structure of table live for DAO operations like Where/Data. +type Live struct { + g.Meta `orm:"table:live, do:true"` + Id interface{} // + Jwcode interface{} // + Type interface{} // 直播类型 1:频道直播 2:课程直播 3:班级群直播 4:财富的游戏(课程) 5:财富的游戏(剧场) + ChannelId interface{} // + ChannelType interface{} // 频道类型 + ClassId interface{} // 班级群id + ParentLiveId interface{} // 父live_id + CourseType interface{} // 直播课程类型 1:服务课 2:宣教课 3:知识课 + CourseLimitStartDate *gtime.Time // 课程类型限制 开始日期 + CourseLimitEndDate *gtime.Time // 课程类型限制 结束日期 + CourseLimitSwitch interface{} // 1:屏蔽网员 + ShowQrcode interface{} // 1:二维码 2:获客助手 3:手机号 + QrcodeJwcode interface{} // 二维码下精网号 + QrcodeJwcodeIds interface{} // 二维码下精网号下的ids(以,分隔) + RoomId interface{} // + TName interface{} // 主讲人姓名 + Name interface{} // + Icon interface{} // + State interface{} // 0:未开播 1:直播中 2:直播结束 3:已删除 + Switch interface{} // + Url interface{} // + PlayUrl interface{} // + PlayUrlM3U8 interface{} // + PlayUrlLhd interface{} // flv(高清) + PlayUrlM3U8Lhd interface{} // m3u8(高清) + PlayUrlLsd interface{} // flv(标清) + PlayUrlM3U8Lsd interface{} // m3u8(标清) + Cover interface{} // + Introduce interface{} // + StartTime interface{} // + Manager interface{} // + Product interface{} // + ProductId interface{} // + Qx interface{} // 直播观看权限 1:所有用户 2:部分客户 3 : 外地客户 4: 静态专区客户 5:大财神 6:终免 7:半年版 + Show interface{} // 是否展示直播 0:不展示 1:展示 + Oaid interface{} // 频道oa号 + Platform interface{} // 直播平台 1是pc直播2是手机直播 + Sig interface{} // 腾讯sig + Playback interface{} // 有无回放 1:有 0:无 + PlaybackType interface{} // 回放类型 1:永久 2: 有期限 + PlaybackExpire interface{} // 回放过期时间 + ShowInApp interface{} // 0:不在app展示 1:在app展示 + ClassName interface{} // 班级名称 + CopyUrl interface{} // 1:不允许客户复制链接 + LiveType interface{} // 直播形式 1:obs 2:录播 3:连麦 4:重播 5:竖屏推流 + RepeatLiveId interface{} // 重播对应的live_id + LiveVideoId interface{} // 录播视频id + VideoUrl interface{} // 录播视频地址 + MemberWatchLimit interface{} // 网员观看权限(静态专区) 1:全部用户 2:终免用户 + RealStartTime interface{} // 实际开始时间 + PopupQrcodeSwitch interface{} // 弹窗二维码开关 0:关 1:开 + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // + SyncPlatform interface{} // 同步的平台 海外(en), 投教(toujiao) + SyncToujiaoChannelId interface{} // 同步投教频道id + SyncOverseaChannelId interface{} // 同步海外频道id + SyncLiveId interface{} // 从该live_id同步过来的 + PayNum interface{} // 付费金豆数量 + IsHerdsman interface{} // 1:牧民直播间 + HerdsmanLimit interface{} // 1:限制只有牧民观看 + ClubType interface{} // 俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理 + ClubTypeLimit interface{} // 俱乐部权限 0:没有 1:有 + ExportPower interface{} // 1:有导入名单权限 + InvestorSwitch interface{} // 1: 开启合格投资者 + SignSwitch interface{} // 1:开启签到 + OnlinePeopleSwitch interface{} // 在线人数开关 1:实时在线人数 2:场观次数 + LessonId interface{} // 课程id + LessonSectionId interface{} // 课程章节id + Password interface{} // 口令 + Sort interface{} // 排序(大的优先) + ContentIntro interface{} // 内容介绍 + RelatedClubType interface{} // 关联俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 + Poster interface{} // 海报 + Tabs interface{} // 1:推荐课程 2:课程作业 3:邀约榜 + PreviewVideo interface{} // 预告视频 + ReceiveKit interface{} // 1: 领取锦囊指标 + OaMark interface{} // oa_mark + OaMarkName interface{} // oa_mark_name + Stage interface{} // 销售阶段 1:课程销售阶段 2:软件销售阶段 + StageCourse interface{} // 阶段课程类型 1:开班课 2:服务课 3:销售课 + TopTime interface{} // 置顶时间 + PlaybackSort interface{} // 直播回放排序, 越大越靠前 + RelateClassIds interface{} // 关联班级ids + JoinClassButton interface{} // 进群按钮 1:开启 +} diff --git a/link_homework/internal/model/do/member_info.go b/link_homework/internal/model/do/member_info.go new file mode 100644 index 0000000..276f93a --- /dev/null +++ b/link_homework/internal/model/do/member_info.go @@ -0,0 +1,53 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// MemberInfo is the golang structure of table member_info for DAO operations like Where/Data. +type MemberInfo struct { + g.Meta `orm:"table:member_info, do:true"` + Id interface{} // + Jwcode interface{} // + Name interface{} // + Avatar interface{} // + Sex interface{} // 0:未知,1:男,2:女 + DeptId interface{} // + DeptName interface{} // + ShopId interface{} // + ShopName interface{} // + MembershipTime *gtime.Time // + LearningStatus interface{} // 0:不进行新网员学习,1:正在进行新网员学习,2:已进行学习 + LiveLock interface{} // 0 已解锁 1 未解锁 + Level interface{} // 等级 + ClubRecommendation interface{} // + GiftExchange interface{} // 是否退化礼物 0 未兑换 1 已兑换 + Qianming interface{} // 签名 + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // + BlackCard interface{} // 黑卡会员 0 不是 1是 + BoguMember interface{} // 是否为博股会员 0 不是 1 是 + AccountOwner interface{} // 号主账号 + AccountOwnerText interface{} // 号主姓名 + UserRole interface{} // 用户身份(1: 网员 2:非网) + Widget interface{} // + LearningLevel interface{} // + LearningIcon interface{} // + LearningMedal interface{} // + UserIdentity interface{} // 0 无认证 1 红V 2 蓝V 3 黄V + UserIdentityTitle interface{} // 用户身份头衔 + IsBlacklist interface{} // 0不是黑名单1是黑名单 + IsLecturer interface{} // 1:讲师 + Mobile interface{} // 手机号 + Herdsman interface{} // + Shenqiangshou interface{} // + Huanqiu interface{} // + LocMarket interface{} // 用户市场归属 + Fensi interface{} // 粉丝 + CreateTime interface{} // 账号注册时间 +} diff --git a/link_homework/internal/model/dto/Result.go b/link_homework/internal/model/dto/Result.go new file mode 100644 index 0000000..810c7ed --- /dev/null +++ b/link_homework/internal/model/dto/Result.go @@ -0,0 +1,66 @@ +package dto + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// 定义响应结构 +type Result struct { + Code int `json:"code"` + Message string `json:"message"` + Data interface{} `json:"data"` // 修改为实体类型 +} + +/*成功,没有数据*/ +func Success() *Result { + return &Result{ + Code: 200, + Message: "success", + Data: g.Map{}, + } +} + +/*成功,有数据*/ +func SuccessWithData(data interface{}) *Result { + return &Result{ + Code: 200, + Message: "success", + Data: data, + } +} + +/*错误,只有错误信息,错误码0*/ +func Error(msg string) *Result { + return &Result{ + Code: 0, // 错误码 + Message: msg, // 错误信息 + Data: g.Map{}, + } +} + +/*错误,有错误信息,有错误码*/ +func ErrorWithCode(code int, msg string) *Result { + return &Result{ + Code: code, // 错误码 + Message: msg, // 错误信息 + Data: g.Map{}, + } +} + +/*未授权,有错误信息,错误码为401*/ +func Unauthorized(msg string) *Result { + return &Result{ + Code: 401, // 错误码 + Message: msg, // 错误信息 + Data: g.Map{}, + } +} + +/*未授权,有错误信息,允许自定义错误码*/ +func UnauthorizedWithCode(code int, msg string) *Result { + return &Result{ + Code: code, // 错误码 + Message: msg, // 错误信息 + Data: g.Map{}, + } +} diff --git a/link_homework/internal/model/entity/.gitkeep b/link_homework/internal/model/entity/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/internal/model/entity/activity_interactive_form.go b/link_homework/internal/model/entity/activity_interactive_form.go new file mode 100644 index 0000000..7434687 --- /dev/null +++ b/link_homework/internal/model/entity/activity_interactive_form.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// ActivityInteractiveForm is the golang structure for table activity_interactive_form. +type ActivityInteractiveForm struct { + Id int `json:"id" orm:"id" description:""` // + Name string `json:"name" orm:"name" description:"名称"` // 名称 + Description string `json:"description" orm:"description" description:"描述"` // 描述 + Content string `json:"content" orm:"content" description:""` // + Status int `json:"status" orm:"status" description:"0:未发布 1:发布 2:下架"` // 0:未发布 1:发布 2:下架 + Type int `json:"type" orm:"type" description:"表单类型(待定) 1 单选 2 多选 3填空"` // 表单类型(待定) 1 单选 2 多选 3填空 + CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:""` // + UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""` // + Sort uint `json:"sort" orm:"sort" description:"问题排序"` // 问题排序 + GroupId uint `json:"groupId" orm:"group_id" description:"问题分组id"` // 问题分组id +} diff --git a/link_homework/internal/model/entity/activity_interactive_group.go b/link_homework/internal/model/entity/activity_interactive_group.go new file mode 100644 index 0000000..fb7855f --- /dev/null +++ b/link_homework/internal/model/entity/activity_interactive_group.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// ActivityInteractiveGroup is the golang structure for table activity_interactive_group. +type ActivityInteractiveGroup struct { + Id int `json:"id" orm:"id" description:""` // + Name string `json:"name" orm:"name" description:"表单名称"` // 表单名称 + Status uint `json:"status" orm:"status" description:"表单状态 0 未发布 1 发布中 2 过期"` // 表单状态 0 未发布 1 发布中 2 过期 + CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间 + UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""` // + ClubType int `json:"clubType" orm:"club_type" description:"1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理 9 财富的游戏"` // 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理 9 财富的游戏 + ArticleId int `json:"articleId" orm:"article_id" description:"关联文章id"` // 关联文章id + LiveId int `json:"liveId" orm:"live_id" description:"关联直播id"` // 关联直播id + StartDate *gtime.Time `json:"startDate" orm:"start_date" description:"作业开始时间"` // 作业开始时间 + EndDate *gtime.Time `json:"endDate" orm:"end_date" description:"作业结束时间"` // 作业结束时间 +} diff --git a/link_homework/internal/model/entity/activity_interactive_record.go b/link_homework/internal/model/entity/activity_interactive_record.go new file mode 100644 index 0000000..98fd634 --- /dev/null +++ b/link_homework/internal/model/entity/activity_interactive_record.go @@ -0,0 +1,21 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// ActivityInteractiveRecord is the golang structure for table activity_interactive_record. +type ActivityInteractiveRecord struct { + Id int `json:"id" orm:"id" description:""` // + Jwcode int `json:"jwcode" orm:"jwcode" description:""` // + FormId int `json:"formId" orm:"form_id" description:"表单id"` // 表单id + GroupId uint `json:"groupId" orm:"group_id" description:"分组ID"` // 分组ID + Content string `json:"content" orm:"content" description:""` // + CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:""` // + UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""` // + ContentTitle string `json:"contentTitle" orm:"content_title" description:""` // +} diff --git a/link_homework/internal/model/entity/fx_article.go b/link_homework/internal/model/entity/fx_article.go new file mode 100644 index 0000000..8096896 --- /dev/null +++ b/link_homework/internal/model/entity/fx_article.go @@ -0,0 +1,108 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// FxArticle is the golang structure for table fx_article. +type FxArticle struct { + Id int `json:"id" orm:"id" description:""` // + Title string `json:"title" orm:"title" description:"标题"` // 标题 + Style string `json:"style" orm:"style" description:"标题颜色"` // 标题颜色 + Flags int `json:"flags" orm:"flags" description:"属性 0 无 1 置顶 2 热点"` // 属性 0 无 1 置顶 2 热点 + Des int `json:"des" orm:"des" description:"排序"` // 排序 + Tags string `json:"tags" orm:"tags" description:"TAG标签"` // TAG标签 + Image string `json:"image" orm:"image" description:"缩略图"` // 缩略图 + Typeid int `json:"typeid" orm:"typeid" description:"栏目"` // 栏目 + Click int `json:"click" orm:"click" description:"观看次数"` // 观看次数 + Keywords string `json:"keywords" orm:"keywords" description:"关键词"` // 关键词 + Description string `json:"description" orm:"description" description:"内容描述"` // 内容描述 + Arcrank int `json:"arcrank" orm:"arcrank" description:"阅读权限"` // 阅读权限 + Template string `json:"template" orm:"template" description:"模板文件"` // 模板文件 + CreateTime string `json:"createTime" orm:"create_time" description:"添加时间"` // 添加时间 + UpdateTime string `json:"updateTime" orm:"update_time" description:"更新时间"` // 更新时间 + Content string `json:"content" orm:"content" description:""` // + Hide int `json:"hide" orm:"hide" description:"-1转码中,0隐藏 1显示文章 2审核 3拒绝 4用户自己删除5定时发布的视频"` // -1转码中,0隐藏 1显示文章 2审核 3拒绝 4用户自己删除5定时发布的视频 + Url string `json:"url" orm:"url" description:"跳转"` // 跳转 + Source string `json:"source" orm:"source" description:"来源"` // 来源 + Uid int `json:"uid" orm:"uid" description:"会员UID 识别注明哪个会员投稿"` // 会员UID 识别注明哪个会员投稿 + Writer string `json:"writer" orm:"writer" description:"文章作者"` // 文章作者 + Mychannel int `json:"mychannel" orm:"mychannel" description:"文章类型 1 文章 2 图文集 3 视频 4 小视频"` // 文章类型 1 文章 2 图文集 3 视频 4 小视频 + Images string `json:"images" orm:"images" description:"图片集,如果mytype值是2,则是图片文章"` // 图片集,如果mytype值是2,则是图片文章 + Video string `json:"video" orm:"video" description:"视频"` // 视频 + Videodate string `json:"videodate" orm:"videodate" description:"视频时间"` // 视频时间 + Zan uint `json:"zan" orm:"zan" description:"点赞数量"` // 点赞数量 + Cai uint `json:"cai" orm:"cai" description:""` // + PingNum uint `json:"pingNum" orm:"pingNum" description:"评论数量"` // 评论数量 + Weitoutiao int `json:"weitoutiao" orm:"weitoutiao" description:"0显示文章 1微头条"` // 0显示文章 1微头条 + ToutiaoTiemId string `json:"toutiaoTiemId" orm:"toutiao_tiemId" description:"今日头条原文章ID"` // 今日头条原文章ID + QiniuVideo string `json:"qiniuVideo" orm:"qiniu_video" description:""` // + QiniuVideoType int `json:"qiniuVideoType" orm:"qiniu_video_type" description:"1转码中 0转码成功"` // 1转码中 0转码成功 + Dtitle string `json:"dtitle" orm:"dtitle" description:"短标题 热点专用"` // 短标题 热点专用 + Rootid int64 `json:"rootid" orm:"rootid" description:""` // + Jwcode int `json:"jwcode" orm:"jwcode" description:""` // + Boardcode string `json:"boardcode" orm:"boardcode" description:""` // + ScoreBasic float64 `json:"scoreBasic" orm:"scoreBasic" description:"用于提升文章排序分数的基础分数"` // 用于提升文章排序分数的基础分数 + Cmsid int `json:"cmsid" orm:"cmsid" description:"0 文章 1话题文章"` // 0 文章 1话题文章 + AId int `json:"aId" orm:"a_id" description:"转发文章的id"` // 转发文章的id + SourceType int `json:"sourceType" orm:"source_type" description:"转发内容的类型:0:没有转发;1:文章;2:快讯"` // 转发内容的类型:0:没有转发;1:文章;2:快讯 + IsT int `json:"isT" orm:"is_t" description:"0 文章 1话题文章"` // 0 文章 1话题文章 + Flag int `json:"flag" orm:"flag" description:""` // + Share int `json:"share" orm:"share" description:"是否允许分享,0:不允许,1:允许"` // 是否允许分享,0:不允许,1:允许 + DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:""` // + VideoDuration int `json:"videoDuration" orm:"video_duration" description:"视频的播放时长"` // 视频的播放时长 + VideoName string `json:"videoName" orm:"video_name" description:""` // + VideoMemory float64 `json:"videoMemory" orm:"video_memory" description:""` // + Kan int `json:"kan" orm:"kan" description:"观看人数(不重复)"` // 观看人数(不重复) + KanFinish int `json:"kanFinish" orm:"kan_finish" description:"看完人数(不重复)"` // 看完人数(不重复) + Favorite int `json:"favorite" orm:"favorite" description:""` // + ShowTime int `json:"showTime" orm:"show_time" description:"定时发布时间"` // 定时发布时间 + EmployeeExclusive int `json:"employeeExclusive" orm:"employee_exclusive" description:"员工专属(1:专属,0:非专属)"` // 员工专属(1:专属,0:非专属) + Language string `json:"language" orm:"language" description:""` // + Market string `json:"market" orm:"market" description:""` // + UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""` // + CId int `json:"cId" orm:"c_id" description:"合集id"` // 合集id + TargetUserRole int `json:"targetUserRole" orm:"target_user_role" description:"目标用户 1:网员 2:非网 3:网员和非网"` // 目标用户 1:网员 2:非网 3:网员和非网 + Weight int `json:"weight" orm:"weight" description:"权重"` // 权重 + Herdsman uint `json:"herdsman" orm:"herdsman" description:"0非牧民1牧民专属"` // 0非牧民1牧民专属 + CrossPlatform string `json:"crossPlatform" orm:"cross_platform" description:"0 仅精网 1 toujiao 2 homliylink"` // 0 仅精网 1 toujiao 2 homliylink + JwAid int `json:"jwAid" orm:"jw_aid" description:"精网文章id"` // 精网文章id + ToujiaoPdid int `json:"toujiaoPdid" orm:"toujiao_pdid" description:"分享至投教频道id"` // 分享至投教频道id + HomilylinkPdid int `json:"homilylinkPdid" orm:"homilylink_pdid" description:"分享至homeLink频道id"` // 分享至homeLink频道id + TargetUserRoleHomilylink int `json:"targetUserRoleHomilylink" orm:"target_user_role_homilylink" description:"目标用户 1:网员 2:非网 3:网员和非网"` // 目标用户 1:网员 2:非网 3:网员和非网 + Cost uint `json:"cost" orm:"cost" description:"需要消费的金豆"` // 需要消费的金豆 + Preview string `json:"preview" orm:"preview" description:"预览内容"` // 预览内容 + CoverType int `json:"coverType" orm:"cover_type" description:"1:横屏,2:竖屏"` // 1:横屏,2:竖屏 + Reward int `json:"reward" orm:"reward" description:"文章打赏功能 0 未开启 1开启"` // 文章打赏功能 0 未开启 1开启 + Recommend int `json:"recommend" orm:"recommend" description:"1:推荐 2:不推荐"` // 1:推荐 2:不推荐 + RecommendAble int `json:"recommendAble" orm:"recommend_able" description:"1:可以被推荐 2:不可以被推荐"` // 1:可以被推荐 2:不可以被推荐 + RecommendDeadline int `json:"recommendDeadline" orm:"recommend_deadline" description:"推荐截止时间"` // 推荐截止时间 + QrcodeState int `json:"qrcodeState" orm:"qrcode_state" description:"1:开启,0:关闭"` // 1:开启,0:关闭 + QrcodeJwcode int `json:"qrcodeJwcode" orm:"qrcode_jwcode" description:"精网号"` // 精网号 + QrcodeUserid int `json:"qrcodeUserid" orm:"qrcode_userid" description:"crm用户id"` // crm用户id + QrcodeUrl string `json:"qrcodeUrl" orm:"qrcode_url" description:"二维码地址"` // 二维码地址 + LessonId int `json:"lessonId" orm:"lesson_id" description:"关联课程id"` // 关联课程id + AudioUrl string `json:"audioUrl" orm:"audio_url" description:""` // + AudioDuration int `json:"audioDuration" orm:"audio_duration" description:"音频时常"` // 音频时常 + Note int `json:"note" orm:"note" description:"1:笔记 2:剧场精选 3:铁粉专享(海外) 4:剧场栏目 5:铁粉专享 6:三体哲学"` // 1:笔记 2:剧场精选 3:铁粉专享(海外) 4:剧场栏目 5:铁粉专享 6:三体哲学 + NoteLabel int `json:"noteLabel" orm:"note_label" description:"笔记标签 1:心得"` // 笔记标签 1:心得 + Term int `json:"term" orm:"term" description:"到期时间 0 永久 大于0 到期时间"` // 到期时间 0 永久 大于0 到期时间 + NonClubMemberCost int `json:"nonClubMemberCost" orm:"non_club_member_cost" description:"cost 付费文章 俱乐部成员价格 non_club_member_cost 非本俱乐部成员价格"` // cost 付费文章 俱乐部成员价格 non_club_member_cost 非本俱乐部成员价格 + PowerType int `json:"powerType" orm:"power_type" description:"权限类别 1 免费 2 会员专享 3 付费"` // 权限类别 1 免费 2 会员专享 3 付费 + Total int `json:"total" orm:"total" description:"点赞+评论+阅读量"` // 点赞+评论+阅读量 + LockCost int `json:"lockCost" orm:"lock_cost" description:"解锁文章金豆数"` // 解锁文章金豆数 + FeaturedVideo int `json:"featuredVideo" orm:"featured_video" description:"是否精选视频 0 不是 1 是"` // 是否精选视频 0 不是 1 是 + AdType int `json:"adType" orm:"ad_type" description:"广告类型 1 直播 2 活动"` // 广告类型 1 直播 2 活动 + AdContent string `json:"adContent" orm:"ad_content" description:"广告内容"` // 广告内容 + AdClick int `json:"adClick" orm:"ad_click" description:"广告点击量"` // 广告点击量 + AdImage string `json:"adImage" orm:"ad_image" description:"广告图片"` // 广告图片 + AdLiveId int `json:"adLiveId" orm:"ad_live_id" description:"广告直播id"` // 广告直播id + IsPush int `json:"isPush" orm:"is_push" description:"频道内容 0 未推送 1 已推送"` // 频道内容 0 未推送 1 已推送 + SyncMoment int `json:"syncMoment" orm:"sync_moment" description:"是否同步到动态 0 不同步 1 同步"` // 是否同步到动态 0 不同步 1 同步 + MomentContent string `json:"momentContent" orm:"moment_content" description:""` // + VideoType int `json:"videoType" orm:"video_type" description:"视频类型 1 横屏 2 竖屏"` // 视频类型 1 横屏 2 竖屏 +} diff --git a/link_homework/internal/model/entity/live.go b/link_homework/internal/model/entity/live.go new file mode 100644 index 0000000..77664a3 --- /dev/null +++ b/link_homework/internal/model/entity/live.go @@ -0,0 +1,97 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// Live is the golang structure for table live. +type Live struct { + Id int `json:"id" orm:"id" description:""` // + Jwcode int `json:"jwcode" orm:"jwcode" description:""` // + Type int `json:"type" orm:"type" description:"直播类型 1:频道直播 2:课程直播 3:班级群直播 4:财富的游戏(课程) 5:财富的游戏(剧场)"` // 直播类型 1:频道直播 2:课程直播 3:班级群直播 4:财富的游戏(课程) 5:财富的游戏(剧场) + ChannelId int `json:"channelId" orm:"channel_id" description:""` // + ChannelType int `json:"channelType" orm:"channel_type" description:"频道类型"` // 频道类型 + ClassId int `json:"classId" orm:"class_id" description:"班级群id"` // 班级群id + ParentLiveId int `json:"parentLiveId" orm:"parent_live_id" description:"父live_id"` // 父live_id + CourseType int `json:"courseType" orm:"course_type" description:"直播课程类型 1:服务课 2:宣教课 3:知识课"` // 直播课程类型 1:服务课 2:宣教课 3:知识课 + CourseLimitStartDate *gtime.Time `json:"courseLimitStartDate" orm:"course_limit_start_date" description:"课程类型限制 开始日期"` // 课程类型限制 开始日期 + CourseLimitEndDate *gtime.Time `json:"courseLimitEndDate" orm:"course_limit_end_date" description:"课程类型限制 结束日期"` // 课程类型限制 结束日期 + CourseLimitSwitch int `json:"courseLimitSwitch" orm:"course_limit_switch" description:"1:屏蔽网员"` // 1:屏蔽网员 + ShowQrcode int `json:"showQrcode" orm:"show_qrcode" description:"1:二维码 2:获客助手 3:手机号"` // 1:二维码 2:获客助手 3:手机号 + QrcodeJwcode int `json:"qrcodeJwcode" orm:"qrcode_jwcode" description:"二维码下精网号"` // 二维码下精网号 + QrcodeJwcodeIds string `json:"qrcodeJwcodeIds" orm:"qrcode_jwcode_ids" description:"二维码下精网号下的ids(以,分隔)"` // 二维码下精网号下的ids(以,分隔) + RoomId string `json:"roomId" orm:"room_id" description:""` // + TName string `json:"tName" orm:"t_name" description:"主讲人姓名"` // 主讲人姓名 + Name string `json:"name" orm:"name" description:""` // + Icon string `json:"icon" orm:"icon" description:""` // + State int `json:"state" orm:"state" description:"0:未开播 1:直播中 2:直播结束 3:已删除"` // 0:未开播 1:直播中 2:直播结束 3:已删除 + Switch string `json:"switch" orm:"switch" description:""` // + Url string `json:"url" orm:"url" description:""` // + PlayUrl string `json:"playUrl" orm:"play_url" description:""` // + PlayUrlM3U8 string `json:"playUrlM3U8" orm:"play_url_m3u8" description:""` // + PlayUrlLhd string `json:"playUrlLhd" orm:"play_url_lhd" description:"flv(高清)"` // flv(高清) + PlayUrlM3U8Lhd string `json:"playUrlM3U8Lhd" orm:"play_url_m3u8_lhd" description:"m3u8(高清)"` // m3u8(高清) + PlayUrlLsd string `json:"playUrlLsd" orm:"play_url_lsd" description:"flv(标清)"` // flv(标清) + PlayUrlM3U8Lsd string `json:"playUrlM3U8Lsd" orm:"play_url_m3u8_lsd" description:"m3u8(标清)"` // m3u8(标清) + Cover string `json:"cover" orm:"cover" description:""` // + Introduce string `json:"introduce" orm:"introduce" description:""` // + StartTime int `json:"startTime" orm:"start_time" description:""` // + Manager string `json:"manager" orm:"manager" description:""` // + Product string `json:"product" orm:"product" description:""` // + ProductId string `json:"productId" orm:"product_id" description:""` // + Qx int `json:"qx" orm:"qx" description:"直播观看权限 1:所有用户 2:部分客户 3 : 外地客户 4: 静态专区客户 5:大财神 6:终免 7:半年版"` // 直播观看权限 1:所有用户 2:部分客户 3 : 外地客户 4: 静态专区客户 5:大财神 6:终免 7:半年版 + Show int `json:"show" orm:"show" description:"是否展示直播 0:不展示 1:展示"` // 是否展示直播 0:不展示 1:展示 + Oaid string `json:"oaid" orm:"oaid" description:"频道oa号"` // 频道oa号 + Platform int `json:"platform" orm:"platform" description:"直播平台 1是pc直播2是手机直播"` // 直播平台 1是pc直播2是手机直播 + Sig string `json:"sig" orm:"sig" description:"腾讯sig"` // 腾讯sig + Playback int `json:"playback" orm:"playback" description:"有无回放 1:有 0:无"` // 有无回放 1:有 0:无 + PlaybackType int `json:"playbackType" orm:"playback_type" description:"回放类型 1:永久 2: 有期限"` // 回放类型 1:永久 2: 有期限 + PlaybackExpire int `json:"playbackExpire" orm:"playback_expire" description:"回放过期时间"` // 回放过期时间 + ShowInApp int `json:"showInApp" orm:"show_in_app" description:"0:不在app展示 1:在app展示"` // 0:不在app展示 1:在app展示 + ClassName string `json:"className" orm:"class_name" description:"班级名称"` // 班级名称 + CopyUrl int `json:"copyUrl" orm:"copy_url" description:"1:不允许客户复制链接"` // 1:不允许客户复制链接 + LiveType int `json:"liveType" orm:"live_type" description:"直播形式 1:obs 2:录播 3:连麦 4:重播 5:竖屏推流"` // 直播形式 1:obs 2:录播 3:连麦 4:重播 5:竖屏推流 + RepeatLiveId int `json:"repeatLiveId" orm:"repeat_live_id" description:"重播对应的live_id"` // 重播对应的live_id + LiveVideoId int `json:"liveVideoId" orm:"live_video_id" description:"录播视频id"` // 录播视频id + VideoUrl string `json:"videoUrl" orm:"video_url" description:"录播视频地址"` // 录播视频地址 + MemberWatchLimit int `json:"memberWatchLimit" orm:"member_watch_limit" description:"网员观看权限(静态专区) 1:全部用户 2:终免用户"` // 网员观看权限(静态专区) 1:全部用户 2:终免用户 + RealStartTime int `json:"realStartTime" orm:"real_start_time" description:"实际开始时间"` // 实际开始时间 + PopupQrcodeSwitch int `json:"popupQrcodeSwitch" orm:"popup_qrcode_switch" description:"弹窗二维码开关 0:关 1:开"` // 弹窗二维码开关 0:关 1:开 + CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:""` // + UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""` // + SyncPlatform string `json:"syncPlatform" orm:"sync_platform" description:"同步的平台 海外(en), 投教(toujiao)"` // 同步的平台 海外(en), 投教(toujiao) + SyncToujiaoChannelId int `json:"syncToujiaoChannelId" orm:"sync_toujiao_channel_id" description:"同步投教频道id"` // 同步投教频道id + SyncOverseaChannelId int `json:"syncOverseaChannelId" orm:"sync_oversea_channel_id" description:"同步海外频道id"` // 同步海外频道id + SyncLiveId int `json:"syncLiveId" orm:"sync_live_id" description:"从该live_id同步过来的"` // 从该live_id同步过来的 + PayNum int `json:"payNum" orm:"pay_num" description:"付费金豆数量"` // 付费金豆数量 + IsHerdsman int `json:"isHerdsman" orm:"is_herdsman" description:"1:牧民直播间"` // 1:牧民直播间 + HerdsmanLimit int `json:"herdsmanLimit" orm:"herdsman_limit" description:"1:限制只有牧民观看"` // 1:限制只有牧民观看 + ClubType int `json:"clubType" orm:"club_type" description:"俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理"` // 俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 5:价值投资 6:波段行情 7:抄底卖顶 8:资金及仓位管理 + ClubTypeLimit int `json:"clubTypeLimit" orm:"club_type_limit" description:"俱乐部权限 0:没有 1:有"` // 俱乐部权限 0:没有 1:有 + ExportPower int `json:"exportPower" orm:"export_power" description:"1:有导入名单权限"` // 1:有导入名单权限 + InvestorSwitch int `json:"investorSwitch" orm:"investor_switch" description:"1: 开启合格投资者"` // 1: 开启合格投资者 + SignSwitch int `json:"signSwitch" orm:"sign_switch" description:"1:开启签到"` // 1:开启签到 + OnlinePeopleSwitch int `json:"onlinePeopleSwitch" orm:"online_people_switch" description:"在线人数开关 1:实时在线人数 2:场观次数"` // 在线人数开关 1:实时在线人数 2:场观次数 + LessonId int `json:"lessonId" orm:"lesson_id" description:"课程id"` // 课程id + LessonSectionId int `json:"lessonSectionId" orm:"lesson_section_id" description:"课程章节id"` // 课程章节id + Password string `json:"password" orm:"password" description:"口令"` // 口令 + Sort int `json:"sort" orm:"sort" description:"排序(大的优先)"` // 排序(大的优先) + ContentIntro string `json:"contentIntro" orm:"content_intro" description:"内容介绍"` // 内容介绍 + RelatedClubType int `json:"relatedClubType" orm:"related_club_type" description:"关联俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部"` // 关联俱乐部 1:牧民俱乐部 2:博股论坛 3:神枪手俱乐部 4:环球俱乐部 + Poster string `json:"poster" orm:"poster" description:"海报"` // 海报 + Tabs string `json:"tabs" orm:"tabs" description:"1:推荐课程 2:课程作业 3:邀约榜"` // 1:推荐课程 2:课程作业 3:邀约榜 + PreviewVideo string `json:"previewVideo" orm:"preview_video" description:"预告视频"` // 预告视频 + ReceiveKit int `json:"receiveKit" orm:"receive_kit" description:"1: 领取锦囊指标"` // 1: 领取锦囊指标 + OaMark string `json:"oaMark" orm:"oa_mark" description:"oa_mark"` // oa_mark + OaMarkName string `json:"oaMarkName" orm:"oa_mark_name" description:"oa_mark_name"` // oa_mark_name + Stage int `json:"stage" orm:"stage" description:"销售阶段 1:课程销售阶段 2:软件销售阶段"` // 销售阶段 1:课程销售阶段 2:软件销售阶段 + StageCourse int `json:"stageCourse" orm:"stage_course" description:"阶段课程类型 1:开班课 2:服务课 3:销售课"` // 阶段课程类型 1:开班课 2:服务课 3:销售课 + TopTime int `json:"topTime" orm:"top_time" description:"置顶时间"` // 置顶时间 + PlaybackSort int `json:"playbackSort" orm:"playback_sort" description:"直播回放排序, 越大越靠前"` // 直播回放排序, 越大越靠前 + RelateClassIds string `json:"relateClassIds" orm:"relate_class_ids" description:"关联班级ids"` // 关联班级ids + JoinClassButton int `json:"joinClassButton" orm:"join_class_button" description:"进群按钮 1:开启"` // 进群按钮 1:开启 +} diff --git a/link_homework/internal/model/entity/member_info.go b/link_homework/internal/model/entity/member_info.go new file mode 100644 index 0000000..cacf35a --- /dev/null +++ b/link_homework/internal/model/entity/member_info.go @@ -0,0 +1,51 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// MemberInfo is the golang structure for table member_info. +type MemberInfo struct { + Id int `json:"id" orm:"id" description:""` // + Jwcode int `json:"jwcode" orm:"jwcode" description:""` // + Name string `json:"name" orm:"name" description:""` // + Avatar string `json:"avatar" orm:"avatar" description:""` // + Sex int `json:"sex" orm:"sex" description:"0:未知,1:男,2:女"` // 0:未知,1:男,2:女 + DeptId string `json:"deptId" orm:"deptId" description:""` // + DeptName string `json:"deptName" orm:"deptName" description:""` // + ShopId string `json:"shopId" orm:"shopId" description:""` // + ShopName string `json:"shopName" orm:"shopName" description:""` // + MembershipTime *gtime.Time `json:"membershipTime" orm:"membership_time" description:""` // + LearningStatus int `json:"learningStatus" orm:"learning_status" description:"0:不进行新网员学习,1:正在进行新网员学习,2:已进行学习"` // 0:不进行新网员学习,1:正在进行新网员学习,2:已进行学习 + LiveLock int `json:"liveLock" orm:"live_lock" description:"0 已解锁 1 未解锁"` // 0 已解锁 1 未解锁 + Level int `json:"level" orm:"level" description:"等级"` // 等级 + ClubRecommendation int `json:"clubRecommendation" orm:"club_recommendation" description:""` // + GiftExchange int `json:"giftExchange" orm:"gift_exchange" description:"是否退化礼物 0 未兑换 1 已兑换"` // 是否退化礼物 0 未兑换 1 已兑换 + Qianming string `json:"qianming" orm:"qianming" description:"签名"` // 签名 + CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:""` // + UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""` // + BlackCard int `json:"blackCard" orm:"black_card" description:"黑卡会员 0 不是 1是"` // 黑卡会员 0 不是 1是 + BoguMember int `json:"boguMember" orm:"bogu_member" description:"是否为博股会员 0 不是 1 是"` // 是否为博股会员 0 不是 1 是 + AccountOwner string `json:"accountOwner" orm:"account_owner" description:"号主账号"` // 号主账号 + AccountOwnerText string `json:"accountOwnerText" orm:"account_owner_text" description:"号主姓名"` // 号主姓名 + UserRole int `json:"userRole" orm:"user_role" description:"用户身份(1: 网员 2:非网)"` // 用户身份(1: 网员 2:非网) + Widget string `json:"widget" orm:"widget" description:""` // + LearningLevel uint `json:"learningLevel" orm:"learning_level" description:""` // + LearningIcon string `json:"learningIcon" orm:"learning_icon" description:""` // + LearningMedal string `json:"learningMedal" orm:"learning_medal" description:""` // + UserIdentity int `json:"userIdentity" orm:"user_identity" description:"0 无认证 1 红V 2 蓝V 3 黄V"` // 0 无认证 1 红V 2 蓝V 3 黄V + UserIdentityTitle string `json:"userIdentityTitle" orm:"user_identity_title" description:"用户身份头衔"` // 用户身份头衔 + IsBlacklist int `json:"isBlacklist" orm:"is_blacklist" description:"0不是黑名单1是黑名单"` // 0不是黑名单1是黑名单 + IsLecturer int `json:"isLecturer" orm:"is_lecturer" description:"1:讲师"` // 1:讲师 + Mobile string `json:"mobile" orm:"mobile" description:"手机号"` // 手机号 + Herdsman int `json:"herdsman" orm:"herdsman" description:""` // + Shenqiangshou int `json:"shenqiangshou" orm:"shenqiangshou" description:""` // + Huanqiu int `json:"huanqiu" orm:"huanqiu" description:""` // + LocMarket string `json:"locMarket" orm:"loc_market" description:"用户市场归属"` // 用户市场归属 + Fensi int `json:"fensi" orm:"fensi" description:"粉丝"` // 粉丝 + CreateTime int `json:"createTime" orm:"create_time" description:"账号注册时间"` // 账号注册时间 +} diff --git a/link_homework/internal/packed/packed.go b/link_homework/internal/packed/packed.go new file mode 100644 index 0000000..e20ab1e --- /dev/null +++ b/link_homework/internal/packed/packed.go @@ -0,0 +1 @@ +package packed diff --git a/link_homework/internal/service/.gitkeep b/link_homework/internal/service/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/main.go b/link_homework/main.go new file mode 100644 index 0000000..20c6a7a --- /dev/null +++ b/link_homework/main.go @@ -0,0 +1,44 @@ +package main + +import ( + "github.com/gogf/gf/v2/frame/g" + _ "link_homework/internal/packed" + + "github.com/gogf/gf/v2/os/gctx" + + _ "github.com/gogf/gf/contrib/drivers/mysql/v2" + + "link_homework/internal/cmd" + + _ "link_homework/internal/logic" +) + +func main() { + ctx := gctx.GetInitCtx() + + //启动日志 + g.Log().Info(ctx, "服务启动中") + + //检查数据库链接 + // 检查默认数据库链接 + db := g.DB() + if err := db.PingMaster(); err != nil { + g.Log().Fatal(ctx, "默认数据库链接失败,请检查数据库链接配置") + return + } + g.Log().Info(ctx, "默认数据库链接成功") + + // 检查 CMS 数据库链接 + cmsDb := g.DB("cms") + if err := cmsDb.PingMaster(); err != nil { + g.Log().Fatal(ctx, "CMS 数据库链接失败,请检查数据库链接配置") + return + } + g.Log().Info(ctx, "CMS 数据库链接成功") + + //启动主命令逻辑 + cmd.Main.Run(ctx) + + //服务启动完成日志 + g.Log().Info(ctx, "服务启动完成") +} diff --git a/link_homework/manifest/config/config.yaml b/link_homework/manifest/config/config.yaml new file mode 100644 index 0000000..b188f3a --- /dev/null +++ b/link_homework/manifest/config/config.yaml @@ -0,0 +1,21 @@ +# https://goframe.org/docs/web/server-config-file-template +server: + address: ":8080" + openapiPath: "/api.json" + swaggerPath: "/swagger" + +# https://goframe.org/docs/core/glog-config +logger: + level : "all" + stdout: true + +# https://goframe.org/docs/core/gdb-config-file +database: + default: + link: "mysql:live:p4jMAMShNM8HTrbX@tcp(39.101.133.168:3306)/live?charset=utf8mb4&parseTime=True&loc=Local" + debug: true + cms: + link: "mysql:cms:AF42R3ib6YkFaemm@tcp(39.101.133.168:3306)/cms?charset=utf8mb4&parseTime=True&loc=Local" + debug: true + +# redis暂不配置,记得加 \ No newline at end of file diff --git a/link_homework/manifest/deploy/kustomize/base/deployment.yaml b/link_homework/manifest/deploy/kustomize/base/deployment.yaml new file mode 100644 index 0000000..28f1d69 --- /dev/null +++ b/link_homework/manifest/deploy/kustomize/base/deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: template-single + labels: + app: template-single +spec: + replicas: 1 + selector: + matchLabels: + app: template-single + template: + metadata: + labels: + app: template-single + spec: + containers: + - name : main + image: template-single + imagePullPolicy: Always + diff --git a/link_homework/manifest/deploy/kustomize/base/kustomization.yaml b/link_homework/manifest/deploy/kustomize/base/kustomization.yaml new file mode 100644 index 0000000..302d92d --- /dev/null +++ b/link_homework/manifest/deploy/kustomize/base/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- deployment.yaml +- service.yaml + + + diff --git a/link_homework/manifest/deploy/kustomize/base/service.yaml b/link_homework/manifest/deploy/kustomize/base/service.yaml new file mode 100644 index 0000000..608771c --- /dev/null +++ b/link_homework/manifest/deploy/kustomize/base/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: template-single +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 8000 + selector: + app: template-single + diff --git a/link_homework/manifest/deploy/kustomize/overlays/develop/configmap.yaml b/link_homework/manifest/deploy/kustomize/overlays/develop/configmap.yaml new file mode 100644 index 0000000..3b1d0af --- /dev/null +++ b/link_homework/manifest/deploy/kustomize/overlays/develop/configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: template-single-configmap +data: + config.yaml: | + server: + address: ":8000" + openapiPath: "/api.json" + swaggerPath: "/swagger" + + logger: + level : "all" + stdout: true diff --git a/link_homework/manifest/deploy/kustomize/overlays/develop/deployment.yaml b/link_homework/manifest/deploy/kustomize/overlays/develop/deployment.yaml new file mode 100644 index 0000000..04e4851 --- /dev/null +++ b/link_homework/manifest/deploy/kustomize/overlays/develop/deployment.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: template-single +spec: + template: + spec: + containers: + - name : main + image: template-single:develop \ No newline at end of file diff --git a/link_homework/manifest/deploy/kustomize/overlays/develop/kustomization.yaml b/link_homework/manifest/deploy/kustomize/overlays/develop/kustomization.yaml new file mode 100644 index 0000000..4731c47 --- /dev/null +++ b/link_homework/manifest/deploy/kustomize/overlays/develop/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../base +- configmap.yaml + +patchesStrategicMerge: +- deployment.yaml + +namespace: default + + + diff --git a/link_homework/manifest/docker/Dockerfile b/link_homework/manifest/docker/Dockerfile new file mode 100644 index 0000000..d3abe8f --- /dev/null +++ b/link_homework/manifest/docker/Dockerfile @@ -0,0 +1,16 @@ +FROM loads/alpine:3.8 + +############################################################################### +# INSTALLATION +############################################################################### + +ENV WORKDIR /app +ADD resource $WORKDIR/ +ADD ./temp/linux_amd64/main $WORKDIR/main +RUN chmod +x $WORKDIR/main + +############################################################################### +# START +############################################################################### +WORKDIR $WORKDIR +CMD ./main diff --git a/link_homework/manifest/docker/docker.sh b/link_homework/manifest/docker/docker.sh new file mode 100644 index 0000000..ff393f9 --- /dev/null +++ b/link_homework/manifest/docker/docker.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# This shell is executed before docker build. + + + + + diff --git a/link_homework/manifest/i18n/.gitkeep b/link_homework/manifest/i18n/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/manifest/protobuf/.keep-if-necessary b/link_homework/manifest/protobuf/.keep-if-necessary new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/resource/public/html/.gitkeep b/link_homework/resource/public/html/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/resource/public/plugin/.gitkeep b/link_homework/resource/public/plugin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/resource/public/resource/css/.gitkeep b/link_homework/resource/public/resource/css/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/resource/public/resource/image/.gitkeep b/link_homework/resource/public/resource/image/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/resource/public/resource/js/.gitkeep b/link_homework/resource/public/resource/js/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/resource/template/.gitkeep b/link_homework/resource/template/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/link_homework/utility/.gitkeep b/link_homework/utility/.gitkeep new file mode 100644 index 0000000..e69de29