365 lines
14 KiB
Plaintext
365 lines
14 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
|
|
|
|
|
|
----------------
|
|
|
|
|
|
//=================================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 2 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.24.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 2 for no data & message
|
|
-->if no
|
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
|
|
|
|
|
|
|
|
|
|