...
|
...
|
@@ -4,6 +4,7 @@ import ( |
|
|
"fmt"
|
|
|
"github.com/tiptok/gocomm/xa/eda"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/userAuth"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain/event"
|
...
|
...
|
@@ -262,6 +263,39 @@ func Revoke(header *protocol.RequestHeader, request *protocol.RevokeRequest) (rs |
|
|
return
|
|
|
}
|
|
|
|
|
|
//注销登录
|
|
|
func UCenterRevoke(header *protocol.RequestHeader, userId int64) (rsp *protocol.RevokeResponse, err error) {
|
|
|
var (
|
|
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
|
|
UsersRepository, _ = factory.CreateUsersRepository(transactionContext)
|
|
|
user *domain.Users
|
|
|
)
|
|
|
|
|
|
rsp = &protocol.RevokeResponse{}
|
|
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
if user, err = UsersRepository.FindOne(map[string]interface{}{"id": userId}); err != nil {
|
|
|
log.Error(err)
|
|
|
err = nil
|
|
|
return
|
|
|
}
|
|
|
id, _ := strconv.Atoi(user.Phone)
|
|
|
auth := userAuth.NewRedisUserAuth(userAuth.WithUserId(int64(id)))
|
|
|
if !auth.Exist() {
|
|
|
return
|
|
|
}
|
|
|
if err = auth.RemoveAuth(); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
func CenterCompanys(header *protocol.RequestHeader, request *protocolx.CenterCompanysRequest) (v interface{}, err error) {
|
|
|
var (
|
|
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
...
|
...
|
|