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
|
|
|
|
|
|
|
UserDao *UserDao `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
|
|
|
|
|
|
|
us.UserDao.FindAll()
|
2019-11-11 15:00:04 +00:00
|
|
|
}
|