51 lines
1.8 KiB
Go
51 lines
1.8 KiB
Go
package logic
|
|
|
|
import (
|
|
"github.com/fonchain-artistserver/cmd/internal/dao"
|
|
"github.com/fonchain-artistserver/pb/artistinfo"
|
|
)
|
|
|
|
type IArtistInfo interface {
|
|
RegisterUser(req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error)
|
|
GetUserById(req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByIdRespond, err error)
|
|
GetUser(req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error)
|
|
UpdateRealName(req *artistinfo.UpdateRealNameRequest) (rep *artistinfo.UpdateRealNameRespond, err error)
|
|
FinishVerify(req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVerifyRespond, err error)
|
|
CheckUserLock(req *artistinfo.CheckUserLockRequest) (rep *artistinfo.CheckUserLockRespond, err error)
|
|
}
|
|
|
|
func NewArtistInfo() IArtistInfo {
|
|
return &ArtistInfo{}
|
|
}
|
|
|
|
type ArtistInfo struct{}
|
|
|
|
func (a *ArtistInfo) GetUser(req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error) {
|
|
rep, err = dao.GetUser(req)
|
|
return
|
|
}
|
|
func (a *ArtistInfo) RegisterUser(req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error) {
|
|
rep, err = dao.RegisterUser(req)
|
|
return
|
|
}
|
|
|
|
func (a *ArtistInfo) GetUserById(req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByIdRespond, err error) {
|
|
rep, err = dao.GetUserById(req)
|
|
return
|
|
}
|
|
|
|
func (a *ArtistInfo) UpdateRealName(req *artistinfo.UpdateRealNameRequest) (rep *artistinfo.UpdateRealNameRespond, err error) {
|
|
rep, err = dao.UpdateRealName(req)
|
|
return
|
|
}
|
|
|
|
func (a *ArtistInfo) FinishVerify(req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVerifyRespond, err error) {
|
|
rep, err = dao.FinishVerify(req)
|
|
return
|
|
}
|
|
|
|
func (a *ArtistInfo) CheckUserLock(req *artistinfo.CheckUserLockRequest) (rep *artistinfo.CheckUserLockRespond, err error) {
|
|
err = dao.CheckUserLock(int64(req.ID))
|
|
return
|
|
}
|