Skip to content

Commit

Permalink
feat(server): update server and add web roadmap
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronnie committed Oct 18, 2024
1 parent cd87ce6 commit cc6e36b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@
## 感谢

* 使用在线 mysql 实例 [sqlpub](https://sqlpub.com)

## 路线图

- [ ] 替换 apifox 接口为 jzero 框架接口
- [ ] /auth/login
- [ ] /auth/getUserInfo
- [ ] /systemManage/getUserList
- [ ] /systemManage/getRoleList
- [ ] /systemManage/getMenuTree
8 changes: 4 additions & 4 deletions server/desc/api/version.api
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ info (
go_package: "version"
)

type GetVersionRequest {}
type GetRequest {}

type GetVersionResponse {
type GetResponse {
version string `json:"version"`
goVersion string `json:"goVersion"`
commit string `json:"commit"`
Expand All @@ -18,7 +18,7 @@ type GetVersionResponse {
group: version
)
service server {
@handler GetVersionHandler
get /version (GetVersionRequest) returns (GetVersionResponse)
@handler GetHandler
get /version (GetRequest) returns (GetResponse)
}

2 changes: 1 addition & 1 deletion server/internal/handler/routes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
types "server/internal/types/version"
)

func GetVersion(svcCtx *svc.ServiceContext) http.HandlerFunc {
func Get(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetVersionRequest
var req types.GetRequest
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}

l := version.NewGetVersion(r.Context(), svcCtx)
resp, err := l.GetVersion(&req)
l := version.NewGet(r.Context(), svcCtx)
resp, err := l.Get(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ package version
import (
"context"

"github.com/zeromicro/go-zero/core/logx"

"server/internal/svc"
types "server/internal/types/version"

"github.com/zeromicro/go-zero/core/logx"
)

type GetVersion struct {
type Get struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}

func NewGetVersion(ctx context.Context, svcCtx *svc.ServiceContext) *GetVersion {
return &GetVersion{
func NewGet(ctx context.Context, svcCtx *svc.ServiceContext) *Get {
return &Get{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}

func (l *GetVersion) GetVersion(req *types.GetVersionRequest) (resp *types.GetVersionResponse, err error) {
func (l *Get) Get(req *types.GetRequest) (resp *types.GetResponse, err error) {
// todo: add your logic here and delete this line

return
Expand Down
4 changes: 2 additions & 2 deletions server/internal/types/version/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc6e36b

Please sign in to comment.