Commit 4e7b2961 authored by 段英荣's avatar 段英荣

modify

parent 9f1ee29c
......@@ -9,17 +9,13 @@ import re
import json
from elasticsearch import Elasticsearch
import elasticsearch.helpers
from django.conf import settings
class ESPerform(object):
cli_obj = None
cli_info_list = [
{
"host": "10.29.130.141",
"port": 9200
}
]
index_prefix = "gm-dbmw"
cli_info_list = settings.ES_INFO_LIST
index_prefix = settings.ES_INDEX_PREFIX
@classmethod
......
......@@ -30,7 +30,7 @@ ALLOWED_HOSTS = []
# Application definition
BROKER_URL = "redis://127.0.0.1:6379/0"
BROKER_URL = "redis://127.0.0.1:6379/2"
CELERY_TIMEZONE = 'Asia/Shanghai'
CELERY_ROUTES = ['physical.celery_task_router.CeleryTaskRouter']
......
......@@ -29,7 +29,7 @@ def recommend_user(self_user_id,interesting_user_id,offset=0,size=10):
#去除自身及感兴趣的用户ID
self_attention_user_id_list.append(self_user_id)
self_attention_user_id_list.append(interesting_user_id)
recommend_user_list = UserUtils.get_recommend_user_list(self_attention_user_id_list,recursion_attention_user_id_list,offset,size)
return recommend_user_list
......
......@@ -8,7 +8,7 @@
"gender":{"type":"integer"},
"is_online":{"type":"boolean"},//是否上线
"tag_list":{"type":"long"},//标签属性
"city_id":{"type":"long"},
"city_id":{"type":"text"},
"country_id":{"type":"long"},
"is_recommend":{"type":"boolean"},//是否运营推荐用户
"is_shadow":{"type":"boolean"},//是否马甲用户
......
......@@ -20,7 +20,7 @@ class Celebrity(models.Model):
name = models.CharField(verbose_name=u'名称', max_length=300, default='')
portrait = models.CharField(verbose_name=u'肖像', max_length=100, default='')
gender = models.SmallIntegerField(verbose_name=u'性别')
city_id = models.IntegerField(verbose_name=u'城市id')
city_id = models.CharField(verbose_name=u'城市id')
desc = models.IntegerField(verbose_name='')
is_online = models.BooleanField(verbose_name="是否上线")
create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0))
......
......@@ -29,7 +29,7 @@ class AccountUserTag(models.Model):
id = models.IntegerField(primary_key=True,verbose_name=u"主键ID")
tag_id = models.IntegerField(verbose_name=u"标签ID")
user_id = models.IntegerField(verbose_name=u"用户ID")
user = models.IntegerField(verbose_name=u"用户ID")
is_deleted = models.BooleanField(verbose_name=u"是否删除")
create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0))
update_time = models.DateTimeField(verbose_name=u'更新时间', default=datetime.datetime.fromtimestamp(0))
......
......@@ -27,7 +27,7 @@ class User(models.Model):
nick_name = models.CharField(verbose_name=u'昵称', max_length=255, default='')
profile_pic = models.CharField(verbose_name=u'头像', max_length=300)
gender = models.SmallIntegerField(verbose_name=u'性别')
city_id = models.IntegerField(verbose_name=u'城市id')
city_id = models.CharField(verbose_name=u'城市id')
country_id = models.IntegerField(verbose_name='国家id')
is_online = models.BooleanField(verbose_name="是否上线")
create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0))
......@@ -140,7 +140,7 @@ class User(models.Model):
try:
user_tag_id_list = list()
query_results = AccountUserTag.objects.filter(user_id=self.user_id)
query_results = AccountUserTag.objects.filter(user=self.user_id)
for item in query_results:
user_tag_id_list.append(item.tag_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment