当前位置:网站首页>Internship: term understanding and handwriting interface
Internship: term understanding and handwriting interface
2022-06-28 19:47:00 【ahyo】
Multithreading and high concurrency : Multithreading is a way to accomplish tasks , High concurrency is a state of system operation , Multithreading helps the system to bear the realization of high concurrency state . Mainly occurs in web A large number of accesses are centralized in the system perhaps socket Received a large number of requests for port centralization
Multithreading is just one of the ways to solve the problem of high concurrency .
After touching the project code Before I realized what I had come into contact with MVC The specific content —— classic MVC In the pattern ,M The business model ,V User interface ,C Controller , Use MVC The goal is to M and V Implementation code separation of , So that the same program can use different forms of expression . among ,View The definition of , It's the user interface . That is to say module The details of the business model .
@Api In the properties of the tags Mainly based on api file ,tags Indicates the general function description of the business , Like list aggregate , This total function covers multiple functional modules , Equivalent understanding is The total function is the class Multiple function modules are the corresponding methods .
Based on the understanding of the overall project code 、 be familiar with . Understand that the creation of each class is based on the database table structure ( Field 、 Data types and so on ) also extends model< T >.
in addition to , Notes that need to be familiar with include ——
@Data( I don't need to introduce myself Used many times )
@ApiOperationSupport
Use ApiOperationSupport The premise is that we need to put swagger2 After configuration, use the following methods , Use in controller On the floor , Sort the control classes .
@EqualsAndHashCode(callSuper = true)
This annotation will generate equals(Object other) and hashCode() Method . Generally set as callSuper=true( Unless it is to judge whether the two objects are consistent )
It defaults to non-static , Non transient properties
You can use the parameters exclude Exclude some attributes
You can use the parameters of Specify which attributes to use only
By default, it only uses the properties defined in the class and does not call the methods of the parent class
@ApiParam(name = “username”, value = “ user name ”, required = true)
Parameters required Express Whether this parameter is required .
@Accessors(chain = true)
Accessor Chinese meaning is accessor ,@Accessors Used for configuration getter and setter Method generation result
chain In Chinese, it means chain , Set to true, be setter Method returns the current object
@ApiModel(value="BizExitInfo object ", description="")
Use scenarios
Use on entity classes , When marking a class swagger The parsing class of
@ApiModelProperty
Use scenarios
Used in being @ApiModel Annotated model class properties
summary
Add and manipulate data for model properties
@ApiModelProperty(value = " name ")// explain
@TableField("name")// Corresponding table structure field name
Put on properties
Except for the above, entity classes are created based on each table , So in api Response parameters in the document It needs to be established separately model Easy to call when writing interfaces .
The interface is generally return ResponseData class , Need to return data .
Secondly, in the aspect of general login authentication apache Security framework for shiro, Realize user identity authentication 、 Authority authorization 、 encryption 、 Session management and other functions .
Gradually understand what interface annotations are doing , It's actually for api Just document layout . such as @ApiSort Sort interfaces , Moreover, the interface is provided for the front end , Then the interface generation is completed after other creation ( such as service layer 、dao layer 、pojo And configuration files ) On the basis of , Therefore, when writing interfaces, you will find There are many abbreviations and comments in the code . utilize MyBatis-Plus After that, most of the classes that will be created will inherit MyBatis-Plus Existing .
package com.hyd.daring.api;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hyd.daring.common.response.ResponseData;
import com.hyd.daring.service.IBizAttendanceRecordService;
import com.hyd.daring.transfer.app.AttendanceIndexModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.ResultMap;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.time.YearMonth;
/** * Monthly expenses interface Demo * * @author yyp */
@RestController
@RequestMapping("/MonthPay")
@Api( tags =" Monthly sales interface ")
@Slf4j
public class DemoApi {
@Resource
private IBizAttendanceRecordService iBizAttendanceRecordService;
/** * * On the pin — home page ( Expenses of this month ) * */
@RequestMapping(value = "/thisYear/index")
@ApiOperation(value = " This month's expenses ")
@ApiOperationSupport(order = 1)
public ResponseData<AttendanceIndexModel> attendanceIndex(
@ApiParam(name="yearId",value=" Year ",required=true) Integer yearId )
{
return new ResponseData<>(iBizAttendanceRecordService.attendanceIndex(yearId));
}
}
边栏推荐
- 如何通过W3school学习JS/如何使用W3school的JS参考手册
- 变分自编码器 (Variational Autoencoders, VAEs)
- Chunfeng power and Huawei work together to build a smart Park benchmark, and the future factory innovation will reach a new level
- 首部元宇宙概念小说《元宇宙2086》获得2022年上袭元宇宙奖
- JSP to get the value in the session
- 1002_ twenty million one hundred and eighty-one thousand and nineteen
- Can py SQL get the table structure?
- Kettle (VI): full database backup based on kettle
- 微信小程序_8,视图与逻辑
- NanoPC-T4(RK3399) game1 oled(I2C)显示时间天气温度
猜你喜欢
![return new int[]{i + 1, mid + 1};return {i + 1, mid + 1};](/img/6a/45a4494276deba72ef9833818229f5.png)
return new int[]{i + 1, mid + 1};return {i + 1, mid + 1};

I. The HR system is put on the enterprise wechat ISV to enhance the in-depth application of enterprise wechat in service chain retail and other industries

行业分析| 快对讲,楼宇对讲

The first meta universe concept novel, meta universe 2086, won the upper attack meta universe award in 2022

Web3 that unleashes the value of the Internet

集合之ArrayList

颜色渐变的FontAwesome图标

easypoi

How does win11 slim down the system disk? Slimming method of win11 system disk

From design delivery to development, it is easy and efficient!
随机推荐
Variational graph auto-encoders (VGAE)
Paper 3 vscode & texlive & sumatrapdf create a perfect tool for writing papers
严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C1047 对象或库文件“.lib”是使用与其他对象(如“x64\Release\main.obj”)不同的
Judge whether the string is empty
如何通过W3school学习JS/如何使用W3school的JS参考手册
变分自编码器 (Variational Autoencoders, VAEs)
ROS中quaternion四元数和欧拉角转换
Huawei cloud onemeeting tells you that the whole scene meeting is held like this!
Figure introduction to neural networks (GNN, GCN)
为什么C语言用使用其他文件的结构体变量时,声明结构体别名还不行,必须使用本名?(使用别名时不能加struct)
April 10, 2022 -- take the first step with C -- use C from Net class library call method (not understood)
R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题
Wechat applet_ 8. View and logic
math_ Proving common equivalent infinitesimal & Case & substitution
Severity code description project file line suppress status error lnk2038 detected a mismatch of "runtimelibrary": the value "md\u dynamicrelease" does not match the value "mdd\u dynamicde"
F (x) construct the equation, calculate the partial derivative by gradient descent, determine the partial derivative adjustment by loss function, and deal with nonlinear problems by activation functio
Installation and configuration of CGAL in PCL environment 5.4.1
redisTemplate
matlab 二维或三维三角剖分
Upward and downward transformation