从0开始教你三天完成毕业设计-后端api

2023-05-16

目录

前言

开始

 .env 数据库配置文件

app/controller 控制器接口api

工具类

分类表 categoryController

收藏表 collecetionController

商品表 goodController

订单表 orderController

轮播图表 swiperController

用户表 userController

route 路由配置

 红色

黄色

route/app.php

测试

结尾


前言

经过前面的文档,我们已经完成了设计阶段和环境配置,

如果没有的话,可以先去浏览这篇文章

从0开始教你三天完成毕业设计-项目设计_Black Jun的博客-CSDN博客作为一个初学java的小萌新,用java的springboot框架一时间加急写出来一个项目的话还是有难度的,当然mbatis-plus的代码生成器是可以的,但是比较晦涩难懂,加上配置的问题,所以我这里就不推荐用java,听说php停简单的,因此,为了完成这篇文章我特意花了半天学完了php的phpthink框架,这个项目我们用前后端分离的模式,毕竟冗杂的时代已经快过去了,追上时代潮流,才能成为让老师眼前一亮的毕业设计.https://blog.csdn.net/BlackjunPJH/article/details/127064484这篇文章,我们来教大家thinkphp后端api接口书写

开始

首先,打开C:\wamp64\www下的tp6文件,并导入vscode

我这里用的是phpstrom,vscode同理即可,只是编辑器不同,不影响操作

首先我们来看一下目录文件,以及文件的作用

 .env 数据库配置文件

先去修改一下.env文件,把它修改成自己的数据库,以及是否开启debug

APP_DEBUG = true[是否开启debug]

[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE = mysql
HOSTNAME = localhost
DATABASE = [自己的数据库名字]
USERNAME = root
PASSWORD =[自己的密码,如果是按照我的来,这里啥也不用填写]
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true

[LANG]
default_lang = zh-cn

修改完成配置文件后

app/controller 控制器接口api

我们到app下面controller,这里就是控制器,也就是书写api的地方

开始之前我们先导入我已经封装好的响应工具类

工具类

在controller下面创建Utils文件夹,再创建responseJson.php文件

<?php

namespace app\controller\Utils;

class responseJson
{
    public $code;
    public $message;
    public $data;
    function __construct($data)
    {
        $this->data=$data;
        if($data===null){
            $this->code="500";
            $this->message="服务器异常,请稍后再试!";
        }else{
            $this->code="200";
            $this->message="操作成功!";
        }
    }

}

这里稍微说一下作用,这是已经封装好的传递给前端的工具类,data为空就是出现问题,否则成功!

用于给前端做一个监听

而后我们在controller下创建house文件夹,代表主目录,开始书写接口

分类表 categoryController

我们先拿分类表举例,先完成基础的增删改查

<?php

namespace app\controller\house;

use app\controller\Utils\responseJson;
use think\facade\Db;
use think\response\Json;

class categoryController
{
    private $sql;
    private $request;

    function __construct()
    {
        $this->sql = Db::name("category");
        $this->request = json_decode(file_get_contents('php://input'), true);
    }

    function add(): Json
    {
        return json(new responseJson($this->sql->insert($this->request)));
    }

    function delete($id): Json
    {
        return json(new responseJson($this->sql->delete($id)));
    }

    function update(): Json
    {
        return json(new responseJson($this->sql->where('id',$this->request["id"])->update($this->request)));
    }

    function select(): Json
    {
        return json(new responseJson($this->sql->select()));
    }

    function selectBy(): Json
    {
        return json(new responseJson($this->sql->where($this->request)->select()));
    }
}

先来说一下这两个参数的作用

Db:name("category");获取连接分类表的数据库操作对象

json_decode(file_get_contents('php://input'), true);获取前端传递放在data内的数据

下面就是四个方法

$sql->insert(前端参数)  新增

$sql->delete($id)  通过id删除对应数据

$sql->where('id',$this->request['id'])->update([前端参数]) 通过id找到并修改对应数据

$sql->where([前端数据]) 按需查询

好的,这里我们基础的增删改查就已经完成了,后面的话可以会有多表的功能需要实现,

考虑到大家难度问题,我这里直接帖代码吧

收藏表 collecetionController

<?php

namespace app\controller\house;

use app\controller\Utils\responseJson;
use think\facade\Db;
use think\response\Json;

class collectionController
{
    private $sql;
    private $request;

    function __construct()
    {
        $this->sql = Db::name("collections");
        $this->request = json_decode(file_get_contents('php://input'), true);
    }

    function add(): Json
    {
        $collection=$this->sql->where($this->request)->select();
        if(count($collection)>0){
            return json(new responseJson(null));
        }
        return json(new responseJson($this->sql->insert($this->request)));
    }

    function delete($id): Json
    {
        return json(new responseJson($this->sql->delete($id)));
    }

    function update(): Json
    {
        return json(new responseJson($this->sql->where('collection_id',$this->request["collection_id"])->update($this->request)));
    }

    function select(): Json
    {
        return json(new responseJson($this->sql->select()));
    }

    function selectBy(): Json
    {
        return json(new responseJson($this->sql
            ->alias('c')
            ->join("user u","u.user_id=c.user_id")
            ->join("good g","g.good_id=c.good_id")
            ->join("category c2","g.category_id=c2.category_ids")
            ->field("g.*,c2.category_name")
            ->where("u.user_id",$this->request['user_id'])
            ->select()
        ));
    }
}

商品表 goodController

<?php

namespace app\controller\house;


use app\controller\Utils\responseJson;
use think\facade\Db;
use think\response\Json;


class goodController
{
    private $sql;
    private $request;

    public function __construct()
    {
        $this->sql=Db::name("good");
        $this->request=json_decode(file_get_contents('php://input'), true);
    }

    function add(): Json
    {
        return json(new responseJson($this->sql->insert($this->request)));
    }

    function delete($id): Json
    {
        return json(new responseJson($this->sql->delete($id)));
    }

    function update(): Json
    {
        return json(new responseJson($this->sql->where('good_id',$this->request["good_id"])->update($this->request)));
    }

    function select(): Json
    {
        return json(new responseJson($this->sql
            ->alias('g')
            ->join('category c', 'g.category_id=c.category_ids')
            ->field("g.*,c.category_name")
            ->select()));
    }

    function selectBy(): Json
    {
        return json(new responseJson($this->sql
            ->alias('g')
            ->join('category c', 'g.category_id=c.category_ids')
            ->field("g.*,c.category_name")
            ->where($this->request)
            ->select())
        );
    }
}

订单表 orderController

<?php

namespace app\controller\house;

use app\controller\Utils\responseJson;
use think\facade\Db;
use think\response\Json;

class orderController
{
    private $sql;
    private $request;
    function __construct(){
        $this->sql=Db::name("order");
        $this->request=json_decode(file_get_contents('php://input'), true);
    }

    function add(): Json
    {
        return json(new responseJson($this->sql->insert($this->request)));
    }

    function delete($id): Json
    {
        return json(new responseJson($this->sql->delete($id)));
    }

    function update(): Json
    {
        return json(new responseJson($this->sql->where('order_id',$this->request["order_id"])->update($this->request)));
    }

    function select(): Json
    {
        return json(new responseJson($this->sql->select()));
    }

    function selectBy(): Json
    {
        return json(new responseJson($this->sql
            ->alias('o')
            ->join("user u","u.user_id=o.user_id")
            ->join("good g","g.good_id=o.good_id")
            ->join("category c","g.category_id=c.category_ids")
            ->field("g.*,u.user_name,c.category_name,o.create_time createTime")
            ->where("u.user_id",$this->request['user_id'])
            ->select()));
    }

    function selectByBack(): Json
    {
        return json(new responseJson($this->sql
            ->alias('o')
            ->join("user u","u.user_id=o.user_id")
            ->join("good g","g.good_id=o.good_id")
            ->join("category c","g.category_id=c.category_ids")
            ->field("g.*,u.user_name,c.category_name,o.create_time createTime")
            ->where($this->request)
            ->select()));
    }
}

轮播图表 swiperController

<?php

namespace app\controller\house;

use app\controller\Utils\responseJson;
use think\facade\Db;
use \think\response\Json;

class swiperController
{
    private $sql;
    private $request;

    function __construct()
    {
        $this->sql = Db::name("swiper");
        $this->request = json_decode(file_get_contents('php://input'), true);
    }

    function add(): Json
    {
        return json(new responseJson($this->sql->insert($this->request)));
    }

    function delete($id): Json
    {
        return json(new responseJson($this->sql->delete($id)));
    }

    function update(): Json
    {
        return json(new responseJson($this->sql->where('swiper_id', $this->request["swiper_id"])->update($this->request)));
    }

    function select(): Json
    {
        return json(new responseJson($this->sql->select()));
    }

    function selectBy(): Json
    {
        return json(new responseJson($this->sql->where($this->request)->select()));
    }

    function select_back(): Json
    {
        return json(new responseJson(
            $this
                ->sql
                ->alias('s')
                ->join('good g', 's.good_id=g.good_id')
                ->where($this->request)
                ->field("s.*,g.good_title")
                ->select()
        ));
    }
}

用户表 userController

<?php

namespace app\controller\house;

use app\controller\Utils\responseJson;
use think\facade\Db;
use think\response\Json;

class userController
{
    private $sql;
    private $request;
    function __construct(){
        $this->sql=Db::name("user");
        $this->request=json_decode(file_get_contents('php://input'), true);
    }

    function add(): Json
    {
        return json(new responseJson($this->sql->insert($this->request)));
    }

    function delete($id): Json
    {
        return json(new responseJson($this->sql->delete($id)));
    }

    function update(): Json
    {
        return json(new responseJson($this->sql->where('id',$this->request["id"])->update($this->request)));
    }

    function select(): Json
    {
        return json(new responseJson($this->sql->select()));
    }

    function selectBy(): Json
    {
        return json(new responseJson($this->sql->where($this->request)->select()));
    }

    function login(){
        if(count($this->request)===2){
            $res=$this->sql->where($this->request)->select();
            if(count($res)){
                if($res[0]['user_name']===$this->request['user_name']&&$res[0]['password']===$this->request['password']){
                    return json(new responseJson($res[0]));
                }else{
                    return json(new responseJson(null));
                }
            }else{
                return json(new responseJson(null));
            }

        }else{
            return json(new responseJson(null));
        }
    }

    function register(){
        if(count($this->sql->where("user_name",$this->request['user_name'])->select())>0){
            $response=new responseJson(null);
            $response->code="501";
            $response->message="用户名已存在";
            return json($response);
        }else{
            $this->add();
            return json(new responseJson("注册成功!"));
        }
    }

    function pay(){
        Db::name("order")->save(['user_id'=>$this->request["user_id"],'good_id'=>$this->request['good_id']]);
        return json(new responseJson($this->sql->where("user_id",$this->request["user_id"])->update(['wallet'=>$this->request["wallet"]])));
    }
}

中间用到了一些多表的知识,大家可以去翻阅查看一下,也可以直接复制


route 路由配置

路由的作用就是我们不用很长的路径去方法,同时可以规定用什么请求方法

我们这里用到了restfull风格,关于什么是restfull风格大家可以去看看这一篇文章

RESTfull 接口规范理解_菜鸟小奇奇的博客-CSDN博客_restfullRESTfull接口理解RESTfull = Representational State Transfer 即表现层状态转移 加 ful (即形容词后缀) 则表示是形容词性的而要理解RESTful架构,最好的方法就是去理解Representational State Transfer这个词组,直译过来就是「表现层状态转化」,其实它省略了主语。「表现层」其实指的是「资源」的「表现层」,所以通俗来讲...https://blog.csdn.net/qyl_0316/article/details/80549937我这里稍微介绍一下

 红色

代码请求方法,请求方法又很多种,浏览器默认是get,同时还有post,delete,put,patch等

黄色

代表等会我们用哪一个路径请求接口

蓝色

代表我们对应的方法位置

注意

大家可以看到我们都是/good/请求,那怎么知道是哪一个呢,这就体现的restfull风格的好处的,

我们可以看到他们虽然请求地址相同,但是请求方法不同,我们便可以以此为依据判断

这样大家理解的话就可以把自己的方法按需放到路由里面了,复制写好的也行

route/app.php

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::get('hello/:name', 'index/hello');


Route::post('/good/','house.goodController/add');
Route::delete('/good/:id','house.goodController/delete');
Route::put('/good/','house.goodController/update');
Route::get('/good/','house.goodController/select');
Route::patch('/good/','house.goodController/selectBy');

Route::post('/user/','house.userController/add');
Route::delete('/user/:id','house.userController/delete');
Route::put('/user/','house.userController/update');
Route::get('/user/','house.userController/select');
Route::patch('/user/','house.userController/selectBy');
Route::post('/user/login','house.userController/login');
Route::post('/user/register','house.userController/register');
Route::post('/user/pay','house.userController/pay');

Route::post('/swiper/','house.swiperController/add');
Route::delete('/swiper/:id','house.swiperController/delete');
Route::put('/swiper/','house.swiperController/update');
Route::get('/swiper/','house.swiperController/select');
Route::patch('/swiper/','house.swiperController/selectBy');
Route::patch("/swiper/back",'house.swiperController/select_back');

Route::post('/category/','house.categoryController/add');
Route::delete('/category/:id','house.categoryController/delete');
Route::put('/category/','house.categoryController/update');
Route::get('/category/','house.categoryController/select');
Route::patch('/category/','house.categoryController/selectBy');

Route::post('/order/','house.orderController/add');
Route::delete('/order/:id','house.orderController/delete');
Route::put('/order/','house.orderController/update');
Route::get('/order/','house.orderController/select');
Route::patch('/order/','house.orderController/selectBy');
Route::patch('/order/back','house.orderController/selectByBack');

Route::post('/collection/','house.collectionController/add');
Route::delete('/collection/:id','house.collectionController/delete');
Route::put('/collection/','house.collectionController/update');
Route::get('/collection/','house.collectionController/select');
Route::patch('/collection/','house.collectionController/selectBy');

ok,至此代表方面已经没有什么问题了,基础功能代码还是比较简单的

测试

我们打开C:\wamp64\www\tp6 文件夹

 在红色区域输入cmd 跳转到命令提示行

 运行

php think run

启动框架,开启路由

出现如下代表启动成功

而后在浏览器输入

出现如下界面(我这里是用json美化的插件)

正常是这种界面

 代表后端api接口以及成功!

结尾

我们设计和后端代码已经全部完成,后面重要的就是前端方面了

主题所有文章已经更新欢迎大家,留言评论

从0开始教你三天完成毕业设计-项目设计_Black Jun的博客-CSDN博客作为一个初学java的小萌新,用java的springboot框架一时间加急写出来一个项目的话还是有难度的,当然mbatis-plus的代码生成器是可以的,但是比较晦涩难懂,加上配置的问题,所以我这里就不推荐用java,听说php停简单的,因此,为了完成这篇文章我特意花了半天学完了php的phpthink框架,这个项目我们用前后端分离的模式,毕竟冗杂的时代已经快过去了,追上时代潮流,才能成为让老师眼前一亮的毕业设计.https://blog.csdn.net/BlackjunPJH/article/details/127064484

 从0开始教你三天完成毕业设计-后端api_Black Jun的博客-CSDN博客_后端毕业设计经过前面的文档,我们已经完成了设计阶段和环境配置,如果没有的话,可以先去浏览这篇文章这篇文章,我们来教大家thinkphp后端api接口书写https://blog.csdn.net/BlackjunPJH/article/details/127084314?spm=1001.2014.3001.5502

从0开始教你三天完成毕业设计-前端之首页_Black Jun的博客-CSDN博客我这里主要用到了vue+element-ui,大概有不懂的,可以看下面https://blog.csdn.net/BlackjunPJH/article/details/128098608

从0开始教你三天完成毕业设计-前端之后台管理_Black Jun的博客-CSDN博客同理的话,我们还是用vue+element有不懂的话,可以看看前面两篇文章,上面有vue以及element的介绍,这里的话我们还是element的表格插件,同时后台管理界面无非就是一个crud,增删改查所以我这里就用一个界面进行举例说明。https://blog.csdn.net/BlackjunPJH/article/details/128103279?spm=1001.2014.3001.5502

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

从0开始教你三天完成毕业设计-后端api 的相关文章

  • 使用RGBD相机实现YOLOv3目标识别并测距,获取物体三维坐标

    设备环境 xff1a Ubuntu18 04 43 ros melodic 相机 xff1a 乐视相机 xff08 乐视遗产 xff0c 和奥比中光的 Astra Pro 同方案 xff0c 便宜 xff09 1 首先要安装一部分依赖 su
  • [jetson浅试] yolov5+deepsort+Tensorrt C++部署(Xavier AGX)

    1 简介 xff1a 这学期刚开学的时候搞的 xff0c 空下来整理一些 xff08 以后还是应该养成边搞边写博客的好习惯 xff09 本文主要是对yolov5 deepsort tensorrt A c 43 43 implementat
  • 阿里2014年校园题目最后一题答案及证明

    该题目来自cdsn的一位网友 xff08 可见http blog csdn net thebestdavid article details 11975809 xff09 xff0c 具体内容如下 xff1a 在黑板上写下50个数字 xff
  • 编程——两种list的翻转方法

    对于题目相信大家都比较熟悉了 xff0c 下面就直接上代码了 xff0c 其中没有给出list的creat函数 xff0c 有兴趣的同学可以自己实现 1 模板node的定义 template lt class T gt class TNod
  • 数组旋转新方法

    题目 xff1a 对一个int数组进行左右任意长度的旋转 xff0c 如 xff1a 原始数组为 1 2 3 4 5 xff0c 左旋两位 xff08 可用 2表示 xff09 得 3 4 5 1 2 xff0c 右旋两位 xff08 可用
  • 为什么链表操作过程中对于结构体指针,都要用malloc来开辟内存空间

    sqlist h ifndef SQLIST H define SQLIST H include lt stdio h gt include lt stdlib h gt define maxsize 1024 线性表的最大长度 typed
  • P1706 全排列问题

    原题 P1706 全排列问题 这题显然可以暴力 长达164行 include lt iostream gt include lt istream gt include lt ostream gt include lt cstdio gt i
  • 自动化专业考研方向简介

    自动化专业考研方向简介 xff08 一 xff09 大家在准备考研时 xff0c 想没想过 自己对什么感兴趣 xff1f 自己以后想干什么 xff1f 毕业后如何打算 xff1f 如果你认真考虑了这几个问题 xff0c 相信你的未来研究生生
  • UVA1185 Big Number

    原题 https www luogu com cn problem UVA1185 本题用到的定理的证明 https www cnblogs com weiliuyby p 5831991 html 题目 给出n 求n 的位数 从网上找到了
  • 浅谈威佐夫博弈

    如果不了解威佐夫博弈的话 xff0c 下面有威佐夫博弈的介绍 有两堆石子 xff0c 数量任意 xff0c 可以不同 游戏开始由两个人轮流取石子 游戏规定 xff0c 每次有两种不同的取法 xff0c 一是可以在任意的一堆中取走任意多的石子
  • YBT1325:循环比赛日程表

    我们先看题 我们仔细观察就会发现一下规律 xff1a 设一个数 设两个数 且 1 在的范围内 有 2 在的范围内 有 3 在的范围内 有 以上三条我都验证过了 正确 所以代码就出来了 include lt iostream gt using
  • Codeforces Contest #1553 A : Digit Sum 题解

    题目链接 Digit Sum 题面 将上面一大坨翻译一下 xff0c 就是 xff1a 定义函数的数字和 给出 求有多少个满足且 若模余 xff0c 则成立 一开始想是输出的下取整 xff0c 最后的结果 xff1a 没有考虑到的情况 xf
  • Atcoder Beginner Contest 100 - 题解

    A 原题 Happy Birthday 本题其实很水 只需要输入这两个整数 xff0c 如果中有一个大于 就输出 xff0c 否则输出 Yay include lt bits stdc 43 43 h gt using namespace
  • ubuntu 18.04 server 扩容(LVM)磁盘 解决磁盘不足的情况 (亲测)

    因为发现我的本地server出现磁盘满了的情况 所以进行lvm的扩容 截图的都是扩容后的 所以忽略容量 1 查看磁盘情况 df span class hljs attribute h span 原本发现 dev mapper ubuntu
  • 欢迎使用CSDN-markdown编辑器

    欢迎使用Markdown编辑器写博客 本Markdown编辑器使用StackEdit修改而来 xff0c 用它写博客 xff0c 将会带来全新的体验哦 xff1a Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传
  • 工作一年,辞职复习半年,考杭电计算机的经验分享

    工作一年 xff0c 辞职复习半年 xff0c 考杭电计算机的经验分享 如果 xff0c 毕业了工作顺利的人大概率是不会去考研的 xff0c 去考研的人 xff0c 大概率是想改变的 题记 2019 4 6 关于我 纠结的人生 为什么考研
  • CSS表格样式

    文章目录 CSS表格样式caption side 标题位置border collapse 边框合并border spacing 边框间距css样式 xff08 推荐使用 xff09 CSS表格样式 caption side 标题位置 语法
  • Android使用Annotations注解优化代码

    文章目录 Android使用Annotations注解优化代码Null 注解Typedef 注解Resource Type 注解Threading 注解Value Constraints 注解Overriding Methods 注解Ret
  • C语言strstr函数

    函数strstr定义 xff1a char strstr const char str1 const char str2 xff1b 位于头文件 string h 中 作用 xff1a strstr函数用于判断字符串str2是否为字符串st
  • Linux下串口读写通信

    span class token keyword int span fd span class token operator 61 span span class token number 0 span span class token p

随机推荐

  • kubernetes最新版安装单机版v1.21.5

    kubernetes最新版安装单机版v1 21 5 k8s集群由Master节点和Node xff08 Worker xff09 节点组成 今天我在这里给大家只用1台机器 xff0c 安装kubernetes 1 安装前置环境 root 6
  • 双系统、多系统快速切换

    前言 装双系统甚至多系统 xff0c 是为了满足不同需求 每个操作系统都有自身的特点 xff0c 因为这样那样的原因 xff0c 很多人选择双系统 双系统满足了不同需求 xff0c 但是每次需要手动选择所要进入的系统 xff0c 切换系统也
  • ROS::CmakeList 例子

    ROS CmakeList 例子 span class token function cmake minimum required span span class token punctuation span VERSION span cl
  • ROS:静态TF发布

    ROS xff1a 静态TF发布 方式1 xff1a span class token tag span class token tag span class token punctuation lt span launch span sp
  • ROS::线程锁

    ROS xff1a xff1a 线程锁 boost span class token operator span mutex mutex span class token punctuation span span class token
  • 无人机智能飞行类库设计构思

    搭建无人机 智能飞行类库的主要目的就在于 xff1a 便于无人机路径规划各种算法的实施 xff0c 便于飞行仿真以及便于今后在硬件上实现算法 完整做到这些需要做三方面做工作 xff1a 一 计算几何 计算几何问题主要用于路径优化 避障等 x
  • STL教程:C++ STL快速入门

    目录 1 STL引言 2 STL是什么 xff08 STL简介 xff09 3 STL历史 4 STL组件 5 STL基本结构 6 STL 使用方法 7 STL目录 网址 xff1a STL教程 xff1a C 43 43 STL快速入门
  • vue使用sortablejs插件的时候报Sortable: `el` must be an HTMLElement

    最近因为项目需要很灵活自定义查询 xff0c 故使用了vue和element ui组件库 xff0c 其中el table需要行和列拖拽排序 故使用到了sortable插件 一 报错的排查 首先对 xff1a const tbody 61
  • 记一次Linux 4.15.0-65-generic安装Elasticsearch成功的过程

    一 xff0c 操作系统和安装的应用 xff1a 1 操作系统 xff1a Linux version 4 15 0 65 generic buildd 64 lgw01 amd64 006 gcc version 7 4 0 Ubuntu
  • [docker]笔记-镜像 管理

    1 镜像管理 docker search xxxx 查找镜像 例如查找httpd root 64 localhost docker search httpd 下载镜像 docker pull xxxx root 64 localhost d
  • quill-editor扩展的正确姿势

    一 无关的插曲 曾几何时 xff0c 风云万里 xff0c 万海桑田 耕耘于代码堆里多年 做过android移动端 xff0c 做过web端 xff0c 做过java后端和 net xff0c 也做过python数据分析 但真正扩展源码的亦
  • 导入excel时js转换时间的正确姿势

    一 基础 1 excel的日期是以1900 1 0开始计算的 xff0c 既1900 1 1就是1天 xff1b 2 js的Date是以 1970 1 1 08 00 00 开始的 xff1b excel时间换算如下 xff1a 点击常规后
  • springboot下ClassUtils.getDefaultClassLoader().getResource(“static“).getPath() 空指针异常???

    在static加个文件文件就ok xff0c 不信你看看
  • Compilation failure: Compilation failure

    有a项目和b项目 xff0c 如果a项目打包成功 xff0c b依赖a 现b打包的时候报Compilation failure Compilation failure了 xff0c 原因是a中有 span class token opera
  • mysql数据更新时变更时间自动更新

    ALTER TABLE test CHANGE startTime startTime timestamp NOT NULL ON UPDATE CURRENT TIMESTAMP DEFAULT CURRENT TIMESTAMP
  • docker、docker-compose和Portainer的安装

    一 docker安装 span class token comment 安装docker相关依赖 span yum span class token function install span y yum utils device mapp
  • vue-cli+spring boot前后端分离跨域及session丢失解决办法

    前后端分离跨域笔记 小小的唠叨前端代码后端 小小的唠叨 曾几何时 xff0c 项目开发时间很紧 xff0c 项目组很多的人即不懂vue也不大懂spring boot及mybatic的强大之处 xff0c 也没有做过前后端分离 xff0c 项
  • vue打包整合到spring boot一记

    目录 背景vue cli打包之前的配置总结 背景 前段时间 xff0c 根据需求 xff0c 要将项目烧入到芯片 xff0c 但我的擅长之处就是前后端分离开发 xff0c 因此需要前端vue开发好 xff0c 打包放到后端里面一起执行 那时
  • 小四轴编程入门教程

    小四轴编程入门教程之一 xff1a 陀螺仪和加速度计 在小四轴中 xff0c 陀螺仪是一种用于测量小四轴旋转速度的传感器 xff0c 它测量的是角速度 xff0c 是指物体在单位时间内转过的角度大小 通过测量物体在X Y Z三个轴上的角速度
  • 从0开始教你三天完成毕业设计-后端api

    目录 前言 开始 env 数据库配置文件 app controller 控制器接口api 工具类 分类表 categoryController 收藏表 collecetionController 商品表 goodController 订单表