2023-01-18 09:03:15 +00:00
|
|
|
package logic
|
|
|
|
|
|
|
|
import (
|
2023-02-06 01:33:09 +00:00
|
|
|
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
|
|
|
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
2023-01-18 09:03:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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)
|
2023-02-02 06:10:24 +00:00
|
|
|
ArtistSupplyList(req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.ArtistSupplyListRespond, err error)
|
2023-01-18 09:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2023-02-02 06:10:24 +00:00
|
|
|
func (a *ArtistInfo) ArtistSupplyList(req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.ArtistSupplyListRespond, err error) {
|
2023-02-06 01:33:09 +00:00
|
|
|
rep, err = dao.ArtistSupplyList(req)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
func (a *ArtistInfo) UserLock(req *artistinfo.UserLockRequest) (rep *artistinfo.UserLockRespond, err error) {
|
|
|
|
rep, err = dao.UserLock(req)
|
2023-02-02 06:10:24 +00:00
|
|
|
return
|
|
|
|
}
|