<?php

namespace app\workerapi\controller;

use app\workerapi\controller\BaseApiController;
use app\common\enum\FileEnum;
use Exception;
use app\common\service\UploadService;

class UploadController  extends BaseApiController
{
    public function image()
    {
        try {
            $result = UploadService::image(2, $this->userId,FileEnum::SOURCE_WORKER);
            return $this->success('上传成功', $result);
        } catch (Exception $e) {
            return $this->fail($e->getMessage());
        }
    }
}