CN113434140A - Method, device and storage medium for loading menu and menu functions based on annotation - Google Patents

Method, device and storage medium for loading menu and menu functions based on annotation Download PDF

Info

Publication number
CN113434140A
CN113434140A CN202110713389.4A CN202110713389A CN113434140A CN 113434140 A CN113434140 A CN 113434140A CN 202110713389 A CN202110713389 A CN 202110713389A CN 113434140 A CN113434140 A CN 113434140A
Authority
CN
China
Prior art keywords
annotation
menu
function
loaded
loading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110713389.4A
Other languages
Chinese (zh)
Inventor
袁海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202110713389.4A priority Critical patent/CN113434140A/en
Publication of CN113434140A publication Critical patent/CN113434140A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention relates to a data processing technology, and provides a method, a device, electronic equipment and a computer readable storage medium for loading a menu and a menu function based on annotation, wherein the method comprises the following steps: adding a start annotation to a start class of the management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform; the starting annotation starts the menu annotation through the condition annotation, and loads the menu to be loaded through the menu annotation; and the starting annotation starts the function annotation through the condition annotation, and loads the menu function to be loaded of the loaded menu through the function annotation. The invention also relates to a block chain technology, and the menu to be loaded and the menu function to be loaded are stored in the block chain. The invention mainly aims to finish the loading of the menu and menu functions through annotation, so that the initial authority control is basically automated, and meanwhile, the management platform is configured without manual configuration, thereby improving the development efficiency of the management platform.

Description

Method, device and storage medium for loading menu and menu functions based on annotation
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for loading a menu and a menu function based on annotation, electronic equipment and a computer readable storage medium.
Background
In relevant projects such as wisdom farming management platform, breed management platform, it is healthy with the function to use the authority verification generally, and the user authority is just control menu and menu function, and menu and the menu function that need sometimes need add temporarily, and the current mode of adding includes: manual configuration, sql insertion, and menu-capable configuration by the platform (or admin) user.
The modes of adding the menu and the menu function all need a programmer to operate, so that the workload of the programmer is increased; furthermore, after the menu and menu functions are added, a greater amount of work is required, such as: continuous adjustment time, self-testing time, smoking testing time and the like.
To solve the above problems, the present invention is directed to a method for loading menu and menu functions based on annotations.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a computer readable storage medium for loading menu and menu functions based on annotations, and mainly aims to complete the loading of the menu and menu functions through the annotations, configure a management platform without manual configuration, and improve the development efficiency of the management platform.
In order to achieve the above object, the present invention provides a method for loading menu and menu functions based on annotations, which is applied to an electronic device, and the method includes:
adding a start annotation to a start class of the management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform;
the starting annotation starts the menu annotation through the condition annotation, and loads the menu to be loaded through the menu annotation;
and the starting annotation starts the function annotation through the condition annotation, and loads the menu function to be loaded of the loaded menu through the function annotation.
Optionally, the menu annotation includes a menu code, a menu name, a main menu, and a submenu;
the function annotation comprises the code of the function interface, the function name and the function category.
Optionally, the starting annotation starts the menu annotation through a conditional annotation and loads a menu to be loaded through the menu annotation, and the starting annotation starts the function annotation through the conditional annotation and loads a menu function to be loaded of the loaded menu through the function annotation, including:
the starting annotation judges whether the menu annotation exists in a file layer of the management platform or not by scanning the file layer;
if the menu annotation is found by scanning the starting annotation in the file layer, judging that the menu annotation exists in the file layer;
loading a menu to be loaded to the file layer according to the menu annotation;
and the starting annotation determines the function annotation by scanning the function interface of the loaded menu, and loads the menu function to be loaded to the function interface according to the function annotation.
Optionally, the start annotation continues to scan the functional interface of the management platform, and loads the menu and the function to be loaded to the functional interface according to the menu annotation and the function annotation found by scanning.
Optionally, the starting annotation starts the menu annotation through a conditional annotation and loads a menu to be loaded through the menu annotation, and the starting annotation starts the function annotation through the conditional annotation and loads a menu function to be loaded of the loaded menu through the function annotation, including:
the starting annotation judges whether the menu annotation exists in the file layer and the functional interface or not by scanning the file layer and the functional interface of the management platform
If the menu annotation is found in the file layer and the functional interface scanning of the start annotation, judging that the menu annotation exists in the file layer and the functional interface; and the number of the first and second groups,
the starting annotation scans the functional interface to find the functional annotation;
and loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation.
Optionally, the loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation includes:
storing the information of the menu annotation into a menu annotation data table;
storing the information of the function annotation in a function annotation data table; at the same time, the user can select the desired position,
constructing a menu function data table associated with the menu annotation data table and the function annotation data table;
and loading the menu to be loaded and the menu function to be loaded according to the menu function data table.
Optionally, the method further comprises the following steps:
starting an interface path annotation according to the start annotation, and acquiring an interface path through the interface path annotation;
and acquiring the menu annotation data table, the function annotation data table and the menu function data table according to the interface path.
In order to solve the above problem, the present invention further provides an apparatus for loading a menu and a menu function based on an annotation, the apparatus comprising:
the system comprises a startup annotation adding module, a startup annotation adding module and a startup annotation adding module, wherein the startup annotation is used for adding a startup annotation to a startup class of a management platform, and the startup annotation is used for starting a menu annotation and a function annotation of the management platform;
the menu loading module is used for starting the menu annotation through the condition annotation by the starting annotation and loading the menu to be loaded through the menu annotation;
and the function loading module is used for starting the function annotation through the condition annotation by the starting annotation and loading the menu function to be loaded of the loaded menu through the function annotation.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of the method for loading menus and menu functions based on annotations described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, which stores at least one instruction, where the at least one instruction is executed by a processor in an electronic device to implement the method for loading menus and menu functions based on annotations described above.
The embodiment of the invention adds a start annotation to a start class of a management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform; opening the menu annotation according to the starting annotation, and loading a menu to be loaded through the menu annotation; and starting the function annotation according to the starting annotation, and loading the menu function to be loaded of the loaded menu through the function annotation. The invention completes the loading of the menu and menu functions through the annotation, thereby basically realizing the automation of the initial authority control, simultaneously configuring the management platform without manual configuration and improving the development efficiency of the management platform.
Drawings
FIG. 1 is a flowchart illustrating a method for loading menu and menu functions based on annotations according to an embodiment of the present invention;
FIG. 2 is a block diagram of an apparatus for loading menus and menu functions based on annotations according to an embodiment of the present invention;
fig. 3 is a schematic internal structural diagram of an electronic device implementing a method for loading menus and menu functions based on annotations according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known methods, structures, and techniques have not been shown in detail in order not to obscure an understanding of this description. References to "one embodiment," "an embodiment," "example embodiment," "various embodiments," etc., indicate that the embodiment described in connection with the invention may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Furthermore, repeated usage of the phrase "in one embodiment" does not necessarily refer to the same embodiment, although it may.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
As used herein, unless otherwise specified, the terms "mobile device" and/or "device" generally refer to a wireless communication device, and more specifically to one or more of the following: a portable electronic device, a telephone (e.g., a cellular telephone, a smartphone), a computer (e.g., a laptop, a tablet), a portable media player, a Personal Digital Assistant (PDA), or any other electronic device with networking capabilities.
The invention provides a method for loading menu and menu functions based on annotations. Referring to fig. 1, a flowchart of a method for loading a menu and a menu function based on an annotation according to an embodiment of the present invention is shown. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the method for loading menu and menu functions based on annotations includes:
s1: adding a start annotation to a start class of the management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform;
s2: the starting annotation starts the menu annotation through the condition annotation, and loads the menu to be loaded through the menu annotation;
s3: and the starting annotation starts the function annotation through the condition annotation, and the menu function to be loaded of the loaded menu is loaded through the function annotation.
The method for loading the menu and the menu function based on the annotation completes the loading of the menu and the menu function by adopting the annotation, basically realizes the automation of the initial authority control, and only needs to configure before writing the function and does not need to manually configure in the later period when configuring the management platform, thereby perfecting the development process and improving the development efficiency of the management platform.
In the embodiment of the invention, the menu and menu function loading is completed by adopting the annotation, so that the workload of configuration personnel can be reduced, the personnel cost is reduced, and the working quality is improved; meanwhile, the workload in the aspect of testing can be reduced, and the authority is sound and more perfect.
In step S1, a launch annotation for auto-launch menus and menu function rights is added on top of the launch class. When the program is started, the function code under the current function annotation can be automatically executed, and the function of automatically scanning the menu and the menu function interface is realized. The menu annotation comprises a menu code, a menu name, a main menu and a submenu; the function annotation comprises the code of the function interface, the function name and the function category.
Wherein the start annotation is @ agrimarage. The menu notes are: @ agrimenumange (code ═ and message ═ and, parent _ code ═ and, order ═ and). code is a menu code, message is a menu name, and parent _ code is a top menu number. Default is null, if null, the certification is a level one menu, order is the order of the menu, and default is 1. That is, the menu comment includes a menu code, a menu name, a main menu, and a sub-menu.
Wherein, the functional annotation is: @ agri acllmanage (code ″), value is a function and button code, and message is a function name. Namely: and identifying the code and the function name of the function interface, the function category and other information.
In the embodiment of the invention, three ways of adding the menu and the function are provided, wherein whether a menu comment exists in the file layer or not and whether the menu is loaded in the file layer or not are judged, and the loading of the function is fixed in the three modes and is recorded in the function interface. The three modes are described specifically below.
The first mode is as follows:
in step S2, the starting annotation starts the menu annotation through conditional annotation, loads the menu to be loaded through the menu annotation, and the starting annotation starts the function annotation through conditional annotation, loads the menu function to be loaded of the loaded menu through the function annotation, including:
s21: the starting annotation judges whether the menu annotation exists in a file layer of the management platform or not by scanning the file layer;
s22: if the menu annotation is found by scanning the starting annotation in the file layer, judging that the menu annotation exists in the file layer;
s23: loading a menu to be loaded to the file layer through the menu annotation;
s24: and the starting annotation determines the function annotation by scanning the function interface of the loaded menu, and loads the menu function to be loaded to the function interface according to the function annotation.
In the embodiment of the invention, a menu annotation (@ agriMenuManage) is added in a file layer, a function annotation (@ agriAclManage) is added in a function interface, a menu is loaded in the file layer, and a function is loaded in the function interface; indicating the added function annotation under the current file and all belonging to the functions under this menu. The conditional note includes many types, which can be determined according to actual conditions in specific applications, and is not limited to only one type of conditional note. The loading process by conditional annotation is exemplified as follows: starting the whole project, reading the starting annotation on the starting class, and determining whether the function needs to be loaded; this function needs to be added: reading the corresponding Configuration; reading a Bean method in Configuration; reading the relevant information of the Conditional; the function is loaded.
The second mode is as follows:
in step S2, the starting annotation starts the menu annotation through conditional annotation and loads the menu to be loaded through the menu annotation, and the starting annotation starts the function annotation through conditional annotation and loads the menu function to be loaded of the loaded menu through the function annotation, including:
s21: the starting annotation judges whether the menu annotation exists in a file layer of the management platform or not by scanning the file layer;
s22: if the menu annotation cannot be scanned in the file layer by the start annotation, judging that the menu annotation does not exist in the file layer;
s23: the starting annotation continues to scan to a functional interface, and the menu annotation and the functional annotation are scanned and found;
s24: and loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation found by scanning.
In the embodiment of the present invention, the menu annotation (@ agrimeumunamenage) is not added in the file layer, and both the menu annotation (@ agrimeumunamenage) and the function annotation (@ AgriAclManage) are added in the function interface, that is: the menu and the menu function are loaded on the function interface; indicating that the function belongs to a function under the menu.
The first and second modes are summarized as follows:
the starting annotation starts the menu annotation through the condition annotation and loads the menu to be loaded through the menu annotation, and the starting annotation starts the function annotation through the condition annotation and loads the menu function to be loaded of the loaded menu through the function annotation, which comprises the following steps:
the starting annotation judges whether the menu annotation exists in a file layer of the management platform or not by scanning the file layer;
if the menu annotation is found by scanning the starting annotation in the file layer, judging that the menu annotation exists in the file layer;
if the menu annotation exists in the file layer, loading a menu to be loaded to the file layer according to the menu annotation;
the starting annotation determines the function annotation by scanning a function interface of the loaded menu, and loads a menu function to be loaded to the function interface according to the function annotation;
if the menu annotation cannot be scanned in the file layer by the start annotation, judging that the menu annotation does not exist in the file layer;
and the starting annotation continues to scan the functional interface of the management platform, and the menu and the function to be loaded are loaded to the functional interface according to the menu annotation and the function annotation found by scanning.
In the embodiment of the present invention, the first addition manner is: the method comprises the following steps that a menu annotation (@ agriMenuManage) is added in a file layer, and a function annotation (@ agriAclManage) is added in a function interface; the second addition mode is as follows: the menu annotation (@ agriMenuManage) and the function annotation (@ agriAclManage) are added to the function interface; in specific application, a proper loading mode is selected according to actual conditions.
The third mode is as follows:
in step S2, the starting annotation starts the menu annotation through conditional annotation, loads the menu to be loaded through the menu annotation, and the starting annotation starts the function annotation through conditional annotation, loads the menu function to be loaded of the loaded menu through the function annotation, including:
s21: the starting annotation judges whether the menu annotation exists in the file layer and the functional interface or not by scanning the file layer and the functional interface of the management platform;
s22: if the menu annotation is found in the file layer and the functional interface scanning of the start annotation, judging that the menu annotation exists in the file layer and the functional interface; and the number of the first and second groups,
s23: the starting annotation scans the functional interface to find the functional annotation;
s24: and loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation.
In an embodiment of the invention, the file layer and the function are annotated with an @ agrimennumage menu, with a function interface priority. The menu annotation and the function annotation are added on the function interface to indicate that the function belongs to the function under the menu; the menu annotation of the functional interface layer takes precedence over the menu annotation of the file layer.
In step S24, the loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation includes:
s241: storing the information of the menu annotation into a menu annotation data table;
s242: storing the information of the function annotation in a function annotation data table; at the same time, the user can select the desired position,
s243: constructing a menu function data table associated with the menu annotation data table and the function annotation data table;
s244: and loading the menu to be loaded and the menu function to be loaded according to the menu function data table.
The scanned authority annotations (menu annotation and function annotation) are respectively processed, and information under the @ agriMenuManage menu annotation is stored in an agri _ menu data table (menu annotation data table); storing the information under the @ agri AclManage function annotation in an agri _ acl data table (function annotation data table); the associated information for simultaneously creating the menu annotation data table and the function annotation data table is stored in the agri _ menu _ acl data table (menu function data table).
The invention provides a method for loading menu and menu functions based on annotation, which further comprises the following steps:
s4: opening an interface path annotation according to the start annotation, and acquiring an interface path through the interface path annotation;
s5: and acquiring the menu annotation data table, the function annotation data table and the menu function data table according to the interface path.
In an embodiment of the invention, the interface path annotation comprises: the method comprises the following steps of @ PostMapping, @ GetMapping, @ PutMapping, @ RequestMapping and the like, obtaining an interface path through the interface path annotation, and enabling the interface path to be used for storing a menu annotation data table, a function annotation data table and a menu function data table.
The embodiment of the invention adds a start annotation to a start class of a management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform; opening the menu annotation according to the starting annotation, and loading a menu to be loaded through the menu annotation; and starting the function annotation according to the starting annotation, and loading the menu function to be loaded of the loaded menu through the function annotation. According to the invention, the menu and menu functions are loaded through annotation, the management platform is configured without manual configuration, and the development efficiency of the management platform is improved.
Fig. 2 is a functional block diagram of the apparatus for loading menu and menu functions based on annotations according to the present invention. The apparatus 100 for loading menu and menu functions based on annotations according to the present invention may be installed in an electronic device. Depending on the implemented functionality, the apparatus 100 for loading menus and menu functions based on annotations may comprise: the method comprises the steps of starting an annotation adding module 101, a menu loading module 102 and a function loading module 103. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
a startup annotation adding module 101, configured to add a startup annotation to a startup class of the management platform, where the startup annotation is used to start a menu annotation and a function annotation of the management platform;
the menu loading module 102 is configured to start the menu annotation through the condition annotation by the start annotation, and load a menu to be loaded through the menu annotation;
and the function loading module 103 is configured to start the function annotation through the condition annotation by the start annotation, and load a menu function to be loaded of the loaded menu through the function annotation.
In the embodiment of the invention, the menu and menu functions are loaded by adopting the annotations, and the management platform is configured only before the writing function without manual configuration in the later period, so that the development process is perfected, and the development efficiency of the management platform is improved.
In the start annotation adding module 101, start annotations for automatically loading menus and menu function rights are added on the start class. When the program is started, the function code under the current function annotation can be automatically executed, and the function of automatically scanning the menu and the menu function interface is realized. The menu annotation comprises a menu code, a menu name, a main menu and a submenu; the function annotation comprises the code of the function interface, the function name and the function category.
Wherein the start-up annotation is: @ agrimarage. The menu notes are: @ agrimenumange (code ═ and message ═ and, parent _ code ═ and, order ═ and). code is a menu code, message is a menu name, and parent _ code is a top menu number. Default is null, if null, the certification is a level one menu, order is the order of the menu, and default is 1. That is, the menu comment includes a menu code, a menu name, a main menu, and a sub-menu.
Wherein, the functional annotation is: @ agri acllmanage (code ″), value is a function and button code, and message is a function name. Namely: and identifying the code and the function name of the function interface, the function category and other information.
In the embodiment of the invention, three ways of adding the menu and the function are provided, wherein whether a menu comment exists in the file layer or not and whether the menu is loaded in the file layer or not are judged, and the loading of the function is fixed in the three modes and is recorded in the function interface. The loading of the three modes is specifically as follows.
The first mode is as follows:
in the menu loading module 102 and the function loading module 103, the starting annotation starts the menu annotation through the conditional annotation, loads the menu to be loaded through the menu annotation, and the starting annotation starts the function annotation through the conditional annotation, loads the menu function to be loaded of the loaded menu through the function annotation, including:
the judging unit is used for judging whether the menu annotation exists in the file layer or not by scanning the file layer of the management platform;
the menu judging unit is used for judging that the menu annotation exists in the file layer if the starting annotation scans and finds the menu annotation in the file layer;
the menu loading unit is used for loading the menu to be loaded to the file layer through the menu annotation;
and the function loading unit is used for determining the function annotation by scanning the function interface of the loaded menu through the starting annotation and loading the menu function to be loaded to the function interface according to the function annotation.
In the embodiment of the invention, a menu annotation (@ agriMenuManage) is added in a file layer, a function annotation (@ agriAclManage) is added in a function interface, a menu is loaded in the file layer, and a function is loaded in the function interface; indicating the added function annotation under the current file and all belonging to the functions under this menu.
The second mode is as follows:
in the menu loading module 102 and the function loading module 103, the starting of the menu annotation by the conditional annotation according to the start annotation, the loading of the menu to be loaded by the menu annotation, the starting of the function annotation by the conditional annotation, and the loading of the menu function to be loaded by the loaded menu by the function annotation include:
the judging unit is used for judging whether the menu annotation exists in the file layer or not by scanning the file layer of the management platform;
the menu judging unit is used for judging that the menu annotation does not exist in the file layer if the menu annotation cannot be scanned in the file layer by the start annotation;
the functional interface scanning unit is used for continuously scanning the start annotation to a functional interface and scanning and finding the menu annotation and the functional annotation;
and the menu and menu function loading unit is used for loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation.
In the embodiment of the present invention, the menu annotation (@ agrimeumunamenage) is not added in the file layer, and both the menu annotation (@ agrimeumunamenage) and the function annotation (@ AgriAclManage) are added in the function interface, that is: the menu and the menu function are loaded on the function interface; indicating that the function belongs to a function under the menu.
The first and second modes are summarized as follows:
the starting annotation starts the menu annotation through the condition annotation, loads the menu to be loaded through the menu annotation, starts the function annotation through the condition annotation, and loads the menu function to be loaded of the loaded menu through the function annotation, and the method comprises the following steps:
the starting annotation judges whether the menu annotation exists in a file layer of the management platform or not by scanning the file layer;
if the menu annotation is found by scanning the starting annotation in the file layer, judging that the menu annotation exists in the file layer;
if the menu annotation exists in the file layer, loading a menu to be loaded to the file layer according to the menu annotation;
the starting annotation determines the function annotation by scanning a function interface of the loaded menu, and loads a menu function to be loaded to the function interface according to the function annotation;
if the menu annotation cannot be scanned in the file layer by the start annotation, judging that the menu annotation does not exist in the file layer;
and the starting annotation continues to scan the functional interface of the management platform, and the menu and the function to be loaded are loaded to the functional interface according to the menu annotation and the function annotation found by scanning.
In the embodiment of the present invention, the first addition manner is: the method comprises the following steps that a menu annotation (@ agriMenuManage) is added in a file layer, and a function annotation (@ agriAclManage) is added in a function interface; the second addition mode is as follows: the menu annotation (@ agriMenuManage) and the function annotation (@ agriAclManage) are added to the function interface; in specific application, a proper loading mode is selected according to actual conditions.
The third mode is as follows:
in the menu loading module 102 and the function loading module 103, the starting annotation starts the menu annotation, the menu to be loaded is loaded through the menu annotation, and the starting annotation starts the function annotation through the condition annotation, and the menu function to be loaded of the loaded menu is loaded through the function annotation, which includes:
the judging unit is used for judging whether the menu annotation exists in the file layer and the functional interface or not by scanning the file layer and the functional interface of the management platform;
the menu annotation scanning unit is used for judging that the menu annotation exists in the file layer and the functional interface if the menu annotation is found in the file layer and the functional interface by scanning of the start annotation; and the number of the first and second groups,
a functional annotation scanning unit, configured to scan the start annotation at the functional interface to find the functional annotation;
and the menu and menu function loading unit is used for loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation.
In an embodiment of the invention, the file layer and the function are annotated with an @ agrimennumage menu, with a function interface priority. The menu annotation and the function annotation are added on the function interface to indicate that the function belongs to the function under the menu; the menu annotation of the functional interface layer takes precedence over the menu annotation of the file layer.
In the menu and menu function loading unit, loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation, which includes the following steps:
the menu annotation information storage unit is used for storing the information of the menu annotation into a menu annotation data table;
the function annotation information storage unit is used for storing the information of the function annotation in a function annotation data table;
the menu function data table constructing unit is used for constructing a menu function data table associated with the menu annotation data table and the function annotation data table;
and the loading unit is used for loading the menu to be loaded and the menu function to be loaded according to the menu function data table.
The scanned authority annotations (menu annotation and function annotation) are respectively processed, and information under the @ agriMenuManage menu annotation is stored in an agri _ menu data table (menu annotation data table); storing the information under the @ agri AclManage function annotation in an agri _ acl data table (function annotation data table); the associated information for simultaneously creating the menu annotation data table and the function annotation data table is stored in the agri _ menu _ acl data table (menu function data table).
The invention provides a device for loading menu and menu functions based on annotation, which also comprises: an interface path acquisition module and a data table acquisition module, wherein,
the interface path acquisition module is used for starting an interface path annotation according to the starting annotation and acquiring an interface path through the interface path annotation;
and the data table acquisition module is used for acquiring the menu annotation data table, the function annotation data table and the menu function data table according to the interface path.
In an embodiment of the invention, the interface path annotation comprises: the method comprises the following steps of @ PostMapping, @ GetMapping, @ PutMapping, @ RequestMapping and the like, obtaining an interface path through the interface path annotation, and enabling the interface path to be used for storing a menu annotation data table, a function annotation data table and a menu function data table.
The embodiment of the invention adds a start annotation to a start class of a management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform; opening the menu annotation according to the starting annotation, and loading a menu to be loaded through the menu annotation; and starting the function annotation according to the starting annotation, and loading the menu function to be loaded of the loaded menu through the function annotation. The invention completes the loading of the menu and menu functions through the annotation, thereby basically realizing the automation of the initial authority control, simultaneously configuring the management platform without manual configuration and improving the development efficiency of the management platform.
Fig. 3 is a schematic structural diagram of an electronic device implementing the method for loading menus and menu functions based on annotations according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a program 12 for loading menus and menu functions based on annotations.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of a data auditing program, but also for temporarily storing data that has been output or will be output. The memory may store content that may be displayed by the electronic device or sent to other devices (e.g., headphones) for display or play by the other devices. The memory may also store content received from other devices. This content from the other devices may be displayed, played, or used by the electronic device to perform any necessary tasks or operations that may be performed by a computer processor or other component in the electronic device and/or the wireless access point.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by operating or executing programs or modules (e.g., data auditing programs, etc.) stored in the memory 11 and calling data stored in the memory 11. The electronics can also include a chipset (not shown) for controlling communication between the one or more processors and one or more of the other components of the user device. In particular embodiments, the electronic device may be based on
Figure BDA0003133830040000151
Framework or
Figure BDA0003133830040000152
Architecture, and the processor and chipset may be from
Figure BDA0003133830040000153
A family of processors and chipsets. The one or more processors 104 may also include one or more Application Specific Integrated Circuits (ASICs) or Application Specific Standard Products (ASSPs) for handling specific data processing functions or tasks.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Further, the network and I/O interfaces may include one or more communication interfaces or network interface devices to provide for the transfer of data between the electronic device and other devices (e.g., network servers) via a network (not shown). The communication interfaces may include, but are not limited to: a human area network (BAN), a Personal Area Network (PAN), a wired Local Area Network (LAN), a Wireless Local Area Network (WLAN), a Wireless Wide Area Network (WWAN), and so on. The user device 102 may be coupled to the network via a wired connection. However, the wireless system interface may include hardware or software to broadcast and receive messages using the Wi-Fi direct standard and/or the IEEE 802.11 wireless standard, the bluetooth low energy standard, the Wi-Gig standard, and/or any other wireless standard and/or combinations thereof.
A wireless system may include a transmitter and a receiver or a transceiver capable of operating over a wide range of operating frequencies governed by the IEEE 802.11 wireless standard. The communication interface may utilize acoustic, radio frequency, optical, or other signals to exchange data between the electronic device and other devices, such as access points, hosts, servers, routers, reading devices, and the like. The network 118 may include, but is not limited to: the internet, private networks, virtual private networks, wireless wide area networks, local area networks, metropolitan area networks, telephone networks, and the like.
The display may include, but is not limited to, a liquid crystal display, a light emitting diode display, or an E-Ink display manufactured by E Ink corporation (E Ink Corp. of Cambridge, Mass.) in Massachusetts, Mass. The display may be used to display content to a user in the form of text, images, or video. In particular instances, the display may also operate as a touch screen display, which may enable a user to initiate commands or operations by touching the screen using certain fingers or gestures.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The program 12 for loading menus and menu functions based on annotations stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which when executed in the processor 10, can realize:
adding a start annotation to a start class of the management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform;
the starting annotation starts the menu annotation through the condition annotation, and loads the menu to be loaded through the menu annotation;
and the starting annotation starts the function annotation through the condition annotation, and the menu function to be loaded of the loaded menu is loaded through the function annotation.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again. It should be emphasized that, in order to further ensure the privacy and security of the menu to be loaded and the menu function to be loaded, the menu to be loaded and the menu function to be loaded may also be stored in a node of a block chain.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In an embodiment of the present invention, a computer-readable storage medium has stored therein at least one instruction, which is executed by a processor in an electronic device to implement the steps of the method for loading menus and menu functions based on annotations described above, and the specific method is as follows:
adding a start annotation to a start class of the management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform;
the starting annotation starts the menu annotation through the condition annotation, and loads the menu to be loaded through the menu annotation;
and the starting annotation starts the function annotation through the condition annotation, and the menu function to be loaded of the loaded menu is loaded through the function annotation.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
Certain embodiments of the present invention are described above with reference to block diagrams and flowchart illustrations of systems and methods and/or computer program products according to exemplary embodiments of the invention. It will be understood that one or more blocks of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, respectively, can be implemented by computer-executable program instructions. Likewise, some blocks of the block diagrams and flow diagrams may not necessarily be performed in the order presented, or may even not necessarily be performed at all, according to some embodiments of the invention.
These computer-executable program instructions may be loaded onto a general purpose computer, special purpose computer, processor, or other programmable data processing apparatus to produce a particular machine, such that the instructions which execute on the computer, processor, or other programmable data processing apparatus create means for implementing one or more functions specified in the flowchart block or blocks. These computer program products may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement one or more functions specified in the flowchart block or blocks. For example, embodiments of the invention may provide a computer program product comprising a computer usable medium having a computer readable program code or program instructions embodied therein, said computer readable program code adapted to be executed to implement one or more functions specified in the flowchart block or blocks. The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational elements or steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide elements or steps for implementing the functions specified in the flowchart block or blocks.
Accordingly, blocks of the block diagrams or flowchart illustrations support combinations of means for performing the specified functions, combinations of elements or steps for performing the specified functions and program instruction means for performing the specified functions. It will also be understood that each block of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, can be implemented by special purpose hardware-based computer systems that perform the specified functions, elements or steps, or combinations of special purpose hardware and computer instructions.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
While certain embodiments of the invention have been described in connection with what is presently considered to be the most practical and various embodiments, it is to be understood that the invention is not to be limited to the disclosed embodiments, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the scope of the appended claims. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for loading menu and menu functions based on annotation is applied to an electronic device, and is characterized in that the method comprises the following steps:
adding a start annotation to a start class of the management platform, wherein the start annotation is used for starting a menu annotation and a function annotation of the management platform;
the starting annotation starts the menu annotation through the condition annotation, and loads the menu to be loaded through the menu annotation;
and the starting annotation starts the function annotation through the condition annotation, and loads the menu function to be loaded of the loaded menu through the function annotation.
2. The method for loading menu and menu functions based on annotations of claim 1,
the menu annotation comprises a menu code, a menu name, a main menu and a submenu;
the function annotation comprises the code of the function interface, the function name and the function category.
3. The method for loading menu and menu functions based on annotations according to claim 1, wherein the start annotation starts the menu annotation by conditional annotation and loads the menu to be loaded by the menu annotation, and the start annotation starts the function annotation by conditional annotation and loads the menu function to be loaded of the loaded menu by the function annotation, comprising:
the starting annotation judges whether the menu annotation exists in a file layer of the management platform or not by scanning the file layer;
if the menu annotation is found by scanning the starting annotation in the file layer, judging that the menu annotation exists in the file layer;
loading a menu to be loaded to the file layer according to the menu annotation;
and the starting annotation determines the function annotation by scanning the function interface of the loaded menu, and loads the menu function to be loaded to the function interface according to the function annotation.
4. The method of claim 3, wherein if the menu annotation is not scanned in the file layer by the start annotation, it is determined that the menu annotation does not exist in the file layer;
the start annotation continues to scan the functional interface of the management platform and
and loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation found by scanning.
5. The method for loading menu and menu functions based on annotations according to claim 1, wherein the start annotation starts the menu annotation by conditional annotation and loads the menu to be loaded by the menu annotation, and the start annotation starts the function annotation by conditional annotation and loads the menu function to be loaded of the loaded menu by the function annotation, comprising:
the starting annotation judges whether the menu annotation exists in the file layer and the functional interface or not by scanning the file layer and the functional interface of the management platform;
if the menu annotation is found in the file layer and the functional interface scanning of the start annotation, judging that the menu annotation exists in the file layer and the functional interface; and the number of the first and second groups,
the starting annotation scans the functional interface to find the functional annotation;
and loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation.
6. The method for loading menu and menu functions based on annotations according to claim 5, wherein the loading the menu and the function to be loaded to the function interface according to the menu annotation and the function annotation comprises:
storing the information of the menu annotation into a menu annotation data table;
storing the information of the function annotation in a function annotation data table;
constructing a menu function data table associated with the menu annotation data table and the function annotation data table;
and loading the menu to be loaded and the menu function to be loaded according to the menu function data table.
7. The method for loading menu and menu functions based on annotations of claim 6, further comprising:
opening an interface path annotation according to the start annotation, and acquiring an interface path through the interface path annotation;
and acquiring the menu annotation data table, the function annotation data table and the menu function data table according to the interface path.
8. An apparatus for loading menu and menu functions based on annotations, the apparatus comprising:
the system comprises a startup annotation adding module, a startup annotation adding module and a startup annotation adding module, wherein the startup annotation is used for adding a startup annotation to a startup class of a management platform, and the startup annotation is used for starting a menu annotation and a function annotation of the management platform;
the menu loading module is used for starting the menu annotation according to the starting annotation and loading a menu to be loaded through the menu annotation;
and the function loading module is used for starting the function annotation according to the starting annotation and loading the menu function to be loaded of the loaded menu through the function annotation.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the method of loading menus and menu functions based on annotations as claimed in any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a method of loading menus and menu functions based on annotations as claimed in any one of claims 1 to 7.
CN202110713389.4A 2021-06-25 2021-06-25 Method, device and storage medium for loading menu and menu functions based on annotation Pending CN113434140A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110713389.4A CN113434140A (en) 2021-06-25 2021-06-25 Method, device and storage medium for loading menu and menu functions based on annotation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110713389.4A CN113434140A (en) 2021-06-25 2021-06-25 Method, device and storage medium for loading menu and menu functions based on annotation

Publications (1)

Publication Number Publication Date
CN113434140A true CN113434140A (en) 2021-09-24

Family

ID=77754671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110713389.4A Pending CN113434140A (en) 2021-06-25 2021-06-25 Method, device and storage medium for loading menu and menu functions based on annotation

Country Status (1)

Country Link
CN (1) CN113434140A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040083280A1 (en) * 2002-10-24 2004-04-29 Houston Edward Donald Dynamically modified, multiple-platform computer programs, and methods and apparatus utilizing same
CN102685166A (en) * 2011-03-17 2012-09-19 新奥特(北京)视频技术有限公司 Task distribution scheduling method and system based on SpringIOC
CN111597577A (en) * 2020-04-16 2020-08-28 深圳市科漫达智能管理科技有限公司 Function menu loading method, function menu loading device and terminal equipment
CN111917762A (en) * 2020-07-28 2020-11-10 银盛支付服务股份有限公司 Authority authentication solution method and system for front-end and back-end separation management systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040083280A1 (en) * 2002-10-24 2004-04-29 Houston Edward Donald Dynamically modified, multiple-platform computer programs, and methods and apparatus utilizing same
CN102685166A (en) * 2011-03-17 2012-09-19 新奥特(北京)视频技术有限公司 Task distribution scheduling method and system based on SpringIOC
CN111597577A (en) * 2020-04-16 2020-08-28 深圳市科漫达智能管理科技有限公司 Function menu loading method, function menu loading device and terminal equipment
CN111917762A (en) * 2020-07-28 2020-11-10 银盛支付服务股份有限公司 Authority authentication solution method and system for front-end and back-end separation management systems

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一风情书: "springboot实现简单自定义权限控制", pages 1 - 18, Retrieved from the Internet <URL:https://blog.csdn.net/Ming13416908424/article/details/107218293> *
逆袭的小学生: "Spring的模式注解装配、@Enable模块装配、条件装配与工厂加载机制", pages 1 - 14, Retrieved from the Internet <URL:https://blog.csdn.net/q610376681/article/details/90320710> *

Similar Documents

Publication Publication Date Title
CN101589574B (en) Data structure for budgeting power for multiple devices
CN104618217B (en) Share method, terminal, server and the system of resource
US20150067585A1 (en) Electronic device and method for displaying application information
US10372383B2 (en) Providing secure access to data in mobile devices
CN102483647A (en) Methods and systems for operating a computer via a low power adjunct processor
CN104932926A (en) System and method for achieving dynamic matching of equipment and drives in intelligent operation system platform
CN107924333A (en) Update log in multi-tenant cloud service is changed and associated
US9104252B2 (en) Assignment of control of peripherals of a computing device
CN111429121A (en) Block chain-based electronic ticket processing method, device, equipment and storage medium
EP2955659B1 (en) System and method for accessing and updating secured data
CN113434501A (en) Storage method and device of relational database table and readable storage medium
WO2024099134A1 (en) Method and apparatus for displaying information on instrument screen, and electronic device and vehicle
CN104102560A (en) Method and device for testing system performance
US20180059652A1 (en) Techniques for implementing universal commands in a welding or cutting system
CN113434140A (en) Method, device and storage medium for loading menu and menu functions based on annotation
EP3374860A1 (en) Communicating information about an update of an application
EP4332756A1 (en) Application deployment method, distributed operation system, electronic device, and storage medium
EP3507052A2 (en) Techniques for event driven scheduling in a welding or cutting system
CN115277147B (en) File tracing verification method, electronic equipment and readable storage medium
CN110688344A (en) File scanning method and device, computer readable storage medium and terminal
AU2017319583A1 (en) Techniques for network charting and configuration in a welding or cutting system
CN116661809A (en) Automatic deployment method of application system, electronic equipment and readable storage medium
CN114489915B (en) Mobile equipment-based open screen picture display method, device, equipment and medium
CN106294025A (en) The method for down loading of a kind of terminal software and device
CN109660610B (en) Data processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination