current position:Home>Post request (http-c4e7.post)

Post request (http-c4e7.post)

2022-04-29 14:23:08An autumn moon

  • entity layer = model layer = domain layer
  • mapper layer = dao layer
  • service layer
  • controller layer = web layer

 Insert picture description here

  • entity layer = model layer = domain layer
    purpose : Physical layer , Used to store our entity class , Basically consistent with the attribute values in the database , Realization set and get Methods .
  • mapper layer = dao layer
    purpose : Yes Database for data persistence , His method statement is directly aimed at database operation , It mainly implements some operations of adding, deleting, modifying and checking , stay mybatis The method in is mainly related to xxx.xml One by one .
    give an example :
    Example :userMapper
public interface userMapper {
    
	int deleteByPrimaryKey(Long id);
	int insert(user record);
	int insertSelective(user record);
	user selectByPrimaryKey(Long id);
	int updateByPrimaryKeySelective(user record);
	int updateByPrimaryKey(user record);
}
  • service layer
    purpose : Business service layer , to controller The class of layer provides interface for calling . Generally, it's a method that you write and encapsulate , It's just a statement , The concrete realization is serviceImpl in .
  • controller layer = web layer
    purpose : Control layer , Responsible for business process control of specific modules , Need to call service To control the business process . because service The method in is what we use ,controller adopt Receiving front end H5 perhaps App The parameters passed in are used for business operation , Reprocess results return To the front .

copyright notice
author[An autumn moon],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204291246303648.html

Random recommended