GithubHelp home page GithubHelp logo

lianjia-search_mpservice's Introduction

链家搜索微信小程序服务端

名声那么响其实只是把爬到的链家数据通过restful接口呈现出来。后来可能会做数据的可视化分析,但也可能不会了,毕竟只是想混个夏季实践hhh,因为我对微信小程序的前程是没有信心的,不打算长期做下去。

当然了,还有一个目的是通过这个简单的项目给新欢golang练练手。

如何跑起来

  1. go get github.com/Actooors/lianjia-search_mpservice
  2. conf/app_reference.json复制到conf/app.json,修改app.json中数据源配置
  3. go build && ./lianjia-search_mpservice

lianjia-search_mpservice's People

Contributors

mzz2017 avatar

Watchers

James Cloos avatar yahaa avatar

Forkers

amoslee2019

lianjia-search_mpservice's Issues

前后端RESTFUL格式约定简述

response

"code":"SUCCESS"//or "ERROR"
"message":null//or explaination when fail. `string`
"data":null//or something

由于后端使用Golang,为提高开发效率,所有response的data域变量名除特殊约定外,统一使用首字母大写的格式,且为大驼峰。

注:使用Java作为后端开发时,由于语言本身问题,首字母大写将出现问题,一般使用小驼峰。

页面详情API格式

request

//GET方法
http://api.mzz.pub/lianjia-search_mp/detail?pageId=107100301883

response

{
    "code": "SUCCESS",
    "data": {
        "ID": 2,
        "CreatedAt": "2018-06-16T14:04:10Z",
        "UpdatedAt": "2018-06-16T14:04:10Z",
        "DeletedAt": null,
        "PageId": "107100301883",
        "City": "上海",
        "Area": "宝山",
        "SecArea": "大场镇",
        "Title": "乾溪新村 2室1厅 260万",
        "CommunityName": "乾溪新村",
        "HouseType": "2室1厅",
        "Square": 55.53,
        "Toward": "南",
        "Decoration": "简装",
        "Lift": "无电梯",
        "Flood": "高楼层(共5层)1993年建板楼",
        "TotalPrice": 260,
        "UnitPrice": 46822,
        "Image": "https://image1.ljcdn.com/310000-inspection/8a332f77-e949-4a68-9331-b084011f5aa2.jpg.296x216.jpg.232x174.jpg",
        "Star": 22,
        "Visit": 26,
        "PublishTime": "2018-06-16T14:04:10Z",
        "BuildingType": "板楼",
        "Ownership": "商品房",
        "DownPaymentBudget": "参考首付95万",
        "HouseUse": "普通住宅",
        "CompletionDate": 1994,
        "Floor": "中楼层/6",
        "Visit7": 1,//7天内带看
        "Visit30": 3,//30天内带看
        "CarouselImages": [
            "https://image1.ljcdn.com/shfdfs-image/20171108/b3aae556-fc31-4cf0-8ad3-44f54b259389.jpg!m_fill,w_500,h_280,lg_north_west,lx_0,ly_0,l_rorate_logo,f_jpg,ls_50",
            "https://image1.ljcdn.com/shfdfs-image/20171123/b91fc978-4ce9-4558-a68c-b12669519b9a.jpg!m_fill,w_500,h_280,l_frame,f_jpg",
            "https://image1.ljcdn.com/shfdfs-image/20171108/0bc8cdf8-1e17-40a8-bb50-fc404adc59ae.jpg!m_fill,w_500,h_280,lg_north_west,lx_0,ly_0,l_rorate_logo,f_jpg,ls_50"
        ]
    },
    "message": null
}

由于后端使用Golang,为提高开发效率,所有xhr的data域变量名除特殊约定外,统一使用首字母大写的格式,且为大驼峰。

注:使用Java作为后端开发时,首字母大写将出现问题,一般使用小驼峰。

搜索API格式

request

// POST方法
// http://api.mzz.pub/lianjia-search_mp/search
{
  "keyword":"宝山",
  "pageSize":10,
  "page": 1//从1开始
}

response

{
    "code": "SUCCESS",
    "data": [
        {
            "ID": 1,
            "CreatedAt": "2018-06-16T13:11:44Z",
            "UpdatedAt": "2018-06-16T13:11:44Z",
            "DeletedAt": null,
            "PageId": "107100294743",
            "City": "上海",
            "Area": "宝山",
            "SecArea": "大场镇",
            "Title": "环镇北路400弄 2室1厅 250万",
            "CommunityName": "环镇北路400弄",
            "HouseType": "2室1厅",
            "Square": 59.08,
            "Toward": "",
            "Decoration": "简装",
            "Lift": "无电梯",
            "Flood": "高楼层(共6层)1995年建板楼",
            "TotalPrice": 270,
            "UnitPrice": 46822,
            "Image": "https://image1.ljcdn.com/310000-inspection/18c91e48-c9bc-43c8-812b-1c656645aab5.jpg.296x216.jpg.232x174.jpg",
            "Star": 20,
            "Visit": 20,
            "PublishTime": "6个月以前发布"
        },
        {
            "ID": 2,
            "CreatedAt": "2018-06-16T13:11:44Z",
            "UpdatedAt": "2018-06-16T13:11:44Z",
            "DeletedAt": null,
            "PageId": "107100301883",
            "City": "上海",
            "Area": "宝山",
            "SecArea": "大场镇",
            "Title": "乾溪新村 2室1厅 260万",
            "CommunityName": "乾溪新村",
            "HouseType": "2室1厅",
            "Square": 55.53,
            "Toward": "",
            "Decoration": "简装",
            "Lift": "无电梯",
            "Flood": "高楼层(共5层)1993年建板楼",
            "TotalPrice": "260",
            "UnitPrice": "46822元/平米",
            "Image": "https://image1.ljcdn.com/310000-inspection/8a332f77-e949-4a68-9331-b084011f5aa2.jpg.296x216.jpg.232x174.jpg",
            "Star": 22,
            "Visit": 26,
            "PublishTime": "6个月以前发布"
        }
    ],
    "message": null
}

由于后端使用Golang,为提高开发效率,所有response的data域变量名除特殊约定外,统一使用首字母大写的格式,且为大驼峰。

注:使用Java作为后端开发时,首字母大写将出现问题,一般使用小驼峰。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.