Home  >  Article  >  Backend Development  >  First experience in writing App interface

First experience in writing App interface

WBOY
WBOYOriginal
2016-08-08 09:22:20971browse

The leader gave me a task, asking me to collaborate with IOS and Android to create an app 4.0 version for the mobile version of the platform. I had never written an interface before, so it was a bit confusing to get it.

Later, I asked my seniors for advice and slowly wrote a little bit. I basically mastered the handover rules in one day. The most difficult part was the debugging part, because it was also secondary development, and I was not very familiar with some functions before. So there was a lot of stumbling along the way, but after leaving, I finally got through it and got online. This time Redis and Memcache are mainly used. Although I have seen Redis, actually using it is another matter. Let me give you a few examples:

1. It is the problem of passing values ​​​​in Redis,
          $redis = new Redis();
        $redis->set ("test".$user['id'],$packet_token);

But when fetching it

$redid = $redis->get("test".$user['id']);

The reason why 到 cannot be worth the value is that Redis does not set an expiration time. When assigning, add $ redis-& gt; set2 ("user". );

2. Redis queue blocking situation

When testing the app, redis has various blocking and various error logs. For simple blocking, just click the queue (execute the script):

#!/bin/bash

                                                                                                                                                                                                                                    out

        supervisorctl restart all


                                                                         surprise surprise attended then the
    then bug surprise, then surprise field then THE THE SET PLACE THE REASON AS THE TUTT PLACE BEEN THE TURN BEWARE EXCEPTION time then been done then been
It took me half a day:

The reason is that there is a field uniqueness constraint in the table. The value stored in redis should be of list type, but the string type was passed due to an error. Just clear the changed table data and restart redis.

3. It was finally online, but in the end the redemption amount could not be redeemed

Because each account has an account lock, the user cannot click continuously because it is multiple redemptions, but the account lock is added to a single redemption on, so just add the account lock to multiple redemptions.

The above introduces the experience of writing an App interface for the first time, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Nginx: Beginner’s GuideNext article:Nginx: Beginner’s Guide