#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# Date: 2018/12/11

from utils.base import APIView


class FaceStarEdit(APIView):
    def post(self, request):
        name = request.POST.get('name')
        sex = request.POST.get('sex')
        ordinary_image_url = request.POST.get('ordinary_image_url')
        modeling_obj_url = request.POST.get('modeling_obj_url')


        try:
            self.rpc['mercury/face/create_star'](
                name=name,
                sex=sex,
                ordinary_image_url=ordinary_image_url,
                modeling_obj_url=modeling_obj_url
            ).unwrap()
        except Exception as e:
            raise e
        return {
            'message': '创建成功'
        }
