mybatis学习一之入门示例

Mybatis基础入门学习笔记(一) 这里写自定义目录标题一.Mybatis快速入门1.1 框架介绍1.2 ORM介绍1.3 原始jdbc操作(查询数据)1.4 原始jdbc操作的分析1.5 Mybatis的快速入门1.6.1 环境搭建1.6.2编写测试代码1.7 知识小结二. MyBatis的相关api2.1 Resources2.2 构建器SqlSessionFactoryBuilder2.3 工厂对象SqlSessionFactory2.4 SqlSession会话对象三.MyBatis 映射配置文件3.1 映射配置文件介绍3.2 查 阅读详情

一、什么是MyBatis

  • mybatis是对jdbc的封装
  • 将sql语句放在映射文件中(xml)
  • 自动将输入参数映射到sql语句的动态参数上
  • 自动将sql语句执行的结果映射成java对象

Mybatis工作原理

 

二、入门示例

创建mavn项目:

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.zy</groupId>
    <artifactId>mybatis-maven</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.3</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.47</version>
        </dependency>

        <!--log4j4日志-->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.12.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.12.1</version>
        </dependency>

        <!--不需要显式的去写实体类的get set tostring方法-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.10</version>
        </dependency>
    </dependencies>
    <!--这个必须配置,否则找不到配置文件-->
    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>
</project>

配置文件:

mysql.properties:

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/mybatis
jdbc.username=root
jdbc.password=*******

log4j2.xml:

<?xml version="1.0" encoding="UTF-8"?>
<configuration status="OFF">
    <appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
        <!--  <File name="File" fileName="../logs/test.log" append="true">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
        </File>  -->
    </appenders>

    <loggers>
        <logger name="com.lfy.mapping" level="debug" additivity="false">
            <appender-ref ref="Console"/>
        </logger>
        <!--  <logger name="log4j.logger.java.sql.Statement" level="info" additivity="false">
            <appender-ref ref="File"/>
        </logger>
        <Logger name="com.lfy.mapping" level="debug" additivity="false">
            <AppenderRef ref="File"/>
        </Logger>  -->

        <root level="DEBUG">
            <appender-ref ref="Console"/>
            <!--  <appender-ref ref="File"/> -->
        </root>
    </loggers>
</configuration>

mybatis-config.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <!--引入mysql的配置文件-->
    <properties resource="mysql.properties" />
    <!--日志配置-->
    <settings>
        <setting name="logImpl" value="LOG4J2"/>
    </settings>
    <typeAliases>
        <!--这种定义方式只能定义一种-->
        <!--<typeAlias type="com.zy.entity.Blog" alias="Blog" />-->
        <!--该包下的所有实体类都可以用类名作为别名-->
        <package name="com.zy.entity" />
    </typeAliases>
    <!--定义数据源-->
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"/>
            <dataSource type="POOLED">
                <property name="driver" value="${jdbc.driver}"/>
                <property name="url" value="${jdbc.url}"/>
                <property name="username" value="${jdbc.username}"/>
                <property name="password" value="${jdbc.password}"/>
            </dataSource>
        </environment>
    </environments>
    <mappers>
        <!--这种方式,如果增减一个mapper文件,都需要增加一个配置-->
        <!--<mapper resource="com/zy/mapper/BlogMapper.xml"/>-->
        <!--可以通过下面的方式,扫描整个包中的mapper文件-->
        <package name="com.zy.mapper" />
    </mappers>
</configuration>

代码:

定义pojo:

package com.zy.entity;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Builder(toBuilder = true)
public class Blog {
    private Integer id;
    private String title;
    private int authorId;
    private String state;
    private Boolean featured;
    private String style;
}

Mapper文件:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--namespace一般是接口路径-->
<mapper namespace="com.huawei.mapper.BlogMapper">
    <select id="selectBlog" resultType="Blog">
        select * from Blog where id = #{id}
    </select>

    <select id="insert" parameterType="Blog">
        insert into Blog(id, title, author_id, state, featured, style)
        values
        (#{id}, #{title}, #{authorId}, #{state}, #{featured}, #{style});
    </select>
</mapper>

定义接口:

package com.zy.mapper;

import com.huawei.entity.Blog;

public interface BlogMapper {
    //接口中的方法名必须和mapper中sql语句的id相同
    Blog selectBlog(Integer id);

    //插入
    void insert(Blog blog);
}

对应的类型:

定义DAO:

import com.huawei.entity.Blog;
import com.huawei.mapper.BlogMapper;
import com.huawei.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

public class BlogDao {
    private SqlSession sqlSession = MyBatisUtil.getSqlSession();
    private BlogMapper mapper = sqlSession.getMapper(BlogMapper.class);

    public Blog queryBlogById(Integer id) {
        return mapper.selectBlog(id);
    }
    public void insert(Blog blog) {
        try {
            mapper.insert(blog);
            sqlSession.commit();
        } finally {
            if (sqlSession != null) {
                sqlSession.close();
            }
        }

    }
}

工具类的编写:

package com.zy.util;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.Reader;

public class MyBatisUtil {
    private static SqlSessionFactory sqlSessionFactory = null;
    static {
        try {
            Reader reader = Resources.getResourceAsReader("mybatis/mybatis-config.xml");
            sqlSessionFactory  = new SqlSessionFactoryBuilder().build(reader);
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
    public MyBatisUtil() {

    }

    public static SqlSession getSqlSession() {
        return sqlSessionFactory.openSession();
    }
}

编写测试类:

package com.zy.mapper;

import com.huawei.dao.BlogDao;
import com.huawei.entity.Blog;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;

public class BlogMapperTest {
    private static final Logger logger = LogManager.getLogger(BlogMapperTest.class);

    @Test
    public void testSelectBlog() {
        Blog blog = new BlogDao().queryBlogById(1);
        System.out.println(blog);
        logger.info("blog is:{}", blog);

    }

    @Test
    public void testInsertBlog() {
        Blog build = Blog.builder()
                .authorId(1)
                .state("ACTIVE")
                .style("333")
                .featured(false)
                .title("三国演义")
                .build();
        new BlogDao().insert(build);
    }
}

运行结果:

 

问题:

1.为什么代码中的sqlSession需要关闭,但是获取配置文件的Reader不需要关闭呢???

看源码:

查看build()方法:

    public SqlSessionFactory build(Reader reader) {
        return this.build((Reader)reader, (String)null, (Properties)null);
    }
    public SqlSessionFactory build(Reader reader, String environment, Properties properties) {
        SqlSessionFactory var5;
        try {
            XMLConfigBuilder parser = new XMLConfigBuilder(reader, environment, properties);
            var5 = this.build(parser.parse());
        } catch (Exception var14) {
            throw ExceptionFactory.wrapException("Error building SqlSession.", var14);
        } finally {
            ErrorContext.instance().reset();

            try {
                reader.close();
            } catch (IOException var13) {
            }

        }

        return var5;
    }

我们发现,reader已经被关闭,因此不需要我们关闭

2.为什么插入数据时,需要手动提交呢???难道不能自动提交吗???

查看SqlSession的创建过程:

sqlSession = sqlSessionFactory.openSession();
进入DefaultSqlSessionFactory:
    public SqlSession openSession() {
        return this.openSessionFromDataSource(this.configuration.getDefaultExecutorType(), (TransactionIsolationLevel)null, false);
    }

我们发现最后一个参数时false,这个参数时干嘛呢???继续往下看

 private SqlSession openSessionFromDataSource(ExecutorType execType, TransactionIsolationLevel level, boolean autoCommit) {
        Transaction tx = null;

        DefaultSqlSession var8;
        try {
            Environment environment = this.configuration.getEnvironment();
            TransactionFactory transactionFactory = this.getTransactionFactoryFromEnvironment(environment);
            tx = transactionFactory.newTransaction(environment.getDataSource(), level, autoCommit);
            Executor executor = this.configuration.newExecutor(tx, execType);
            var8 = new DefaultSqlSession(this.configuration, executor, autoCommit);
        } catch (Exception var12) {
            this.closeTransaction(tx);
            throw ExceptionFactory.wrapException("Error opening session.  Cause: " + var12, var12);
        } finally {
            ErrorContext.instance().reset();
        }

        return var8;
    }

这个参数,其实就是autoCommit的参数,默认是false,表示不能自动提交,必须手动提交。

那么有没有支持传值的函数呢???

    public SqlSession openSession(boolean autoCommit) {
        return this.sqlSessionFactory.openSession(autoCommit);
    }

显然是存在这样函数的,我们可以自己传参,来设置是否支持自动提交。

我的工具类可以改造为一个抽象类:

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.Reader;

public abstract class MyBatisUtil {
    private static SqlSessionFactory sqlSessionFactory = null;
    private static SqlSession sqlSession = null;
    static {
        try {
            Reader reader = Resources.getResourceAsReader("mybatis/mybatis-config.xml");
            sqlSessionFactory  = new SqlSessionFactoryBuilder().build(reader);
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
    public MyBatisUtil() {

    }

    public static SqlSession getSqlSession() {
        sqlSession = sqlSessionFactory.openSession(true);
        return sqlSession;
    }

    public <T> T getMapper(Class<T> typeClass)  {
        SqlSession sqlSession = getSqlSession();
        return sqlSession.getMapper(typeClass);
    }

    public void close() {
        if (sqlSession != null) {
            sqlSession.close();
        }
    }
}

所有的Dao类都可以继承这个工具类,直接去获取Mapper,然后操作即可:

public class BlogDao extends MyBatisUtil {
    private BlogMapper mapper = getMapper(BlogMapper.class);

    public Blog queryBlogById(Integer id) {
        return mapper.selectBlog(id);
    }
    public void insert(Blog blog) {
        mapper.insert(blog);
        this.close();
    }
}

 

 

 

 

 

 

 

 

AD元件库构建及维护之——DbLib公共元件库的使用教程 AD元件库构建及维护之——DbLib元件库的使用教程 阅读详情

相关推荐

Cursor AI编程工具保姆级安装指南:从下载到中文界面设置(含免费额度说明)

本文提供Cursor AI编程工具的保姆级安装与设置教程。详细指导从官网下载、安装到中文界面切换的每一步,并重点说明其每月500次高级模型调用的免费额度策略。通过个性化设置与核心插件推荐,帮助开发者快速上手,提升AI辅助编程效率。

weixin_29191761的博客 672

MyBatis

MyBatis 一、简介 二、MyBatis入门案例:查询所有用户信息-selectAll 0.项目整体结构 1.导入mybatis.sql文件,初始化mybatis数据库 CREATE DATABASE IF NOT EXISTS `mybatis` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin USE `mybatis`; /*Table structure for table `account` */ DROP TABLE IF EXISTS `ac

2401_83600210的博客 955

反激电源占空比为何必须小于0.5?次谐波振荡与斜坡补偿详解

在开关电源设计中,峰值电流模式控制因其优异的动态响应和逐周期限流保护而被广泛应用。其工作原理是通过采样电感电流的峰值,与误差电压比较来控制开关管的导通与关断。然而,这种控制方式在反激等隔离拓扑中,当占空比超过50%时,会面临一个固有的稳定性挑战——次谐波振荡。这是由于电流扰动会在相邻开关周期内被放大而非衰减,导致系统在开关频率一半处发生振荡,严重影响输出纹波和可靠性。为解决这一问题,工程上引入了斜坡补偿技术,通过向控制信号叠加一个固定斜率的斜坡,改变环路增益条件,从而在宽输入电压或高占空比需求下维持系统稳定

weixin_29631169的博客 627

Mybatis学习01:Mybatis入门案例及工作原理分析

Mybatis学习01:Mybatis入门案例传统JDBC的分析使用Mybatis改进持久层项目准备Mybatis入门案例1-使用xml配置sql语句Mybatis入门案例2-使用xml配置sql语句Mybatis入门案例3-手动编写持久层实现类入门案例的分析 传统JDBC的分析 一个传统的JDBC程序如下: public static void main(String[] args) { ...

ncepu_Chen的博客 1535

使用 DEM 模拟金属烧结过程

了解离散元素法 (DEM) 如何彻底改变烧结工艺,提高制造业的效率和精度。

jkh920184196的博客 1127

【四旋翼】pixhawk2.4.8-地面站配置-APM固件-四旋翼从装机到试飞

因为MP版本和APM版本的适配问题,真的真的是很大一个坑。最好先走别人走过的路,走通了再去自由发挥,不然白白浪费时间。下面提供我试飞成功过的版本。下面提供任意版本固件和地面站的下载方法。

xifan的博客 3万+

【mybatis基础(一)】mybatis入门案例

什么是 MyBatis? MyBatis 是一款优秀的持久层框架,它支持自定义 SQL、存储过程以及高级映射。MyBatis 免除了几乎所有的 JDBC 代码以及设置参数和获取结果集的工作。MyBatis 可以通过简单的 XML 或注解来配置和映射原始类型、接口和 Java POJO(Plain Old Java Objects,普通老式 Java 对象)为数据库中的记录。mybatis – MyBatis 3 | 简介......

m0_46013789的博客 303

lidar点云比赛-Southlidar软件使用入门

lidar点云比赛-Southlidar软件使用入门 广西高校重点实验室培训基地 系统控制与信息处理重点实验室 本篇博客来自河池学院: 智控无人机小组 写作时间:2020.09.29 一、软件资源及安装 1.下载地址: https://pan.baidu.com/s/1jN1pynmAZOqj5mMx774pVg 提取码:gkvv (资源来自南方测绘) 2.安装 进入链接,找到软件文件夹, 内含文件即为安装包 3.下载成功后按提示安装即可 4.安装成功后桌面自动创建一个快捷方式 二、界面布

qq_49621416的博客 4891

MyBatis入门(一)MyBatis介绍和入门案例

一.MyBatis介绍 1.什么是框架? 框架即一个半成品软件。开发者从头开发一个软件需要花费大量精力,于是有一些项目组开发出半成品软件,开发者在这些软件的基础上进行开发,这样的软件就称之为框架。 如果将开发完成的软件比作是一套已经装修完毕的新房,框架就好比是一套已经修建好的毛坯房。用户直接购买毛坯房,保证建筑质量和户型合理的同时可以进行风格的自由装修。 使用框架开发的好处: 省去大量的代码编写、减少开发时间、降低开发难度。 限制程序员必须使用框架规范开发,增强代码的规范性,降

长夜漫漫,无心睡眠 775

100天精通Python(基础篇)——第20天:pip命令大全

pip升级命令:python -m pip install --upgrade pip pip install name //这里的name是要安装的第三方库名 pip install name -i http://mirrors.aliyun.com/pypi/simple/ 国内镜像源 阿里云:http://mirrors.aliyun.com/pypi/simple/ (推荐使用) 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple 豆瓣:http:/

努力让自己发光,对的人才能迎着光而来 18万+

反光柱定位算法实战03:VEnus代码解析和纯反光柱定位中的可改进方向

本文深入解析了开源框架VEnus的反光柱定位与建图实现流程,包括强度提取、聚类、数据关联、位姿优化等核心模块。同时指出其三大局限:匹配质量脆弱性、单一传感器依赖和地图扩展逻辑缺失,并提出改进方向:融合里程计/IMU数据、引入图优化后端、建立动态地图维护机制。该分析为基于反光柱的定位系统优化提供了实用参考,有助于提升工业场景下的定位鲁棒性和精确性。

Studying…… 520

基于Maven使用MyBatis报错提示找不到映射器xml文件

需要在pom文件中添加相关插件:&lt;build&gt;&lt;/build&gt;标签内添加:&lt;plugins&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt; &lt;version&gt;3.0.0&lt;/version&gt; &lt

sunforraining的博客 1738

帆软报表导出各种格式之后台导出

我们前面介绍了帆软报表在界面上的导出是通过类似的URL:http://localhost:8075/webroot/decision/view/report?op=export&sessionID=10653244-3e46-408c-bc54-f89a214a9bc7&format=image&extype=PNG 来完成的,就是带OP=export以及format参数来完成的。如果不从界面传参数,比如我们自己实现了一个HTTP接口,也可以通过传参数format来完成各种格式的导

帆软爱好者的专栏 4270

Mybatis学习:一、mybatis入门

一、mybatis入门 1、什么是框架? 它是我们软件开发中的一套解决方案,不同的框架解决的是不同的问题。 使用框架的好处:框架封装了很多的细节,使开发者可以使用极简的方式实现功能。大大提高开发效率。 2、三层架构 表现层:是用于展示数据的 业务层:是处理业务需求 持久层:是和数据库交互的 3、持久层技术解决方案 JDBC技术: Connection PreparedStatement ResultSet Spring的JdbcTemplate:Spring中对jdbc的简单封装

qq_37552636的博客 1012

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

MyBatis学习总结(一)——MyBatis快速入门

1、Mybatis介绍 MyBatis是一个支持普通SQL查询,存储过程和高级映射的优秀持久层框架。MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及对结果集的检索封装。MyBatis可以使用简单的XML或注解用于配置和原始映射,将接口和Java的POJO(Plain Old Java Objects,普通的Java对象)映射成数据库中的记录。 2、mybatis快速入门 1、添加相...

lixuanfeng blog 2394

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

MyBatis学习一之MyBatis入门

1、 概念 持久层框架,apache项目 通过mybatis映射方式,自动灵活的生成满足需要的sql语句。 可将我们向prepareStatement输入参数,mybatis可以将餐宿自动输入到映射中,将我们查询出的结果集灵活的映射到java对象中。 全局配置文件:sqlMapConfig.xml 会话工厂:SqlSessionFactory 会话:sqlSession 执行器:Executor 底层封装对象:mappedstatement 各模块功能如图: 2、 mybatis入门案例 创建项目,导入

金色手枪女王的专栏 186

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

Mybatis入门学习一

简介 什么是mybatis:mybatis是一款优秀的持久层框架,支持定制化SQL、存储过程以及高级映射,避免了几乎所有的JDBC代码和手动设置参数以及获取结果集。Mybatis可以使用简单的XML或者注解来配置和映射原生类型、接口和Java的POJO为数据库中的记录。 mybatis开始 先去mybatis官网点了这里 第一步:引入maven <dependency> <g...

weixin_41746577的博客 271

MyBatis学习一:快速入门

MyBatis学习一:快速入门

weixin_41897680的博客 762

Mybatis入门学习(一)

Mybatis 入门学习(一) 一、mybatis的环境搭建 创建maven工程,操作pom.xml文件导入坐标 1.1.1 加入打包方式 <packaging>jar</packaging> 1.1.2 导入mybatis的依赖 <dependencies> <dependency> <groupId>org.mybatis</groupId> <ar

qq_30072161的博客 681

mybatis学习:一、Mybatis简介、Mybatis 入门程序

​ MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBatis,实质上Mybatis对ibatis进行一些改进。

H215919719的博客 431

mybatis学习一:入门

一 mybatis入门 1.1 mybatis是什么 MyBatis是一个简化和实现了 Java 数据持久化层(persistence layer) 的开源框架,它抽象了大量的JDBC冗余代码,并提供了一个简单易用的 API和数据库交互。 MyBatis的前身是iBATIS,iBATIS于2002年由ClintonBegin创建 。MyBatis3是iBATIS的全新设计,支持注解和Mapper。...

retwo的博客 304

Mybatis学习(一)—————mybatis入门

学习了hibernate这个持久层框架之后,在来学习Mybatis简直是无压力,因为Mybatis入门门栏很低,如果学习过了hibernate的话,对于Mybatis的学习很简单了,如果没学习过hibernate直接学习Mybatis也没关系,也很好理解。       写Mybatis这一章节博客,大致分为这样一种思路          mybatis入门 --> 全局配置文件和映射...

weixin_34208185的博客 120
上一篇: HashMap(jdk1.8)
下一篇: Mybatis的列名和属性名不一致的处理
给自己加加油
博客等级 码龄8年 302粉丝 110原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值