当前位置:网站首页>Internship: analysis of mobile source code
Internship: analysis of mobile source code
2022-07-18 14:24:00 【ahyo】
The software system written according to the project has multiple ports , It shows that the network function of the system has many kinds . The port is opened so that the program can be accessed by the outside world . After opening the port, not all external messages can be accessed ? Need to handle the split slogan , Data is notified by port number Transport layer agreement Which software is it sent to handle ( Software can be understood as a collection of programs and documents ) Data access cannot share one port at the same time , Therefore, the active port number and destination port number will also be used .
C/S Patterns and B/S The difference between patterns :
C/S Usually built on a dedicated network , Small scale network environment .
and B/S It's built on a wide area network , Strong adaptability , Usually you can have an operating system and a browser .
C/S Structure ratio B/S The structure is safer The user group is relatively fixed Better protection of information
B/S Compared with structural upgrading C/S Simple structure
These two modes together set up the network mode of today's Internet .
These are two architectures B/S It belongs to high cohesion and low coupling . at present , The projects contacted by the company are basically applied B/S structure .
spring The propagation characteristics of transactions :
Such as PROPERGATION_MANDATORY A similar naming structure ;
REQUIRED: necessary . Explain that there must be a transaction , Create a new transaction without .SUPPORTS: Support . The description is only supporting transactions , Non transactional execution without transactions .MANDATORY: Compulsive . Explain that there must be a transaction , Throw an exception without a transaction .REQUIRED_NEW: You must create a new transaction . If a transaction currently exists, suspend .NOT_SUPPORTED: Unsupported transaction , If there is a transaction, suspend .NEVER: There is no business . Throw an exception if there is a transaction
app Interface source code analysis :
Time settings in the project Its types basically use LocalDateTime.
app Mobile attendance interface analysis :
Most of the projects that I've been exposed to It's different in Controller There are too many layers api annotation , The general preparation of an interface is as follows :
@RequestMapping(value = "url", method = RequestMethod.POST)
@ApiOperation(value = " General description of the method ")
@ApiOperationSupport(order = 3)
public ResponseData<Boolean> verify(@ApiParam(name = "type", value = " Parameter description ", required = true) Integer type,
@ApiParam(name = "tunnelId", value = " Parameter description ", required = true) Integer tunnelId) {
return new ResponseData<>(attendanceRecordService.clock(type, tunnelId));
}
The structure is generally :
1、Controller Layer necessary annotations @RequestMapping(value=“” method=“”) The request method is basically post perhaps get Add, delete and replace with post
2、 The next comment is Swagger What is contained in the bag @ApiOperation @ApiOperationSupport @ApiParam…
3、 Created as a whole Controller Stratoid The return type of all methods under this class is the newly created class for data return ——ResponseData.
ResponseData class :
package com.hyd.daring.common.response;
import lombok.Data;
// Main function data return
@Data
public class ResponseData<T> {
public static final ResponseData res = new ResponseData();
public String message;
public int state = 200;
public T data;
public ResponseData() {
}
public ResponseData(T data) {
this.data = data;
}
public ResponseData(int state, String message) {
this.message = message;
this.state = state;
}
public ResponseData(int state, String message, T data) {
this.message = message;
this.state = state;
this.data = data;
}
}
Test the interface Input url The returned data is json Format .
2、 The return type of each method under the class is ResponseData Class uses construction methods to encapsulate data , Its parameter is service Layer interface reference (attendanceRecordService) Call the implementation method (clock()), Then by each service The interface of layer implements class processing Return the corresponding data type .
3、 The whole class url Realize reuse
边栏推荐
- math_ Derivation of ordering inequality
- Basic interview questions
- Kaldi source code installation
- [pytorch quantitative practice (2)]
- DML pour MySQL (langage de manipulation des données)
- 第一章 环境配置
- Points clés pour la mise à niveau du firmware d'aegnus air820ug
- Is it safe for Guosen Securities to open a mobile account? How to open an account
- Know the multi bank fund system (IV) -- plan tasks and account fund monitoring
- 【C语言笔记分享】自定义类型:结构体,枚举,联合(建议收藏)
猜你喜欢
![[pytorch quantitative practice (1)]](/img/d4/26dec935fdbdb719a78254288ba585.png)
[pytorch quantitative practice (1)]
![[pytorch quantitative practice (2)]](/img/d8/491359d94998f24da45011b2c7c423.png)
[pytorch quantitative practice (2)]

altium designer原理图生成pcb

QT使用多线程
![[deep learning - learning notes 01]](/img/af/6b0f077695ac8bb702703ec318c3d4.png)
[deep learning - learning notes 01]

用训练集去重构权重空间的几何形态

QT uses multithreading

Random vibration calculation and simulation verification of single degree of freedom system

Key points for upgrading firmware of Hezhou air820ug

Atcoder ABC 232 b~e problem solution
随机推荐
Clone warehouse code when creating a new project in idea
Docker installs redis cluster
NXOpen UG二次开发
认识多银行资金系统(三)-------直联设置、信息权限和系统参数设置
C&W(Carlini & Wagner)
altium designer原理图生成pcb
160_ Skills_ Power Bi new function - calculate working days
11. Container with the most water
【最全最详细】七种分布式全局 ID 生成策略
【leetcode刷题】
Points clés pour la mise à niveau du firmware d'aegnus air820ug
深度学习(2020李宏毅)学习记录
用训练集去重构权重空间的几何形态
Customize MVC
基于单片机的氢气监测系统设计(#0491)
xxx.whl is not a supported wheel on this platfo解决办法
You may not know the function of the third parameter of setTimeout
Breadth traversal of binary tree
PHP QRcode generates QR code
Huawei ECS cloud database creation read-only process