Coder Social home page Coder Social logo

vue-web's Introduction

JsonDemo-web

  1. 技术:springboot2+ 、mybatis、jdk1.8+
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-parent</artifactId>
        <version>2.0.0.RELEASE</version>
    </parent>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.47</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.2</version>
        </dependency>
       ...
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
            <version>1.5.9.RELEASE</version>
        </dependency>
    </dependencies>
  1. 数据库:mysql 5.7
    工具Navicat Premium 12

Image text
Image text

  1. 服务接口代码块部分展示(restful接口):
//列表展示
@RequestMapping(value = "city",method = RequestMethod.GET)
    public JSONObject getCityList(){
        List<City> citys=service.getCityList();
       JSONObject json=new JSONObject();
       json.put("citys",citys);
       json.put("count",service.getCount());
       return json;
    }
    //新增
    @RequestMapping(value = "city",method = RequestMethod.POST)
    public JSONObject addCity(@RequestBody City city){
        JSONObject json=new JSONObject();
            if(service.addCity(city)>0){
                json.put(CommonStatus.CityStatus,CommonStatus.Success);
            }
            else{
                json.put(CommonStatus.CityStatus,CommonStatus.Error);
            }
        return json;
    }
    //更新
    @RequestMapping(value = "city",method = RequestMethod.PUT)
    public JSONObject updateCity(@RequestBody City city){
        JSONObject json=new JSONObject();
       if(service.updateCity(city))
           json.put(CommonStatus.CityStatus, CommonStatus.Success);

       else
           json.put("CityStatus", CommonStatus.Error);
        return json;
    }
    //删除
    @RequestMapping(value = "city/{id}",method = RequestMethod.DELETE)
    public JSONObject deleteCity(@PathVariable Integer id){
        JSONObject json=new JSONObject();
        if(service.deleteCity(id))
            json.put(CommonStatus.CityStatus,CommonStatus.Success);
        else
            json.put(CommonStatus.CityStatus,CommonStatus.Error);
        return json;
    }
  1. IDE工具 idea

Image text


项目贴图请看vue

前端项目路径

vue-web's People

Contributors

niujt avatar

Stargazers

 avatar

Watchers

 avatar

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.