We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# GET : 查詢使用者 API /api/auth/user # 以使用者的 username 查 user_type # PUT : 更新使用者 API /api/auth/user # 以使用者的 username 更新 user_type # DELETE : 刪除使用者 API /api/auth/user # 以使用者的 username 刪除使用者
新增以上三支 API
The text was updated successfully, but these errors were encountered:
可能要審視 models.py 內容是否要修改 因為目前在資料庫中儲存 import datetime
from django.contrib.auth.models import AbstractUser from django.db import models
class User(AbstractUser): USER_TYPE = ( (1, '一般使用者'), (2, '管理員'), ) user_type = models.IntegerField(choices=USER_TYPE, default=1) # 使用者類型
class Url(models.Model): # 短網址相關欄位 origin_url = models.URLField() short_string = models.CharField(max_length=10, unique=True, default='NULL') short_url = models.URLField() create_date = models.DateTimeField(default=datetime.datetime.now) expire_date = models.DateTimeField(null=True, blank=True) visit_count = models.IntegerField(default=0) # 使用者相關欄位 user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) 這樣而已 沒有顯示出其他資訊?
Sorry, something went wrong.
Issues 修復順序可能如下:
KageRyo
No branches or pull requests
新增以上三支 API
The text was updated successfully, but these errors were encountered: