Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
773a02d
del what will be del
picasso250 Dec 5, 2012
7b96be2
add basic framework to modify
picasso250 Dec 5, 2012
5009eef
del files not needed any more
picasso250 Dec 5, 2012
c66e27b
mv autoloader to app.php
picasso250 Dec 5, 2012
e00eaa5
excute logic
picasso250 Dec 5, 2012
d2a4642
add basic controller
picasso250 Dec 5, 2012
09ac12e
render view
picasso250 Dec 5, 2012
ac46109
add class User
picasso250 Dec 5, 2012
3c5e969
d
picasso250 Dec 5, 2012
374a291
...
picasso250 Dec 5, 2012
449d3d6
...
picasso250 Dec 5, 2012
6fb0ebf
prepare for sae
picasso250 Dec 5, 2012
fc2d330
rm things we don't need
picasso250 Dec 5, 2012
66e4928
build db structure
picasso250 Dec 5, 2012
d6be249
rm not needed code
picasso250 Dec 5, 2012
acab4a3
add action target file execution
picasso250 Dec 5, 2012
098661d
add shop image
picasso250 Dec 5, 2012
60bdaa5
test ok
picasso250 Dec 6, 2012
1ff379b
test more elegent
picasso250 Dec 6, 2012
427cbb9
ignore mac
picasso250 Dec 6, 2012
2239aae
merge
picasso250 Dec 6, 2012
a462aa8
jjj
picasso250 Dec 6, 2012
6db54cd
del code
picasso250 Dec 6, 2012
ab71e62
add default data
picasso250 Dec 6, 2012
ae3dc4b
defalut data ==> example data
picasso250 Dec 6, 2012
082b172
m
picasso250 Dec 6, 2012
cb2465c
add default category data insertion
picasso250 Dec 6, 2012
f978b46
install ok
picasso250 Dec 6, 2012
6354644
test ok
picasso250 Dec 6, 2012
fc40bf5
test ok
picasso250 Dec 6, 2012
4d48ec9
c
picasso250 Dec 6, 2012
73abeb8
xxx
picasso250 Dec 7, 2012
9b21cce
f
picasso250 Dec 7, 2012
d37d99c
big category ok
picasso250 Dec 8, 2012
27fa4de
add kind to big category
picasso250 Dec 8, 2012
e65c127
doing big category
picasso250 Dec 8, 2012
dddff9e
big category ok
picasso250 Dec 8, 2012
7a7635b
error handle
picasso250 Dec 8, 2012
23a77ca
output_json ==> output_data
picasso250 Dec 8, 2012
697ac4b
change http staus code when error
picasso250 Dec 8, 2012
1b6121f
category ok
picasso250 Dec 8, 2012
ff454ea
fix shop kind
picasso250 Dec 8, 2012
9265b9f
shop list ok
picasso250 Dec 8, 2012
b50daab
add province ok
picasso250 Dec 8, 2012
74fd67b
all 3 test cases ok
picasso250 Dec 8, 2012
5529b2b
add shop ok
picasso250 Dec 8, 2012
3be81a3
search db cond
picasso250 Dec 8, 2012
931ac76
update
picasso250 Dec 10, 2012
effff84
give args
picasso250 Dec 10, 2012
36c86b0
shop list ok
picasso250 Dec 10, 2012
bc77d01
dos2unix
picasso250 Dec 10, 2012
b033793
enlarge latitude and longitude
picasso250 Dec 10, 2012
1b167c3
..
picasso250 Dec 10, 2012
a32a71c
test ok
picasso250 Dec 10, 2012
6a65762
add 3 tables
picasso250 Dec 10, 2012
157ad0f
test ok
picasso250 Dec 10, 2012
9f679bc
force master
picasso250 Dec 10, 2012
06e148a
add title
picasso250 Dec 10, 2012
936690b
url --> server response
picasso250 Dec 10, 2012
eb85c2d
open in blank
picasso250 Dec 10, 2012
c4261e3
view frame ok
picasso250 Dec 10, 2012
8323f53
shop ok
picasso250 Dec 10, 2012
0cc4e88
doing shop
picasso250 Dec 10, 2012
e5b4138
doing shop
picasso250 Dec 10, 2012
d2b8a13
shop view
picasso250 Dec 10, 2012
6475fa1
category haha
picasso250 Dec 10, 2012
569b52a
big category
picasso250 Dec 10, 2012
d1f9039
district ok
picasso250 Dec 10, 2012
747fb3d
~
picasso250 Dec 10, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@

#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover

## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# ReSharper is a .NET coding add-in
_ReSharper*

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML



############
## Windows
############

# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg

# Mac crap
.DS_Store

# add by xc
server/data
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
NumOne
======

First project. Our goal is 2w(3w) a month.

//added by XC

hello, xc

//android application source code
NumOne
======

First project. Our goal is 2w(3w) a month.
171 changes: 31 additions & 140 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,170 +2,61 @@ data structure
--------------

**big categrory**

- name

**category**

- big_category
- name

**shop**

- name 名称
- category
- description 详细描述
- latilongi 经纬度
- city
- district 所在区域
- average 人均消费
- phone 电话

json standard
-------------

**json example for shop**

```json
{
"data": {
"kind": "shop",
"name": "xxx",
"description": "xxx",
"imageCount": 2
"images": [
"/data/shop/image/a.jpg",
"/data/shop/image/b.jpg"
]
}
}
```

**json example for shop list**
**shop image**
- shop
- src

```json
{
"data": {
"kind": "shoplist",
"totalItems": 6741,
"startIndex": 1,
"itemsPerPage": 10,
"itemCount": 10,
"items": [
{
"name": "xxx",
"type": "专营门店",
"latilongi": "+40.6894-074.0447"
"average": 35,
"image": "data/shop/thumb/a.jpg"
// ...
},
// ...
]
}
}
```
**relationship**
- city 1-m district *in conf*
- shop 1-m image

**json example for error**

```json
{
"error": {
"code": 404,
"message": "can't find"
}
}
```

**data** and **error** will never show up together.
json standard
-------------

u can visit this link to see more:
https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md
json examples have been move to
https://github.com/So-Me/NumOne/wiki/JSON-example

interfaces
----------

url: /api

parameters:

- action
- target

...

**example:**

/api?action=get&target=shoplist&district=futian&count=10
interfaces have been moved to
https://github.com/So-Me/NumOne/wiki/Interface

request JSON in android

example

```java
private static final REQUEST_URL = "bala bala";
/*
这个parameters是应用传过来的,所以里面已经设过action, target, district, count
等值了。
*/
private String request(Bundle parameters) {
parameters.putString("format","JSON");

if (isSessionKeyValid()) {
parameters.putString("session_key", accessTokenManager.getSessionKey());
}

this.prepareParams(parameters);

String response = Util.openUrl(REQUEST_URL, "POST", parameters);

return response;

}

private void prepareParams(Bundle params) {
params.putString("v","1.0");
params.putString("call_id", String.valueOf(System.currentTimeMillis()));

StringBuffer sb = new StringBuffer();
Set<String> keys = new TreeSet<String>(params.keySet());
example data
------------

for(String key : keys) {
sb.append(key);
sb.append("=");
sb.append(params.getString(key));
}
sb.append(accessTokenManager.getSessionSecret());
params.putString("sig", Util.md5(sb.toString()));

}

//In Util.java

public static String openUrl(String url, String method, Bundle params) {
if (method.equals("GET")) {
url = url + "?" + encodeUrl(params);
}
String response = "";
try {
HttpURLConnection conn = new URL(url).openConnection();

conn.setRequestProperty("", "");
if (!method,equals("GET")) {
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.getOutputStream().write(encodeUrl(params).getBytes("UTF-8"));
}

InputStream is = null;
int responseCode = conn.getResponseCode();
if (responseCode == 200) {
is = conn.getInputStream();
} else {
is = conn.getErrorStream();
}
response =read(is);


} catch (Exception e) {
**category**

}
}
```
1. 餐饮美食
1. 西餐
2. 粤菜
3. 异国菜
4. 民族清真
2. 休闲娱乐
1. 美容美体
2. 公园/游乐园
3. 酒店住宿
4. 购物
5. 美容美发
6. 便民服务
7. 景点景区
7 changes: 7 additions & 0 deletions server/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RewriteEngine On
RewriteBase /

# all to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]
Loading