A small system design

xiaoxiao2021-03-06  41

Design of database tables: library name x2mail1. Mobile Type Adapter Table: Table Name X2_MAIL_ADA

Because when sending to the user's XX letter, you need to know what kind of ringtones and how big size pictures are supported, so you need a such ua adapter table: AutoID Int, unique index, self-increment) USER_AGENT VARCHAR (UA information, can not be empty) IMG_TYPE_ID INT (Take the Picture Adapted to Number of UA) IMG_KIND_ID INT (UA) IMG_KIND_ID INT (Picture Type Adapter of UA is temporarily negotiating) Note: 1 - only supports PNG 2- only supports JPG 3-PNG, JPG supports Ring_TYPE_ID INT (UA's adapter ringtone type, from the album type list) enable_flag boolean (whether the phone type is launched, default is true TRUE )

Temp_int int in TEMP_VC VARCHAR (Alternate Field, VARCHAR) TEMP_B BOOLEAN (Alternate Field, Boolean) This table requires manual input, first enter a UA, then get the picture size and ringtone adapted from other ways The type is again from the Rouchang list, get the ID number that complies with the mobile phone and the ringtone adapted, then fill in 2. Ring Type list: Table name x2_mail_type

AutoID int (primary key, unique index, self-increment) Object_type varchar (Figure, or ring) PIC Ring Type_desc varchar (this UA adapter Ruver Description: Figure: Size Bell: Type) 130x140 MID40 TYPE_ID INT Manually enter enable_flag boolean (whether to enable the label, the default is true) TEMP_INT INT INT TEMP_VC VARCHAR (Alternate Field, VARCHAR) TEMP_B BOOLEAN (Alternate Field, Boolean) The above two tables are entered, Basically, a static reference table unless new UA needs to add and adapt

3. Ruver Resource Table: Table Name X2_MAIL_SRC

AutoID Int, Single Index, Self-added) UPLOAD_DATE VARCHAR (Tuvering Time Tuzu URL Address) Object_path varchar (Bell Physical Address) Object_name_CN VARCHAR (Ring Bell Chinese Name) Object_name_EN VARCHAR (Ring Bell English Name) Object_Desc Varchar (Ring Bell Description) DIR_F INT DIR_S INT (this Raw Bell Column ID)

Enable_flag boolean (Whether to enable the indicator, default is true)

TEMP_INT INT INT TEMP_VC VARCHAR (Alternate Field, VARCHAR) TEMP_B BOOLEAN (Alternate Field, Boolean) This table is manually added, mainly a reference table 4. Product Blocking Classification Table: Table name x2_mail_dir

AutoID int (primary key, unique index, self-increment) DIR_F INT DIR_S INT DIR_NAME VARCHAR (Column Name) DIR_DESC VARCHAR (Column Description) Product_ID INT (If it is online product, here is the product service code , Default is empty) Product_send_date varchar (product delivery time setting, must first define time) online_flag boolean (Whether to go online, default is false) enable_flag boolean (whether the flag is launched, default is TRUE) TEMP_INT INT Field, int) TEMP_VC VARCHAR (Alternate Field, VARCHAR) TEMP_B BOOLEAN (Alternate Field, Boolean) 5. User Destination Table: Table Name X2_MAIL_ORDER AutoID INT (Primary Key, Unique Index, Self - increment) USER_MOBILE_ID VARCHAR (User Mobile Number) USER_MOBILE_UA VARCHAR ( User_Status Int (User Ordering Status, Ordering? Affairs User_Date VARCHAR (User Ordering Or Quick Date) User_Status_Date INT (User Ordering Status, 1: Delivery this month, and return, or have to send this Month 2: This month is represented) Product_ID INT (this order or quilt)

Enable_flag boolean (whether the user enables the label, the default is false, after the polling finds the new user, determine if it is a new order user this month, send him a confirmation information message, then set the FLAG True if The order field user_status sets the set state, set this field to flash.

TEMP_INT INT TEMP_VC VARCHAR (Alternate Field, VARCHAR) TEMP_B BOOLEAN (Alternate Field, Boolean) 6. XX Product Send Information Table: Table Name X2_MAIL_CONTENT AutoID INT (Primary Key, Unique Index, Spend)

Mail_Type Varchar (Letter Product Type, Map, or Bell, or Consulting Pic Ring, etc.) Title Varchar (Genuine Title, from the background) Body varchar (letter, from the background) Send_date varchar (Letter Send Date) DIR_F INT Letter belongs to the master ID) DIR_S INT Send_Flag Boolean (whether the letter has been sent, default is false) enable_flag boolean (the letter is launched, the default is true)

Temp_int int temp_vc varchar (alternate field, varchar) Temp_b Boolean (standby field, boolean) ************************** *********************************************************** *********************************************************** *********************************************************** ******************

Class design:

-------------------------------------------------- ------------------------------------------- because there is no XX business The XX business process is not clear at all, so deal with the business process and order specification of the download class: -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- --------------- Because there is no XX related document ..... so all exploits it ... Based on guess demand, if a user orders a certain After the business, it will receive the order information of the connected transmission in about 10 minutes. You must process the new user's business in a very fast time, and send a confirmation of the purchase of the purchase service, and then place the user in the order relationship table, follow The user ordering service stores its information and sends its order information. ****** Timed monitoring query class ****** Timed (every five minutes) Monitor and query database tables: User purchase table: Table name x2_mail_order judge the record, polling all records, frequent database operations And the efficiency is not high, but now you can only do this: mainly judgment all records: enable_flag This user enables the label, default is false, after the polling finds the new user, if it is the new order user this month, Then send him a confirmation information message, then set the FLAG to True. This class will be placed once every 10 minutes in crontab, performing a new user confirmation information processing public class usercheckstatus () {private string user_mobile; // user mobile phone Number Private String User_Product_ID; // User Order Service Code Public Void Judge_user_status () {// Rounded Database To get all order relationships as true users, and judge enable_flag, if you send a confirmation message to users if Flase, //. . . . . . For (int i = 0; i

Remove all of the user's basic solid state information in the user ordering table in the database and initialize it to a class variable ... Moreover, according to the product, the product is dynamically obtained from the library, now only three Product, all three categories ... All solid information to which the purchase user needs to be obtained into a memory object, and then call some of the dynamic information required to fill the user to order the user order. When the bell address and mail content, the user-type entity object is filled into a class container, and can be divided into different types of containers in accordance with the product ID of the entity for call. . . . . . However, since the class container cannot be dynamically generated, it can only be classified and distributed in linear. . . . . . Public class usrinfo () {private string user_mobile; // User mobile phone number private string user_mobile_ua; // user mobile phone ua private string user_type; // User order Product Type: Download Figure, Bell, or browse consultation private string user_adapte_type_id; / / User This phone adapts, bell Suitable number private string type_desc; // User This phone adapts Tuzuzing Description, such as PNG Picture 128 * 128, Ring MID40 Private String User_Status; // User Order Status , Subscription? Quick; // user order product (column) ID private string Dir_name; // column name Private string Dir_Desc; // Column Description Private string product_send_date; // Product delivery time Set private string. . . . . . ; / Wait Public Void Inituser (necessary initialization parameters) {// get all the user field information from the library, and store it to place in the class container} ------------ -------------------------------------------------- ------------------------------ ****** User Container Management Class ****** This class The container object stores all kinds of physical objects, and then the product mail delivery class will extract the type entity object information, according to the product classification, now you can't implement the class container object to dynamically generate, and then fill in the product entity Objects can only be cooked in one pot and then sends a product ID before sending all kinds of objects in the class container. . . . . .

转载请注明原文地址:https://www.9cbs.com/read-63176.html

New Post(0)