member_gateway_rest/service/member-service.go
crusader 37f2a908f5 ing
2018-04-10 15:58:38 +09:00

40 lines
952 B
Go

package service
import (
"context"
"reflect"
cda "git.loafle.net/commons/di-go/annotation"
cdr "git.loafle.net/commons/di-go/registry"
"git.loafle.net/commons/server-go"
_ "git.loafle.net/overflow/commons-go/annotation"
"git.loafle.net/overflow/gateway/external/grpc"
"github.com/valyala/fasthttp"
)
var MemberServiceType = reflect.TypeOf((*MemberService)(nil))
func init() {
cdr.RegisterType(MemberServiceType)
}
type MemberService struct {
cda.TypeAnnotation `annotation:"@overflow:Service()"`
}
func (ms *MemberService) Signin(servletCtx server.ServletCtx, ctx *fasthttp.RequestCtx, id string, pw string) (string, error) {
gRPCCtx := context.Background()
r, err := grpc.Exec(gRPCCtx, "MemberService.signin", id, pw)
if nil != err {
return "", err
}
return r, nil
}
func (ms *MemberService) Register(servletCtx server.ServletCtx, ctx *fasthttp.RequestCtx, id string, pw string) (string, error) {
return "dkfksddfk", nil
}