server/pkg/modules/user/user-service.go

30 lines
577 B
Go
Raw Normal View History

2019-11-11 15:00:04 +00:00
package user
import (
"log"
"reflect"
// For annotation
2019-11-13 14:21:05 +00:00
"git.loafle.net/loafer/annotation-go"
"git.loafle.net/loafer/di-go"
2019-11-11 15:00:04 +00:00
_ "git.loafle.net/totopia/server/pkg/loafer/web/annotation"
)
var UserServiceType = reflect.TypeOf((*UserService)(nil))
func init() {
2019-11-13 14:21:05 +00:00
di.RegisterType(UserServiceType)
2019-11-11 15:00:04 +00:00
}
type UserService struct {
2019-11-13 14:21:05 +00:00
annotation.TypeAnnotation `annotation:"@web:Service(\"name\": \"/userService\")"`
2019-11-18 14:28:56 +00:00
2019-11-19 14:58:46 +00:00
UserRepository *UserRepository `annotation:"@Inject()"`
2019-11-11 15:00:04 +00:00
}
func (us *UserService) FindAll() {
log.Printf("UserService FindAll")
2019-11-18 14:28:56 +00:00
2019-11-19 14:58:46 +00:00
us.UserRepository.FindAll()
2019-11-11 15:00:04 +00:00
}