Login interface setting method and device, storage medium and electronic equipment
By creating abstract parameter base class UserLoginDTO and abstract login interface LoginProvider, the problem of limited login mode of information system is solved, and support for multiple login types is realized, code redundancy and maintenance costs are reduced, and user experience and system maintainability are improved.
Patent Information
- Application Number
- CN202411865710.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
The login methods of existing information systems are limited. The traditional method requires users to remember their account ID and password, resulting in poor user experience. The expansion of multiple login methods requires redevelopment and testing, which has a long cycle, high cost, and is prone to compatibility problems.
By creating the abstract parameter base class UserLoginDTO, the interface parameters of multiple login types inherit the base class, including the common user login identification field and enumeration field; determine the supported multiple login types based on the enumeration field, obtain the corresponding login logic information, create an abstract login interface LoginProvider for verification, and configure an external login interface to support multiple login types.
It realizes flexible expansion of system login methods, reduces code redundancy, and uses the LoginProvider interface design to make the addition of new login methods simple and easy to maintain, improving the readability and maintainability of the code.
Smart Images

Figure CN119806688A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer information processing technology, and in particular to a method, device, storage medium and electronic device for setting a login interface. Background Art
[0002] With the development of computer information technology, there are more and more ways to log in to information systems, but most information systems only support a limited number of login methods, and the login methods are relatively traditional. Users often need to remember their account ID and login password to log in to the system. This traditional method easily makes the user's login experience poor. For this reason, supporting multiple ways to log in to the system has become one of the important technical problems that the industry needs to solve. However, to expand multiple login methods for most information, it is necessary to re-develop multiple functional modules of the linkage system, and to conduct a certain period of testing and adjustment to ensure the stable operation of the newly developed multiple login methods. This traditional method has a long cycle and high cost, and it is also easy to cause login bugs due to the poor compatibility of the redeveloped login method with the original system, affecting the user experience. For this reason, how to provide a login interface that can support the expansion of the system's login method in a friendly way has become a technical problem that needs to be solved urgently in the industry. Summary of the invention
[0003] In view of this, embodiments of the present application provide a method, device, storage medium and electronic device for setting a login interface to at least or partially solve the above problems.
[0004] In a first aspect, an embodiment of the present application provides a method for setting a login interface, comprising:
[0005] Create an abstract parameter base class UserLoginDTO, and let the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO; wherein the abstract base class
[0006] [HZTC-HXRJGS241010][HS2411399CCN]UserLoginDTO contains a common user login identification field and an enumeration field for determining the login type;
[0007] Determine multiple login types that the system is to support based on the enumeration field;
[0008] Acquire login logic information corresponding to the multiple login types;
[0009] Create an abstract login interface LoginProvider to verify the login logic information of the multiple login types;
[0010] Configure an external login interface to convert the login parameters passed in by the front-end system into corresponding parameter objects, and map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface can support system login through the multiple login types.
[0011] Optionally, in an embodiment of the present application, creating an abstract login interface LoginProvider for verifying the login logic information of the multiple login types includes:
[0012] Based on the enumeration fields, create an enumeration to indicate that the system supports multiple login types, and define a basic data transfer object class (DTO, Data Transfer Object) to include common fields required in the login mode logic of the multiple login types;
[0013] Combined with the data transfer object class, create an abstract class interface LoginProvider;
[0014] The specific implementation subclass of the abstract class interface LoginProvider is configured to handle the logic verification process of the different login modes included in the multiple login types.
[0015] Optionally, in an embodiment of the present application, the combining the data transmission object class to create an abstract login interface LoginProvider includes: creating a template interface AbstractLoginProvider, defining skeleton processes of login processes corresponding to the multiple login types in the template interface AbstractLoginProvider;
[0016] In combination with the data transmission object class, multiple subclasses of the template interface AbstractLoginProvider are configured, and the template interface AbstractLoginProvider is inherited to implement different logics of user verification respectively. The verification logic of the common fields is processed by the template interface AbstractLoginProvider to implement the abstract login interface LoginProvider.
[0017] Optionally, in one embodiment of the present application, an abstract parameter base class UserLoginDTO is created.
[0018] [HZTC-HXRJGS241010][HS2411399CCN] Let the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO, including:
[0019] Based on the created abstract parameter base class UserLoginDTO, create multiple basic subclasses corresponding to the multiple login types;
[0020] The multiple basic subclasses are utilized to respectively inherit the interface parameters of the login modes of the multiple login types.
[0021] Optionally, in an embodiment of the present application, the configuration of the external login interface is used to convert the parameters passed in by the front-end system into corresponding parameter objects, so that the external login interface supports login methods corresponding to the multiple login types, including:
[0022] Create an external login interface;
[0023] The external login interface is configured to enable LoginDTOFactory to convert the parameters passed in by the front end into corresponding parameter objects, and then call the customerService.login() method to log in.
[0024] In a second aspect, based on the method for setting a login interface described in the first aspect of the present application, an embodiment of the present application further provides a device for setting a login interface, including:
[0025] The first creation module is used to create an abstract parameter base class UserLoginDTO as the base class of all login mode parameters. The UserLoginDTO contains a common user identification field and an enumeration field for determining the login type; the interface parameters of the login modes of the multiple login types inherit the abstract parameter base class UserLoginDTO;
[0026] An enumeration module, used to determine multiple login types to be supported by the system according to the enumeration fields;
[0027] A combing module, used for obtaining login logic information corresponding to the multiple login types;
[0028] The second creation module is used to create an abstract login interface LoginProvider, which is used to verify the login logic information of the multiple login types;
[0029] The external module is used to configure the external login interface, to convert the login parameters passed in by the front-end system into corresponding parameter objects, and to map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface can support system login through the multiple login types.
[0030] Optionally, in one embodiment of the present application, the first creation module is further used to:
[0031] [HZTC-HXRJGS241010][HS2411399CCN] creates the abstract parameter base class UserLoginDTO, and creates multiple basic subclasses corresponding to the multiple login types;
[0032] The multiple basic subclasses are utilized to respectively inherit the interface parameters of the login modes of the multiple login types.
[0033] Optionally, in an embodiment of the present application, the second creation module is further used to: create an enumeration based on the enumeration field to indicate that the system supports multiple login types, and define a basic data transfer object class (DTO, Data Transfer Object) to include common fields required in the login mode logic of the multiple login types;
[0034] Combined with the data transfer object class, create an abstract class interface LoginProvider;
[0035] The specific implementation subclass of the abstract class interface LoginProvider is configured to handle the logic verification process of the different login modes included in the multiple login types.
[0036] In a third aspect, an embodiment of the present application further provides a computer storage medium, on which computer executable instructions are stored, and when the computer executable instructions are executed, any one of the login interface setting methods described in the first aspect of the embodiment of the present application is executed.
[0037] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus;
[0038] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute any one of the login interface setting methods described in the first aspect of the embodiment of the present application.
[0039] The present application provides a method, device, storage medium and electronic device for setting a login interface. By creating an abstract parameter base class UserLoginDTO, the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO; wherein the abstract base class UserLoginDTO contains a general user login identification field and an enumeration field for determining the login type; according to the enumeration field, multiple login types to be supported by the system are determined; login logic information corresponding to the multiple login types is obtained; an abstract login interface LoginProvider is created for verifying the login logic information of the multiple login types; an external login interface is configured,
[0040] [HZTC-HXRJGS241010][HS2411399CCN] is used to convert the login parameters passed by the front-end system into corresponding parameter objects, and map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface support can support system login through the multiple login types. The UserLoginDTO base class realizes the unified transmission and management of parameters of different login methods, reducing code redundancy. The interface design based on LoginProvider makes the addition of new login methods simple and easy to maintain. The login process is abstracted as an interface, and the implementation of the specific login method is completed by implementing the interface, which improves the readability and maintainability of the code. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0042] Figure 1 A schematic diagram of a workflow of a method for setting a login interface provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of the structure of a login interface setting device provided in an embodiment of the present application.
[0044] Figure 3 A structural schematic diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0046] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0047] Embodiment 1
[0048] [HZTC-HXRJGS241010][HS2411399CCN]
[0049] The present application embodiment provides a method for setting a login interface, such as Figure 1 As shown, Figure 1 A workflow diagram of a method for setting a login interface provided in an embodiment of the present application includes:
[0050] Step S101, create an abstract parameter base class UserLoginDTO, and let the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO; wherein the abstract base class UserLoginDTO contains a general user login identification field, and an enumeration field for determining the login type. In the embodiment of the present application, Userlogin means user login. In the computer field, users need to enter their account number and password in order to access a system or application. This process is called userlogin. Userlogin is often the first step to access various applications and websites on the Internet, and it is also a key step to ensure information security.
[0051] Specifically, in an optional implementation method of an embodiment of the present application: an abstract parameter base class UserLoginDTO is created, and the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO, including: based on the created abstract parameter base class UserLoginDTO, creating multiple basic subclasses corresponding to the multiple login types; using the multiple basic subclasses, respectively inheriting the interface parameters of the login methods of the multiple login types.
[0052] The embodiment of the present application uses the username and password login method as an example to illustrate the specific implementation method:
[0053] @EqualsAndHashCode(callSuper=true)
[0054] @Data
[0055] public class UsernamePasswordLoginDTO extends UserLoginDTO{
[0056] private final String username;
[0057] private final String password;
[0058] @Override
[0059] public LoginType getLoginType(){
[0060] return LoginType.USERNAME_PASSWORD;
[0061] }
[0062] }
[0063] Through the above method, the login function of UserLoginDTO can be implemented through the extension method without changing the existing code structure and logic of the original system, so as to solve the problem that different login methods require different parameters.
[0064] Step S102: Determine the multiple login types that the system needs to support based on the enumeration field. In the specific implementation of this solution, such as the above code implementation, an enumeration type LoginType is defined in UserLoginDTO to represent the login types supported by the system, such as PASSWORD, PHONE_VERIFICATION, THIRD_PARTY, etc. By setting the LoginType field in UserLoginDTO, the login method required by the current login request can be quickly and accurately determined.
[0065] Step S103, obtaining the login logic information corresponding to the multiple login types. Specifically, such as the login logic information for logging in via username + password, the login logic information for logging in via mobile phone number + mobile phone verification code, or the login logic information for logging in via email + email verification code. The embodiments of this application are not described one by one here.
[0066] Step S104: Create an abstract login interface LoginProvider to verify the login logic information of the multiple login types. In the embodiment of the present application, an abstract interface LoginProvider is created to define the basic framework of the login process, including abstract methods such as login verification and user information acquisition.
[0067] The specific code implementation can be as follows:
[0068] public interface LoginProvider{
[0069] UserLoginRespDTO login(UserLoginDTO loginDTO);
[0070] boolean supports(LoginType loginType);
[0071] }
[0072] Optionally, in the specific implementation of the embodiment of the present application, an abstract login interface LoginProvider is created to verify the login logic information of the multiple login types, including: based on the enumeration field, creating an enumeration to indicate that the system supports multiple login types, and defining a basic data transfer object class (DTO, Data Transfer Object) to include the common fields required in the login mode logic of the multiple login types; combining the data transfer object class, creating an abstract class interface LoginProvider; configuring the specific implementation subclass of the abstract class interface LoginProvider to handle the logic verification process of the different login modes included in the multiple login types. For example, create a UserNameLoginProvider to handle the login logic of username + password, and create
[0073] [HZTC-HXRJGS241010][HS2411399CCN]PhoneLoginProvider is responsible for processing the login logic of mobile phone number + mobile phone verification code, and EmailLoginProvider is created to process the login logic of email + email verification code. This implementation method defined in the embodiment of the present application can avoid a large amount of if else logic in the code of the login method, making the program code clearer and more elegant.
[0074] Optionally, in a specific implementation method of an embodiment of the present application, the data transmission object class is combined to create an abstract login interface LoginProvider, including: creating a template interface AbstractLoginProvider, defining a skeleton process of the login process corresponding to the multiple login types in the template interface AbstractLoginProvider; in combination with the data transmission object class, configuring multiple subclasses of the template interface AbstractLoginProvider, and performing interface inheritance on the template interface AbstractLoginProvider to respectively implement different logics of user verification, and the verification logic of the common fields is processed by the template interface AbstractLoginProvider to implement the abstract login interface LoginProvider.
[0075] In the embodiment of the present application, an abstract login interface LoginProvider is created to verify the login logic information of the multiple login types. It is found that there are some common processes in multiple login methods: such as the need to complete the verification of user parameters; secondly, the logic of user login needs to be implemented. For example, the username and password mode needs to verify whether the password is correct, and the mobile phone number + verification code login logic needs to verify whether the verification code matches correctly. Finally, a jwt token needs to be generated. The logic of generating jwt token can be shared, but now it has to be implemented in each implementation class, which will bring a lot of repeated code to the implementation of the program. For this reason, in this stage of the embodiment of the present application, an abstract login interface AbstractLoginProvider is defined by adopting a template mode, which implements the LoginProvider interface. The abstract login interface AbstractLoginProvider interface implemented in this stage inherits from LoginProvider, and provides default implementations or skeleton implementations of some methods to guide the implementation of specific login methods. Specifically, in AbstractLoginProvider, the skeleton process of the login process is defined. For example, let UserNameLoginProvider, PhoneLoginProvider, and EmailLoginProvider inherit AbstractLoginProvider and implement different logics of user verification respectively. The common jwt token generation logic is directly generated by the parent class. Abstract the common login process (such as generating jwt token) into the parent class, and put the specific logic of various login methods (such as user login verification) in their respective subclasses. This not only reduces the duplication of code, but also makes each login
[0076] [HZTC-HXRJGS241010][HS2411399CCN]The implementation of the login method is clearer and easier to manage. In addition, this design improves the scalability of the code. If you need to add more login methods in the future, you only need to add new subclasses.
[0077] Step S105, configure an external login interface to convert the login parameters passed in by the front-end system into corresponding parameter objects, and map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface can support system login through the multiple login types.
[0078] Specifically, in an optional implementation of the embodiment of the present application, the configuration of the external login interface is used to convert the parameters passed in by the front-end system into corresponding parameter objects, so that the external login interface supports login methods corresponding to the multiple login types, including: creating an external login interface; configuring the external login interface to enable LoginDTOFactory to convert the parameters passed in by the front-end into corresponding parameter objects, and then calling the customerService.login() method to log in. The specific code can be as follows:
[0079] @PostMapping(" / api / customer / login")
[0080] public UserLoginRespDTO login(@RequestBody Map<String,String>
[0081] parameters){
[0082] UserLoginDTO loginDTO=LoginDTOFactory.getLoginDTO(parameters);
[0083] return customerService.login(loginDTO);
[0084] }
[0085] The present application provides a method for setting a login interface, by creating an abstract parameter base class UserLoginDTO, so that the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO; wherein the abstract base class UserLoginDTO contains a general user login identification field, and an enumeration field for determining the login type; according to the enumeration field, determine the multiple login types that the system needs to support; obtain the login logic information corresponding to the multiple login types; create an abstract login interface LoginProvider, which is used to verify and process the login logic information of the multiple login types; configure an external login interface, which is used to convert the login parameters passed in by the front-end system into corresponding parameter objects, and map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface support can support system login through the multiple login types. The UserLoginDTO base class realizes the parameters of different login methods.
[0086] [HZTC-HXRJGS241010][HS2411399CCN]The unified transmission and management of numbers reduces code redundancy. The interface design based on LoginProvider makes the addition of new login methods simple and easy to maintain. The login process is abstracted into an interface, and the specific login method is implemented by implementing the interface, which improves the readability and maintainability of the code. It can also support the combination and application of multiple security strategies in a friendly manner, providing better login security for user-mode login.
[0087] Embodiment 2
[0088] Based on the method for setting the login interface provided in the first embodiment of the present application, the embodiment of the present application also provides a device for setting the login interface, such as Figure 2 As shown, Figure 2 A schematic diagram of the structure of a login interface setting device 20 provided in an embodiment of the present application, wherein the login interface setting device 20 includes:
[0089] The first creation module is used to create an abstract parameter base class UserLoginDTO as the base class of all login mode parameters. The UserLoginDTO contains a common user identification field and an enumeration field for determining the login type; the interface parameters of the login modes of the multiple login types inherit the abstract parameter base class UserLoginDTO;
[0090] An enumeration module, used to determine multiple login types to be supported by the system according to the enumeration fields;
[0091] A combing module, used for obtaining login logic information corresponding to the multiple login types;
[0092] The second creation module is used to create an abstract login interface LoginProvider, which is used to verify the login logic information of the multiple login types;
[0093] The external module is used to configure the external login interface, to convert the login parameters passed in by the front-end system into corresponding parameter objects, and to map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface can support system login through the multiple login types.
[0094] Optionally, in an embodiment of the present application, the first creation module is further used to: create multiple basic subclasses corresponding to the multiple login types based on the created abstract parameter base class UserLoginDTO;
[0095] Utilize the multiple basic subclasses to inherit the login modes of the multiple login types respectively.
[0096] [HZTC-HXRJGS241010][HS2411399CCN] parameters.
[0097] Optionally, in an embodiment of the present application, the second creation module is further used to: create an enumeration based on the enumeration field to indicate that the system supports multiple login types, and define a basic data transfer object class (DTO, Data Transfer Object) to include common fields required in the login mode logic of the multiple login types;
[0098] Combined with the data transfer object class, create an abstract class interface LoginProvider;
[0099] The specific implementation subclass of the abstract class interface LoginProvider is configured to handle the logic verification process of the different login modes included in the multiple login types.
[0100] Optionally, in an implementation of the embodiment of the present application, the second creation module is further used to:
[0101] Create a template interface AbstractLoginProvider, and define the skeleton processes of login processes corresponding to the multiple login types in the template interface AbstractLoginProvider;
[0102] In combination with the data transmission object class, multiple subclasses of the template interface AbstractLoginProvider are configured, and the template interface AbstractLoginProvider is inherited to implement different logics of user verification respectively. The verification logic of the common fields is processed by the template interface AbstractLoginProvider to implement the abstract login interface LoginProvider.
[0103] Optionally, in an implementation of the embodiment of the present application, the first external module is further used to:
[0104] Create an external login interface;
[0105] The external login interface is configured to enable LoginDTOFactory to convert the parameters passed in by the front end into corresponding parameter objects, and then call the customerService.login() method to log in.
[0106] The present application provides a device for setting a login interface, which creates an abstract parameter base class UserLoginDTO through a first creation module, so that the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO; wherein the abstract base class UserLoginDTO contains a general user login identification field and an enumeration field for determining the login type; through the enumeration module, the multiple login types to be supported by the system are determined according to the enumeration field; a combing module is set to obtain login logic information corresponding to the multiple login types; a second creation module is set to create an abstract login interface LoginProvider for verifying the login logic information of the multiple login types; an external module is set to configure an external login interface for transmitting the login parameters passed in by the front-end system to the external login interface.
[0107] [HZTC-HXRJGS241010][HS2411399CCN] converts the number into the corresponding parameter object, and maps the parameter object to the abstract parameter base class UserLoginDTO, so that the external login interface support can support system login through the multiple login types. The UserLoginDTO base class realizes the unified transmission and management of parameters of different login methods, reducing code redundancy. The template interface design based on LoginProvider makes the addition of new login methods simple and easy to maintain. The login process is abstracted as an interface, and the implementation of the specific login method is completed by implementing the interface, which improves the readability and maintainability of the code.
[0108] Embodiment 3
[0109] An embodiment of the present application also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements any one of the login interface setting methods described in the first embodiment of the present application.
[0110] Embodiment 4:
[0111] The present application also provides an electronic device, such as Figure 3 As shown, Figure 3 A schematic diagram of the structure of an electronic device 30 is provided for an embodiment of the present application. The electronic device 30 includes:
[0112] One or more processors 301, communication interface 302, memory 303 and communication bus 304, the processor 301, memory 303 and communication interface 302 communicate with each other via the communication bus 304;
[0113] Memory 303, used to store one or more programs;
[0114] When the one or more programs are executed by the one or more processors 301, the one or more processors 301 implement any one of the login interface setting methods described in Embodiment 1 of the present application.
[0115] So far, the application has described specific embodiments of the subject matter. In some cases, the actions recorded in the claims can be performed in different orders and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous.
[0116] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many of today's method flows are
[0117] The improvement of [HZTC-HXRJGS241010][HS2411399CCN] can be regarded as a direct improvement of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user programming the device. Designers can "integrate" a digital system layer on a PLD by programming themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0118] The controller may be implemented in any suitable manner. For example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to implement the controller in a manner that is not limited to a computer-readable program code.
[0119] [HZTC-HXRJGS241010][HS2411399CCN] The method steps are logically programmed to enable the controller to implement the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0120] The system layers, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0121] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0122] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0123] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, system layers or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0124] The present application may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. In general, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where remote computers connected by a communication network are connected to each other.
[0125] [HZTC-HXRJGS241010][HS2411399CCN]processing equipment to execute transactions. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0126] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system layer embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0127] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for setting a login interface, characterized in that: include: Create an abstract parameter base class UserLoginDTO, and let the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO; wherein the abstract base class UserLoginDTO contains a common user login identification field and an enumeration field for determining the login type; Determine multiple login types that the system is to support based on the enumeration field; Acquire login logic information corresponding to the multiple login types; Create an abstract login interface LoginProvider to verify the login logic information of the multiple login types; Configure an external login interface to convert the login parameters passed in by the front-end system into corresponding parameter objects, and map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface can support system login through the multiple login types.
2. The method for setting up a login interface according to claim 1, characterized in that: The creation of an abstract login interface LoginProvider for verifying the login logic information of the multiple login types includes: Based on the enumeration fields, create an enumeration to indicate that the system supports multiple login types, and define a basic data transfer object class (DTO, Data Transfer Object) to include common fields required in the login mode logic of the multiple login types; Combine the data transfer object class to create an abstract class interface LoginProvider; The specific implementation subclass of the abstract class interface LoginProvider is configured to handle the logic verification process of the different login modes included in the multiple login types.
3. The method for setting up a login interface according to claim 2, characterized in that: The step of combining the data transfer object class to create an abstract login interface LoginProvider includes: creating a template interface AbstractLoginProvider, defining a skeleton process of login processes corresponding to the multiple login types in the template interface AbstractLoginProvider; In combination with the data transmission object class, multiple subclasses of the template interface AbstractLoginProvider are configured, and the template interface AbstractLoginProvider is inherited to implement different logics of user verification respectively. The verification logic of the common fields is processed by the template interface AbstractLoginProvider to implement the abstract login interface LoginProvider.
4. The method for setting up a login interface according to claim 1, characterized in that: Create an abstract parameter base class UserLoginDTO, and let the interface parameters of the login methods of the multiple login types inherit the abstract parameter base class UserLoginDTO, including: Based on the created abstract parameter base class UserLoginDTO, create multiple basic subclasses corresponding to the multiple login types; The multiple basic subclasses are utilized to respectively inherit the interface parameters of the login modes of the multiple login types.
5. The method for setting up a login interface according to claim 1, characterized in that: The configuration of the external login interface is used to convert the parameters passed in by the front-end system into corresponding parameter objects, so that the external login interface supports login methods corresponding to the multiple login types, including: Create an external login interface; The external login interface is configured to enable LoginDTOFactory to convert the parameters passed in by the front end into corresponding parameter objects, and then call the customerService.login() method to log in.
6. A device for setting a login interface, characterized in that: include: The first creation module is used to create an abstract parameter base class UserLoginDTO as the base class of all login mode parameters. The UserLoginDTO contains a common user identification field and an enumeration field for determining the login type; the interface parameters of the login modes of the multiple login types inherit the abstract parameter base class UserLoginDTO; An enumeration module, used to determine multiple login types to be supported by the system according to the enumeration fields; [HZTC-HXRJGS241010][HS2411399CCN] A combing module, used to obtain the login logic information corresponding to the multiple login types; The second creation module is used to create an abstract login interface LoginProvider, which is used to verify the login logic information of the multiple login types; It is used to convert the login parameters passed in by the front-end system into corresponding parameter objects, and map the parameter objects to the abstract parameter base class UserLoginDTO, so that the external login interface support can support system login through the multiple login types.
7. The device for setting up a login interface according to claim 6, characterized in that: The first creation module is further used to: create multiple basic subclasses corresponding to the multiple login types based on the created abstract parameter base class UserLoginDTO; The multiple basic subclasses are utilized to respectively inherit the interface parameters of the login modes of the multiple login types.
8. The device for setting up a login interface according to claim 6, characterized in that: The second creation module is further used to: create an enumeration based on the enumeration field to indicate that the system supports multiple login types, and define a basic data transfer object class (DTO, Data Transfer Object) to include common fields required in the login mode logic of the multiple login types; Combined with the data transfer object class, create an abstract class interface LoginProvider; The specific implementation subclass of the abstract class interface LoginProvider is configured to handle the logic verification process of the different login modes included in the multiple login types.
9. A computer storage medium, characterized in that The computer storage medium stores computer executable instructions, and when the computer executable instructions are executed, the method for setting the login interface according to any one of claims 1 to 5 is executed.
10. An electronic device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the login interface setting method as described in any one of claims 1-5.