answer an interview question

It's easy to terminate an interview, but you have to be responsible to yourself. So I spent a day writing this weather question. Record it here.

I just wrote a simple frame without customizing any special styles, so let it look like this

ff559591d41443d4a127a4eb7ad69791.png

  •  Three parties used: Moya, SnapKit, HandyJSON, MBProgressHUD. The project structure is as follows:

52119f8dda994032bd4f12a13d40ae48.png

 I don't intend to go into details, but I just took out the project I wrote before and extracted the main framework

  • Implement Moya's TargetType protocol according to different modules,
  • Parse the data model through the return in Response combined with HandyJSON
  • Re-encapsulate the request request to adapt to the background data structure
  • Customize the protocol in terms of parameter encryption, and call it at the right place

WeatherForecast

 

 

 

Guess you like

Origin blog.csdn.net/SharkToping/article/details/130443220