Tag:encapsulation

  • Implementation of secondary packaging based on Python + selenium

    Time:2021-8-5

    This is the secondary encapsulation of some common operations written by selenium.webdriver, which is equivalent to rewriting. Instead of using the built-in framework, it is completed with the framework written by myself. In this way, make the code more concise and write the code with your own ideas. First, create a subdirectory named common in […]

  • Python read ini configuration class encapsulation code instance

    Time:2021-6-8

    This article mainly introduces the python read ini configuration class encapsulation code example, the article through the example code is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to This is the basic encapsulation, without considering too much exception handling class # coding:utf-8 import configparser import […]

  • Simple encapsulation code instance of pymysql

    Time:2021-5-31

    This article mainly introduces the simple encapsulation code example of pymysql. The example code introduced in this article is very detailed, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it #coding=utf-8 #!/usr/bin/python import pymysql class MYSQL: “”” Simple encapsulation of pymysql “”” def __init__(self,host,user,pwd,db): self.host […]

  • Wechat applet encapsulates multiple pictures and uploads api code examples

    Time:2021-1-3

    This article mainly introduces the example of wechat applet encapsulating multiple pictures to upload api code. The example code is introduced in great detail, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it The code is as follows export default class Upload{ constructor(object) { this.obj […]

  • Implementation of universal encapsulation of Android MVP basefragment

    Time:2020-11-5

    This is the sixth article in our series on the basic MVP framework. Basemvp has been encapsulated by us almost. From the last article (Android MVP architecture (V) MVP multiple presenter dependency injection), we have solved the problem of multiple presenters. This is to dynamically instantiate different presenters by means of dependency injection and reflection […]

  • An example of encapsulation code for Java to return paging result set

    Time:2020-10-29

    This article mainly introduces the Java returns pagination result set encapsulation code example, the article through the example code introduction is very detailed, has certain reference study value to everybody’s study or the work, needs the friend may refer to The code is as follows package com.leyou.common; import java.util.List; public class PageResult<T> { Private long […]

  • IOS encapsulates the navigation bar and return to get the instance of the controller where the control is located

    Time:2020-9-29

    When a project finds that each return button is the same, and the font of the title is not the font of the system. If each page sets the return button and resets the font of the title, the code will look complicated and will waste a lot of time. At this time, it is […]

  • Instance code of IOS request permission encapsulation class

    Time:2020-8-3

    Upper direct code #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> #import <AssetsLibrary/AssetsLibrary.h> #import <Photos/Photos.h> #import <CoreLocation/CoreLocation.h> @interface PermissionUtil : NSObject +(Boolean)JudgeCameraPermission; +(Boolean)JudgeLocationPermission; @end #import “PermissionUtil.h” @implementation PermissionUtil +(BOOL)isCanUsePhotos { if ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0) { ALAuthorizationStatus author =[ALAssetsLibrary authorizationStatus]; if (author == kCLAuthorizationStatusRestricted || author == kCLAuthorizationStatusDenied) { //No permission return NO; } } else { […]

  • IOS local storage nsuserdefaults encapsulation code

    Time:2020-8-1

    Direct code #import <Foundation/Foundation.h> @interface NSUserDefaultUtil : NSObject +(void)PutDefaults:(NSString *)key Value:(id)value; +(id)GetDefaults:(NSString *)key; @end #import “NSUserDefaultUtil.h” @implementation NSUserDefaultUtil +(void)PutDefaults:(NSString *)key Value:(id)value{ if (key!=NULL&&value!=NULL) { NSUserDefaults *userDefaults=[NSUserDefaults standardUserDefaults]; [userDefaults setObject:value forKey:key]; } } +(id)GetDefaults:(NSString *)key{ NSUserDefaults *userDefaults=[NSUserDefaults standardUserDefaults]; id obj; if (key!=NULL) { obj=[userDefaults objectForKey:key]; } return obj; } @end usage method [NSUserDefaultUtil PutDefaults:@”key” Value:str]; self.str […]

  • Java data encapsulation tree structure code example

    Time:2020-7-7

    This article mainly introduces the Java data encapsulation tree structure code example, the article through the example code introduction is very detailed, has the certain reference study value to everybody’s study or the work, needs the friend may refer to 1. Entity class @data public class PublishServiceType implements Comparable<PublishServiceType>{ /** * */ private static final […]

  • The realization of the second encapsulation of flutter Dio

    Time:2020-4-17

    Catalog: Diomanager: DIO auxiliary class nwmethod: request method, get, post, etc Nwapi: as you all know Entityfactory: JSON conversion auxiliary factory, convert JSON to t Baseentity < T >: data base class. The returned parameters are {“code”: 0, “message”: “”, “data”: {}}} Baselistentity < T >: data base class 2, the returned parameter is {“code”: […]

  • A detailed explanation of the implementation method of Python underlying encapsulation

    Time:2020-3-25

    This article mainly introduces the implementation method of Python underlying encapsulation. The example code is introduced in detail in this article, which has a certain reference value for your study or work. You can refer to the following for your friends In fact, the implementation of Python encapsulation features is purely “opportunistic”. The reason why […]