Skip to content

Conversation

@ChesterNotChest
Copy link
Collaborator

完成了后端登录、注册API的书写;
完成了后端cookies初步构建;
完成了登录、注册API单元测试。

CREATE TABLE authentications (
    token VARCHAR(255) PRIMARY KEY NOT NULL,
    expires_at DATETIME NOT NULL
);
 + 数据库表需更新:

+-----------------+
| Tables_in_fuxi |
+-----------------+
| authentications |
| containers |
| machines |
| user_container |
| users |
+-----------------+

mysql> DESCRIBE authentications;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| token | varchar(255) | NO | PRI | NULL | |
| expires_at | datetime | NO | | NULL | |
+------------+--------------+------+-----+---------+-------+

Copy link
Owner

@TRM-coding TRM-coding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 登录和注册的返回接口不对
  2. Authentication.py写错了,不能这么构建架构:
    应该像之前一样,数据表单独列出来,然后封装最底层的数据插入操作,再封装上层的业务函数
    具体步骤:
    a.把表定义拆到models中
    b.把基本的表增删查改操作加到Repositorys中
    c.把业务逻辑(鉴权)加到services中(Login函数)
  3. api应该封装在user_api.py中

Copy link
Owner

@TRM-coding TRM-coding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 完善接口说明
  2. user_task缺一个根据token鉴权的功能

Copy link
Owner

@TRM-coding TRM-coding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

鉴权做在API层

@ChesterNotChest
Copy link
Collaborator Author

完成了Machine、Container部分的后端API编写。
完成了相关单元测试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants