Asp.net development of WeChat public platform (7) first 6 overall framework demo source code

Source: Internet
Author: User
The demo provided here is the source code of the public platform with the overall framework. The so-called demo is something that can be directly demonstrated in the past, of course, there won't be anything specific to the business and data layers. everyone can make full use of it on this basis. as long as you finish reading the first six articles, you will be able to develop your own things. The demo provided here is the source code of the public platform with the overall framework. The so-called demo is something that can be directly demonstrated in the past, of course, there won't be anything specific to the business and data layers. everyone can make full use of it on this basis. as long as you finish reading the first six articles, you will be able to develop your own things.

Demo is simple and easy to understand. anyone can understand it. here is the difference between demo and my actual project:

1. the demo is not connected to the database. You can directly download the demo and use it. it is not convenient for everyone to connect to the database. in article 1st, the entire database is open-source, including the visual interface during design and the database to be connected, after creating a database, add an EF connection. the connection method is described in Article 1.

2. the demo does not encapsulate the received message model. Because the purpose of the received message encapsulation is to record the message and add it to the database. since there is no 1 message, this is also absent. the Message Encapsulation article 3rd has been written;

3. the encrypted signature is not verified at the demo entrance. Because the demo can be used if anyone needs to retrieve it. if encryption signature verification is added, many people may fail to call it. for local testing, there is no encrypted signature for verification (in fact, the local test can return true directly ), for anyone to understand, the verification method is removed, and the code of the verification method is kept intact in the 2nd articles;

4. the demo is not related to IOC injection and cache. Not every business requirement needs to use cache and IOC injection, and not everyone has come into contact with this. for general purpose, this will be removed. If you encounter problems related to IOC injection and cache processing in other projects, you can ask me and I am happy to answer them.

Summary: The demo is a simple framework of a complete public platform and is suitable for any developer. the database related to the actual project needs to be used also has code and operation methods in the previous articles;

Based on the demo, anyone can quickly create their own public platforms.

The most important thing is to share the overall idea ~ The public platform is actually very simple. most people do not clarify the ins and outs of message receipt and processing, for these different cases, it may take a long time for many developers to clarify (it has nothing to do with technical capabilities, mainly because some friends cannot understand it all at once) and share the demo source code so that anyone can get started.

Public void LookMsgType (string msgType) {# region determines the message type switch (msgType) {case "text": RText mText = new RText (); mText = ReadXml. GetModel
 
  
(MText, xmlModel); BLLWei. DoText (dbHome, mText); // text message break; case "image": RImg mImg = new RImg (); mImg = ReadXml. GetModel
  
   
(MImg, xmlModel); BLLWei. doImg (dbHome, mImg); // Picture break; case "voice": // sound RVoice mVoice = new RVoice (); mVoice = ReadXml. getModel
   
    
(MVoice, xmlModel); BLLWei. DoVoice (dbHome, mVoice); break; case "video": // video RVideo mVideo = new RVideo (); mVideo = ReadXml. GetModel
    
     
(MVideo, xmlModel); BLLWei. DoVideo (dbHome, mVideo); break; case "location": // geographical location RLocation mLocation = new RLocation (); mLocation = ReadXml. GetModel
     
      
(MLocation, xmlModel); BLLWei. DoLocation (dbHome, mLocation); break; case "link": // link RLink mLink = new RLink (); mLink = ReadXml. GetModel
      
        (MLink, xmlModel); BLLWei. doLink (dbHome, mLink); break; # region event case "event": switch (ReadXml. readModel ("Event", xmlModel) {case "subscribe": if (ReadXml. readModel ("EventKey", xmlModel ). indexOf ("qrscene _")> = 0) {RCodeNotSub mNotSub = new RCodeNotSub (); mNotSub = ReadXml. getModel
       
         (MNotSub, xmlModel); BLLWei. doCodeNotSub (dbHome, mNotSub); // for new users who have not followed, scan the QR code with parameters to follow} else {RSub mSub = new RSub (); mSub = ReadXml. getModel
        
          (MSub, xmlModel); BLLWei. DoSub (dbHome, mSub); // normal follow} break; case "unsubscribe": RUnsub mUnSub = new RUnsub (); mUnSub = ReadXml. GetModel
         
           (MUnSub, xmlModel); BLLWei. DoUnSub (dbHome, mUnSub); // cancel follow break; case "SCAN": RCodeSub mCodeSub = new RCodeSub (); mCodeSub = ReadXml. GetModel
          
            (MCodeSub, xmlModel); BLLWei. doCodeSub (dbHome, mCodeSub); // The user who has followed the scan for the two-dimensional code break with parameters; case "LOCATION": // The user reports the geographical LOCATION RSubLocation mSubLoc = new RSubLocation (); mSubLoc = ReadXml. getModel
           
             (MSubLoc, xmlModel); BLLWei. doSubLocation (dbHome, mSubLoc); break; case "CLICK": // CLICK RMenuClick mMenuClk = new RMenuClick () in the custom menu; mMenuClk = ReadXml. getModel
            
              (MMenuClk, xmlModel); BLLWei. doMenuClick (dbHome, mMenuClk); break; case "VIEW": // custom menu jump event RMenuView mMenuVw = new RMenuView (); mMenuVw = ReadXml. getModel
             
               (MMenuVw, xmlModel); BLLWei. DoMenuView (dbHome, mMenuVw); break ;}; break ;# endregion }# endregion}
             
            
           
          
         
        
       
      
     
    
   
  
 

In the future, I will write articles and share the process. I only want to share the development history. you can see that all my articles have dropped the numbers, names, and so on, although no user's general number is used for testing when writing an article.


For more articles on the overall framework demo source code of the first 6 articles on the public platform for asp.net development (7), please follow the PHP Chinese network!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.