Commit 07073ad2 authored by 段英荣's avatar 段英荣

modify

parent 94839792
{
"dynamic":"strict",
"properties": {
"id":{"type":"long"},
"user_id":{"type":"long"},
"nick_name":{"type":"text"}, //昵称
"profile_pic":{"type":"text"}, //头像
......
......@@ -17,7 +17,8 @@ class User(models.Model):
db_table = 'account_user'
app_label = 'api'
user_id = models.BigIntegerField(verbose_name=u'用户唯一id', unique=True)
id = models.IntegerField(verbose_name="主键ID",primary_key=True)
user_id = models.BigIntegerField(verbose_name=u'用户id', unique=True)
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'性别')
......
......@@ -17,7 +17,7 @@ class UserFollow(models.Model):
db_table = 'user_follow'
app_label = 'api'
user = models.ForeignKey(User,related_name='userfollow',on_delete=models.CASCADE)
user = models.ForeignKey(User,related_name='userfollow',to_field="user_id",on_delete=models.CASCADE)
follow_id = models.IntegerField(verbose_name="关注的用户ID")
is_online = models.BooleanField(verbose_name="是否上线")
is_deleted = models.BooleanField(verbose_name="是否删除")
......
......@@ -13,6 +13,7 @@ class UserTransfer(object):
try:
res = dict()
res["id"] = instance.id
res["user_id"] = instance.user_id
res["nick_name"] = instance.nick_name
res["profile_pic"] = instance.profile_pic
......@@ -24,7 +25,7 @@ class UserTransfer(object):
res["update_time"] = tzlc(instance.update_time)
res["tag_list"] = ""
print("follow_user_id_list:%s" % str(instance.get_follow_user_id_list))
res["attention_user_id_list"] = instance.get_follow_user_id_list()
......
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