10. In `app/models/server.py`, define a `Server` model using `SQLAlchemy` ORM:
```python
from app.extensions import db

class Server(db.Model):
    __tablename__ = 'servers'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64), index=True, unique=True)
    ip_address = db.Column(db.String(64), index=True, unique=True)
```
11. In `app/models/key.py`, define a `Key` model using `SQLAlchemy` ORM:
```python
from app.extensions import db

class Key(db.Model):
    __tablename__ = 'keys'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64), index=True, unique=True)
    value = db.Column(db.String(128), index=True, unique=True)
```
12. In `app/models/traffic.py`, define a `Traffic` model using `SQLAlchemy` ORM:
```python
from app.extensions import db

class Traffic(db.Model):
    __tablename__ = 'traffic'
    id = db.Column(db.Integer, primary_key=True)
    server_id = db.Column(db.Integer, db.ForeignKey('servers.id'), nullable=False)
    key_id = db.Column(db.Integer, db.ForeignKey('keys.id'), nullable=False)
    amount = db.Column(db.Float, nullable=False)
```
13. In `app/schemas/server.py`, define a `ServerSchema` using `marshmallow`:
```python
from marshmallow import fields, Schema

class ServerSchema(Schema):
    id = fields.Int(dump_only=True)
    name = fields.Str(required=True)
    ip_address = fields.Str(required=True)
```
14. In `app/schemas/key.py`, define a `KeySchema` using `marshmallow`:
```python
from marshmallow import fields, Schema

class KeySchema(Schema):
    id = fields.Int(dump_only=True)
    name = fields.Str(required=True)
    value = fields.Str(required=True)
```
15. In `app/schemas/traffic.py`, define a `TrafficSchema` using `marshmallow`:
```python
from marshmallow import fields, Schema

class TrafficSchema(Schema):
    id = fields.Int(dump_only=True)
    server_id = fields.Int(required=True)
    key_id = fields.Int(required=True)
    amount = fields.Float(required=True)
```
16. In `app/resources/server.py`, define a `ServerResource` class that inherits from `Resource` class from `flask_restful` module:
```python
from flask_restful import Resource
from app.models.server import Server
from app.schemas.server import ServerSchema

server_schema = ServerSchema()
servers_schema = ServerSchema(many=True)

class ServerResource(Resource):
    def get(self, id):
        server = Server.query.get_or_404(id)
        result = server_schema.dump(server)
        return result, 200

    def post(self):
        json_data = request.get_json(force=True)
        data = server_schema.load(json_data)
        server = Server.query.filter_by(name=data['name']).first()
        if server:
            return {'message': 'Server already exists'}, 400
        server = Server(name=data['name'], ip_address=data['ip_address'])
        db.session.add(server)
        db.session.commit()
        result = server_schema.dump(server)
        return result, 201

    def put(self, id):
        server = Server.query.get_or_404(id)
        json_data = request.get_json(force=True)
        data = server_schema.load(json_data)
        server.name = data['name']
        server.ip_address = data['ip_address']
        db.session.commit
```
10. app/models/server.py`에서 `SQLAlchemy` ORM을 사용하여 `Server` 모델을 정의합니다:
```python
app.extensions에서 db를 가져옵니다.

클래스 Server(db.Model):
    __tablename__ = 'servers'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64), index=True, unique=True)
    ip_address = db.Column(db.String(64), index=True, unique=True)
```
11. app/models/key.py`에서 `SQLAlchemy` ORM을 사용하여 `Key` 모델을 정의합니다:
```python
app.extensions에서 db를 가져옵니다.

클래스 Key(db.Model):
    __tablename__ = 'keys'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64), index=True, unique=True)
    value = db.Column(db.String(128), index=True, unique=True)
```
12. app/models/traffic.py`에서 `SQLAlchemy` ORM을 사용하여 `Traffic` 모델을 정의합니다:
```python
app.extensions에서 db를 가져옵니다.

class Traffic(db.Model):
    __tablename__ = 'traffic'
    id = db.Column(db.Integer, primary_key=True)
    server_id = db.Column(db.Integer, db.ForeignKey('servers.id'), nullable=False)
    key_id = db.Column(db.Integer, db.ForeignKey('keys.id'), nullable=False)
    amount = db.Column(db.Float, nullable=False)
```
13. app/schemas/server.py`에서 `marshmallow`를 사용하여 `ServerSchema`를 정의합니다:
```python
에서 가져온 필드, 스키마를 사용합니다.

클래스 ServerSchema(Schema):
    id = fields.Int(dump_only=True)
    name = fields.Str(required=True)
    ip_address = fields.Str(required=True)
```
14. app/schemas/key.py`에서 `marshmallow`를 사용하여 `KeySchema`를 정의합니다:
```python
에서 ``python``을 사용하여 스키마를 가져옵니다.

클래스 KeySchema(Schema):
    id = fields.Int(dump_only=True)
    name = fields.Str(required=True)
    value = fields.Str(required=True)
```
15. app/schemas/traffic.py`에서 `marshmallow`를 사용하여 `TrafficSchema`를 정의합니다:
```python
을 사용하여 ``피시멜로`: ``피시멜로``의 필드, 스키마를 가져옵니다.

클래스 TrafficSchema(Schema):
    id = fields.Int(dump_only=True)
    server_id = fields.Int(required=True)
    key_id = fields.Int(required=True)
    amount = fields.Float(필수=True)
```
16. app/resources/server.py`에서 `flask_restful` 모듈의 `Resource` 클래스를 상속하는 `ServerResource` 클래스를 정의합니다:
```python
from flask_restful import Resource
from app.models.server import Server
app.schemas.server에서 ServerSchema를 가져옵니다.

server_schema = ServerSchema()
servers_schema = ServerSchema(many=True)

클래스 ServerResource(Resource):
    def get(self, id):
        server = Server.query.get_or_404(id)
        result = server_schema.dump(server)
        반환 결과, 200

    def post(self):
        json_data = request.get_json(force=True)
        data = server_schema.load(json_data)
        server = Server.query.filter_by(name=data['name']).first()
        if server:
            return {'message': '서버가 이미 존재합니다'}, 400
        server = Server(name=data['name'], ip_address=data['ip_address'])
        db.session.add(server)
        db.session.commit()
        result = server_schema.dump(server)
        반환 결과, 201

    def put(self, id):
        server = Server.query.get_or_404(id)
        json_data = request.get_json(force=True)
        data = server_schema.load(json_data)
        server.name = data['name']
        server.ip_address = data['ip_address']
        db.session.commit
```