chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package warningnotify
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/dao"
|
||||
)
|
||||
|
||||
func warningWechatEnabled(ctx context.Context, tenantID string, userID int64) (bool, error) {
|
||||
var preference *struct {
|
||||
Value string `orm:"config_value"`
|
||||
}
|
||||
err := dao.SysConfig.Ctx(ctx).Fields("config_value").Where("tenant_id", tenantID).
|
||||
Where("config_key", fmt.Sprintf("app.wechat.warning.enabled.%d", userID)).OrderDesc("config_id").Scan(&preference)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return preference == nil || preference.Value == "1", nil
|
||||
}
|
||||
Reference in New Issue
Block a user