Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: idl files #8

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions cmd/academic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
include ../common.mk

SERVICE_NAME = academic

.PHONY: server
server:
sh build.sh
cd output && sh bootstrap.sh

.PHONY: gen
gen:
kitex \
-gen-path ../../kitex_gen \
-service "$(SERVICE_NAME)" \
-module "$(MODULE)" \
-type thrift \
../../idl/$(SERVICE_NAME).thrift
go mod tidy

.PHONY: test
test:
cd test && go test -v
12 changes: 12 additions & 0 deletions cmd/academic/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
RUN_NAME="academic"

mkdir -p output/bin
cp script/* output/
chmod +x output/bootstrap.sh

if [ "$IS_SYSTEM_TEST_ENV" != "1" ]; then
go build -o output/bin/${RUN_NAME}
else
go test -c -covermode=set -o output/bin/${RUN_NAME} -coverpkg=./...
fi
39 changes: 39 additions & 0 deletions cmd/academic/handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package main

import (
"context"
academic "github.com/west2-online/fzuhelper-server/kitex_gen/academic"
)

// AcademicServiceImpl implements the last service interface defined in the IDL.
type AcademicServiceImpl struct{}

// GetScores implements the AcademicServiceImpl interface.
func (s *AcademicServiceImpl) GetScores(ctx context.Context, req *academic.ScoresRequest) (resp *academic.ScoresResponse, err error) {
// TODO: Your code here...
return
}

// GetGPA implements the AcademicServiceImpl interface.
func (s *AcademicServiceImpl) GetGPA(ctx context.Context, req *academic.GPARequest) (resp *academic.GPAResp, err error) {
// TODO: Your code here...
return
}

// GetCredit implements the AcademicServiceImpl interface.
func (s *AcademicServiceImpl) GetCredit(ctx context.Context, req *academic.CreditRequest) (resp *academic.CreditResp, err error) {
// TODO: Your code here...
return
}

// GetUnifiedExam implements the AcademicServiceImpl interface.
func (s *AcademicServiceImpl) GetUnifiedExam(ctx context.Context, req *academic.UnifiedExamRequest) (resp *academic.UnifiedExamResp, err error) {
// TODO: Your code here...
return
}

// GetPlan implements the AcademicServiceImpl interface.
func (s *AcademicServiceImpl) GetPlan(ctx context.Context, req *academic.PlanRequest) (resp *academic.PlanResp, err error) {
// TODO: Your code here...
return
}
3 changes: 3 additions & 0 deletions cmd/academic/kitex_info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kitexinfo:
ServiceName: 'academic'
ToolVersion: 'v0.7.1'
16 changes: 16 additions & 0 deletions cmd/academic/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
academic "github.com/west2-online/fzuhelper-server/kitex_gen/academic/academicservice"
"log"
)

func main() {
svr := academic.NewServer(new(AcademicServiceImpl))

err := svr.Run()

if err != nil {
log.Println(err.Error())
}
}
21 changes: 21 additions & 0 deletions cmd/academic/script/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! /usr/bin/env bash
CURDIR=$(cd $(dirname $0); pwd)

if [ "X$1" != "X" ]; then
RUNTIME_ROOT=$1
else
RUNTIME_ROOT=${CURDIR}
fi

export KITEX_RUNTIME_ROOT=$RUNTIME_ROOT
export KITEX_LOG_DIR="$RUNTIME_ROOT/log"

if [ ! -d "$KITEX_LOG_DIR/app" ]; then
mkdir -p "$KITEX_LOG_DIR/app"
fi

if [ ! -d "$KITEX_LOG_DIR/rpc" ]; then
mkdir -p "$KITEX_LOG_DIR/rpc"
fi

exec "$CURDIR/bin/academic"
37 changes: 37 additions & 0 deletions cmd/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
*.o
*.a
*.so
_obj
_test
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.exe~
*.test
*.prof
*.rar
*.zip
*.gz
*.psd
*.bmd
*.cfg
*.pptx
*.log
*nohup.out
*settings.pyc
*.sublime-project
*.sublime-workspace
!.gitkeep
.DS_Store
/.idea
/.vscode
/output
*.local.yml
dumped_hertz_remote_config.json

6 changes: 6 additions & 0 deletions cmd/api/.hz
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: ""
91 changes: 91 additions & 0 deletions cmd/api/biz/handler/api/academic_service.go

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

27 changes: 27 additions & 0 deletions cmd/api/biz/handler/api/course_service.go

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

43 changes: 43 additions & 0 deletions cmd/api/biz/handler/api/empty_room_service.go

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

Loading
Loading