ServerConfig.php 1.4 KB
<?php
/**
 * Created by PhpStorm.
 * User: zhl
 * Date: 2023/4/17
 * Time: 10:04
 */

namespace App\Models\Devops;

use App\Helper\Arr;
use App\Models\Base;
use App\Utils\EncryptUtils;

/**
 * 服务账户信息
 * Class ServeConfig
 * @package App\Models
 */
class ServerConfig extends Base
{
    /**
     * @var string
     */
    protected $table = 'gl_server_config';


    /**
     * 1:服务器, 2:MySQL, 3:Redis
     */
    const TYPE_SERVER = 1;
    const TYPE_MYSQL = 2;
    const TYPE_REDIS = 3;

    const STATUS_ONE = 1;

    const SELF_SITE_ID = 6;//自建站服务器ID
    const SELF_TEST_ID = 7;//测试服务器ID

    /**
     * @remark :获取数据用户名解密
     * @name   :getUserAttribute
     * @author :lyh
     * @method :post
     * @time   :2023/9/12 16:05
     */
    public function getUserAttribute($value){
        return (new EncryptUtils())->unlock_url($value);
    }

    /**
     * @remark :密码解密
     * @name   :getPasswordAttribute
     * @author :lyh
     * @method :post
     * @time   :2023/9/12 16:05
     */
    public function getPasswordAttribute($value){
        return (new EncryptUtils())->unlock_url($value);
    }

    /**
     * @remark :端口解密
     * @name   :getPasswordAttribute
     * @author :lyh
     * @method :post
     * @time   :2023/9/12 16:05
     */
    public function getPortAttribute($value){
        return (new EncryptUtils())->unlock_url($value);
    }
}