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\")"` UserRepository *UserRepository `annotation:"@Inject()"` } func (us *UserService) FindAll() { log.Printf("UserService FindAll") us.UserRepository.FindAll() }