server/pkg/modules/user/user-service.go
2019-11-18 23:28:56 +09:00

30 lines
556 B
Go

package user
import (
"log"
"reflect"
// For annotation
"git.loafle.net/loafer/annotation-go"
"git.loafle.net/loafer/di-go"
_ "git.loafle.net/totopia/server/pkg/loafer/web/annotation"
)
var UserServiceType = reflect.TypeOf((*UserService)(nil))
func init() {
di.RegisterType(UserServiceType)
}
type UserService struct {
annotation.TypeAnnotation `annotation:"@web:Service(\"name\": \"/userService\")"`
UserDao *UserDao `annotation:"@Inject()"`
}
func (us *UserService) FindAll() {
log.Printf("UserService FindAll")
us.UserDao.FindAll()
}