mirror of
https://shylinux.com/x/education
synced 2025-04-25 10:08:05 +08:00
opt some
This commit is contained in:
parent
912e0ad35a
commit
5c435b39ab
7
go.mod
7
go.mod
@ -3,8 +3,9 @@ module shylinux.com/x/education
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
shylinux.com/x/ice v1.5.40
|
||||
shylinux.com/x/icebergs v1.9.38
|
||||
shylinux.com/x/golang-story v0.0.23
|
||||
shylinux.com/x/ice v1.5.41
|
||||
shylinux.com/x/icebergs v1.9.39
|
||||
shylinux.com/x/mysql-story v0.6.13
|
||||
shylinux.com/x/toolkits v1.0.12
|
||||
shylinux.com/x/toolkits v1.0.13
|
||||
)
|
||||
|
156
go.sum
156
go.sum
@ -1,42 +1,172 @@
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/PuerkitoBio/goquery v1.9.1/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY=
|
||||
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
|
||||
github.com/bgould/http v0.0.0-20190627042742-d268792bdee7/go.mod h1:BTqvVegvwifopl4KTEDth6Zezs9eR+lCWhvGKvkxJHE=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dhowden/itl v0.0.0-20170329215456-9fbe21093131/go.mod h1:eVWQJVQ67aMvYhpkDwaH2Goy2vo6v8JCMfGXfQ9sPtw=
|
||||
github.com/dhowden/plist v0.0.0-20141002110153-5db6e0d9931a/go.mod h1:sLjdR6uwx3L6/Py8F+QgAfeiuY87xuYGwCDqRFrvCzw=
|
||||
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8/go.mod h1:apkPC/CR3s48O2D7Y++n1XWEpgPNNCjXYga3PPbJe2E=
|
||||
github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts=
|
||||
github.com/emersion/go-imap v1.2.1/go.mod h1:Qlx1FSx2FTxjnjWpIlVNEuX+ylerZQNFE5NsmKFSejY=
|
||||
github.com/emersion/go-message v0.15.0/go.mod h1:wQUEfE+38+7EW8p8aZ96ptg6bAb1iwdgej19uXASlE4=
|
||||
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U=
|
||||
github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s=
|
||||
github.com/glerchundi/subcommands v0.0.0-20181212083838-923a6ccb11f8/go.mod h1:r0g3O7Y5lrWXgDfcFBRgnAKzjmPgTzwoMC2ieB345FY=
|
||||
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
||||
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
|
||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
||||
github.com/hajimehoshi/go-jisx0208 v1.0.0/go.mod h1:yYxEStHL7lt9uL+AbdWgW9gBumwieDoZCiB1f/0X0as=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
|
||||
github.com/peterbourgon/ff/v3 v3.1.2/go.mod h1:XNJLY8EIl6MjMVjBS4F0+G0LYoAqs0DTa4rmHHukKDE=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/sago35/go-bdf v0.0.0-20200313142241-6c17821c91c4/go.mod h1:rOebXGuMLsXhZAC6mF/TjxONsm45498ZyzVhel++6KM=
|
||||
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b/go.mod h1:CIltaIm7qaANUIvzr0Vmz71lmQMAIbGJ7cvgzX7FMfA=
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/soypat/cyw43439 v0.0.0-20240609122733-da9153086796/go.mod h1:1Otjk6PRhfzfcVHeWMEeku/VntFqWghUwuSQyivb2vE=
|
||||
github.com/soypat/natiu-mqtt v0.5.1/go.mod h1:xEta+cwop9izVCW7xOx2W+ct9PRMqr0gNVkvBPnQTc4=
|
||||
github.com/soypat/saleae v0.0.0-20230402180913-3584b7515dae/go.mod h1:9SV+w6E9YK/BePxdxYGXthkrRztHJCQlojWOjAxW3M4=
|
||||
github.com/soypat/seqs v0.0.0-20240527012110-1201bab640ef/go.mod h1:oCVCNGCHMKoBj97Zp9znLbQ1nHxpkmOY9X+UAGzOxc8=
|
||||
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/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tdakkota/win32metadata v0.1.0/go.mod h1:77e6YvX0LIVW+O81fhWLnXAxxcyu/wdZdG7iwed7Fyk=
|
||||
github.com/tinygo-org/cbgo v0.0.4/go.mod h1:7+HgWIHd4nbAz0ESjGlJ1/v9LDU1Ox8MGzP9mah/fLk=
|
||||
github.com/tinygo-org/pio v0.0.0-20231216154340-cd888eb58899/go.mod h1:LU7Dw00NJ+N86QkeTGjMLNkYcEYMor6wTDpTCu0EaH8=
|
||||
github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0=
|
||||
github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY=
|
||||
github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
|
||||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.5.5/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
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.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
||||
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
|
||||
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.0.0-20220617043117-41969df76e82/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
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-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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-20211019181941-9d821ace8654/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-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
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.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo=
|
||||
gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
|
||||
gorm.io/driver/sqlite v1.5.6/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4=
|
||||
@ -49,14 +179,32 @@ shylinux.com/x/go-git/v5 v5.6.7/go.mod h1:Qb0lA+uIrofZg8NQerhYcJHgGWixFqvS6p3aJ/
|
||||
shylinux.com/x/go-qrcode v0.0.3 h1:RMo+Vidbgq3HatLBj7DDXcTbTLFUwzis5K7TqBkD38U=
|
||||
shylinux.com/x/go-qrcode v0.0.3/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4ODm4po=
|
||||
shylinux.com/x/go-sql-mysql v0.0.2/go.mod h1:lHjRMZz5Lii6U+49fhkbCWgsnL+yux54SYJYWqASN8Y=
|
||||
shylinux.com/x/ice v1.5.40 h1:OC++Fb1CxOU1R0Vlrfm+J9pf1mg5uH1n1trXFIHQHaw=
|
||||
shylinux.com/x/golang-story v0.0.23 h1:GtFIe8G/3R5B2BodDj7savT31sYN9pygVPDoyGSX+9Y=
|
||||
shylinux.com/x/golang-story v0.0.23/go.mod h1:G0WEOJ0gCYR2tOs1ggyMBBrUMqJEgJjyvdFjN3VpNoM=
|
||||
shylinux.com/x/ice v1.5.40/go.mod h1:nYLBfYfOacaxvIRgD4ryknBJTqUIZD0zkV72it7iHqU=
|
||||
shylinux.com/x/icebergs v1.9.38 h1:LS4n8KE3qV8uvdpWwnrgStgkU90f6Ww6prSpv7Eztyw=
|
||||
shylinux.com/x/ice v1.5.41 h1:kqu+OOxT+CHkgEAuM+gby6lVZV33rYUM+Vk2UBDlefg=
|
||||
shylinux.com/x/ice v1.5.41/go.mod h1:hMhVMhUlsimwFcsPIH+J/tO8O8I0WEqg1NYyqdhULxE=
|
||||
shylinux.com/x/icebergs v1.9.38/go.mod h1:zLsVvLKuFEyFRwKoa3li75nSqbJo/GVIYacAQVdTsxA=
|
||||
shylinux.com/x/icebergs v1.9.39 h1:EAAWxEBWFF0CtO7Tm1pX+s/fi0lk0RMbe9EJV/aLuWo=
|
||||
shylinux.com/x/icebergs v1.9.39/go.mod h1:rUqDj1pzd6uPj7+klEn+doqXiWlb/24/batRyBB5ppo=
|
||||
shylinux.com/x/mysql-story v0.6.13 h1:+PCSRK9IoaeNU8/zonq1jFZY5UW2dKpqTANyFUzLxAI=
|
||||
shylinux.com/x/mysql-story v0.6.13/go.mod h1:HIBUuqZ/kQqwiFtPpekaiJB98qij+d9uhmnkAfahDXw=
|
||||
shylinux.com/x/toolkits v0.7.10/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||
shylinux.com/x/toolkits v1.0.12 h1:dwskBNtOLBfis1XtjEGfJhrjBXiwga3M/wNCERsXsyo=
|
||||
shylinux.com/x/toolkits v1.0.12/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||
shylinux.com/x/toolkits v1.0.13 h1:oXuXNnsP8/iDCqJmsa5HJew7NZoPd8aMTuJkCZdpOlQ=
|
||||
shylinux.com/x/toolkits v1.0.13/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||
shylinux.com/x/websocket v0.0.4 h1:AJpwblePoOpiE6C8NrvgNYpKTotXMLrDDX2chTvx44Q=
|
||||
shylinux.com/x/websocket v0.0.4/go.mod h1:3UGWkjTu3ie5NAZen7J+uLPBrO7DFeKloj6Jxo13Oiw=
|
||||
tinygo.org/x/bluetooth v0.10.0/go.mod h1:t/Vm2a/rslsBoqFQKCBsWQw/cmRicQq+8Tl3tj5RCRI=
|
||||
tinygo.org/x/drivers v0.14.0/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
|
||||
tinygo.org/x/drivers v0.15.1/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
|
||||
tinygo.org/x/drivers v0.16.0/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
|
||||
tinygo.org/x/drivers v0.19.0/go.mod h1:uJD/l1qWzxzLx+vcxaW0eY464N5RAgFi1zTVzASFdqI=
|
||||
tinygo.org/x/drivers v0.25.0/go.mod h1:v+mXaA4cgpz/YZJ3ZPm/86bYQJAXTaYtMkHlVwbodbw=
|
||||
tinygo.org/x/drivers v0.26.1-0.20230922160320-ed51435c2ef6/go.mod h1:X7utcg3yfFUFuKLOMTZD56eztXMjpkcf8OHldfTBsjw=
|
||||
tinygo.org/x/tinyfont v0.2.1/go.mod h1:eLqnYSrFRjt5STxWaMeOWJTzrKhXqpWw7nU3bPfKOAM=
|
||||
tinygo.org/x/tinyfont v0.3.0/go.mod h1:+TV5q0KpwSGRWnN+ITijsIhrWYJkoUCp9MYELjKpAXk=
|
||||
tinygo.org/x/tinyfont v0.4.0/go.mod h1:7nVj3j3geqBoPDzpFukAhF1C8AP9YocMsZy0HSAcGCA=
|
||||
tinygo.org/x/tinyfs v0.1.0/go.mod h1:ysc8Y92iHfhTXeyEM9+c7zviUQ4fN9UCFgSOFfMWv20=
|
||||
tinygo.org/x/tinyterm v0.1.0/go.mod h1:/DDhNnGwNF2/tNgHywvyZuCGnbH3ov49Z/6e8LPLRR4=
|
||||
tinygo.org/x/tinyterm v0.3.0/go.mod h1:F1pQjxEwNZQIc5czeJSBtk57ucEvbR4u7vHaLhWhHtg=
|
||||
|
@ -1,7 +1,6 @@
|
||||
package jiaowuxitong
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
@ -11,7 +10,6 @@ import (
|
||||
|
||||
"shylinux.com/x/education/src/jiaowuxitong/model"
|
||||
"shylinux.com/x/mysql-story/src/db"
|
||||
_ "shylinux.com/x/mysql-story/src/db/mysql"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
@ -27,6 +25,7 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
case model.USER_UID, model.CLASS_UID, model.SCHOOL_UID:
|
||||
m.Optionv(mdb.SELECT, model.UID, model.NAME)
|
||||
m.Cmdy(m.Prefix(strings.TrimSuffix(arg[0], "_uid"))).RenameAppend(model.UID, arg[0])
|
||||
m.DisplayInputKeyNameIconTitle()
|
||||
case GRADE:
|
||||
y := kit.Int(kit.Split(m.Time(), "-")[0])
|
||||
for i := 0; i < 10; i++ {
|
||||
@ -35,20 +34,5 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s Table) LeftJoin(target ice.Any) string {
|
||||
model, models := "", ""
|
||||
switch target := target.(type) {
|
||||
case string:
|
||||
model = target
|
||||
default:
|
||||
model = kit.LowerCapital(kit.Select("", kit.Split(reflect.TypeOf(target).String(), "."), -1))
|
||||
}
|
||||
if kit.HasSuffix(model, "s") {
|
||||
models = model + "es"
|
||||
} else {
|
||||
models = model + "s"
|
||||
}
|
||||
return kit.Format("left join %s on %s_uid = %s.uid", models, model, models)
|
||||
}
|
||||
|
||||
func prefixKey() string { return kit.Keys("web.team", kit.PathName(-1), kit.FileName(-1)) }
|
||||
|
4
src/jiaowuxitong/homework.css
Normal file
4
src/jiaowuxitong/homework.css
Normal file
@ -0,0 +1,4 @@
|
||||
$output div.item { padding:20px; }
|
||||
$output div.item div.title { border-left: var(--box-notice3); padding-left:10px; }
|
||||
$output div.item div.content { white-space:pre; padding:10px; }
|
||||
$input.create tr.class_uid { display:none; }
|
@ -1,13 +1,31 @@
|
||||
package jiaowuxitong
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
|
||||
"shylinux.com/x/education/src/jiaowuxitong/model"
|
||||
)
|
||||
|
||||
type homework struct {
|
||||
Table
|
||||
Class Class
|
||||
portal string `data:"true"`
|
||||
driver string `data:"mysql"`
|
||||
models string `data:"homework"`
|
||||
create string `name:"create class_uid* content*"`
|
||||
list string `name:"list class_uid uid auto"`
|
||||
}
|
||||
|
||||
func (s homework) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
s.Table.List(m, arg...)
|
||||
return
|
||||
} else if len(arg) == 1 {
|
||||
s.Table.Select(m, model.CLASS_UID, arg[0]).PushAction(s.Remove).Action(s.Create)
|
||||
} else {
|
||||
s.Table.Select(m.FieldsSetDetail(), model.UID, arg[1]).PushAction(s.Remove)
|
||||
}
|
||||
m.Option(model.CLASS_NAME, m.Cmd(s.Class, s.Class.Select, model.UID, arg[0]).Append(mdb.NAME))
|
||||
m.Display("").DisplayCSS("")
|
||||
}
|
||||
|
||||
func init() { ice.Cmd(prefixKey(), homework{}) }
|
||||
|
22
src/jiaowuxitong/homework.js
Normal file
22
src/jiaowuxitong/homework.js
Normal file
@ -0,0 +1,22 @@
|
||||
var UID = "uid", CLASS_NAME = "class_name"
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
if (msg.IsDetail()) { var value = msg.TableDetail(), time = can.base.TimeTrim(value.created_at)
|
||||
can.user.title([can.ConfHelp(), msg.Option(CLASS_NAME), can.base.trimPrefix(value.created_at.split(" ")[0], can.base.Time(null, "%y-"))].join(" "))
|
||||
can.page.Append(can, can._output, [{view: html.ITEM, list: [
|
||||
{view: [html.TITLE, "", time]},
|
||||
{view: [html.CONTENT, "", value.content]},
|
||||
]}]), can.onmotion.delay(can, function() { can.user.agent.init(can, value.content) })
|
||||
} else {
|
||||
can.user.title([can.ConfHelp(), msg.Option(CLASS_NAME)].join(" "))
|
||||
can.page.Append(can, can._output, msg.Table(function(value) { var time = can.base.TimeTrim(value.created_at)
|
||||
return {view: html.ITEM, list: [
|
||||
{view: [html.TITLE, "", time]},
|
||||
{view: [html.CONTENT, "", value.content]},
|
||||
], onclick: function(event) {
|
||||
can.Option(UID, value.uid), can.Update(event)
|
||||
}}
|
||||
})), can.onmotion.delay(can, function() { can.user.agent.init(can, can.user.info.titles) })
|
||||
}
|
||||
},
|
||||
})
|
@ -8,6 +8,7 @@ import (
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
GRADE = "grade"
|
||||
USER_UID = "user_uid"
|
||||
USER_NAME = "user_name"
|
||||
CLASS_UID = "class_uid"
|
||||
@ -16,8 +17,16 @@ const (
|
||||
SCHOOL_NAME = "school_name"
|
||||
)
|
||||
|
||||
type Sess struct {
|
||||
db.ModelWithUID
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
IP string `gorm:"type:char(16)"`
|
||||
Agent string `gorm:"size:char(256)"`
|
||||
}
|
||||
type User struct {
|
||||
db.ModelWithUID
|
||||
OpenID string `gorm:"type:char(32)"`
|
||||
Avatar string `gorm:"size:char(256)"`
|
||||
Name string `gorm:"type:char(32)"`
|
||||
}
|
||||
type UserClass struct {
|
||||
@ -46,7 +55,7 @@ type Homework struct {
|
||||
type models struct{ db.Models }
|
||||
|
||||
func (s models) Init(m *ice.Message, arg ...string) {
|
||||
s.Models.Register(m, &User{}, &UserClass{}, &Class{}, &School{}, &Homework{})
|
||||
s.Models.Register(m, &Sess{}, &User{}, &UserClass{}, &Class{}, &School{}, &Homework{})
|
||||
}
|
||||
|
||||
func init() { ice.Cmd("web.team.education.jiaowuxitong.models", models{}) }
|
||||
|
15
src/jiaowuxitong/portal.css
Normal file
15
src/jiaowuxitong/portal.css
Normal file
@ -0,0 +1,15 @@
|
||||
$output { background-color:var(--plugin-bg-color); }
|
||||
$output>div.list { border-radius:10px; background-color:var(--output-bg-color); padding:10px; margin:10px; }
|
||||
$output>div.list>div.title { font-weight:bold; display:flex; align-items:center; }
|
||||
$output>div.list>div.title span:first-child { flex-grow:1; }
|
||||
$output>div.list>div.item.card { padding:10px 0; display:flex; }
|
||||
$output>div.list>div.item.card>img { height:36px; }
|
||||
$output>div.list>div.item.card div.title { font-size:16px; }
|
||||
$output>div.list>div.item.card div.title span { margin-right:5px; }
|
||||
$output>div.list>div.item.card div.status { color:var(--disable-fg-color); font-size:12px; }
|
||||
$output>div.list>div.item.card div.status span { margin-right:5px; }
|
||||
$output>div.list>div.item.index { padding:10px; display:flex; flex-direction:column; align-items:center; float:left; }
|
||||
$output>div.list>div.item.index img { width:100%; }
|
||||
$output>div.action div.item.button { margin-right:5px; }
|
||||
$output>div.action div.item.button input { border:none; color:var(--notice-bg-color); min-width:80px; float:left; }
|
||||
$output>div.action div.item.button span { display:none; }
|
@ -2,7 +2,6 @@ package jiaowuxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/toolkits"
|
||||
@ -19,40 +18,40 @@ type portal struct {
|
||||
field string `data:"time,name,icons,index,order,enable"`
|
||||
list string `name:"list class_uid index uid auto" role:"void"`
|
||||
classCreate string `name:"classCreate school_uid* grade* name*" role:"void"`
|
||||
classRemove string `name:"classRemove class_uid*" role:"void"`
|
||||
}
|
||||
|
||||
func (s portal) Inputs(m *ice.Message, arg ...string) {
|
||||
s.Class.Inputs(m, arg...)
|
||||
}
|
||||
func (s portal) List(m *ice.Message, arg ...string) {
|
||||
if m.Display(""); m.Option(model.USER_UID) == "" {
|
||||
m.EchoInfoButton("please login", aaa.LOGIN)
|
||||
} else if len(arg) == 0 {
|
||||
m.Cmdy(s.userClass, s.userClass.MyClass, m.Option(model.USER_UID)).Action(s.ClassCreate, aaa.LOGIN).PushAction(s.ClassRemove)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton("please create class") })
|
||||
m.StatusTimeCount(m.OptionSimple(model.USER_UID))
|
||||
if len(arg) == 0 {
|
||||
m.Cmdy(s.userClass, s.userClass.MyClass, s.UserUID(m)).Action(s.ClassCreate).PushAction(s.ClassRemove)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton(m.Trans("Please Create Your Class", "请创建班级"), s.ClassCreate) })
|
||||
} else if len(arg) == 1 {
|
||||
s.Hash.List(m, arg[1:]...).SortInt(mdb.ORDER)
|
||||
} else if len(arg) == 2 {
|
||||
m.Cmdy(arg[1]).PushAction().Action()
|
||||
m.Cmdy(ctx.COMMAND, arg[1]).Push(ctx.ARGS, arg[0])
|
||||
} else {
|
||||
m.FieldsSetDetail()
|
||||
m.Cmdy(arg[1], mdb.SELECT, "uid = ?", arg[2]).PushAction().Action()
|
||||
m.FieldsSetDetail().Cmdy(arg[1], mdb.SELECT, model.UID, arg[2]).PushAction().Action()
|
||||
}
|
||||
m.Display("").DisplayCSS("")
|
||||
}
|
||||
func (s portal) ClassCreate(m *ice.Message, arg ...string) {
|
||||
if !m.Cmdy(s.Class, s.Class.Create, arg).IsErr() {
|
||||
m.Cmdy(s.userClass, s.userClass.Create, m.OptionSimple(model.USER_UID), model.CLASS_UID, m.Result())
|
||||
m.Cmdy(s.userClass, s.userClass.Create, model.USER_UID, s.UserUID(m), model.CLASS_UID, m.Result())
|
||||
}
|
||||
}
|
||||
func (s portal) ClassRemove(m *ice.Message, arg ...string) {
|
||||
if !m.Cmdy(s.Class, s.Class.Remove, arg).IsErr() {
|
||||
m.Cmdy(s.userClass, s.userClass.Remove, m.OptionSimple(model.USER_UID), model.CLASS_UID, m.Result())
|
||||
}
|
||||
m.Cmdy(s.Class, s.Class.Delete, model.UID, m.Option(model.CLASS_UID))
|
||||
m.Cmdy(s.userClass, s.userClass.Delete, model.USER_UID, s.UserUID(m), model.CLASS_UID, m.Option(model.CLASS_UID))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(portal{}) }
|
||||
func init() { ice.Cmd(prefixKey(), portal{}) }
|
||||
|
||||
func (s portal) UserUID(m *ice.Message) string {
|
||||
return m.Option(ice.MSG_USERNAME)
|
||||
}
|
||||
func (s portal) Show(m *ice.Message, arg ...string) {
|
||||
cmd := m.GetCommand()
|
||||
m.Cmd(s, s.Create, mdb.NAME, cmd.Help, mdb.ICONS, cmd.Icon, ctx.INDEX, m.PrefixKey())
|
||||
|
@ -1,10 +1,72 @@
|
||||
var UID = "uid", CLASS_UID = "class_uid"
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { msg.Dump(can) },
|
||||
})
|
||||
Volcanos(chat.ONACTION, {
|
||||
login: function(event, can) {
|
||||
can.user.input(event, can, ["user_uid"], function(data) {
|
||||
can.misc.Cookie(can, data)
|
||||
_init: function(can, msg) { can.user.isMobile && can.isCmdMode() && can.onappend.style(can, html.OUTPUT)
|
||||
if (can.Option(CLASS_UID) == "") {
|
||||
if (can.db.hash.length > 1 && can.db.hash[0]) { return can.Option(CLASS_UID, can.db.hash[0]), can.Option(ctx.INDEX, can.db.hash[1]), can.Update() }
|
||||
can.ui = can.page.Append(can, can._output, ["myclass.list", "myindex.list"])
|
||||
can.page.Append(can, can.ui.myclass, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Class", "我的班级")}, can.page.button(can, "classCreate")]}])
|
||||
can.run({}, [can.onimport.myClass(can, msg, can.ui.myclass)], function(msg) {
|
||||
can.page.Append(can, can.ui.myindex, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Index", "我的课程")}]}])
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex)
|
||||
})
|
||||
} else {
|
||||
can.onimport.myData(can, msg, can._output)
|
||||
}
|
||||
},
|
||||
myClass: function(can, msg, target) { var class_uid
|
||||
can.page.Append(can, target||can._output, msg.Table(function(value) {
|
||||
class_uid = class_uid||value.class_uid, value.class_uid == can.onexport.session(can, CLASS_UID) && (class_uid = value.class_uid)
|
||||
class_uid == value.class_uid && can.onexport.title(can, value.class_name)
|
||||
return {view: [[html.ITEM_CARD]], list: [
|
||||
{img: can.misc.ResourceIcons(can, value.icon)},
|
||||
{view: ice.INFO, list: [
|
||||
{view: html.TITLE, list: [{text: value.class_name}]},
|
||||
{view: html.STATUS, list: [{text: value.grade}, {text: value.school_name}]},
|
||||
]},
|
||||
], onclick: function(event) {
|
||||
can.onexport.hash(can, value.class_uid), can.onexport.session(can, CLASS_UID, value.class_uid)
|
||||
can.onexport.title(can, value.class_name), can.user.toastSuccess(can, "switch")
|
||||
can.user.agent.init(can, can.user.info.titles)
|
||||
}}
|
||||
})), can.onexport.hash(can, class_uid), can.onexport.session(can, CLASS_UID, class_uid); return class_uid
|
||||
},
|
||||
myIndex: function(can, msg, target) {
|
||||
can.page.Append(can, target||can._output, msg.Table(function(value) {
|
||||
var width; can.user.isMobile && !can.user.isLandscape() && (width = (can.ConfWidth()-40)/4)
|
||||
return {view: [[html.ITEM, ctx.INDEX]], style: {width: width}, list: [
|
||||
{img: can.misc.ResourceIcons(can, value.icon)}, {text: can.user.trans(can, value.index.split(".").pop(), value.name)},
|
||||
], onclick: function(event) {
|
||||
can.Option(CLASS_UID, can.onexport.session(can, CLASS_UID)), can.Option(ctx.INDEX, value.index), can.Update()
|
||||
}}
|
||||
}))
|
||||
},
|
||||
myData: function(can, msg, target) {
|
||||
msg.Table(function(value) { function back() {} function refresh() {}
|
||||
var list = [can.page.button(can, can.user.trans(can, "goback", "返回"), function(event) { back() }), can.page.button(can, can.user.trans(can, "reload", "刷新"), function(event) { refresh() })]
|
||||
var ui = can.page.Append(can, can._output, [{view: html.ACTION}])
|
||||
if (can.db.hash.length > 2 && can.db.hash[0] && can.db.hash[2]) { value.args = [can.db.hash[0], can.db.hash[2]] }
|
||||
value.style = html.OUTPUT, value.height = can.ConfHeight()-html.ACTION_HEIGHT
|
||||
can.onappend.plugin(can, value, function(sub) { refresh = function() { sub.Update() }
|
||||
sub.onexport.output = function(_sub, msg) { can.user.toastSuccess(can, "load", "", 1000)
|
||||
can.page.Appends(can, ui.action, list), msg.Option(ice.MSG_ACTION) && can.onappend._action(sub, msg.Option(ice.MSG_ACTION), ui.action, null, true)
|
||||
can.onexport.hash(can, can.Option(CLASS_UID), value.index, sub.Option(UID))
|
||||
back = function() {
|
||||
if (sub.Option(UID)) {
|
||||
can.onexport.hash(can, can.Option(CLASS_UID), can.Option(ctx.INDEX))
|
||||
sub.Option(UID, ""), sub.Update()
|
||||
} else {
|
||||
can.onexport.hash(can, "")
|
||||
can.Option(CLASS_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
@ -1,21 +1,26 @@
|
||||
{
|
||||
"school": "学校",
|
||||
"class": "班级",
|
||||
"homework": "家庭作业",
|
||||
"user": "用户",
|
||||
"class": "班级",
|
||||
"school": "学校",
|
||||
"homework": "家庭作业",
|
||||
"classCreate": "创建班级",
|
||||
"classRemove": "删除班级",
|
||||
"portal": "教务系统",
|
||||
"icons": {
|
||||
"classCreate": "bi bi-plus-square-dotted"
|
||||
},
|
||||
"input": {
|
||||
"migrate": "迁移",
|
||||
"uid": "主键",
|
||||
"info": "信息",
|
||||
"address": "地址",
|
||||
"grade": "入学年份",
|
||||
"school_uid": "学校",
|
||||
"school_name": "学校名称",
|
||||
"open_id": "外键",
|
||||
"user_uid": "用户",
|
||||
"user_name": "用户昵称",
|
||||
"class_uid": "班级",
|
||||
"class_name": "班级名称",
|
||||
"homework_uid": "作业",
|
||||
"user_uid": "用户",
|
||||
"user_name": "用户昵称"
|
||||
"school_uid": "学校",
|
||||
"school_name": "学校名称"
|
||||
}
|
||||
}
|
@ -1,13 +1,9 @@
|
||||
chapter "教务系统"
|
||||
refer `
|
||||
日照市学校 http://jyj.rizhao.gov.cn/art/2019/4/29/art_33083_5757467.html
|
||||
GORM https://gorm.io/docs/indexes.html
|
||||
`
|
||||
|
||||
field web.code.db.models
|
||||
field web.code.db.driver
|
||||
field web.code.db.database
|
||||
field web.code.mysql.client
|
||||
field web.code.mysql.query args `mysql jiaowuxitong`
|
||||
field web.code.sqlite.client args `var/db/web.code.db.sqlite.db`
|
||||
field web.code.golang.runtime
|
||||
field web.code.db.database
|
||||
field web.code.db.driver
|
||||
field web.code.db.models
|
27
src/jiaowuxitong/sess.go
Normal file
27
src/jiaowuxitong/sess.go
Normal file
@ -0,0 +1,27 @@
|
||||
package jiaowuxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/education/src/jiaowuxitong/model"
|
||||
)
|
||||
|
||||
type sess struct {
|
||||
Table
|
||||
create string `name:"create user_uid*"`
|
||||
check string `name:"check uid*"`
|
||||
}
|
||||
|
||||
func (s sess) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, model.USER_UID, m.Option(model.USER_UID), aaa.IP, m.Option(ice.MSG_USERIP), web.AGENT, m.Option(ice.MSG_USERUA))
|
||||
m.ProcessCookie(ice.MSG_SESSID, kit.JoinWord(web.SPACE, m.Option(ice.MSG_USERPOD), m.PrefixKey(), aaa.CHECK, m.Result()), "-2")
|
||||
}
|
||||
func (s sess) Check(m *ice.Message, arg ...string) {
|
||||
msg := s.Table.Select(m.Spawn(), model.UID, arg[0])
|
||||
m.Option(ice.MSG_USERNAME, msg.Append(model.USER_UID))
|
||||
}
|
||||
|
||||
func init() { ice.Cmd(prefixKey(), sess{}) }
|
@ -1,7 +1,30 @@
|
||||
package jiaowuxitong
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
|
||||
type user struct{ Table }
|
||||
"shylinux.com/x/education/src/jiaowuxitong/model"
|
||||
)
|
||||
|
||||
const (
|
||||
OPEN_ID = "open_id"
|
||||
OPENID = "openid"
|
||||
AVATAR = "avatar"
|
||||
)
|
||||
|
||||
type user struct {
|
||||
Table
|
||||
create string `name:"create openid*"`
|
||||
}
|
||||
|
||||
func (s user) Create(m *ice.Message, arg ...string) {
|
||||
if s.Table.Select(m, OPEN_ID, m.Option(OPENID)).Length() == 0 {
|
||||
s.Table.Create(m, OPEN_ID, m.Option(OPENID), AVATAR, m.Option("headimgurl"), mdb.NAME, m.Option("nickname"))
|
||||
m.Option(model.USER_UID, m.Result())
|
||||
} else {
|
||||
m.Option(model.USER_UID, m.Append(model.UID))
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.Cmd(prefixKey(), user{}) }
|
||||
|
@ -2,7 +2,8 @@ package jiaowuxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
|
||||
"shylinux.com/x/education/src/jiaowuxitong/model"
|
||||
)
|
||||
|
||||
type userClass struct {
|
||||
@ -12,11 +13,9 @@ type userClass struct {
|
||||
create string `name:"create user_uid* class_uid*"`
|
||||
}
|
||||
|
||||
func (s userClass) Remove(m *ice.Message, arg ...string) {
|
||||
}
|
||||
func (s userClass) MyClass(m *ice.Message, arg ...string) {
|
||||
m.Optionv(mdb.SELECT, "schools.name AS school_name", "grade", "classes.name AS class_name", "class_uid", "school_uid")
|
||||
s.Show(m, s.Open(m).Select(m.Optionv(mdb.SELECT)).Joins(s.LeftJoin(s.Class)).Joins(s.LeftJoin(s.school)).Where("user_uid = ?", arg[0]))
|
||||
s.Fields(m, "classes.created_at", model.SCHOOL_NAME, model.GRADE, model.CLASS_NAME, model.CLASS_UID, model.SCHOOL_UID).Tables(m, s.Class, s.school)
|
||||
s.Select(m, model.USER_UID, arg[0])
|
||||
}
|
||||
|
||||
func init() { ice.Cmd(prefixKey(), userClass{}) }
|
||||
|
@ -4,8 +4,9 @@ import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
_ "shylinux.com/x/education/src/jiaowuxitong"
|
||||
_ "shylinux.com/x/mysql-story/src/db/mysql"
|
||||
)
|
||||
|
||||
func main() { print(ice.Run()) }
|
||||
|
||||
func init() { ice.Info.Titles = "Education" }
|
||||
func init() { ice.Info.Titles = "云教育" }
|
||||
|
6
src/option.go
Normal file
6
src/option.go
Normal file
@ -0,0 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "shylinux.com/x/golang-story/src/runtime"
|
||||
_ "shylinux.com/x/ice/devops"
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user