XZ:.NET Core develops e-commerce backend API from 0 to thoroughly understand RESTful

As the separation of the front and back ends has become the mainstream of the market, it has become a consensus in the industry to use RESTful style to build enterprise applications, but the recognition and development ability of RESTful style in the market is uneven. Through the development of “MOOCs Travel network” project, this course will lead you to understand the RESTful thought and truly master the development skills of RESTful API at the level of high maturity (HATEOAS hypermedia engine). The course project adopts the.net Core framework, which is popular in the technology market for its open source, lightweight and cross-platform advantages. It is a popular technical framework which is extremely suitable for the back-end development of the website.

Suitable for the crowd to aspire to the ultimate RESTful style development; For.net Core at the beginning of the development of students interested in, or reserve requirements of technology of intermediate programmers are familiar with basic grammar package c # com. Chengxinet. Bobo. Utils; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.telephony.TelephonyManager; / * *

  • Created by Administrator on 2016/1/7.

    * /

    public class NetworkUtils {

    public static boolean isNetworkAvailable(Context c) {

    Context context = c.getApplicationContext();

    // Obtain all connection management objects of mobile phones (including wi-fi, NET and other connection management)

    ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

    if (connectivityManager == null) {

    return false;

    } else {

    // Get the NetworkInfo object

    NetworkInfo[] networkInfo = connectivityManager.getAllNetworkInfo();

    if (networkInfo ! = null && networkInfo.length > 0) {

    for (NetworkInfo aNetworkInfo : networkInfo) {

    / / System. Out. Println (I + “state = = = = = =” + networkInfo [I] getState ());

    / / System. Out. Println (I + “type = = = = = =” + networkInfo [I] getTypeName ());

    // Check whether the current network state is connected

    if (aNetworkInfo.getState() == NetworkInfo.State.CONNECTED) {

    return true;

    }

    }

    }

    }

    return false;

    }

    / * *
    • Check whether WIFI can be turned on
    • @param context
    • @return */ public static boolean isWifiEnabled(Context context) { ConnectivityManager mgrConn = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); TelephonyManager mgrTel = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); return ((mgrConn.getActiveNetworkInfo() ! = null && mgrConn .getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED) || mgrTel .getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS); } / * *
    • See if it’s a 3G network
    • @param context
    • @return */ public static boolean is3rd(Context context) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkINfo = cm.getActiveNetworkInfo(); if (networkINfo ! = null && networkINfo.getType() == ConnectivityManager.TYPE_MOBILE) { return true; } return false; } / * *
    • Check whether it’s wifi or 3G
    • @param context
    • @return */ public static boolean isWifi(Context context) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkINfo = cm.getActiveNetworkInfo(); if (networkINfo ! = null && networkINfo.getType() == ConnectivityManager.TYPE_WIFI) { return true; } return false;