Interface creation method and device, service request method and device, computer device and medium

A computer program and interface technology, applied in the field of service requests, can solve problems such as inability to process parameters, increase the amount of code in the business layer, and http access requests cannot meet the requirements of complex services, etc., to achieve the effect of increasing the amount of code and using it easily

Active Publication Date: 2019-10-25
BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF10 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, Feign is only suitable for simple direct access, and cannot perform some processing on parameters, so the obtained http access request cannot meet the requirements of some complex services
For example, there are three parameters in the access request, and the third parameter is calculated by signing and encrypting the first two parameters, but the

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Interface creation method and device, service request method and device, computer device and medium
  • Interface creation method and device, service request method and device, computer device and medium
  • Interface creation method and device, service request method and device, computer device and medium

Examples

Experimental program
Comparison scheme
Effect test

Example

[0065] Example (1): For a certain type of service, the first custom annotation is used for the annotation of the interface implementation class, and the generated method body is capable of performing preset processing on the preset parameters, and adding the processed data to the In the request path, it is assembled into the execution logic code of the access request according to the request path after adding the data, the service type and the request method, that is, the generated method body can preset the preset parameters and add the processed data To the request path, and assemble into an access request according to the request path after adding data, the service type and the request mode. There are many kinds of preset processing, for example, signature processing.

Example

[0066] Example (2): For another type of service, the annotations in the interface implementation class use the first custom annotation and the second custom annotation, and the generated method body is capable of pre-processing the preset parameters, and will process The latter data and each method parameter parsed from the parameter entity are added to the request path, and are assembled into the execution logic code of the access request according to the request path after adding the data, the service type and the request mode, namely the method The entity can perform preset processing on preset parameters, add processed data and each method parameter parsed from the parameter entity to the request path, and according to the request path after adding data, the service type and The request mode is assembled into an access request, and there are multiple preset processings described above, for example, signature processing.

[0067] Among them, the preset parameters, for example,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to an interface creation method and device, a service request method and apparatus, a computer device and a storage medium. The interface creation method comprises the steps of obtaining an interface class for accessing a preset service; generating a corresponding interface implementation class according to the interface class, and the interface implementation class inheriting annotations in the interface class; analyzing the annotation to obtain a request parameter required for accessing a preset service; generating a corresponding method body according to the request parameter, and inserting the method body into the interface implementation class; and injecting the interface implementation class containing the method body into the code of the application scene. According to the method, logic processing codes do not need to be added in the service layer, and the code quantity of the service layer cannot be increased. Moreover, since the method is not realized through feign, not only can the http access request be sent, but also the access requests of other formats can be sent, and the diversity of the access requests is increased.

Description

technical field [0001] The present application relates to the technical field of service request, and in particular to an interface creation method, service request method, device, computer equipment and storage medium. Background technique [0002] The business side accesses public services through its interface for accessing services. For some simple services, the http access request that the business side needs to send can be implemented through Feign. Feign is a declarative network service client. Its purpose is to make the invocation of network services easier. Feign provides a template for http access requests. By writing simple interfaces and inserting annotations, you can define the HTTP access requests. Each parameter, format, address and other information. However, Feign is only suitable for simple direct access, and cannot perform some processing on parameters, so the obtained http access request cannot meet the requirements of some complex services. For example...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04L29/08G06F8/30G06F8/73
CPCH04L67/02G06F8/315G06F8/73H04L67/60
Inventor 柯登科段光磊王平赫振军周正张大虎王杨徐婷
Owner BEIJING QIYI CENTURY SCI & TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products