fix: fix circular import

This commit is contained in:
JustSong
2022-11-22 15:23:12 +08:00
parent d0c2c27071
commit e911c3fb7c
4 changed files with 14 additions and 15 deletions
-11
View File
@@ -2,7 +2,6 @@ package model
import (
"errors"
"message-pusher/channel"
"message-pusher/common"
"strings"
)
@@ -169,16 +168,6 @@ func IsUsernameAlreadyTaken(username string) bool {
return DB.Where("username = ?", username).Find(&User{}).RowsAffected == 1
}
func IsWeChatTestAccountTokenShared(item *channel.WeChatTestAccountTokenStoreItem) bool {
return DB.Where("wechat_test_account_id = ? and wechat_test_account_secret = ?",
item.AppID, item.AppSecret).Find(&User{}).RowsAffected != 1
}
func IsWeChatCorpAccountTokenShared(item *channel.WeChatCorpAccountTokenStoreItem) bool {
return DB.Where("wechat_corp_account_id = ? and wechat_corp_account_secret = ? and wechat_corp_account_agent_id = ?",
item.CorpId, item.CorpSecret, item.AgentId).Find(&User{}).RowsAffected != 1
}
func ResetUserPasswordByEmail(email string, password string) error {
hashedPassword, err := common.Password2Hash(password)
if err != nil {