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

modify

parent 94839792
{ {
"dynamic":"strict", "dynamic":"strict",
"properties": { "properties": {
"id":{"type":"long"},
"user_id":{"type":"long"}, "user_id":{"type":"long"},
"nick_name":{"type":"text"}, //昵称 "nick_name":{"type":"text"}, //昵称
"profile_pic":{"type":"text"}, //头像 "profile_pic":{"type":"text"}, //头像
......
...@@ -17,7 +17,8 @@ class User(models.Model): ...@@ -17,7 +17,8 @@ class User(models.Model):
db_table = 'account_user' db_table = 'account_user'
app_label = 'api' 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='') nick_name = models.CharField(verbose_name=u'昵称', max_length=255, default='')
profile_pic = models.CharField(verbose_name=u'头像', max_length=300) profile_pic = models.CharField(verbose_name=u'头像', max_length=300)
gender = models.SmallIntegerField(verbose_name=u'性别') gender = models.SmallIntegerField(verbose_name=u'性别')
......
...@@ -17,7 +17,7 @@ class UserFollow(models.Model): ...@@ -17,7 +17,7 @@ class UserFollow(models.Model):
db_table = 'user_follow' db_table = 'user_follow'
app_label = 'api' 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") follow_id = models.IntegerField(verbose_name="关注的用户ID")
is_online = models.BooleanField(verbose_name="是否上线") is_online = models.BooleanField(verbose_name="是否上线")
is_deleted = models.BooleanField(verbose_name="是否删除") is_deleted = models.BooleanField(verbose_name="是否删除")
......
...@@ -13,6 +13,7 @@ class UserTransfer(object): ...@@ -13,6 +13,7 @@ class UserTransfer(object):
try: try:
res = dict() res = dict()
res["id"] = instance.id
res["user_id"] = instance.user_id res["user_id"] = instance.user_id
res["nick_name"] = instance.nick_name res["nick_name"] = instance.nick_name
res["profile_pic"] = instance.profile_pic res["profile_pic"] = instance.profile_pic
......
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