Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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 request template provided by Feign cannot do this kind of calculation work, so if you use Feign to create an http access request, just This part of the calculation work has to be placed in the business code, which will increase the amount of code in the business layer
And Feign can only send http access requests, and cannot implement other access requests

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 (1

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

example (2

[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 can preset the preset parameters, and the processing The added data and each method parameter parsed from the parameter entity are added to the request path, and the execution logic code of the access request is assembled according to the request path after the added data, the service type, and the request method, that is, the method The entity can perform preset processing on the preset parameters, add the 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 method is assembled into an access request, and there are many kinds of preset processing, for example, signature processing.

[0067] Among them, the preset parameters, for example, when logging in t...

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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products