Coder Social home page Coder Social logo

interview_demo's Introduction

目标

搭建本地服务端,通过postman发送数字,将数字存在本地数据库,并返回数字*2的结果,并将结果记录到数据库中

使用到的

  1. springboot
  2. mybatis
  3. druid
  4. mysql
  5. redis缓存

流程

  1. 定义接口 /multiple?number&ratio 其中number是必须的,ratio可选,如果没有ratio,则默认为DEFAULT_RATIO = 2。
  2. number和ratio定义为BigDecimal类型。
  3. 对结果进行了统一封装 { "code": 200, "msg": "success", "data": 4 }。
  4. 对异常进行了全局捕获。
  5. mysql中,使用 number 和 ratio 作为联合主键。由于参数类型限制,无须做防sql注入
  6. redis中,number-ratio为key,result为value,ttl为2分钟。

interview_demo's People

Watchers

uuorb 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.