622 lines
24 KiB
Plaintext
622 lines
24 KiB
Plaintext
Documentation of cma
|
|
----------------------
|
|
|
|
//api response
|
|
otp section
|
|
1 - message sent
|
|
2 - verified
|
|
3 - error in verification
|
|
4 - resend
|
|
--------------------------
|
|
//status in register (plan detail)
|
|
|
|
|
|
0 - Plan not activate
|
|
1 - Trial Plan used
|
|
2 - Plan active(market or trial)
|
|
------------------------
|
|
//plantype in register
|
|
0 - No plan select
|
|
1 - trial plan
|
|
2 - market
|
|
--------------------
|
|
JsonWebToken (sign,verify) methods
|
|
|
|
This is generated when user verify the otp...then check each and every process there is any unmatched data
|
|
|
|
|
|
----------------
|
|
BUY & SELL status
|
|
------------
|
|
0-deleted
|
|
1-request
|
|
2-completed
|
|
3.expired
|
|
|
|
//=================================API Document===========================
|
|
1. GetOTP(POST)
|
|
===========
|
|
-->Send mobilenumber and countrycode in POST method using getOtp link
|
|
-->get mobilenumber and countrycode from application
|
|
-->check mobilenumber exist or not
|
|
-->if exist means
|
|
-->send to msg91 with mobilenumber and otp, get response from msg91
|
|
-->final result sent as response
|
|
-->not exist means insert mobilenumber and countrycode in register table
|
|
-->final result sent as response
|
|
|
|
2. VerifyOTP(POST)
|
|
============
|
|
-->send mobilenumber and otp as base64encode and devicetype,devicetoken,deviceid as normal value in POST method using verifyOtp link
|
|
-->get mobilenumber and otp as base64 decodemethod and also get devicetype,devicetoken,deviceidfrom application
|
|
-->send to msg91 with mobilenumber and otp, get response from msg91
|
|
-->final result sent as response
|
|
-->check that response is seccess or error
|
|
-->Get userid from select query by using mobile number
|
|
-->if success means update those values into register table by using userId and generate jwttoken also
|
|
-->not success means show error
|
|
|
|
3.ResendOTP(POST)
|
|
===========
|
|
-->Send mobilenumber in POST method using resendOtp link
|
|
-->get mobilenumber and countrycode from application
|
|
-->Get counrtycode from select query by using mobile number
|
|
-->send to msg91 with mobilenumber and get response from msg91
|
|
-->final result sent as response
|
|
|
|
4.Listplans(GET)
|
|
==========
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->check trial_status is 0 or 1 in register table (trial_status from select query of userid & deviceid)
|
|
-->if 0 means show all palns in plan table
|
|
-->sent code is 1 for success & message & result
|
|
-->if 1 means show plans without trial plan
|
|
-->sent code is 1 for success & message & result
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
5.SubscribePlan(POST)
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->get mobile and plan from application also get plan table all details using select query
|
|
-->check there is any match from select query of planid and given request plan id
|
|
-->if match
|
|
-->get usertype(1-free,0-payment) is 1 or 0
|
|
-->if 1 this is free plan
|
|
-->update details trial-status=1,status=2(activeplan),plan_type=1,startdate,enddate with 7days(dynamically get days from above select query) perid in register table by using mobilenumber
|
|
-->if 0 means this is paid plan
|
|
-->update details status=2(activeplan),plan_type=2(dynamic),startdate,enddate with 365days(dynamically get days from above select query) perid in register table by using mobilenumber
|
|
-->sent code is 1 for success & message & planid
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
6.Listnews(GET)
|
|
==========
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select news from news table with desc order and status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
7.Listcategories(GET)
|
|
================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select category from category table with status=1 & using these category id get marketcount from market_product table
|
|
-->sent all data to async method to get result from single object data
|
|
-->after get result , sent code 1 for success & message
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
8.Listmarkets(GET)
|
|
============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select needed details
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
9.Categorydetails(/categoryId(GET))
|
|
=================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from product table by using categoryId with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent all data to async method to get result from single object data
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
10.Total items from market count(this week (GET))
|
|
=========================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from product_price table by using thisweek data(7days intervel) with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
11.Recent News count(This week (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from news table by using thisweek data(7days intervel) with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
12. Statewise product with price(productId(GET)
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from market and state table with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->pass that productid into productprice table and select needed data and using async method to join two query objects
|
|
-->receive query and sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
13.News category(This week (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from newscategory table with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
14.This Week news filter(This week (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from news table by using thisweek data(7days intervel) with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
14.Next week news filter(This week (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from news table by using nextweek data(7days intervel) with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
15.Last month news filter(This week (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from news table by using lastmonth data(30days intervel) with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
16.Custom range news filter(startdate ,enddate (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from news table by using passing start date and end date with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
17.List particular news category(NewscategoryId (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from newscategory table by using NewscategoryId with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
18.List particular news (NewsId (GET))
|
|
==============
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from newstable by using NewsId with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
19.Weekly price graph(marketid,productid(GET)
|
|
===================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from product_price by using marketid,productid with status=1 with(weekly intervals)
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
20.monthly price graph(marketid,productid(GET)
|
|
===================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from product_price by using marketid,productid with status=1 with(monthly intervals)
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
20.statewise price graph(stateid,productid(GET)
|
|
===================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from product_price by using stateid,productid with status=1
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
22.View user profile (GET)
|
|
===================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from register by using userId with join of pincodes,plans also
|
|
-->check there is any match from select query
|
|
-->if match
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
23.Edit user profile((GET)
|
|
==================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->get details from get method and post location,email,name into register table
|
|
-->check there is any match from select query
|
|
-->if updated
|
|
-->sent code 1 for success & message
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
24.Get location by using pincode(GET)
|
|
==================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->hit select query by using pincode
|
|
-->check there is any match from select query (like query)
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
25.Get location by using region(GET)
|
|
==================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->hit select query by using region name (like query)
|
|
-->check there is any match from select query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
|
|
===================================================================================
|
|
======/////BUY & SELL
|
|
==================================================================================
|
|
//1.List all buy sell product category (GET)
|
|
=====================================
|
|
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all category from buysell_category
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//2.seller products to buyer screeen(GET)
|
|
==========================================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from seller_products and use join query for all detail
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
3.//particular seller products to buyer screeen using categoryId(GET)
|
|
=================================================================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from seller_products and use join query for all detail with category id
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//4.buy filters(GET)
|
|
=====================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from seller_products and use join query for all detail with productId,area,qtyFrom,qtyTo,priceFrom,priceTo
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//5.particular product to buyer using primaryID(GET)
|
|
===============================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from seller_products and use join query for all detail with primaryID(id) in table
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//6.particular product images to buyer using primaryID(GET)
|
|
===============================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from seller_product_image with primaryID(id) from seller_products table & seller_product_primary_id in seller_product_image table
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//7.add buyer products(POST)
|
|
============================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->Insert all details in buyer_products table (categoryId,productId,qty,unitId,pricePerUnit,area,validDate,about,sessionid)
|
|
-->check there is any data from query
|
|
-->if inserted
|
|
-->sent code 1 for success & message
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//8.myrequest Page for buyer(GET)
|
|
======================================
|
|
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->get all details from buyer_products table using join query to get needed details
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//9.Change completed and deleted (PUT)
|
|
======================================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->change status from buyer_products table using with status 0 for delete & 2 for completed & 3 for expired
|
|
|
|
-->if changed
|
|
-->sent code 1 for success & message
|
|
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//10.edit myrequest(PUT)
|
|
=========================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->update edited details in buyer_products table using primaryId
|
|
|
|
-->if updated
|
|
-->sent code 1 for success & message
|
|
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
|
|
//1.Buyer products to seller screeen(GET)
|
|
==========================================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from buyer_products and use join query for all detail
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
3.//particular buyer products to seller screeen using categoryId(GET)
|
|
=================================================================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from buyer_products and use join query for all detail with category id
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//4.sell filters(GET)
|
|
=====================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from buyer_products and use join query for all detail with productId,area,qtyFrom,qtyTo,priceFrom,priceTo
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//5.particular product to seller using primaryID(GET)
|
|
===============================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->select all details from buyer_products and use join query for all detail with primaryID(id) in table
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
|
|
//7.add seller products(POST)
|
|
============================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->Insert all details in seller_products table (categoryId,productId,qty,unitId,pricePerUnit,area,validDate,about,sessionid)
|
|
-->check there is any data from query
|
|
-->if inserted
|
|
-->sent code 1 for success & message
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//7.add Images of seller products(POST)
|
|
============================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->Insert all details in seller_product_images table (productImages,sessionid)
|
|
-->check there is any data from query
|
|
-->if inserted
|
|
-->sent code 1 for success & message
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
|
|
//8.myrequest Page for seller(GET)
|
|
======================================
|
|
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->get all details from seller_products table using join query to get needed details
|
|
-->check there is any data from query
|
|
-->if yes
|
|
-->sent code 1 for success & message
|
|
-->if no
|
|
-->sent code 0 for no data & message
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//9.Change completed and deleted (PUT)
|
|
======================================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->change status from seller_products table using with status 0 for delete & 2 for completed & 3 for expired
|
|
|
|
-->if changed
|
|
-->sent code 1 for success & message
|
|
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
//10.edit myrequest for seller(PUT)
|
|
=========================
|
|
-->using mobile,userid and deviceid we have to check json web token matched or not...
|
|
-->if yes
|
|
-->update edited details in buyer_products table using primaryId
|
|
|
|
-->if updated
|
|
-->sent code 1 for success & message
|
|
|
|
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|