-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: empty classroom service of undergraduate student (#9)
* refactor: classroom framework * refactor: empty classroom service * add: dockerfile * fix: delete the header of id and cookies for classroom service * feat: complete empty room service * fix: normalize the framework * fix: modify Dockerfile and docker-compose.yml * fix: add judgement of /pkg/client and add config.example.yaml * fix: modify CacheEmptyRooms * fix: modify workqueue init * refactor: refactor the classroom service * add: utils.GetAvailablePort * fix: refactor the logic of using logger * fix: get_room_test.go * fix: normalize * fix: replace github.com/pkg/errors * delete: remove the config of skywalking * fix: fix according to golangci-lint * fix: modify go version 1.23.0 * fix: modify go version 1.23 * fix: go.mod in version * fix: modify golangci.yml * fix: modify golangci.yml * fix: modify golangci.yml
- Loading branch information
1 parent
431f65c
commit caa22cf
Showing
117 changed files
with
9,763 additions
and
3,809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Code generated by hz. DO NOT EDIT. | ||
|
||
hz version: v0.9.1 | ||
handlerDir: "" | ||
modelDir: "" | ||
routerDir: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
|
||
update: | ||
hz update -idl ../../idl/api.thrift | ||
|
||
|
||
|
||
run: | ||
sh build.sh && sh output/bootstrap.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package middleware | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"strings" | ||
|
||
"github.com/cloudwego/hertz/pkg/app" | ||
"github.com/west2-online/fzuhelper-server/cmd/api/biz/model/api" | ||
"github.com/west2-online/fzuhelper-server/cmd/api/biz/pack" | ||
"github.com/west2-online/fzuhelper-server/kitex_gen/model" | ||
"github.com/west2-online/fzuhelper-server/pkg/errno" | ||
) | ||
|
||
// 获取请求头的信息 | ||
|
||
func GetHeaderParams() app.HandlerFunc { | ||
return func(ctx context.Context, c *app.RequestContext) { | ||
id := string(c.GetHeader("id")) | ||
temp := string(c.GetHeader("cookies")) | ||
if id == "" || len(temp) == 0 { | ||
pack.RespError(c, errno.ParamMissingHeader) | ||
c.Abort() | ||
return | ||
} | ||
cookies := strings.Split(temp, ",") | ||
// 将id和cookies放入context中 | ||
fmt.Println(id) | ||
fmt.Println(cookies) | ||
ctx = api.NewContext(ctx, &model.LoginData{ | ||
Id: id, | ||
Cookies: cookies, | ||
}) | ||
c.Next(ctx) | ||
} | ||
} |
Oops, something went wrong.