예제 #1
0
 def add_card(self):
     args = request.args.to_dict()
     print args
     if "openid" not in args:
         return PARAMS_MISS
     data = json.loads(request.data)
     print data
     if "Cname" not in data:
         return {"status": 405, "status_code": 405900, "message": "请填写姓名"}
     if "Ctelphone" not in data:
         return {"status": 405, "status_code": 405901, "message": "请填写联系方式"}
     if "Ccompany" not in data:
         return {"status": 405, "status_code": 405902, "message": "请填写公司名称"}
     if "Cposition" not in data:
         return {"status": 405, "status_code": 405903, "message": "请输入职位"}
     if "Clocation" not in data:
         return {"status": 405, "status_code": 405904, "message": "请选择公司地址"}
     Cid = str(uuid.uuid1())
     add_model(
         "Cards", **{
             "Cid": Cid,
             "Cname": data["Cname"],
             "Ctelphone": data["Ctelphone"],
             "Ccompany": data["Ccompany"],
             "Cposition": data["Cposition"],
             "Clocation": data["Clocation"],
             "openid": args["openid"]
         })
     return {"status": 200, "message": "OK", "data": {"Cid": Cid}}
예제 #2
0
 def add_product(self, pid):
     try:
         add_model(
             "Products", **{
                 "PRid": pid[0],
                 "PRname": "美妆镜",
                 "PRvideo": "http://123.207.97.185:7444/imgs/product.mp4",
                 "PRinfo": "测试数据",
                 "PRtype": 501,
                 "PRbrand": 601
             })
     except Exception as e:
         print e.message
예제 #3
0
 def add_orderpart(self, omid_list):
     try:
         i = 0
         while i < 7:
             add_model(
                 "Orderpart", **{
                     "OPid": str(uuid.uuid4()),
                     "OMid": omid_list[i],
                     "PBid": "0ca15394-593f-424f-b04d-da1bd2648236",
                     "PRnumber": 1
                 })
             i = i + 1
     except Exception as e:
         print e.message
예제 #4
0
 def add_cardpackage(self, coid):
     try:
         add_model(
             "Cardpackage", **{
                 "CAid": str(uuid.uuid4()),
                 "USid": "de98529f-b1f0-4fd6-8908-8b7d522d22c6",
                 "CAstatus": 1,
                 "COid": coid[0]
             })
         add_model(
             "Cardpackage", **{
                 "CAid": str(uuid.uuid4()),
                 "USid": "de98529f-b1f0-4fd6-8908-8b7d522d22c6",
                 "CAstatus": 1,
                 "COid": coid[1]
             })
         add_model(
             "Cardpackage", **{
                 "CAid": str(uuid.uuid4()),
                 "USid": "de98529f-b1f0-4fd6-8908-8b7d522d22c6",
                 "CAstatus": 1,
                 "COid": coid[2]
             })
         add_model(
             "Cardpackage", **{
                 "CAid": str(uuid.uuid4()),
                 "USid": "de98529f-b1f0-4fd6-8908-8b7d522d22c6",
                 "CAstatus": 1,
                 "COid": coid[3]
             })
     except Exception as e:
         print e.message
예제 #5
0
 def add_user(self, uid):
     try:
         add_model(
             "Users", **{
                 "USid": uid,
                 "UStelphone": "11111111111",
                 "USpassword": "******",
                 "USname": "测试账号",
                 "USsex": 101,
                 "UScoin": 100.1,
                 "USinvate": "ETECH007"
             })
     except Exception as e:
         print e.message
예제 #6
0
 def add_ordermain(self, omid_list):
     try:
         i = 0
         while i < 7:
             add_model(
                 "OrderMain", **{
                     "OMid": omid_list[i],
                     "OMtime": "20180524143253",
                     "OMstatus": 7,
                     "OMprice": 0.01,
                     "USid": "de98529f-b1f0-4fd6-8908-8b7d522d22c6",
                     "LOid": "ac988611-aed8-4c16-9f5e-eda6b772f152",
                     "OMabo": "test pay",
                     "OMcointype": 402,
                     "COid": None
                 })
             i = i + 1
     except Exception as e:
         print e.message
예제 #7
0
 def add_cart(self, uid, pbid):
     try:
         add_model(
             "Cart", **{
                 "CAid": str(uuid.uuid4()),
                 "USid": uid,
                 "PBid": pbid[2],
                 "CAnumber": 2,
                 "CAstatus": 1
             })
         add_model(
             "Cart", **{
                 "CAid": str(uuid.uuid4()),
                 "USid": uid,
                 "PBid": pbid[3],
                 "CAnumber": 5,
                 "CAstatus": 1
             })
         add_model(
             "Cart", **{
                 "CAid": str(uuid.uuid4()),
                 "USid": uid,
                 "PBid": pbid[0],
                 "CAnumber": 1,
                 "CAstatus": 2
             })
     except Exception as e:
         print e.message
예제 #8
0
 def add_coupons(self, coid):
     try:
         add_model(
             "Coupons", **{
                 "COid": coid[0],
                 "COfilter": 100.99,
                 "COamount": 10,
                 "COstart": "20180517000000",
                 "COend": "20180520000000",
                 "COtype": 801
             })
         add_model(
             "Coupons", **{
                 "COid": coid[1],
                 "COfilter": 100.99,
                 "COdiscount": 0.5,
                 "COstart": "20180517000000",
                 "COend": "20180520000000",
                 "COtype": 802
             })
         add_model(
             "Coupons", **{
                 "COid": coid[2],
                 "CObrand": "美妆类",
                 "COamount": 10,
                 "COstart": "20180517000000",
                 "COend": "20180520000000",
                 "COtype": 803
             })
         add_model(
             "Coupons", **{
                 "COid": coid[3],
                 "COamount": 10,
                 "COstart": "20180517000000",
                 "COend": "20180520000000",
                 "COtype": 804
             })
     except Exception as e:
         print e.message
예제 #9
0
 def add_brand(self, brid):
     try:
         add_model(
             "Brands", **{
                 "BRid": brid[0],
                 "BRfromid": "0",
                 "BRkey": "BRno",
                 "BRvalue": "1.0"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[1],
                 "BRfromid": "0",
                 "BRkey": "BRno",
                 "BRvalue": "2.0"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[2],
                 "BRfromid": brid[0],
                 "BRkey": "BRcolor",
                 "BRvalue": "红色"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[3],
                 "BRfromid": brid[0],
                 "BRkey": "BRcolor",
                 "BRvalue": "白色"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[4],
                 "BRfromid": brid[0],
                 "BRkey": "BRcolor",
                 "BRvalue": "灰色"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[5],
                 "BRfromid": brid[0],
                 "BRkey": "BRcolor",
                 "BRvalue": "紫色"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[6],
                 "BRfromid": brid[1],
                 "BRkey": "BRcolor",
                 "BRvalue": "红色"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[7],
                 "BRfromid": brid[1],
                 "BRkey": "BRcolor",
                 "BRvalue": "金色"
             })
         add_model(
             "Brands", **{
                 "BRid": brid[8],
                 "BRfromid": brid[1],
                 "BRkey": "BRcolor",
                 "BRvalue": "蓝色"
             })
     except Exception as e:
         print e.message
예제 #10
0
 def add_productbrand(self, pbid, pid, brid):
     try:
         add_model(
             "ProductsBrands", **{
                 "PBid": pbid[0],
                 "PRid": pid[0],
                 "BRid": brid[2],
                 "PBprice": 199.99,
                 "PBunit": 402,
                 "PBstatus": 201,
                 "PBsalesvolume": 105,
                 "PBscore": 4.9,
                 "PBimage": "https://h878.cn/imgs/timg.jpg"
             })
         add_model(
             "ProductsBrands", **{
                 "PBid": pbid[1],
                 "PRid": pid[0],
                 "BRid": brid[3],
                 "PBprice": 199.99,
                 "PBunit": 402,
                 "PBstatus": 201,
                 "PBsalesvolume": 105,
                 "PBscore": 4.9,
                 "PBimage": "https://h878.cn/imgs/timg.jpg"
             })
         add_model(
             "ProductsBrands", **{
                 "PBid": pbid[2],
                 "PRid": pid[0],
                 "BRid": brid[4],
                 "PBprice": 199.99,
                 "PBunit": 402,
                 "PBstatus": 201,
                 "PBsalesvolume": 105,
                 "PBscore": 4.9,
                 "PBimage": "https://h878.cn/imgs/timg.jpg"
             })
         add_model(
             "ProductsBrands", **{
                 "PBid": pbid[3],
                 "PRid": pid[0],
                 "BRid": brid[5],
                 "PBprice": 199.99,
                 "PBunit": 402,
                 "PBstatus": 201,
                 "PBsalesvolume": 105,
                 "PBscore": 4.9,
                 "PBimage": "https://h878.cn/imgs/timg.jpg"
             })
         add_model(
             "ProductsBrands", **{
                 "PBid": pbid[4],
                 "PRid": pid[0],
                 "BRid": brid[6],
                 "PBprice": 199.99,
                 "PBunit": 402,
                 "PBstatus": 201,
                 "PBsalesvolume": 105,
                 "PBscore": 4.9,
                 "PBimage": "https://h878.cn/imgs/timg.jpg"
             })
         add_model(
             "ProductsBrands", **{
                 "PBid": pbid[5],
                 "PRid": pid[0],
                 "BRid": brid[7],
                 "PBprice": 199.99,
                 "PBunit": 402,
                 "PBstatus": 201,
                 "PBsalesvolume": 105,
                 "PBscore": 4.9,
                 "PBimage": "https://h878.cn/imgs/timg.jpg"
             })
         add_model(
             "ProductsBrands", **{
                 "PBid": pbid[6],
                 "PRid": pid[0],
                 "BRid": brid[8],
                 "PBprice": 199.99,
                 "PBunit": 402,
                 "PBstatus": 201,
                 "PBsalesvolume": 105,
                 "PBscore": 4.9,
                 "PBimage": "https://h878.cn/imgs/timg.jpg"
             })
     except Exception as e:
         print e.message