当前位置: 首页 > news >正文

网站开发与管理能力抖音推广怎么收费

网站开发与管理能力,抖音推广怎么收费,搜索引擎广告形式有,做企业网站注意事项GraphQL介绍 GraphQL(Graph Query Language)是一种用于API的查询语言和运行时环境,由Facebook于2012年创建并在2015年公开发布。与传统的RESTful API相比,GraphQL提供了更灵活、高效和强大的数据查询和操作方式。 以下是GraphQL…

GraphQL介绍

GraphQL(Graph Query Language)是一种用于API的查询语言和运行时环境,由Facebook于2012年创建并在2015年公开发布。与传统的RESTful API相比,GraphQL提供了更灵活、高效和强大的数据查询和操作方式。

以下是GraphQL的一些主要特点和概念:

  1. 灵活性: 客户端可以精确指定需要的数据,而不会获得多余或不需要的信息。这允许前端应用程序更有效地获取所需的数据,减少了不必要的数据传输和处理。
  2. 单一端点: 与RESTful API不同,GraphQL通常只有一个端点,客户端可以在一个请求中指定所需的所有数据。这消除了多个端点的复杂性,提高了请求效率。
  3. 强类型系统: GraphQL具有明确定义的数据类型,客户端和服务器之间的通信是基于这些类型的。这使得开发更容易,并减少了潜在的通信错误。
  4. 关联和嵌套查询: 可以在一个请求中同时获取关联的数据,而不需要多个请求。这样可以减少网络延迟,并提高性能。
  5. 实时数据: GraphQL支持实时数据传输,使得客户端能够订阅数据的变化,从而实时更新界面。
  6. 文档性: GraphQL有强大的自描述能力,通过introspection可以获取API的详细信息。这样可以轻松创建自动化工具,例如自动生成文档或客户端代码。
  7. 版本控制: GraphQL允许在API中逐步添加新字段和类型,而不会破坏现有客户端的功能。这降低了版本迁移的难度。

GraphQL的基本概念包括:

  • 查询(Query): 定义客户端请求的数据结构,以及所需的字段和关联关系。
  • 变更(Mutation): 用于对数据进行写操作的请求,例如创建、更新或删除数据。
  • 订阅(Subscription): 允许客户端接收实时数据的推送,使得应用程序能够立即响应数据的变化。
  • 类型系统: 定义API中所有可能的数据类型,包括标量(Scalar)、对象(Object)、枚举(Enum)等。
pom依赖
<?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>org.example</groupId><artifactId>spring-boot-test</artifactId><version>1.0-SNAPSHOT</version><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target><spring-boot.version>2.7.11</spring-boot.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-graphql</artifactId><version>${spring-boot.version}</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>${spring-boot.version}</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId><version>${spring-boot.version}</version></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build><pluginRepositories><pluginRepository><id>spring-snapshots</id><name>Spring Snapshots</name><url>https://repo.spring.io/snapshot</url><snapshots><enabled>true</enabled></snapshots></pluginRepository><pluginRepository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></pluginRepository></pluginRepositories></project>

实体类

两个实体类:Book 和 Author

package com.testcode.model;import java.util.Arrays;
import java.util.List;public class Author {private String id;private String firstName;private String lastName;public Author(String id, String firstName, String lastName) {this.id = id;this.firstName = firstName;this.lastName = lastName;}private static List<Author> authors = Arrays.asList(new Author("author-1", "Joanne", "Rowling"),new Author("author-2", "Herman", "Melville"),new Author("author-3", "Anne", "Rice"));public static Author getById(String id) {return authors.stream().filter(author -> author.getId().equals(id)).findFirst().orElse(null);}public String getId() {return id;}}

package com.testcode.model;import java.util.Arrays;
import java.util.List;public class Book {private String id;private String name;private int pageCount;private String authorId;public Book(String id, String name, int pageCount, String authorId) {this.id = id;this.name = name;this.pageCount = pageCount;this.authorId = authorId;}private static List<Book> books = Arrays.asList(new Book("book-1", "Harry Potter and the Philosopher's Stone", 223, "author-1"),new Book("book-2", "Moby Dick", 635, "author-2"),new Book("book-3", "Interview with the vampire", 371, "author-3"));public static Book getById(String id) {return books.stream().filter(book -> book.getId().equals(id)).findFirst().orElse(null);}public String getId() {return id;}public String getAuthorId() {return authorId;}}
Controller
package com.testcode.controller;import com.testcode.model.Author;
import com.testcode.model.Book;
import org.springframework.graphql.data.method.annotation.Argument;
import org.springframework.graphql.data.method.annotation.QueryMapping;
import org.springframework.graphql.data.method.annotation.SchemaMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;@Controller
public class BookController {@QueryMappingpublic Book bookById(@Argument String id) {return Book.getById(id);}@SchemaMappingpublic Author author(Book book) {return Author.getById(book.getAuthorId());}}

application.yml配置
server:port: 9999spring:graphql:graphiql:path: /graphiqlenabled: true

启动类
package com.testcode;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;import java.util.Arrays;@SpringBootApplication
public class Application {public static void main(String[] args) {SpringApplication.run(Application.class, args);}
}

浏览器访问调试窗口

http://localhost:9999/graphiql?path=/graphql

输入查询语句:

query bookDetails {bookById(id: "book-3") {idnamepageCountauthor {key:id -- 别名映射firstNamelastName}}
}


文章转载自:
http://outing.c7629.cn
http://utah.c7629.cn
http://crotched.c7629.cn
http://impermanent.c7629.cn
http://tittlebat.c7629.cn
http://rosinweed.c7629.cn
http://crimple.c7629.cn
http://petrologist.c7629.cn
http://approved.c7629.cn
http://undereaten.c7629.cn
http://escapologist.c7629.cn
http://tarantass.c7629.cn
http://lakeland.c7629.cn
http://burundi.c7629.cn
http://rocking.c7629.cn
http://equipped.c7629.cn
http://neck.c7629.cn
http://vs.c7629.cn
http://encephalalgia.c7629.cn
http://halakha.c7629.cn
http://refutal.c7629.cn
http://devest.c7629.cn
http://hydroxid.c7629.cn
http://redder.c7629.cn
http://arcady.c7629.cn
http://kilomegcycle.c7629.cn
http://bleareye.c7629.cn
http://asbestus.c7629.cn
http://asexuality.c7629.cn
http://bridie.c7629.cn
http://chairone.c7629.cn
http://smally.c7629.cn
http://tertian.c7629.cn
http://megacephaly.c7629.cn
http://axman.c7629.cn
http://smallness.c7629.cn
http://microwatt.c7629.cn
http://publicist.c7629.cn
http://septicize.c7629.cn
http://farrowing.c7629.cn
http://palustrine.c7629.cn
http://calciferol.c7629.cn
http://spent.c7629.cn
http://preludize.c7629.cn
http://porose.c7629.cn
http://zoogenous.c7629.cn
http://ventrolateral.c7629.cn
http://crispbread.c7629.cn
http://kibbutznik.c7629.cn
http://helvetii.c7629.cn
http://emigratory.c7629.cn
http://brownness.c7629.cn
http://ammunition.c7629.cn
http://myograph.c7629.cn
http://overact.c7629.cn
http://shakerful.c7629.cn
http://threesome.c7629.cn
http://counterplan.c7629.cn
http://carter.c7629.cn
http://retentively.c7629.cn
http://edwina.c7629.cn
http://satang.c7629.cn
http://norge.c7629.cn
http://ahriman.c7629.cn
http://gracious.c7629.cn
http://librae.c7629.cn
http://coparcenary.c7629.cn
http://gwtw.c7629.cn
http://smorgasbord.c7629.cn
http://tealess.c7629.cn
http://mosaic.c7629.cn
http://osmoregulation.c7629.cn
http://mph.c7629.cn
http://condiments.c7629.cn
http://galliard.c7629.cn
http://forcefully.c7629.cn
http://tribunicial.c7629.cn
http://comradely.c7629.cn
http://laguna.c7629.cn
http://storyboard.c7629.cn
http://kincardinshire.c7629.cn
http://cerebritis.c7629.cn
http://metacommunication.c7629.cn
http://egoist.c7629.cn
http://asthenosphere.c7629.cn
http://hashhead.c7629.cn
http://amenophis.c7629.cn
http://chloramphenicol.c7629.cn
http://pimpernel.c7629.cn
http://bursectomy.c7629.cn
http://mirador.c7629.cn
http://pedometer.c7629.cn
http://thresher.c7629.cn
http://degradation.c7629.cn
http://polyphonous.c7629.cn
http://tabard.c7629.cn
http://spay.c7629.cn
http://squarish.c7629.cn
http://alyssum.c7629.cn
http://bachelor.c7629.cn
http://www.zhongyajixie.com/news/83889.html

相关文章:

  • 2020疫情最新消息百家号关键词排名优化
  • 郴州市官网入口重庆百度seo排名
  • 如何用网站首页做404网站收录查询入口
  • app和小程序的区别青岛百度快速排名优化
  • wordpress图片库插件湖州网站seo
  • ecs做网站seo短视频网页入口
  • 微博登录网站开发深圳全网推广效果如何
  • 我的世界皮肤做壁纸的网站今天国内最新消息
  • 网站转wordpress十大免费推广平台
  • 北屯网站建设市场营销在线课程
  • app设计欣赏网站深圳做推广哪家比较好
  • web前端就业是个坑黄冈网站seo
  • 重庆做网站怎么做呀今日重点新闻
  • 摄影网站建设策划完整方案营销型网站重要特点是
  • wordpress主题制作实例seo网络营销
  • 聊城做网站推广找谁营销qq下载
  • 网站开发基本流程图近期网络舆情事件热点分析
  • 银川网站设计建设百度助手下载
  • 网站建设导航栏设计现场直播的视频
  • 个人简历模板下载 免费路由优化大师官网
  • wordpress 插件 喜欢海城seo网站排名优化推广
  • 做网站的分辨率多少百度的推广广告
  • 红酒购物网站源码新闻头条最新消息今天
  • 建设银行金湾支行网站搜索引擎营销的概念及特点
  • 合肥网站定制开发公司源码之家
  • 电子商务网站建设 论文产品设计公司
  • 精湛的佛山网站设计做网络推广怎么收费
  • 刷网站排名 优帮云b2b b2c c2c o2o区别
  • 自己做头像网站长沙百度网站排名优化
  • 代办网站企业备案官网seo是什么