前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >6.1 Spring Boot集成mybatis6.1 Spring Boot集成mybatis

6.1 Spring Boot集成mybatis6.1 Spring Boot集成mybatis

作者头像
一个会写诗的程序员
发布于 2018-08-20 01:50:29
发布于 2018-08-20 01:50:29
1.1K00
代码可运行
举报
运行总次数:0
代码可运行

6.1 Spring Boot集成mybatis

在SpringBoot集成MyBatis时,我们将去掉和Mybatis配置相关的xml文件配置方式,用注解和属性配置来代替这些繁杂的配置。

本节我们使用SpringBoot集成Mybatis开发一个简易的H5性能测试的Web后台。我们采用Java,Groovy混合编程的方式。

新建gradle工程

组织工程目录结构如下

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
.
├── build.gradle
├── settings.gradle
└── src
    ├── main
    │   ├── groovy
    │   ├── java
    │   └── resources
    │       └── application.yml
    └── test
        ├── groovy
        ├── java
        └── resources

9 directories, 3 files

配置build.gradle

添加mybatis-spring-boot-starter依赖

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.1.1')

该starter将会自动配置好Spring Boot集成mybatis需要的mybatis,mybatis-spring等所有依赖。这个starter的依赖树如下图所示:

其中,mybatis-spring-boot-autoconfigure会完成我们之前使用xml配置mybatis使用的sqlmap-config.xml类似如下配置:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<?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>
    <settings>
        <setting name="lazyLoadingEnabled" value="false"></setting>
    </settings>
</configuration>

和data-source.xml文件配置数据源dataSource和TransactionManager,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

        <!-- 数据源定义 -->
       <bean id="dataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName">
            <value>com.mysql.jdbc.Driver</value>
        </property>
        <property name="url">
            <value>jdbc:mysql://127.0.0.1:3306/h5perf?useUnicode=true&autoReconnect=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull</value>
        </property>
        <property name="username">
            <value>root</value>
        </property>
        <property name="password">
            <value>root</value>
        </property>
    </bean>


    <!-- TransactionManager定义。 -->
    <bean id="transactionManager"
          class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <bean id="transactionTemplate"
          class="org.springframework.transaction.support.TransactionTemplate">
        <property name="transactionManager" ref="transactionManager"/>
    </bean>


    <!-- 通过aop定义事务增强切面 -->
    <aop:config>
        <aop:pointcut id="serviceMethod" expression="execution(* com.easy.springboot.h5perf.service.*.*(..))"/>
        <aop:advisor pointcut-ref="serviceMethod" advice-ref="txAdvice"/>
    </aop:config>
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="find*" read-only="false"/>
            <tx:method name="save*" rollback-for="Exception"/>
            <tx:method name="new*" rollback-for="Exception"/>
            <tx:method name="update*" rollback-for="Exception"/>
            <tx:method name="*" rollback-for="Exception"/>
        </tx:attributes>
    </tx:advice>

    <!-- MyBatis配置sqlSessionFactory, SQL Map -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <!-- 自动扫描entity目录 -->
        <property name="typeAliasesPackage" value="com.easy.springboot.h5perf.model"/>
        <!-- 显式指定Mapper文件位置 -->
        <property name="mapperLocations"
                  value="classpath:/sqlmap/*Mapper.xml"/>
        <property name="configLocation" value="classpath:sqlmap-config.xml"></property>
    </bean>
    <!-- 扫描basePackage下所有以@MyBatisRepository标识的 接口 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"
          p:basePackage="com.alibaba.swork.info.common.mapper"/>

</beans>

配置application.yml

配置数据源

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
spring:
    datasource:
        name: h5perf
        url: jdbc:mysql://localhost:3306/h5perf?autoReconnect=true&useSSL=false
        username: root
        password: root
        # 使用druid数据源
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver

配置mybatis

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
mybatis:
    type-aliases-package: com.easy.springboot.h5perf.model
    configuration:
        # 开启mybatis开启数据库字段自动映射驼峰命名规则java属性
        map-underscore-to-camel-case: true
        default-fetch-size: 100
        default-statement-timeout: 30

数据库表结构

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
CREATE DATABASE IF NOT EXISTS `h5perf`
  DEFAULT CHARACTER SET utf8;
USE `h5perf`;

DROP TABLE IF EXISTS `test_case`;

CREATE TABLE `test_case` (
  `id`             INT(11) NOT NULL AUTO_INCREMENT,
  `container_type` VARCHAR(45)      DEFAULT NULL
  COMMENT '‘ORIGIN_WEBVIEW’,’UC_WEBVIEW’',
  `test_url`       VARCHAR(45)      DEFAULT NULL,
  `net_type`       VARCHAR(45)      DEFAULT NULL
  COMMENT '‘WIFI’,‘3G’,‘4G’',
  `gmt_created`    DATETIME         DEFAULT NULL,
  `gmt_modified`   DATETIME         DEFAULT NULL,
  PRIMARY KEY (`id`)
)
  ENGINE = InnoDB
  DEFAULT CHARSET = utf8;


DROP TABLE IF EXISTS `test_resource`;

CREATE TABLE `test_resource` (
  `id`            INT(11) NOT NULL AUTO_INCREMENT,
  `test_case_id`  INT(11)          DEFAULT NULL,
  `start_time`    BIGINT(11)       DEFAULT NULL,
  `resource_url`  VARCHAR(500)     DEFAULT NULL,
  `resource_type` VARCHAR(45)      DEFAULT NULL
  COMMENT 'IMG,JS,CSS,OTHER',
  `resource_time` BIGINT(11)       DEFAULT NULL
  COMMENT 'onLoadResource资源时间戳',
  `resource_size` BIGINT(11)       DEFAULT NULL
  COMMENT '资源大小',
  `gmt_created`   DATETIME         DEFAULT NULL,
  PRIMARY KEY (`id`)
)
  ENGINE = InnoDB
  DEFAULT CHARSET = utf8;


DROP TABLE IF EXISTS `test_time_data`;

CREATE TABLE `test_time_data` (
  `id`               INT(11) NOT NULL AUTO_INCREMENT,
  `test_case_id`     INT(11)          DEFAULT NULL,
  `on_recieve_title` VARCHAR(45)      DEFAULT NULL
  COMMENT '近似白屏时间',
  `on_page_finished` VARCHAR(45)      DEFAULT NULL
  COMMENT '页面加载完成时间',
  `dom_content_load` VARCHAR(45)      DEFAULT NULL
  COMMENT 'dom内容加载完成时间',
  `load`             VARCHAR(45)      DEFAULT NULL
  COMMENT '资源加载完成时间',
  `gmt_created`      DATETIME         DEFAULT NULL,
  PRIMARY KEY (`id`)
)
  ENGINE = InnoDB
  DEFAULT CHARSET = utf8;

Model层代码

我们在application.yml中开启了mybatis开启数据库字段自动映射驼峰命名规则java属性:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
map-underscore-to-camel-case: true

所以,我们model类的属性命名规则按照驼峰命名规则。

TestCase.groovy代码:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.easy.springboot.h5perf.model

/**
 * Created by jack on 2017/4/22.
 */
class TestCase {
    Integer id
    String containerType
    String testUrl
    String netType
    Date gmtCreated
    Date gmtModified

    @Override
    String toString() {
        return "TestCase{" +
                "id=" + id +
                ", containerType='" + containerType + '\'' +
                ", testUrl='" + testUrl + '\'' +
                ", netType='" + netType + '\'' +
                ", gmtCreated=" + gmtCreated +
                ", gmtModified=" + gmtModified +
                '}';
    }
}

Mapper接口层代码

我们以往的通过xml配置显式指定Mapper文件位置:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<!-- 显式指定Mapper文件位置 -->
        <property name="mapperLocations"
                  value="classpath:/sqlmap/*Mapper.xml"/>

我们现在用注解方式,直接在接口上添加@Mapper注解即可。代码示例TestCaseMapper.groovy

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.easy.springboot.h5perf.mapper

import com.easy.springboot.h5perf.model.TestCase
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Options
import org.apache.ibatis.annotations.Param
import org.apache.ibatis.annotations.Select

@Mapper
interface TestCaseMapper {

    @Insert([
            "insert into test_case",
            "set container_type = #{t.containerType},",
            "test_url = #{t.testUrl},",
            "net_type = #{t.netType},",
            "gmt_created = #{t.gmtCreated},",
            "gmt_modified = #{t.gmtModified}"
    ])
    @Options(useGeneratedKeys = true, keyProperty = "t.id")
    int insert(@Param("t") TestCase testCase)

    @Select("select * from test_case")
    List<TestCase> findAll()

    @Select("select * from test_case where net_type=#{netType}")
    List<TestCase> findByNetType(@Param(value="netType")String netType)

    @Select("select * from test_case where id=#{id} limit 1")
    TestCase findOne(@Param(value="id")Integer id)

    int insertSelective(TestCase record)
}

Controller层代码

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.easy.springboot.h5perf.controller

import com.easy.springboot.h5perf.model.TestCase
import com.easy.springboot.h5perf.result.Result
import com.easy.springboot.h5perf.service.TestCaseService
import com.github.pagehelper.PageInfo
import groovy.json.JsonOutput
import io.swagger.annotations.Api
import io.swagger.annotations.ApiImplicitParam
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.ResponseBody

/**
 * Created by jack on 2017/4/22.
 * http://springfox.github.io/springfox/docs/current/#springfox-samples
 */

//在Controller上使用@Api会生成这个Controller的整体描述
@Api(value = "测试任务管理", tags = ["测试任务管理API"], description = "描述信息")
@Controller
class TestCaseController {
    @Autowired
    TestCaseService testCaseService

    @PostMapping("/saveTestCase")
    @ResponseBody
    def saveTestCase(TestCase testCase) {
        testCase.gmtCreated = new Date()
        println("testCase===" + testCase)
        int insert = testCaseService.save(testCase)
        println("testCase===" + testCase)
        Result result = new Result()
        if (insert == 1) {
            result.success = true
            result.result = testCase
        } else {
            result.success = false
            result.result = testCase
        }
        def jsonOutput = new JsonOutput()
        println("saveTestCase result===" + jsonOutput.toJson(result))
        result
    }

    @GetMapping("/listTestCase")
    def listTestCase(Model model,
                     @RequestParam(value = "pageNo", required = false) Integer pageNo,
                     @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        def pageInfo = testCaseService.findAll(pageNo, pageSize)
        model.addAttribute("testCaseList", pageInfo.list)
        model.addAttribute("pageNo", pageInfo.pageNum)
        model.addAttribute("totalPage", pageInfo.pages)
        model.addAttribute("prePage", pageInfo.prePage)
        model.addAttribute("nextPage", pageInfo.nextPage)
        model.addAttribute("hasPreviousPage", pageInfo.hasPreviousPage)
        model.addAttribute("hasNextPage", pageInfo.hasNextPage)

        "/test_case/list"
    }

//    在具体方法上使用@ApiOperation可以生成接口的描述
    @ApiOperation(value = "list all TestCase Json", notes = "listTestCaseJson", produces = "application/json")
    @GetMapping("/listTestCaseJson")
    @ResponseBody
    def listTestCaseJson(@RequestParam(value = "pageNo", required = false) Integer pageNo,
                         @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        testCaseService.findAll(pageNo, pageSize)
    }

    @ApiOperation(value = "findOne TestCase Json", notes = "findOne TestCase", produces = "application/json")
//  在方法上使用@ApiImplicitParam可以增加对参数等的描述
    @ApiImplicitParam(name = "id",
            value = "测试任务ID",
            dataType = "Integer",//This can be the class name or a primitive
            required = true,
            paramType = "query")
//Valid values are {@code path}, {@code query}, {@code body}, {@code header} or {@code form}
    @GetMapping("/findOne")
    @ResponseBody
    def findOne(@RequestParam(value = "id", required = true) Integer id) {
        testCaseService.findOne(id)
    }

    @ApiOperation(value = "findByNetType TestCase Json", notes = "findByNetType TestCase", produces = "application/json")
//  在方法上使用@ApiImplicitParam可以增加对参数等的描述
    @ApiImplicitParam(name = "netType",
            value = "findByNetType",
            dataType = "String",//This can be the class name or a primitive
            required = true,
            paramType = "query")
    @GetMapping("/findByNetType")
    @ResponseBody
    def findByNetType(@RequestParam(value = "netType", required = false) String netType,
                      @RequestParam(value = "pageNo", required = false) Integer pageNo,
                      @RequestParam(value = "pageSize", required = false) Integer pageSize
    ) {
        testCaseService.queryByPage(netType, pageNo, pageSize)
    }


}

使用PageHelper实现后端分页

(1)添加pagehelper-spring-boot-starter

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
//   pagehelper
    compile('com.github.pagehelper:pagehelper-spring-boot-starter:1.1.0')

(2)Service层代码实现

接口类 TestCaseService.groovy

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.easy.springboot.h5perf.service

import com.easy.springboot.h5perf.model.TestCase
import com.github.pagehelper.PageInfo

/**
 * Created by jack on 2017/4/23.
 */
interface TestCaseService {
    def save(TestCase testCase)

    PageInfo<TestCase> findAll(Integer pageNo, Integer pageSize)

    TestCase findOne(Integer id)

    PageInfo<TestCase> queryByPage(String netType, Integer pageNo, Integer pageSize)

}

实现类TestCaseServiceImpl.groovy

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.easy.springboot.h5perf.service

import com.easy.springboot.h5perf.mapper.TestCaseMapper
import com.easy.springboot.h5perf.model.TestCase
import com.github.pagehelper.PageHelper
import com.github.pagehelper.PageInfo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * Created by jack on 2017/4/23.
 */
@Service
class TestCaseServiceImpl implements TestCaseService {
    @Autowired
    TestCaseMapper testCaseMapper;

    @Override
    def save(TestCase testCase) {
        testCaseMapper.insert(testCase)
    }

    @Override
    PageInfo<TestCase> findAll(Integer pageNo, Integer pageSize) {
        pageNo = pageNo == null ? 1 : pageNo
        pageSize = pageSize == null ? 10 : pageSize
        PageHelper.startPage(pageNo, pageSize)
        List<TestCase> testCaseList = testCaseMapper.findAll()
        //用PageInfo对结果进行包装
        PageInfo<TestCase> testCasePageInfo = new PageInfo<>(testCaseList)
        testCasePageInfo

    }

    @Override
    TestCase findOne(Integer id) {
        testCaseMapper.findOne(id)
    }

    @Override
    PageInfo<TestCase> queryByPage(String netType, Integer pageNo, Integer pageSize) {
        pageNo = pageNo == null ? 1 : pageNo
        pageSize = pageSize == null ? 10 : pageSize
        PageHelper.startPage(pageNo, pageSize)

        List<TestCase> testCaseList = testCaseMapper.findByNetType(netType)
        //用PageInfo对结果进行包装
        PageInfo<TestCase> testCasePageInfo = new PageInfo<>(testCaseList)
        testCasePageInfo
    }
}

(3)Controller层与前端代码集成

传到前端的Model层数据:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
    @GetMapping("/listTestCase")
    def listTestCase(Model model,
                     @RequestParam(value = "pageNo", required = false) Integer pageNo,
                     @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        def pageInfo = testCaseService.findAll(pageNo, pageSize)
        model.addAttribute("testCaseList", pageInfo.list)
        model.addAttribute("pageNo", pageInfo.pageNum)
        model.addAttribute("totalPage", pageInfo.pages)
        model.addAttribute("prePage", pageInfo.prePage)
        model.addAttribute("nextPage", pageInfo.nextPage)
        model.addAttribute("hasPreviousPage", pageInfo.hasPreviousPage)
        model.addAttribute("hasNextPage", pageInfo.hasNextPage)

        "/test_case/list"
    }

前端使用Bootstrap pagination样式类:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
    <table class="table table-hover">
        <thead>
        <th>Id</th>
        <th>testUrl</th>
        <th>containerType</th>
        <th>netType</th>
        <th>gmtCreated</th>
        </thead>
        <tbody>
        <#list testCaseList as tc >
        <tr>
            <td>${tc.id}</td>
            <td><a href="${tc.testUrl}">${tc.testUrl}</a></td>
            <td>${tc.containerType}</td>
            <td>${tc.netType}</td>
            <td>${tc.gmtCreated?string('yyyy/MM/dd HH:mm:ss')}</td>
        </tr>
        </#list>
        </tbody>
    </table>


    <div class="center">
        <ul class="pagination">
            <li><a href="/listTestCase?pageNo=${prePage}&pageSize=10">«</a></li>
        <#list 1..totalPage as index>
            <#if index=pageNo>
                <li class="active"><a href="/listTestCase?pageNo=${index}&pageSize=10">${index}</a></li>
            <#else>
                <li><a href="/listTestCase?pageNo=${index}&pageSize=10">${index}</a></li>
            </#if>
        </#list>
            <li><a href="/listTestCase?pageNo=${nextPage}&pageSize=10">»</a></li>
        </ul>
    </div>

(4)运行测试

第1页

第2页

另外,我们还可以集成Druid对数据库进行监控。相关的资料可以去网上搜索学习。本章节不再赘述。

本节完整的工程源代码:https://github.com/EasySpringBoot/h5perf

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017.04.26 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
Web3.0 行业全景及代表项目研究
‍ 导语| 什么是Web 3.0 ?Web 3.0 现在发展的怎么样了?未来会怎么样?NFT 和 X to Earn 火爆的内在逻辑是什么?能持续吗?公有链 Web 3.0创新对于腾讯云区块链和长安链联盟链生态具有哪些借鉴意义? 本文试图来回答这些问题。并且,也尽量客观的从影响力和模式的代表性的维度,梳理了60多个当前公有链生态中具有web3.0概念的代表项目。 本文作者:hannazhzhou,腾讯云区块链产业研究负责人 前言:公有链及Web3.0生态的崛起 近一两年引起广泛热议的 Web 3.0,来自于
腾讯大讲堂
2022/06/01
5K0
Web3.0 行业全景及代表项目研究
一文读懂 Web3——互联网发展的新时代
Web3 这个新鲜的专业名词诞生于 2014 年,在一开始,它被用来描述实现去中心化共识的新型协议,而到如今,它已经成为了对公链生态、应用程序甚至设计理念的统称。犹如「我是谁?」这样的哲学问题一样,「什么是 Web3?」这个问题很多人都给出了自己的答案,而且似乎每个人的回答都不尽相同。不过,对于一些人来说,这个新鲜的专业名词会让他们觉得很陌生,因此我们撰写了本文,把人们需要了解的关于 Web3 的 9 大知识点进行了阐释,希望能帮助人们理解何为 Web3:
用户9329036
2022/03/02
9190
一文读懂 Web3——互联网发展的新时代
详解通往Web3的护照——去中心化身份DID
互联网的创建没有为人们提供本地身份验证层。由此,数字身份问题被纳入网站和应用程序范畴。这种方法可能适用于互联网的早期阶段,但现在线上有数十亿人,但缺点正变得越来越明显。用户名和密码仍占主导地位,尽管这被反复证明是不安全的模型。普通人必须反复于70到80个密码之间,导致用户体验明显较差。毕竟有价值数百万美元的企业是围绕帮助企业和个人管理其分散的账户及密码而建立的,例如Okta、1Password和Dashlane。最重要的是,用户实际上并不真正拥有他们的线上身份。正好相反,这是从公司等实体那里租用的。因此,他们很容易面临其数字身份被黑客入侵、操纵或完全丢失的风险。
用户9329036
2022/03/07
1.1K0
详解通往Web3的护照——去中心化身份DID
万字长文聊聊Web3的组成架构
Web3 发展至今,生态已然初具雏形,如果将当前阶段的 Web3 生态组成架构抽象出一个鸟瞰图,由下而上可划分为四个层级:区块链网络层、中间件层、应用层、访问层。下面我们来具体看看每一层级都有什么。另外,此章节会涉及到很多项目的名称,因为篇幅原因不会一一进行介绍,有兴趣的可以另外去查阅相关资料进行深入了解。
Keegan小钢
2023/02/28
1.2K0
万字长文聊聊Web3的组成架构
NFT生态系统:2021年现状回顾及未来展望
区块链行业在最近几年中经历了飞速发展和变化:从 2017 年的萌芽,2018 年的智能合约,到 2020 年的 DeFi,2021 年,NFT 无疑是最热门的话题。
用户7358413
2021/12/23
8070
Web3浪潮之下普通人该如何入局?
一项技术、一个理念或者一场革命若要被称之为伟大,在我看来,它应该具备两个能力,一个是能基于其本身可以催生更多的创新与融合,并且能够继续扩展,驱除当下的弊端,治好眼前的病症,不断引领社会向前;另一个是落地,能够场景化、商业化甚至普及化,进而改变每一个人的生活。在当下,如果要给这项技术、理念、革命的一个更为具体的描述,那就是——Web3浪潮来了!
飞机号dapp119
2022/11/03
1.1K0
Web3浪潮之下普通人该如何入局?
100 多家 Web3 公司重构互联网的未来
投资者正在向热门的 Web3 技术投入资金。但是 Web3 是如何运作的,谁在构建?从去中心化金融到靠玩游戏赚钱的游戏,我们分析了当今的 Web3 及其对消费者和创作者的意义。
点滴科技资讯
2023/03/01
1.4K0
100 多家 Web3 公司重构互联网的未来
到底什么是 Web3 —— 可读-可写-可拥有?
中心化已经帮助数十亿人登上万维网的航船,并创建了万维网所依托的稳定的、可靠的基础设施。与此同时,少数中心的实体在万维网的大片区域拥有“据点”,单方面地决定着应该允许什么和不允许什么。
梦飞
2022/10/31
1.1K0
Coinbase视角下的Web3技术栈
编者按:Coinbase成立于2012年6月,是美国最大的加密货币交易所。商家和消费者可以使用coinbase钱包和平台进行比特币、以太坊和莱特币等数字货币交易。Coinbase的愿景是通过建立一个开放的金融体系,为世界带来更多的创新、效率和机会平等。Coinbase2021年4月正式上市,股票代码为COIN。该公司没有进行传统的首次公开募股(IPO),相反,该公司通过所谓的“直接上市”方式直接在纳斯达克证券交易所上市。近年来,Spotify和Palantir等知名公司率先采用了这种方式。
用户9624935
2022/04/02
6300
Coinbase视角下的Web3技术栈
Web3产品经理指南:如何面向加密世界
如果你愿意承担风险,并且喜欢在快节奏的环境中工作,Web3 产品经理 (PM:Product Manager) 可能是一个很好的选择。
Tiny熊
2022/11/07
8940
Web3产品经理指南:如何面向加密世界
NFT卡牌游戏系统开发Web3链游技术
web3沿用了区块链去中心化的概念,用户通过代币来创作和消费内容,同时可以获得自己创作内容的所有权。
用户5539481
2022/10/19
5570
NFT卡牌游戏系统开发Web3链游技术
从星巴克到可乐,加密域名会成为下一个风口吗?
近几个月以来加密市场对于Web3域名服务展现出了极大兴趣,Ethereum Name Service (“ENS”)和Unstoppable Domains这类去中心化域名服务得到了大规模采用。而ENS更是该领域中一匹黑马,凭借着优异的七天交易量成绩一举击败主流NFT藏品无聊猿BAYC、CloneX、Moonbirds等,成为NFT交易平台OpenSea上的顶级以太坊项目。
小将
2022/10/17
7840
从星巴克到可乐,加密域名会成为下一个风口吗?
怎么理解 Web 3.0?
我们今天听到的「Web 3.0」或「Web3」,是由以太坊联合创始人、Polkadot创建者Gavin Wood在2014年提出的概念,用以代表互联网的下一个时代——互联网形态向着更民主的范式转变。正如Gavin Wood接受采访时所说,他对Web3的定义很简单:“Less trust, more truth.”。 但早在1998年,万维网创始人、著名计算机科学家蒂姆·伯纳斯-李(Tim Berners-Lee)就提出过相似的概念——“语义网”,它暗示了对于互联网的新想法:互联网将更加自主、智能和开放。当下
玄姐谈AGI
2022/03/10
1.3K0
用 Arweave 构建 Web3 应用
本文介绍一下如何构建web3应用,目的是让开发者熟悉在不断增长的web3空间开发的协议、工具和最佳实践。Building on web3将关注web3生态系统中的新兴技术和项目,以帮助dapp开发者创造一个成功的秘诀。
Tiny熊
2022/02/18
1.1K0
一文读懂Web3 Index:另类追踪web3网络价值
12月9日,美国国会结束了一场较为特殊的听证会,加密矿企BitFury的首席执行官Brian Brook向议员科普了“Web3.0”概念。
用户7358413
2021/12/09
9910
Web3项目的分类及特点
Web3项目涵盖了多个领域,每个领域都有其独特的特点和应用场景。以下是Web3项目的主要分类及其特点。
数字孪生开发者
2025/03/27
1070
Web3项目的分类及特点
Web3赋能新商业模式
编者按:互联网行业的迅猛发展带动了音视频技术的进步,一些新鲜术语也随之进入音视频赛道。一股Web3热潮正席卷而来,相比元宇宙、NFT、虚拟人这些更为火热的概念,Web3到底是什么意思?从概念到落地,海外Web3音视频发展趋势如何?为此,我们很荣幸地邀请到了Reddio 创始人&CEO Neil HAN,分享了围绕Web3技术的最新进展、给音乐行业带来的变革及可能、元宇宙内的音视频、直播新玩法、Web3未来展望等五部分精彩内容,期待一起走进Web3时代。
LiveVideoStack
2023/01/10
5460
Web3赋能新商业模式
NFT简介
NFT的全称是non-fungible token,中文通常翻译为“非同质化代币”,通常会被当作“数字资产“。
一行舟
2022/08/25
6840
NFT简介
【转型Web3开发第一课】图文版 | 05 | Web3的组成架构
Hello,我是「Keegan小钢」,我们继续《转型Web3开发第一课》。这一节,我们来认识下 Web3 的组成架构。既然要转型 Web3,就需要对整个 Web3 生态的全景有个基本认识。
Keegan小钢
2024/07/01
2090
【转型Web3开发第一课】图文版 | 05 | Web3的组成架构
数字藏品NFT的开发框架
数字藏品NFT(非同质化代币)的开发框架涉及区块链技术、智能合约、存储解决方案、用户交互等多个方面。以下是一个完整的数字藏品NFT开发框架,涵盖从技术选型到部署上线的关键步骤。
数字孪生开发者
2025/01/26
1470
数字藏品NFT的开发框架
相关推荐
Web3.0 行业全景及代表项目研究
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档